- changes to round system, stats collection
[oweals/gnunet.git] / src / mesh / mesh_protocol.h
index 7773992b988444d7207cc53b03af15e45375c5a8..5618360b741a685294611bc7be82c2817e27e7c7 100644 (file)
@@ -63,7 +63,7 @@ struct GNUNET_MESH_ConnectionCreate
     /**
      * ID of the connection
      */
-  struct GNUNET_HashCode cid;
+  struct GNUNET_MeshHash cid;
 
     /**
      * path_length structs defining the *whole* path from the origin [0] to the
@@ -82,17 +82,11 @@ struct GNUNET_MESH_ConnectionACK
      */
   struct GNUNET_MessageHeader header;
 
-    /**
-     * Always 0.
-     */
-  uint32_t reserved GNUNET_PACKED;
-
     /**
      * ID of the connection.
      */
-  struct GNUNET_HashCode cid;
+  struct GNUNET_MeshHash cid;
 
-  /* TODO: signature */
 };
 
 
@@ -106,15 +100,10 @@ struct GNUNET_MESH_KX
      */
   struct GNUNET_MessageHeader header;
 
-    /**
-     * Always 0.
-     */
-  uint32_t reserved GNUNET_PACKED;
-
     /**
      * ID of the connection.
      */
-  struct GNUNET_HashCode cid;
+  struct GNUNET_MeshHash cid;
 
   /* Specific KX message follows. */
 };
@@ -235,15 +224,10 @@ struct GNUNET_MESH_Encrypted
    */
   struct GNUNET_MessageHeader header;
 
-  /**
-   * Initialization Vector for payload encryption.
-   */
-  uint32_t iv GNUNET_PACKED;
-
   /**
    * ID of the connection.
    */
-  struct GNUNET_HashCode cid;
+  struct GNUNET_MeshHash cid;
 
   /**
    * ID of the packet (hop by hop).
@@ -255,11 +239,26 @@ struct GNUNET_MESH_Encrypted
    */
   uint32_t ttl GNUNET_PACKED;
 
+  /**
+   * Initialization Vector for payload encryption.
+   */
+  uint32_t iv GNUNET_PACKED;
+
+  /**
+   * MAC of the encrypted message, used to verify message integrity.
+   * Everything after this value  will be encrypted and authenticated.
+   */
+  struct GNUNET_MeshHash hmac;
+
   /**
    * Encrypted content follows.
    */
 };
 
+
+/**
+ * Message to create a Channel.
+ */
 struct GNUNET_MESH_ChannelCreate
 {
   /**
@@ -283,6 +282,10 @@ struct GNUNET_MESH_ChannelCreate
   uint32_t opt GNUNET_PACKED;
 };
 
+
+/**
+ * Message to manage a Channel (ACK, NACK, Destroy).
+ */
 struct GNUNET_MESH_ChannelManage
 {
   /**
@@ -296,6 +299,7 @@ struct GNUNET_MESH_ChannelManage
   MESH_ChannelNumber chid GNUNET_PACKED;
 };
 
+
 /**
  * Message for mesh data traffic.
  */
@@ -370,7 +374,7 @@ struct GNUNET_MESH_ACK
     /**
      * ID of the connection.
      */
-  struct GNUNET_HashCode cid;
+  struct GNUNET_MeshHash cid;
 };
 
 
@@ -379,20 +383,20 @@ struct GNUNET_MESH_ACK
  */
 struct GNUNET_MESH_Poll
 {
-  /**
-   * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
-   */
+    /**
+     * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
+     */
   struct GNUNET_MessageHeader header;
 
-  /**
-   * Last packet sent.
-   */
+    /**
+     * Last packet sent.
+     */
   uint32_t pid GNUNET_PACKED;
 
     /**
      * ID of the connection.
      */
-  struct GNUNET_HashCode cid;
+  struct GNUNET_MeshHash cid;
 
 };
 
@@ -407,15 +411,10 @@ struct GNUNET_MESH_ConnectionBroken
      */
   struct GNUNET_MessageHeader header;
 
-    /**
-     * Always 0.
-     */
-  uint32_t reserved GNUNET_PACKED;
-
     /**
      * ID of the connection.
      */
-  struct GNUNET_HashCode cid;
+  struct GNUNET_MeshHash cid;
 
     /**
      * ID of the endpoint
@@ -426,8 +425,6 @@ struct GNUNET_MESH_ConnectionBroken
      * ID of the endpoint
      */
   struct GNUNET_PeerIdentity peer2;
-
-  /* TODO: signature */
 };
 
 
@@ -441,43 +438,13 @@ struct GNUNET_MESH_ConnectionDestroy
      */
   struct GNUNET_MessageHeader header;
 
-    /**
-     * Always 0.
-     */
-  uint32_t reserved GNUNET_PACKED;
-
     /**
      * ID of the connection.
      */
-  struct GNUNET_HashCode cid;
-
-  /* TODO: signature */
+  struct GNUNET_MeshHash cid;
 };
 
 
-/**
- * Message to keep a connection alive.
- */
-struct GNUNET_MESH_ConnectionKeepAlive
-{
-  /**
-   * Type: GNUNET_MESSAGE_TYPE_MESH_(FWD|BCK)_KEEPALIVE
-   */
-  struct GNUNET_MessageHeader header;
-
-  /**
-   * Always 0.
-   */
-  uint32_t reserved GNUNET_PACKED;
-
-  /**
-   * ID of the connection.
-   */
-  struct GNUNET_HashCode cid;
-};
-
-
-
 GNUNET_NETWORK_STRUCT_END
 
 #if 0                           /* keep Emacsens' auto-indent happy */