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.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * @file multicast/multicast.h
21 * @brief multicast IPC messages
22 * @author Christian Grothoff
23 * @author Gabor X Toth
29 #include "gnunet_multicast_service.h"
31 GNUNET_NETWORK_STRUCT_BEGIN
35 * Header of a join request sent to the origin or another member.
37 struct MulticastJoinRequestMessage
40 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST
42 struct GNUNET_MessageHeader header;
50 * ECC signature of the rest of the fields of the join request.
52 * Signature must match the public key of the joining member.
54 struct GNUNET_CRYPTO_EcdsaSignature signature;
57 * Purpose for the signature and size of the signed data.
59 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
62 * Public key of the target group.
64 struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key;
67 * Public key of the joining member.
69 struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key;
72 * Peer identity of the joining member.
74 struct GNUNET_PeerIdentity peer;
76 /* Followed by struct GNUNET_MessageHeader join_message */
81 * Header of a join decision message sent to a peer requesting join.
83 struct MulticastJoinDecisionMessage
86 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION
88 struct GNUNET_MessageHeader header;
91 * #GNUNET_YES if the peer was admitted
92 * #GNUNET_NO if entry was refused,
93 * #GNUNET_SYSERR if the request could not be answered.
98 * Number of relays given.
100 uint32_t relay_count;
102 /* Followed by relay_count peer identities */
104 /* Followed by the join response message */
109 * Header added to a struct MulticastJoinDecisionMessage
110 * when sent between the client and service.
112 struct MulticastJoinDecisionMessageHeader
115 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION
117 struct GNUNET_MessageHeader header;
120 * C->S: Peer to send the join decision to.
121 * S->C: Peer we received the join decision from.
123 struct GNUNET_PeerIdentity peer;
126 * C->S: Public key of the member requesting join.
129 struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key;
131 /* Followed by struct MulticastJoinDecisionMessage */
136 * Message sent from the client to the service to notify the service
137 * about the result of a membership test.
139 struct MulticastMembershipTestResultMessage
142 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_MEMBERSHIP_TEST_RESULT
144 struct GNUNET_MessageHeader header;
147 * Unique ID that identifies the associated membership test.
152 * #GNUNET_YES if the peer is a member
153 * #GNUNET_NO if peer is not a member,
154 * #GNUNET_SYSERR if the test could not be answered.
161 * Message sent from the client to the service OR the service to the
162 * client asking for a message fragment to be replayed.
164 struct MulticastReplayRequestMessage
168 * The message type should be
169 * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST.
171 struct GNUNET_MessageHeader header;
174 * S->C: Public key of the member requesting replay.
177 struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key;
180 * ID of the message that is being requested.
182 uint64_t fragment_id;
185 * ID of the message that is being requested.
190 * Offset of the fragment that is being requested.
192 uint64_t fragment_offset;
195 * Additional flags for the request.
207 * Message sent from the client to the service to give the service
208 * a replayed message.
210 struct MulticastReplayResponseMessage
214 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE
215 * or GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE_END
217 struct GNUNET_MessageHeader header;
220 * ID of the message that is being requested.
222 uint64_t fragment_id;
225 * ID of the message that is being requested.
230 * Offset of the fragment that is being requested.
232 uint64_t fragment_offset;
235 * Additional flags for the request.
240 * An `enum GNUNET_MULTICAST_ReplayErrorCode` identifying issues (in NBO).
244 /* followed by replayed message */
249 * Message sent from the client to the service to notify the service
250 * about the starting of a multicast group with this peers as its origin.
252 struct MulticastOriginStartMessage
255 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_ORIGIN_START
257 struct GNUNET_MessageHeader header;
265 * Private, non-ephemeral key for the multicast group.
267 struct GNUNET_CRYPTO_EddsaPrivateKey group_key;
270 * Last fragment ID sent to the group, used to continue counting fragments if
271 * we resume operating * a group.
273 uint64_t max_fragment_id;
277 struct MulticastMemberJoinMessage
280 * Type: GNUNET_MESSAGE_TYPE_MULTICAST_MEMBER_JOIN
282 struct GNUNET_MessageHeader header;
284 uint32_t relay_count GNUNET_PACKED;
286 struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key;
288 struct GNUNET_CRYPTO_EcdsaPrivateKey member_key;
290 struct GNUNET_PeerIdentity origin;
292 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
294 /* Followed by struct GNUNET_MessageHeader join_msg */
298 GNUNET_NETWORK_STRUCT_END
301 /* end of multicast.h */