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_EcdsaSignature 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_EcdsaPublicKey member_key;
71 * Peer identity of the joining member.
73 struct GNUNET_PeerIdentity peer;
75 /* Followed by struct GNUNET_MessageHeader join_message */
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_EcdsaPublicKey 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_EcdsaPrivateKey member_key;
249 struct GNUNET_PeerIdentity origin;
251 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
253 /* Followed by struct GNUNET_MessageHeader join_msg */
258 * Message sent from the client to the service to broadcast to all group
261 struct MulticastBroadcastMessage
267 struct GNUNET_MessageHeader header;
270 * #GNUNET_OK normally, #GNUNET_SYSERR if the origin aborted the
283 uint64_t group_generation;
286 * Total message size.
294 * Message sent from the client to the service to join a multicast group.
296 struct MulticastJoinMessage
302 struct GNUNET_MessageHeader header;
305 * Number of relays we (think) we already know about.
307 uint32_t relay_count;
310 * Public non-ephemeral key of the mutlicast group.
312 struct GNUNET_CRYPTO_EddsaPublicKey group_key;
315 * Our private key for the group.
317 struct GNUNET_CRYPTO_EcdsaPrivateKey member_key;
319 /* followed by 'relay_count' `struct GNUNET_PeerIdentity`s */
326 * Message sent from the client to the service OR the service to the
327 * client asking for a message fragment to be replayed.
329 struct MulticastReplayRequestMessage
333 * The message type can be either
334 * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST or
335 * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST_CANCEL.
337 struct GNUNET_MessageHeader header;
345 * ID of the message that is being requested.
350 * Offset of the fragment that is being requested.
352 uint64_t fragment_offset;
355 * Additional flags for the request.
364 * Message sent from the client to the service to unicast to the group origin.
366 struct MulticastUnicastToOriginMessage
372 struct GNUNET_MessageHeader header;
375 * Reserved (always 0).
385 * Total message size.
389 /* followed by payload */
395 * Message sent from the client to the service to
396 * cancel unicast to the group origin.
398 struct MulticastUnicastToOriginCancelMessage
404 struct GNUNET_MessageHeader header;
407 * Reserved (always 0).
419 GNUNET_NETWORK_STRUCT_END
422 /* end of multicast.h */