- stop using message types of payload on service side
[oweals/gnunet.git] / src / mesh / mesh2.h
index 4b55c3c4e8fc882b51e6a8baa70c88871fd87a15..c66a810a15580f31010787f8d2a116363935903f 100644 (file)
@@ -112,8 +112,7 @@ struct GNUNET_MESH_ClientConnect
      *       sizeof(uint16_t) * types
      */
   struct GNUNET_MessageHeader header;
-  uint16_t types GNUNET_PACKED;
-  /* uint16_t                 list_types[types]           */
+  /* uint32_t                 list_ports[]           */
 };
 
 
@@ -125,6 +124,7 @@ struct GNUNET_MESH_ClientConnect
  */
 typedef uint32_t MESH_TunnelNumber;
 
+
 /**
  * Message for a client to create and destroy tunnels.
  */
@@ -132,7 +132,6 @@ struct GNUNET_MESH_TunnelMessage
 {
     /**
      * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_[CREATE|DESTROY]
-     *       GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_[MAX|MIN]
      *
      * Size: sizeof(struct GNUNET_MESH_TunnelMessage)
      */
@@ -147,6 +146,11 @@ struct GNUNET_MESH_TunnelMessage
      * Tunnel's peer
      */
   struct GNUNET_PeerIdentity peer;
+
+    /**
+     * Port of the tunnel.
+     */
+  uint32_t port GNUNET_PACKED;
 };
 
 
@@ -172,10 +176,15 @@ struct GNUNET_MESH_TunnelNotification
      */
   struct GNUNET_PeerIdentity peer;
 
+    /**
+     * Port for this tunnel
+     */
+  uint32_t port GNUNET_PACKED;
+
     /**
      * Tunnel options (speed, buffering)
      */
-  uint32_t opt;
+  uint32_t opt GNUNET_PACKED;
 };
 
 
@@ -241,44 +250,34 @@ GNUNET_NETWORK_STRUCT_END
 /******************************************************************************/
 
 /**
- * All the states a peer participating in a tunnel can be in.
+ * All the states a tunnel can be in.
  */
-enum MeshPeerState
+enum MeshTunnelState
 {
     /**
      * Uninitialized status, should never appear in operation.
      */
-  MESH_PEER_INVALID,
-
-    /**
-     * Peer is the root and owner of the tree
-     */
-  MESH_PEER_ROOT,
-
-    /**
-     * Peer only retransmits traffic, is not a final destination
-     */
-  MESH_PEER_RELAY,
+  MESH_TUNNEL_NEW,
 
     /**
      * Path to the peer not known yet
      */
-  MESH_PEER_SEARCHING,
+  MESH_TUNNEL_SEARCHING,
 
     /**
      * Request sent, not yet answered.
      */
-  MESH_PEER_WAITING,
+  MESH_TUNNEL_WAITING,
 
     /**
      * Peer connected and ready to accept data
      */
-  MESH_PEER_READY,
+  MESH_TUNNEL_READY,
 
     /**
      * Peer connected previosly but not responding
      */
-  MESH_PEER_RECONNECTING
+  MESH_TUNNEL_RECONNECTING
 };