2 This file is part of GNUnet.
3 (C) 2012, 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.
22 * @file multicast/multicast.h
23 * @brief multicast IPC messages
24 * @author Christian Grothoff
25 * @author Gabor X Toth
30 GNUNET_NETWORK_STRUCT_BEGIN
34 * Header of a join request sent to the origin or another member.
36 struct MulticastJoinRequestMessage
39 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST
41 struct GNUNET_MessageHeader header;
49 * ECC signature of the rest of the fields of the join request.
51 * Signature must match the public key of the joining member.
53 struct GNUNET_CRYPTO_EddsaSignature signature;
56 * Purpose for the signature and size of the signed data.
58 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
61 * Public key of the target group.
63 struct GNUNET_CRYPTO_EddsaPublicKey group_key;
66 * Public key of the joining member.
68 struct GNUNET_CRYPTO_EddsaPublicKey member_key;
71 * Peer identity of the joining member.
73 struct GNUNET_PeerIdentity member_peer;
75 /* Followed by struct GNUNET_MessageHeader join_request */
80 * Header of a join decision message sent to a peer requesting join.
82 struct MulticastJoinDecisionMessage
85 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION
87 struct GNUNET_MessageHeader header;
90 * #GNUNET_YES if the peer was admitted
91 * #GNUNET_NO if entry was refused,
92 * #GNUNET_SYSERR if the request could not be answered.
97 * Number of relays given.
101 /* Followed by relay_count peer identities */
103 /* Followed by the join response message */
108 * Header added to a struct MulticastJoinDecisionMessage
109 * when sent between the client and service.
111 struct MulticastJoinDecisionMessageHeader
114 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION
116 struct GNUNET_MessageHeader header;
119 * C->S: Peer to send the join decision to.
120 * S->C: Peer we received the join decision from.
122 struct GNUNET_PeerIdentity peer;
125 * C->S: Public key of the member requesting join.
128 struct GNUNET_CRYPTO_EddsaPublicKey member_key;
130 /* Followed by struct MulticastJoinDecisionMessage */
135 * Message sent from the client to the service to notify the service
136 * about the result of a membership test.
138 struct MulticastMembershipTestResultMessage
141 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_MEMBERSHIP_TEST_RESULT
143 struct GNUNET_MessageHeader header;
146 * Unique ID that identifies the associated membership test.
151 * #GNUNET_YES if the peer is a member
152 * #GNUNET_NO if peer is not a member,
153 * #GNUNET_SYSERR if the test could not be answered.
160 * Message sent from the client to the service to give the service
161 * a replayed message.
163 struct MulticastReplayResponseMessage
169 struct GNUNET_MessageHeader header;
172 * Unique ID that identifies the associated replay session.
177 * An `enum GNUNET_MULTICAST_ReplayErrorCode` identifying issues (in NBO).
181 /* followed by replayed message */
187 * Message sent from the client to the service to notify the service
188 * about the end of a replay session.
190 struct MulticastReplayEndMessage
196 struct GNUNET_MessageHeader header;
199 * Unique ID that identifies the associated replay session.
207 * Message sent from the client to the service to notify the service
208 * about the starting of a multicast group with this peers as its origin.
210 struct MulticastOriginStartMessage
213 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_ORIGIN_START
215 struct GNUNET_MessageHeader header;
223 * Private, non-ephemeral key for the multicast group.
225 struct GNUNET_CRYPTO_EddsaPrivateKey group_key;
228 * Last fragment ID sent to the group, used to continue counting fragments if
229 * we resume operating * a group.
231 uint64_t max_fragment_id;
236 struct MulticastMemberJoinMessage
239 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_MEMBER_JOIN
241 struct GNUNET_MessageHeader header;
243 uint32_t relay_count GNUNET_PACKED;
245 struct GNUNET_CRYPTO_EddsaPublicKey group_key;
247 struct GNUNET_CRYPTO_EddsaPrivateKey member_key;
249 struct GNUNET_PeerIdentity origin;
251 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
252 /* Followed by struct GNUNET_MessageHeader join_request */
257 * Message sent from the client to the service to broadcast to all group
260 struct MulticastBroadcastMessage
266 struct GNUNET_MessageHeader header;
269 * #GNUNET_OK normally, #GNUNET_SYSERR if the origin aborted the
282 uint64_t group_generation;
285 * Total message size.
293 * Message sent from the client to the service to join a multicast group.
295 struct MulticastJoinMessage
301 struct GNUNET_MessageHeader header;
304 * Number of relays we (think) we already know about.
306 uint32_t relay_count;
309 * Public non-ephemeral key of the mutlicast group.
311 struct GNUNET_CRYPTO_EddsaPublicKey group_key;
314 * Our private key for the group.
316 struct GNUNET_CRYPTO_EddsaPrivateKey member_key;
318 /* followed by 'relay_count' `struct GNUNET_PeerIdentity`s */
325 * Message sent from the client to the service OR the service to the
326 * client asking for a message fragment to be replayed.
328 struct MulticastReplayRequestMessage
332 * The message type can be either
333 * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST or
334 * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST_CANCEL.
336 struct GNUNET_MessageHeader header;
344 * ID of the message that is being requested.
349 * Offset of the fragment that is being requested.
351 uint64_t fragment_offset;
354 * Additional flags for the request.
363 * Message sent from the client to the service to unicast to the group origin.
365 struct MulticastUnicastToOriginMessage
371 struct GNUNET_MessageHeader header;
374 * Reserved (always 0).
384 * Total message size.
388 /* followed by payload */
394 * Message sent from the client to the service to
395 * cancel unicast to the group origin.
397 struct MulticastUnicastToOriginCancelMessage
403 struct GNUNET_MessageHeader header;
406 * Reserved (always 0).
418 GNUNET_NETWORK_STRUCT_END
421 /* end of multicast.h */