remove protocol violation
[oweals/gnunet.git] / src / psycstore / psycstore.h
index cc382a456110780d5273ea3aa18239d09105159a..16d898a459372a8d377d768d89d299ee781efe0e 100644 (file)
@@ -42,13 +42,16 @@ struct OperationResult
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Operation ID.
+   */
+  uint32_t op_id GNUNET_PACKED;
+
   /**
    * Status code for the operation.
    */
   int64_t result_code GNUNET_PACKED;
 
-  uint32_t op_id GNUNET_PACKED;
-
   /* followed by 0-terminated error message (on error) */
 
 };
@@ -57,52 +60,35 @@ struct OperationResult
 /**
  * Answer from service to client about master counters.
  *
- * @see GNUNET_PSYCSTORE_counters_get_master()
+ * @see GNUNET_PSYCSTORE_counters_get()
  */
-struct MasterCountersResult
+struct CountersResult
 {
   /**
-   * Type: GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS_MASTER
+   * Type: GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS
    */
   struct GNUNET_MessageHeader header;
 
-  uint64_t fragment_id GNUNET_PACKED;
-
-  uint64_t message_id GNUNET_PACKED;
-
-  uint64_t group_generation GNUNET_PACKED;
-
   /**
-   * Status code for the operation.
+   * Operation ID.
    */
-  int64_t result_code GNUNET_PACKED;
-
   uint32_t op_id GNUNET_PACKED;
 
-};
+  uint64_t max_fragment_id GNUNET_PACKED;
 
+  uint64_t max_message_id GNUNET_PACKED;
 
-/**
- * Answer from service to client about slave counters.
- *
- * @see GNUNET_PSYCSTORE_counters_get_slave()
- */
-struct SlaveCountersResult
-{
-  /**
-   * Type: GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS_SLAVE
-   */
-  struct GNUNET_MessageHeader header;
+  uint64_t max_group_generation GNUNET_PACKED;
 
-  uint64_t max_known_msg_id GNUNET_PACKED;
+  uint64_t max_state_message_id GNUNET_PACKED;
 
   /**
-   * Status code for the operation.
+   * Status code for the operation:
+   * #GNUNET_OK: success, counter values are returned.
+   * #GNUNET_NO: no message has been sent to the channel yet.
+   * #GNUNET_SYSERR: an error occurred.
    */
-  int64_t result_code GNUNET_PACKED;
-
-  uint32_t op_id GNUNET_PACKED;
-
+  int32_t result_code GNUNET_PACKED;
 };
 
 
@@ -116,6 +102,9 @@ struct FragmentResult
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Operation ID.
+   */
   uint32_t op_id GNUNET_PACKED;
 
   uint32_t psycstore_flags GNUNET_PACKED;
@@ -135,6 +124,9 @@ struct StateResult
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Operation ID.
+   */
   uint32_t op_id GNUNET_PACKED;
 
   uint16_t name_size  GNUNET_PACKED;
@@ -150,9 +142,13 @@ struct OperationRequest
 {
   struct GNUNET_MessageHeader header;
 
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
-
+  /**
+   * Operation ID.
+   */
   uint32_t op_id GNUNET_PACKED;
+
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
+
 };
 
 
@@ -166,22 +162,25 @@ struct MembershipStoreRequest
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Operation ID.
+   */
+  uint32_t op_id GNUNET_PACKED;
+
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   /**
    * Slave's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey slave_key;
-
-  int did_join;
-  uint64_t announced_at;
-  uint64_t effective_since;
-  uint64_t group_generation;
+  struct GNUNET_CRYPTO_EddsaPublicKey slave_key;
 
-  uint32_t op_id GNUNET_PACKED;
+  uint64_t announced_at GNUNET_PACKED;
+  uint64_t effective_since GNUNET_PACKED;
+  uint64_t group_generation GNUNET_PACKED;
+  int did_join GNUNET_PACKED;
 };
 
 
@@ -195,21 +194,24 @@ struct MembershipTestRequest
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Operation ID.
+   */
+  uint32_t op_id GNUNET_PACKED;
+
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   /**
    * Slave's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey slave_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey slave_key;
 
   uint64_t message_id GNUNET_PACKED;
 
   uint64_t group_generation GNUNET_PACKED;
-
-  uint32_t op_id GNUNET_PACKED;
 };
 
 
@@ -223,14 +225,17 @@ struct FragmentStoreRequest
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Operation ID.
+   */
+  uint32_t op_id GNUNET_PACKED;
+
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   uint32_t psycstore_flags GNUNET_PACKED;
-
-  uint32_t op_id GNUNET_PACKED;
 };
 
 
@@ -245,13 +250,16 @@ struct FragmentGetRequest
   struct GNUNET_MessageHeader header;
 
   /**
-   * Channel's public key.
+   * Operation ID.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  uint32_t op_id GNUNET_PACKED;
 
-  uint64_t fragment_id;
+  /**
+   * Channel's public key.
+   */
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
-  uint32_t op_id GNUNET_PACKED;
+  uint64_t fragment_id GNUNET_PACKED;
 };
 
 
@@ -266,13 +274,16 @@ struct MessageGetRequest
   struct GNUNET_MessageHeader header;
 
   /**
-   * Channel's public key.
+   * Operation ID.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  uint32_t op_id GNUNET_PACKED;
 
-  uint64_t message_id;
+  /**
+   * Channel's public key.
+   */
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
-  uint32_t op_id GNUNET_PACKED;
+  uint64_t message_id GNUNET_PACKED;
 };
 
 
@@ -287,15 +298,18 @@ struct MessageGetFragmentRequest
   struct GNUNET_MessageHeader header;
 
   /**
-   * Channel's public key.
+   * Operation ID.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  uint32_t op_id GNUNET_PACKED;
 
-  uint64_t message_id;
+  /**
+   * Channel's public key.
+   */
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
-  uint64_t fragment_offset;
+  uint64_t message_id GNUNET_PACKED;
 
-  uint32_t op_id GNUNET_PACKED;
+  uint64_t fragment_offset GNUNET_PACKED;
 };
 
 
@@ -309,14 +323,17 @@ struct StateHashUpdateRequest
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Operation ID.
+   */
+  uint32_t op_id GNUNET_PACKED;
+
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   struct GNUNET_HashCode hash;
-
-  uint32_t op_id GNUNET_PACKED;
 };
 
 enum StateOpFlags
@@ -335,17 +352,20 @@ struct StateModifyRequest
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Operation ID.
+   */
+  uint32_t op_id GNUNET_PACKED;
+
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   uint64_t message_id GNUNET_PACKED;
 
   uint64_t state_delta GNUNET_PACKED;
 
-  uint32_t op_id GNUNET_PACKED;
-
   /**
    * Size of name, including NUL terminator.
    */
@@ -375,15 +395,18 @@ struct StateSyncRequest
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Operation ID.
+   */
+  uint32_t op_id GNUNET_PACKED;
+
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   uint64_t message_id GNUNET_PACKED;
 
-  uint32_t op_id GNUNET_PACKED;
-
   /**
    * Size of name, including NUL terminator.
    */