2 This file is part of GNUnet.
3 (C) 2001 - 2011 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 * @author Bartlomiej Polot
23 * @file mesh/mesh_protocol.h
26 #ifndef MESH_PROTOCOL_H_
27 #define MESH_PROTOCOL_H_
33 /* keep Emacsens' auto-indent happy */
38 /******************************************************************************/
39 /******************** MESH NETWORK MESSAGES **************************/
40 /******************************************************************************/
42 GNUNET_NETWORK_STRUCT_BEGIN
45 * Message for mesh path management
47 struct GNUNET_MESH_ManipulatePath
50 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_[CREATE|CHANGE|ADD|DEL]
52 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
53 * path_length * sizeof (struct GNUNET_PeerIdentity)
55 struct GNUNET_MessageHeader header;
58 * Global id of the tunnel this path belongs to,
59 * unique in conjunction with the origin.
61 uint32_t tid GNUNET_PACKED;
64 * path_length structs defining the *whole* path from the origin [0] to the
65 * final destination [path_length-1].
67 /* struct GNUNET_PeerIdentity peers[path_length]; */
71 * Message for mesh data traffic to all tunnel targets.
73 struct GNUNET_MESH_Multicast
76 * Type: GNUNET_MESSAGE_TYPE_MESH_MULTICAST
78 struct GNUNET_MessageHeader header;
83 uint32_t tid GNUNET_PACKED;
86 * Number of hops to live
88 uint32_t ttl GNUNET_PACKED;
91 * Unique ID of the packet
93 uint32_t pid GNUNET_PACKED;
98 struct GNUNET_PeerIdentity oid;
107 * Message for mesh data traffic to a particular destination from origin.
109 struct GNUNET_MESH_Unicast
112 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST
114 struct GNUNET_MessageHeader header;
119 uint32_t tid GNUNET_PACKED;
122 * Number of hops to live
124 uint32_t ttl GNUNET_PACKED;
127 * Unique ID of the packet
129 uint32_t pid GNUNET_PACKED;
134 struct GNUNET_PeerIdentity oid;
139 struct GNUNET_PeerIdentity destination;
148 * Message for mesh data traffic from a tunnel participant to origin.
150 struct GNUNET_MESH_ToOrigin
153 * Type: GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
155 struct GNUNET_MessageHeader header;
160 uint32_t tid GNUNET_PACKED;
165 struct GNUNET_PeerIdentity oid;
168 * Sender of the message.
170 struct GNUNET_PeerIdentity sender;
179 * Message to acknowledte mesh data traffic.
181 struct GNUNET_MESH_ACK
184 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
186 struct GNUNET_MessageHeader header;
191 uint32_t tid GNUNET_PACKED;
196 struct GNUNET_PeerIdentity oid;
199 * Sender of the message.
201 struct GNUNET_PeerIdentity sender;
209 * Message for ack'ing a path
211 struct GNUNET_MESH_PathACK
214 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
216 struct GNUNET_MessageHeader header;
221 uint32_t tid GNUNET_PACKED;
226 struct GNUNET_PeerIdentity oid;
231 struct GNUNET_PeerIdentity peer_id;
233 /* TODO: signature */
238 * Message for notifying a disconnection in a path
240 struct GNUNET_MESH_PathBroken
243 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_BROKEN
245 struct GNUNET_MessageHeader header;
250 uint32_t tid GNUNET_PACKED;
255 struct GNUNET_PeerIdentity oid;
260 struct GNUNET_PeerIdentity peer1;
265 struct GNUNET_PeerIdentity peer2;
267 /* TODO: signature */
272 * Message to destroy a tunnel
274 struct GNUNET_MESH_TunnelDestroy
277 * Type: GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY
279 struct GNUNET_MessageHeader header;
284 uint32_t tid GNUNET_PACKED;
289 struct GNUNET_PeerIdentity oid;
291 /* TODO: signature */
296 * Message for mesh flow control
298 struct GNUNET_MESH_SpeedNotify
301 * Type: GNUNET_MESSAGE_TYPE_DATA_SPEED_NOTIFY
303 struct GNUNET_MessageHeader header;
308 uint32_t tid GNUNET_PACKED;
313 struct GNUNET_PeerIdentity oid;
316 * Is the speed limited by the slowest peer?.
321 * Is the buffering allowed?.
327 GNUNET_NETWORK_STRUCT_END
329 #if 0 /* keep Emacsens' auto-indent happy */
336 /* ifndef MESH_PROTOCOL_H */
338 /* end of mesh_protocol.h */