-not needed
[oweals/gnunet.git] / src / include / block_mesh.h
index de9606533ba1fc0302fdc88189f03a7e85349ec1..f051e6666515c37ba9d1de87f8f65e878d0a4796 100644 (file)
@@ -27,6 +27,7 @@
 #define BLOCK_MESH_H
 
 #include "gnunet_util_lib.h"
+#include "gnunet_mesh_service.h"
 #include <stdint.h>
 
 /**
@@ -42,7 +43,77 @@ struct PBlock
     /**
      * Type of service offered
      */
-  uint32_t type;
+  GNUNET_MESH_ApplicationType type;
 };
 
+/**
+ * @brief A MeshRegexBlock contains one or more of this struct in the payload.
+ */
+struct MeshRegexEdge
+{
+      /**
+       * Destination of this edge.
+       */
+    struct GNUNET_HashCode key;
+
+      /**
+       * Length of the token towards the new state.
+       */
+    unsigned int n_token;
+
+    /* char token[n_token] */
+};
+
+/**
+ * @brief Block to announce a regex state.
+ */
+struct MeshRegexBlock
+{
+      /**
+       * The key of the state.
+       */
+    struct GNUNET_HashCode key;
+
+      /**
+       * Length of the proof regex string.
+       */
+    unsigned int n_proof;
+
+      /**
+       * Numer of edges parting from this state.
+       */
+    unsigned int n_edges;
+
+      /**
+       * Is this state an accepting state?
+       */
+    int accepting;
+
+    /* char proof[n_proof] */
+    /* struct MeshEdge edges[n_edges] */
+};
+
+/**
+ * @brief Block to announce a peer accepting a state.
+ */
+struct MeshRegexAccept
+{
+      /**
+       * The key of the state.
+       */
+    struct GNUNET_HashCode key;
+
+      /**
+       * Length of the proof regex string.
+       * FIXME necessary???
+       * already present in the leading MeshRegexBlock
+       */
+    // unsigned int n_proof;
+
+      /**
+       * The identity of the peer accepting the state
+       */
+    struct GNUNET_PeerIdentity id;
+
+};
 #endif
\ No newline at end of file