consensus: destroy set handles
[oweals/gnunet.git] / src / psyc / psyc.h
index f2d386548110bb68dd17d205422724be31d77c2e..c1ce466a939ee9377b664e296c6ea4f05263dc58 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of GNUnet
- * (C) 2013 Christian Grothoff (and other contributing authors)
+ * Copyright (C) 2013 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.
  */
 
 /**
@@ -78,9 +78,9 @@ struct MasterStartRequest
    */
   struct GNUNET_MessageHeader header;
 
-  struct GNUNET_CRYPTO_EddsaPrivateKey channel_key;
-
   uint32_t policy GNUNET_PACKED;
+
+  struct GNUNET_CRYPTO_EddsaPrivateKey channel_key;
 };
 
 
@@ -93,60 +93,60 @@ struct SlaveJoinRequest
 
   uint32_t relay_count GNUNET_PACKED;
 
-  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_pub_key;
 
-  struct GNUNET_CRYPTO_EddsaPrivateKey slave_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey slave_key;
 
   struct GNUNET_PeerIdentity origin;
 
+  uint32_t flags GNUNET_PACKED;
+
   /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
+
+  /* Followed by struct GNUNET_MessageHeader join_msg */
 };
 
 
-struct ChannelSlaveAdd
+struct ChannelMembershipStoreRequest
 {
   /**
-   * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_SLAVE_ADD
+   * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_MEMBERSHIP_STORE
    */
   struct GNUNET_MessageHeader header;
 
-  uint32_t reserved;
+  uint32_t reserved GNUNET_PACKED;
 
-  struct GNUNET_CRYPTO_EddsaPublicKey *slave_key;
+  uint64_t op_id GNUNET_PACKED;
 
-  uint64_t announced_at;
+  struct GNUNET_CRYPTO_EcdsaPublicKey slave_pub_key;
 
-  uint64_t effective_since;
+  uint64_t announced_at GNUNET_PACKED;
+
+  uint64_t effective_since GNUNET_PACKED;
+
+  uint8_t did_join;
 };
 
 
-struct ChannelSlaveRemove
+struct HistoryRequest
 {
   /**
-   * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_SLAVE_RM
+   * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_HISTORY_REQUEST
    */
   struct GNUNET_MessageHeader header;
 
-  uint32_t reserved;
-
-  struct GNUNET_CRYPTO_EddsaPublicKey *slave_key;
-
-  uint64_t announced_at;
-};
-
+  uint32_t reserved GNUNET_PACKED;
 
-struct StoryRequest
-{
   /**
-   * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_STORY_REQUEST
+   * ID for this operation.
    */
-  struct GNUNET_MessageHeader header;
+  uint64_t op_id GNUNET_PACKED;
 
-  uint64_t op_id;
+  uint64_t start_message_id GNUNET_PACKED;
 
-  uint64_t start_message_id;
+  uint64_t end_message_id GNUNET_PACKED;
 
-  uint64_t end_message_id;
+  uint64_t message_limit GNUNET_PACKED;
 };
 
 
@@ -159,10 +159,12 @@ struct StateRequest
    */
   struct GNUNET_MessageHeader header;
 
+  uint32_t reserved GNUNET_PACKED;
+
   /**
    * ID for this operation.
    */
-  uint64_t op_id;
+  uint64_t op_id GNUNET_PACKED;
 
   /* Followed by NUL-terminated name. */
 };
@@ -171,62 +173,6 @@ struct StateRequest
 /**** service -> library ****/
 
 
-struct CountersResult
-{
-  /**
-   * Type: GNUNET_MESSAGE_TYPE_PSYC_RESULT_COUNTERS
-   */
-  struct GNUNET_MessageHeader header;
-
-  /**
-   * Status code for the operation.
-   */
-  int32_t result_code GNUNET_PACKED;
-
-  /**
-   * Last message ID sent to the channel.
-   */
-  uint64_t max_message_id;
-};
-
-/**
- * Answer from service to client about last operation.
- */
-struct OperationResult
-{
-  /**
-   * Types:
-   * - GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE
-   * - GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_STORY_RESULT
-   * - GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_STATE_RESULT
-   */
-  struct GNUNET_MessageHeader header;
-
-  /**
-   * Operation ID.
-   */
-  uint32_t op_id GNUNET_PACKED;
-
-  /**
-   * Status code for the operation.
-   */
-  int64_t result_code GNUNET_PACKED;
-
-  /* Followed by:
-   * - on error: NUL-terminated error message
-   * - on success: one of the following message types
-   *
-   *   For a STORY_RESULT:
-   *   - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE
-   *
-   *   For a STATE_RESULT, one of:
-   *   - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MODIFIER
-   *   - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MOD_CONT
-   *   - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_END
-   */
-};
-
-
 GNUNET_NETWORK_STRUCT_END
 
 #endif