- fix coverity
[oweals/gnunet.git] / src / cadet / cadet_protocol.h
index 9b0abcc554cd736817f0f3cbbe70ec7ba125df18..dbb4f604fc64e16fca44e4525fc081af8ab0018d 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2001 - 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2001 - 2011 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -53,7 +53,7 @@ GNUNET_NETWORK_STRUCT_BEGIN
 struct GNUNET_CADET_ConnectionCreate
 {
     /**
-     * Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE
+     * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE
      *
      * Size: sizeof (struct GNUNET_CADET_ConnectionCreate) +
      *       path_length * sizeof (struct GNUNET_PeerIdentity)
@@ -79,7 +79,7 @@ struct GNUNET_CADET_ConnectionCreate
 struct GNUNET_CADET_ConnectionACK
 {
     /**
-     * Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK
+     * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK
      */
   struct GNUNET_MessageHeader header;
 
@@ -97,7 +97,7 @@ struct GNUNET_CADET_ConnectionACK
 struct GNUNET_CADET_KX
 {
     /**
-     * Type: GNUNET_MESSAGE_TYPE_CADET_KX.
+     * Type: #GNUNET_MESSAGE_TYPE_CADET_KX.
      */
   struct GNUNET_MessageHeader header;
 
@@ -110,6 +110,22 @@ struct GNUNET_CADET_KX
 };
 
 
+/**
+ * Flags to be used in GNUNET_CADET_AX_KX.
+ */
+enum GNUNET_CADET_AX_KX_Flags {
+
+  /**
+   * Should the peer reply with its KX details?
+   */
+  GNUNET_CADET_AX_KX_FLAG_NONE = 0,
+
+  /**
+   * The peer should reply with its KX details?
+   */
+  GNUNET_CADET_AX_KX_FLAG_FORCE_REPLY = 1
+};
+
 
 /**
  * Message for encapsulation of a Key eXchange message in a connection.
@@ -117,14 +133,15 @@ struct GNUNET_CADET_KX
 struct GNUNET_CADET_AX_KX
 {
   /**
-   * Type: GNUNET_MESSAGE_TYPE_CADET_AX_KX.
+   * Type: #GNUNET_MESSAGE_TYPE_CADET_AX_KX.
    */
   struct GNUNET_MessageHeader header;
 
   /**
-   * Should the peer reply with its KX details?
+   * Flags for the key exchange in NBO, based on
+   * `enum GNUNET_CADET_AX_KX_Flags`.
    */
-  uint32_t force_reply;
+  uint32_t flags GNUNET_PACKED;
 
   /**
    * Sender's ephemeral public ECC key encoded in a
@@ -302,6 +319,8 @@ struct GNUNET_CADET_AX
    */
   struct GNUNET_CADET_Hash hmac;
 
+  /**************** AX_HEADER start ****************/
+
   /**
    * Number of messages sent with the current ratchet key.
    */
@@ -317,6 +336,8 @@ struct GNUNET_CADET_AX
    */
   struct GNUNET_CRYPTO_EcdhePublicKey DHRs;
 
+  /**************** AX_HEADER  end  ****************/
+
   /**
    * Encrypted content follows.
    */