2 * This file is part of GNUnet
3 * (C) 2013 Christian Grothoff (and other contributing authors)
5 * GNUnet is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published
7 * by the Free Software Foundation; either version 3, or (at your
8 * option) any later version.
10 * GNUnet is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNUnet; see the file COPYING. If not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
23 * @brief Common type definitions for the PSYC service and API.
24 * @author Gabor X Toth
30 #include "gnunet_common.h"
32 GNUNET_NETWORK_STRUCT_BEGIN
34 /**** service -> library ****/
37 * Answer from service to client about last operation.
39 struct OperationResult
42 * Type: GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_CODE
44 struct GNUNET_MessageHeader header;
49 uint32_t op_id GNUNET_PACKED;
52 * Status code for the operation.
54 int64_t result_code GNUNET_PACKED;
56 /* followed by 0-terminated error message (on error) */
64 * Type: GNUNET_MESSAGE_TYPE_PSYC_RESULT_COUNTERS
66 struct GNUNET_MessageHeader header;
68 uint64_t max_message_id;
73 * Transmit acknowledgment.
75 * Sent after the last GNUNET_PSYC_MessageModifier and after each
76 * GNUNET_PSYC_MessageData.
78 * This message acknowledges previously received messages and asks for the next
84 * Type: GNUNET_MESSAGE_TYPE_PSYC_TRANSMIT_ACK
86 struct GNUNET_MessageHeader header;
89 * Buffer space available for the next data fragment.
95 /**** library -> service ****/
98 struct MasterStartRequest
101 * Type: GNUNET_MESSAGE_TYPE_PSYC_MASTER_START
103 struct GNUNET_MessageHeader header;
105 struct GNUNET_CRYPTO_EccPrivateKey channel_key;
107 uint32_t policy GNUNET_PACKED;
111 struct SlaveJoinRequest
114 * Type: GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN
116 struct GNUNET_MessageHeader header;
118 uint32_t relay_count GNUNET_PACKED;
120 struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
122 struct GNUNET_CRYPTO_EccPrivateKey slave_key;
124 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
128 struct ChannelSlaveAdd
131 * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_SLAVE_ADD
133 struct GNUNET_MessageHeader header;
137 struct GNUNET_CRYPTO_EccPublicSignKey *slave_key;
139 uint64_t announced_at;
141 uint64_t effective_since;
145 struct ChannelSlaveRemove
148 * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_SLAVE_RM
150 struct GNUNET_MessageHeader header;
154 struct GNUNET_CRYPTO_EccPublicSignKey *slave_key;
156 uint64_t announced_at;
163 * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_STORY_REQUEST
165 struct GNUNET_MessageHeader header;
169 uint64_t start_message_id;
171 uint64_t end_message_id;
178 * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_STATE_QUERY
180 struct GNUNET_MessageHeader header;
184 /* Followed by NUL-terminated name. */
191 * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_STATE_RESULT
193 struct GNUNET_MessageHeader header;
196 * Size of name, including NUL terminator.
198 uint16_t name_size GNUNET_PACKED;
205 /* Followed by NUL-terminated name, then the value. */
209 GNUNET_NETWORK_STRUCT_END