/*
* 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
*
* 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.
*/
/**
*/
struct GNUNET_MessageHeader header;
+ uint32_t reserved GNUNET_PACKED;
+
/**
- * Status code for the operation.
+ * Operation ID.
*/
- int64_t result_code GNUNET_PACKED;
+ uint64_t op_id GNUNET_PACKED;
- uint32_t op_id GNUNET_PACKED;
+ /**lowed by
+ * Status code for the operation.
+ */
+ uint64_t result_code GNUNET_PACKED;
/* followed by 0-terminated error message (on error) */
/**
* 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.
+ * 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 result_code GNUNET_PACKED;
- uint32_t op_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
+ * Operation ID.
*/
- struct GNUNET_MessageHeader header;
+ uint64_t op_id GNUNET_PACKED;
- uint64_t max_known_msg_id GNUNET_PACKED;
+ uint64_t max_fragment_id GNUNET_PACKED;
- /**
- * Status code for the operation.
- */
- int64_t result_code GNUNET_PACKED;
+ uint64_t max_message_id GNUNET_PACKED;
- uint32_t op_id GNUNET_PACKED;
+ uint64_t max_group_generation GNUNET_PACKED;
+ uint64_t max_state_message_id GNUNET_PACKED;
};
*/
struct GNUNET_MessageHeader header;
- uint32_t op_id GNUNET_PACKED;
-
uint32_t psycstore_flags GNUNET_PACKED;
- /* followed by GNUNET_MULTICAST_MessageHeader */
+ /**
+ * Operation ID.
+ */
+ uint64_t op_id GNUNET_PACKED;
+ /* Followed by GNUNET_MULTICAST_MessageHeader */
};
*/
struct GNUNET_MessageHeader header;
- uint32_t op_id GNUNET_PACKED;
+ uint16_t name_size GNUNET_PACKED;
+
+ uint16_t reserved GNUNET_PACKED;
- uint16_t name_size GNUNET_PACKED;
+ /**
+ * Operation ID.
+ */
+ uint64_t op_id GNUNET_PACKED;
- /* followed by name and value */
+ /* Followed by name and value */
};
{
struct GNUNET_MessageHeader header;
- struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+ uint32_t reserved GNUNET_PACKED;
- uint32_t op_id GNUNET_PACKED;
+ /**
+ * Operation ID.
+ */
+ uint64_t op_id GNUNET_PACKED;
+
+ struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
};
*/
struct GNUNET_MessageHeader header;
+ uint32_t reserved GNUNET_PACKED;
+
+ /**
+ * Operation ID.
+ */
+ uint64_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_EcdsaPublicKey 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;
+ uint8_t did_join;
};
*/
struct GNUNET_MessageHeader header;
+ uint32_t reserved GNUNET_PACKED;
+
+ /**
+ * Operation ID.
+ */
+ uint64_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_EcdsaPublicKey slave_key;
uint64_t message_id GNUNET_PACKED;
uint64_t group_generation GNUNET_PACKED;
-
- uint32_t op_id GNUNET_PACKED;
};
*/
struct GNUNET_MessageHeader header;
+ /**
+ * enum GNUNET_PSYCSTORE_MessageFlags
+ */
+ uint32_t psycstore_flags GNUNET_PACKED;
+
/**
* Channel's public key.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+ struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
- uint32_t psycstore_flags GNUNET_PACKED;
+ /**
+ * Operation ID.
+ */
+ uint64_t op_id;
- uint32_t op_id GNUNET_PACKED;
+ /* Followed by fragment */
};
*/
struct GNUNET_MessageHeader header;
+ uint32_t reserved GNUNET_PACKED;
+
+ /**
+ * Operation ID.
+ */
+ uint64_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_EcdsaPublicKey slave_key;
+
+ /**
+ * First fragment ID to request.
+ */
+ uint64_t first_fragment_id GNUNET_PACKED;
+
+ /**
+ * Last fragment ID to request.
+ */
+ uint64_t last_fragment_id GNUNET_PACKED;
- uint64_t fragment_id;
+ /**
+ * Maximum number of fragments to retrieve.
+ */
+ uint64_t fragment_limit GNUNET_PACKED;
- uint32_t op_id GNUNET_PACKED;
+ /**
+ * Do membership test with @a slave_key before returning fragment?
+ * #GNUNET_YES or #GNUNET_NO
+ */
+ uint8_t do_membership_test;
};
*/
struct GNUNET_MessageHeader header;
+ uint32_t reserved GNUNET_PACKED;
+
+ /**
+ * Operation ID.
+ */
+ uint64_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_EcdsaPublicKey slave_key;
+
+ /**
+ * First message ID to request.
+ */
+ uint64_t first_message_id GNUNET_PACKED;
- uint64_t message_id;
+ /**
+ * Last message ID to request.
+ */
+ uint64_t last_message_id GNUNET_PACKED;
- uint32_t op_id GNUNET_PACKED;
+ /**
+ * Maximum number of messages to retrieve.
+ */
+ uint64_t message_limit GNUNET_PACKED;
+
+ /**
+ * Maximum number of fragments to retrieve.
+ */
+ uint64_t fragment_limit GNUNET_PACKED;
+
+ /**
+ * Do membership test with @a slave_key before returning fragment?
+ * #GNUNET_YES or #GNUNET_NO
+ */
+ uint8_t do_membership_test;
+
+ /* Followed by method_prefix */
};
*/
struct GNUNET_MessageHeader header;
+ uint32_t reserved GNUNET_PACKED;
+
+ /**
+ * Operation ID.
+ */
+ uint64_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;
+ /**
+ * Slave's public key.
+ */
+ struct GNUNET_CRYPTO_EcdsaPublicKey slave_key;
+
+ /**
+ * Requested message ID.
+ */
+ uint64_t message_id GNUNET_PACKED;
- uint64_t fragment_offset;
+ /**
+ * Requested fragment offset.
+ */
+ uint64_t fragment_offset GNUNET_PACKED;
- uint32_t op_id GNUNET_PACKED;
+ /**
+ * Do membership test with @a slave_key before returning fragment?
+ * #GNUNET_YES or #GNUNET_NO
+ */
+ uint8_t do_membership_test;
};
*/
struct GNUNET_MessageHeader header;
+ uint32_t reserved GNUNET_PACKED;
+
+ /**
+ * Operation ID.
+ */
+ uint64_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
{
STATE_OP_FIRST = 1 << 0,
STATE_OP_LAST = 1 << 1
};
+
/**
* @see GNUNET_PSYCSTORE_state_modify()
*/
struct GNUNET_MessageHeader header;
/**
- * Channel's public key.
+ * Operation ID.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
-
- uint64_t message_id GNUNET_PACKED;
-
- uint64_t state_delta GNUNET_PACKED;
-
- uint32_t op_id GNUNET_PACKED;
+ uint64_t op_id GNUNET_PACKED;
/**
- * Size of name, including NUL terminator.
+ * ID of the message to apply the state changes in.
*/
- uint16_t name_size GNUNET_PACKED;
+ uint64_t message_id GNUNET_PACKED;
/**
- * OR'd StateOpFlags
+ * State delta of the message with ID @a message_id.
*/
- uint8_t flags;
+ uint64_t state_delta GNUNET_PACKED;
/**
- * enum GNUNET_ENV_Operator
+ * Channel's public key.
*/
- uint8_t oper;
-
- /* Followed by NUL-terminated name, then the value. */
+ struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
};
struct GNUNET_MessageHeader header;
/**
- * Channel's public key.
+ * Size of name, including NUL terminator.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+ uint16_t name_size GNUNET_PACKED;
- uint64_t message_id GNUNET_PACKED;
+ /**
+ * OR'd StateOpFlags
+ */
+ uint8_t flags;
- uint32_t op_id GNUNET_PACKED;
+ uint8_t reserved;
/**
- * Size of name, including NUL terminator.
+ * Operation ID.
*/
- uint16_t name_size GNUNET_PACKED;
+ uint64_t op_id GNUNET_PACKED;
/**
- * OR'd StateOpFlags
+ * ID of the message that contains the state_hash PSYC header variable.
*/
- uint8_t flags;
+ uint64_t state_hash_message_id GNUNET_PACKED;
+
+ /**
+ * ID of the last stateful message before @a state_hash_message_id.
+ */
+ uint64_t max_state_message_id GNUNET_PACKED;
+
+ /**
+ * Channel's public key.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
/* Followed by NUL-terminated name, then the value. */
};