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 it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your 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 Affero General Public License for more details.
17 * @file multicast/multicast.h
18 * @brief multicast IPC messages
19 * @author Christian Grothoff
20 * @author Gabor X Toth
26 #include "gnunet_multicast_service.h"
28 GNUNET_NETWORK_STRUCT_BEGIN
32 * Header of a join request sent to the origin or another member.
34 struct MulticastJoinRequestMessage
37 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST
39 struct GNUNET_MessageHeader header;
47 * ECC signature of the rest of the fields of the join request.
49 * Signature must match the public key of the joining member.
51 struct GNUNET_CRYPTO_EcdsaSignature signature;
54 * Purpose for the signature and size of the signed data.
56 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
59 * Public key of the target group.
61 struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key;
64 * Public key of the joining member.
66 struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key;
69 * Peer identity of the joining member.
71 struct GNUNET_PeerIdentity peer;
73 /* Followed by struct GNUNET_MessageHeader join_message */
78 * Header of a join decision message sent to a peer requesting join.
80 struct MulticastJoinDecisionMessage
83 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION
85 struct GNUNET_MessageHeader header;
88 * #GNUNET_YES if the peer was admitted
89 * #GNUNET_NO if entry was refused,
90 * #GNUNET_SYSERR if the request could not be answered.
95 * Number of relays given.
99 /* Followed by relay_count peer identities */
101 /* Followed by the join response message */
106 * Header added to a struct MulticastJoinDecisionMessage
107 * when sent between the client and service.
109 struct MulticastJoinDecisionMessageHeader
112 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION
114 struct GNUNET_MessageHeader header;
117 * C->S: Peer to send the join decision to.
118 * S->C: Peer we received the join decision from.
120 struct GNUNET_PeerIdentity peer;
123 * C->S: Public key of the member requesting join.
126 struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key;
128 /* Followed by struct MulticastJoinDecisionMessage */
133 * Message sent from the client to the service to notify the service
134 * about the result of a membership test.
136 struct MulticastMembershipTestResultMessage
139 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_MEMBERSHIP_TEST_RESULT
141 struct GNUNET_MessageHeader header;
144 * Unique ID that identifies the associated membership test.
149 * #GNUNET_YES if the peer is a member
150 * #GNUNET_NO if peer is not a member,
151 * #GNUNET_SYSERR if the test could not be answered.
158 * Message sent from the client to the service OR the service to the
159 * client asking for a message fragment to be replayed.
161 struct MulticastReplayRequestMessage
165 * The message type should be
166 * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST.
168 struct GNUNET_MessageHeader header;
171 * S->C: Public key of the member requesting replay.
174 struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key;
177 * ID of the message that is being requested.
179 uint64_t fragment_id;
182 * ID of the message that is being requested.
187 * Offset of the fragment that is being requested.
189 uint64_t fragment_offset;
192 * Additional flags for the request.
204 * Message sent from the client to the service to give the service
205 * a replayed message.
207 struct MulticastReplayResponseMessage
211 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE
212 * or GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE_END
214 struct GNUNET_MessageHeader header;
217 * ID of the message that is being requested.
219 uint64_t fragment_id;
222 * ID of the message that is being requested.
227 * Offset of the fragment that is being requested.
229 uint64_t fragment_offset;
232 * Additional flags for the request.
237 * An `enum GNUNET_MULTICAST_ReplayErrorCode` identifying issues (in NBO).
241 /* followed by replayed message */
246 * Message sent from the client to the service to notify the service
247 * about the starting of a multicast group with this peers as its origin.
249 struct MulticastOriginStartMessage
252 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_ORIGIN_START
254 struct GNUNET_MessageHeader header;
262 * Private, non-ephemeral key for the multicast group.
264 struct GNUNET_CRYPTO_EddsaPrivateKey group_key;
267 * Last fragment ID sent to the group, used to continue counting fragments if
268 * we resume operating * a group.
270 uint64_t max_fragment_id;
274 struct MulticastMemberJoinMessage
277 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_MEMBER_JOIN
279 struct GNUNET_MessageHeader header;
281 uint32_t relay_count GNUNET_PACKED;
283 struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key;
285 struct GNUNET_CRYPTO_EcdsaPrivateKey member_key;
287 struct GNUNET_PeerIdentity origin;
289 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
291 /* Followed by struct GNUNET_MessageHeader join_msg */
295 GNUNET_NETWORK_STRUCT_END
298 /* end of multicast.h */