2 This file is part of GNUnet.
3 Copyright (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., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 * @file multicast/multicast.h
23 * @brief multicast IPC messages
24 * @author Christian Grothoff
25 * @author Gabor X Toth
31 #include "gnunet_multicast_service.h"
33 GNUNET_NETWORK_STRUCT_BEGIN
37 * Header of a join request sent to the origin or another member.
39 struct MulticastJoinRequestMessage
42 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST
44 struct GNUNET_MessageHeader header;
52 * ECC signature of the rest of the fields of the join request.
54 * Signature must match the public key of the joining member.
56 struct GNUNET_CRYPTO_EcdsaSignature signature;
59 * Purpose for the signature and size of the signed data.
61 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
64 * Public key of the target group.
66 struct GNUNET_CRYPTO_EddsaPublicKey group_key;
69 * Public key of the joining member.
71 struct GNUNET_CRYPTO_EcdsaPublicKey member_key;
74 * Peer identity of the joining member.
76 struct GNUNET_PeerIdentity peer;
78 /* Followed by struct GNUNET_MessageHeader join_message */
83 * Header of a join decision message sent to a peer requesting join.
85 struct MulticastJoinDecisionMessage
88 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION
90 struct GNUNET_MessageHeader header;
93 * #GNUNET_YES if the peer was admitted
94 * #GNUNET_NO if entry was refused,
95 * #GNUNET_SYSERR if the request could not be answered.
100 * Number of relays given.
102 uint32_t relay_count;
104 /* Followed by relay_count peer identities */
106 /* Followed by the join response message */
111 * Header added to a struct MulticastJoinDecisionMessage
112 * when sent between the client and service.
114 struct MulticastJoinDecisionMessageHeader
117 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION
119 struct GNUNET_MessageHeader header;
122 * C->S: Peer to send the join decision to.
123 * S->C: Peer we received the join decision from.
125 struct GNUNET_PeerIdentity peer;
128 * C->S: Public key of the member requesting join.
131 struct GNUNET_CRYPTO_EcdsaPublicKey member_key;
133 /* Followed by struct MulticastJoinDecisionMessage */
138 * Message sent from the client to the service to notify the service
139 * about the result of a membership test.
141 struct MulticastMembershipTestResultMessage
144 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_MEMBERSHIP_TEST_RESULT
146 struct GNUNET_MessageHeader header;
149 * Unique ID that identifies the associated membership test.
154 * #GNUNET_YES if the peer is a member
155 * #GNUNET_NO if peer is not a member,
156 * #GNUNET_SYSERR if the test could not be answered.
163 * Message sent from the client to the service OR the service to the
164 * client asking for a message fragment to be replayed.
166 struct MulticastReplayRequestMessage
170 * The message type can be either
171 * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST or
172 * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST_CANCEL.
174 struct GNUNET_MessageHeader header;
177 * S->C: Public key of the member requesting replay.
180 struct GNUNET_CRYPTO_EcdsaPublicKey member_key;
183 * ID of the message that is being requested.
185 uint64_t fragment_id;
188 * ID of the message that is being requested.
193 * Offset of the fragment that is being requested.
195 uint64_t fragment_offset;
198 * Additional flags for the request.
210 * Message sent from the client to the service to give the service
211 * a replayed message.
213 struct MulticastReplayResponseMessage
217 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE
218 * or GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE_END
220 struct GNUNET_MessageHeader header;
223 * ID of the message that is being requested.
225 uint64_t fragment_id;
228 * ID of the message that is being requested.
233 * Offset of the fragment that is being requested.
235 uint64_t fragment_offset;
238 * Additional flags for the request.
243 * An `enum GNUNET_MULTICAST_ReplayErrorCode` identifying issues (in NBO).
247 /* followed by replayed message */
252 * Message sent from the client to the service to notify the service
253 * about the starting of a multicast group with this peers as its origin.
255 struct MulticastOriginStartMessage
258 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_ORIGIN_START
260 struct GNUNET_MessageHeader header;
268 * Private, non-ephemeral key for the multicast group.
270 struct GNUNET_CRYPTO_EddsaPrivateKey group_key;
273 * Last fragment ID sent to the group, used to continue counting fragments if
274 * we resume operating * a group.
276 uint64_t max_fragment_id;
281 struct MulticastMemberJoinMessage
284 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_MEMBER_JOIN
286 struct GNUNET_MessageHeader header;
288 uint32_t relay_count GNUNET_PACKED;
290 struct GNUNET_CRYPTO_EddsaPublicKey group_key;
292 struct GNUNET_CRYPTO_EcdsaPrivateKey member_key;
294 struct GNUNET_PeerIdentity origin;
296 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
298 /* Followed by struct GNUNET_MessageHeader join_msg */
304 * Message sent from the client to the service to broadcast to all group
307 struct MulticastBroadcastMessage
313 struct GNUNET_MessageHeader header;
316 * #GNUNET_OK normally, #GNUNET_SYSERR if the origin aborted the
329 uint64_t group_generation;
332 * Total message size.
340 * Message sent from the client to the service to join a multicast group.
342 struct MulticastJoinMessage
348 struct GNUNET_MessageHeader header;
351 * Number of relays we (think) we already know about.
353 uint32_t relay_count;
356 * Public non-ephemeral key of the mutlicast group.
358 struct GNUNET_CRYPTO_EddsaPublicKey group_key;
361 * Our private key for the group.
363 struct GNUNET_CRYPTO_EcdsaPrivateKey member_key;
365 /* followed by 'relay_count' `struct GNUNET_PeerIdentity`s */
372 * Message sent from the client to the service to unicast to the group origin.
374 struct MulticastUnicastToOriginMessage
380 struct GNUNET_MessageHeader header;
383 * Reserved (always 0).
393 * Total message size.
397 /* followed by payload */
403 * Message sent from the client to the service to
404 * cancel unicast to the group origin.
406 struct MulticastUnicastToOriginCancelMessage
412 struct GNUNET_MessageHeader header;
415 * Reserved (always 0).
427 GNUNET_NETWORK_STRUCT_END
430 /* end of multicast.h */