2 This file is part of GNUnet.
3 Copyright (C) 2012, 2013 GNUnet e.V.
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_pub_key;
69 * Public key of the joining member.
71 struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_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_pub_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 should be
171 * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST.
173 struct GNUNET_MessageHeader header;
176 * S->C: Public key of the member requesting replay.
179 struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key;
182 * ID of the message that is being requested.
184 uint64_t fragment_id;
187 * ID of the message that is being requested.
192 * Offset of the fragment that is being requested.
194 uint64_t fragment_offset;
197 * Additional flags for the request.
209 * Message sent from the client to the service to give the service
210 * a replayed message.
212 struct MulticastReplayResponseMessage
216 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE
217 * or GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE_END
219 struct GNUNET_MessageHeader header;
222 * ID of the message that is being requested.
224 uint64_t fragment_id;
227 * ID of the message that is being requested.
232 * Offset of the fragment that is being requested.
234 uint64_t fragment_offset;
237 * Additional flags for the request.
242 * An `enum GNUNET_MULTICAST_ReplayErrorCode` identifying issues (in NBO).
246 /* followed by replayed message */
251 * Message sent from the client to the service to notify the service
252 * about the starting of a multicast group with this peers as its origin.
254 struct MulticastOriginStartMessage
257 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_ORIGIN_START
259 struct GNUNET_MessageHeader header;
267 * Private, non-ephemeral key for the multicast group.
269 struct GNUNET_CRYPTO_EddsaPrivateKey group_key;
272 * Last fragment ID sent to the group, used to continue counting fragments if
273 * we resume operating * a group.
275 uint64_t max_fragment_id;
280 struct MulticastMemberJoinMessage
283 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_MEMBER_JOIN
285 struct GNUNET_MessageHeader header;
287 uint32_t relay_count GNUNET_PACKED;
289 struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key;
291 struct GNUNET_CRYPTO_EcdsaPrivateKey member_key;
293 struct GNUNET_PeerIdentity origin;
295 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
297 /* Followed by struct GNUNET_MessageHeader join_msg */
303 * Message sent from the client to the service to broadcast to all group
306 struct MulticastBroadcastMessage
312 struct GNUNET_MessageHeader header;
315 * #GNUNET_OK normally, #GNUNET_SYSERR if the origin aborted the
328 uint64_t group_generation;
331 * Total message size.
339 * Message sent from the client to the service to join a multicast group.
341 struct MulticastJoinMessage
347 struct GNUNET_MessageHeader header;
350 * Number of relays we (think) we already know about.
352 uint32_t relay_count;
355 * Public non-ephemeral key of the mutlicast group.
357 struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key;
360 * Our private key for the group.
362 struct GNUNET_CRYPTO_EcdsaPrivateKey member_key;
364 /* followed by 'relay_count' `struct GNUNET_PeerIdentity`s */
371 * Message sent from the client to the service to unicast to the group origin.
373 struct MulticastUnicastToOriginMessage
379 struct GNUNET_MessageHeader header;
382 * Reserved (always 0).
392 * Total message size.
396 /* followed by payload */
402 * Message sent from the client to the service to
403 * cancel unicast to the group origin.
405 struct MulticastUnicastToOriginCancelMessage
411 struct GNUNET_MessageHeader header;
414 * Reserved (always 0).
426 GNUNET_NETWORK_STRUCT_END
429 /* end of multicast.h */