-fix ftbfs
[oweals/gnunet.git] / src / multicast / multicast.h
1 /*
2      This file is part of GNUnet.
3      (C) 2012, 2013 Christian Grothoff (and other contributing authors)
4
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.
9
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.
14
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.
19 */
20
21 /**
22  * @file multicast/multicast.h
23  * @brief multicast IPC messages
24  * @author Christian Grothoff
25  */
26 #ifndef MULTICAST_H
27 #define MULTICAST_H
28
29 GNUNET_NETWORK_STRUCT_BEGIN
30
31
32 /**
33  * Message sent from the client to the service to notify the service
34  * about a join decision.
35  */
36 struct MulticastJoinDecisionMessage
37 {
38
39   /**
40    *
41    */
42   struct GNUNET_MessageHeader header;
43
44   /**
45    * Unique ID that identifies the associated join test.
46    */
47   uint32_t uid;
48
49   /**
50    * #GNUNET_YES if the peer was admitted.
51    */
52   int32_t is_admitted;
53
54   /**
55    * Number of relays given.
56    */
57   uint32_t relay_count;
58
59   /* followed by 'relay_count' peer identities */
60
61   /* followed by the join response message */
62
63 };
64
65
66 /**
67  * Message sent from the client to the service to notify the service
68  * about the result of a membership test.
69  */
70 struct MulticastMembershipTestResponseMessage
71 {
72
73   /**
74    *
75    */
76   struct GNUNET_MessageHeader header;
77
78   /**
79    * Unique ID that identifies the associated membership test.
80    */
81   uint32_t uid;
82
83   /**
84    * #GNUNET_YES if the peer is a member, #GNUNET_NO if peer was not a member,
85    * #GNUNET_SYSERR if we cannot answer the test.
86    */
87   int32_t is_admitted;
88
89 };
90
91
92 /**
93  * Message sent from the client to the service to give the service
94  * a replayed message.
95  */
96 struct MulticastReplayResponseMessage
97 {
98
99   /**
100    *
101    */
102   struct GNUNET_MessageHeader header;
103
104   /**
105    * Unique ID that identifies the associated replay session.
106    */
107   uint32_t uid;
108
109   /**
110    * An `enum GNUNET_MULTICAST_ReplayErrorCode` identifying issues (in NBO).
111    */
112   int32_t error_code;
113
114   /* followed by replayed message */
115
116 };
117
118
119 /**
120  * Message sent from the client to the service to notify the service
121  * about the end of a replay session.
122  */
123 struct MulticastReplayEndMessage
124 {
125
126   /**
127    *
128    */
129   struct GNUNET_MessageHeader header;
130
131   /**
132    * Unique ID that identifies the associated replay session.
133    */
134   uint32_t uid;
135
136 };
137
138
139 /**
140  * Message sent from the client to the service to notify the service
141  * about the starting of a multicast group with this peers as its origin.
142  */
143 struct MulticastOriginStartMessage
144 {
145
146   /**
147    *
148    */
149   struct GNUNET_MessageHeader header;
150
151   /**
152    * Always zero.
153    */
154   uint32_t reserved;
155
156   /**
157    * Private, non-ephemeral key for the mutlicast group.
158    */
159   struct GNUNET_CRYPTO_EddsaPrivateKey group_key;
160
161   /**
162    * Last fragment ID, used to continue counting fragments if we resume operating
163    * a group.
164    */
165   uint64_t last_fragment_id;
166
167 };
168
169
170 /**
171  * Message sent from the client to the service to broadcast to all group
172  * members.
173  */
174 struct MulticastBroadcastMessage
175 {
176
177   /**
178    *
179    */
180   struct GNUNET_MessageHeader header;
181
182   /**
183    * #GNUNET_OK normally, #GNUNET_SYSERR if the origin aborted the
184    * transmission.
185    */
186   int32_t status;
187
188   /**
189    * Message ID.
190    */
191   uint64_t message_id;
192
193   /**
194    * Group generation.
195    */
196   uint64_t group_generation;
197
198   /**
199    * Total message size.
200    */
201   uint64_t total_size;
202
203 };
204
205
206 /**
207  * Message sent from the client to the service to join a multicast group.
208  */
209 struct MulticastJoinMessage
210 {
211
212   /**
213    *
214    */
215   struct GNUNET_MessageHeader header;
216
217   /**
218    * Number of relays we (think) we already know about.
219    */
220   uint32_t relay_count;
221
222   /**
223    * Public non-ephemeral key of the mutlicast group.
224    */
225   struct GNUNET_CRYPTO_EddsaPublicKey group_key;
226
227   /**
228    * Our private key for the group.
229    */
230   struct GNUNET_CRYPTO_EddsaPrivateKey member_key;
231
232   /* followed by 'relay_count' `struct GNUNET_PeerIdentity`s */
233
234 };
235
236
237
238 /**
239  * Message sent from the client to the service OR the service to the
240  * client asking for a message fragment to be replayed.
241  */
242 struct MulticastReplayRequestMessage
243 {
244
245   /**
246    * The message type can be either
247    * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST or
248    * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST_CANCEL.
249    */
250   struct GNUNET_MessageHeader header;
251
252   /**
253    * Replay request ID.
254    */
255   uint32_t uid;
256
257   /**
258    * ID of the message that is being requested.
259    */
260   uint64_t message_id;
261
262   /**
263    * Offset of the fragment that is being requested.
264    */
265   uint64_t fragment_offset;
266
267   /**
268    * Additional flags for the request.
269    */
270   uint64_t flags;
271
272 };
273
274
275
276 /**
277  * Message sent from the client to the service to unicast to the group origin.
278  */
279 struct MulticastUnicastToOriginMessage
280 {
281
282   /**
283    *
284    */
285   struct GNUNET_MessageHeader header;
286
287   /**
288    * Reserved (always 0).
289    */
290   uint32_t reserved;
291
292   /**
293    * Message ID.
294    */
295   uint64_t message_id;
296
297   /**
298    * Total message size.
299    */
300   uint64_t total_size;
301
302   /* followed by payload */
303
304 };
305
306
307 /**
308  * Message sent from the client to the service to
309  * cancel unicast to the group origin.
310  */
311 struct MulticastUnicastToOriginCancelMessage
312 {
313
314   /**
315    *
316    */
317   struct GNUNET_MessageHeader header;
318
319   /**
320    * Reserved (always 0).
321    */
322   uint32_t reserved;
323
324   /**
325    * Message ID.
326    */
327   uint64_t message_id;
328
329 };
330
331
332
333
334
335 GNUNET_NETWORK_STRUCT_END
336
337 #endif
338 /* end of multicast.h */