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 #define MESH_TUNNEL_OPT_NOBUFFER 0x2
41 /******************************************************************************/
42 /******************** MESH NETWORK MESSAGES **************************/
43 /******************************************************************************/
45 GNUNET_NETWORK_STRUCT_BEGIN
48 * Message for mesh path creation.
50 struct GNUNET_MESH_CreateTunnel
53 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE
55 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
56 * path_length * sizeof (struct GNUNET_PeerIdentity)
58 struct GNUNET_MessageHeader header;
61 * Global id of the tunnel this path belongs to,
62 * unique in conjunction with the origin.
64 uint32_t tid GNUNET_PACKED;
67 * Tunnel options (MESH_TUNNEL_OPT_*).
69 uint32_t opt GNUNET_PACKED;
74 uint32_t port GNUNET_PACKED;
77 * FIXME do not add the first hop
78 * path_length structs defining the *whole* path from the origin [0] to the
79 * final destination [path_length-1].
81 /* struct GNUNET_PeerIdentity peers[path_length]; */
85 * Message for mesh path destruction.
87 struct GNUNET_MESH_DestroyTunnel
90 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_DESTROY
92 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
93 * path_length * sizeof (struct GNUNET_PeerIdentity)
95 struct GNUNET_MessageHeader header;
98 * Global id of the tunnel this path belongs to,
99 * unique in conjunction with the origin.
101 uint32_t tid GNUNET_PACKED;
106 * Message for mesh data traffic to a particular destination from origin.
108 struct GNUNET_MESH_Unicast
111 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST
113 struct GNUNET_MessageHeader header;
118 uint32_t tid GNUNET_PACKED;
121 * Number of hops to live
123 uint32_t ttl GNUNET_PACKED;
126 * Unique ID of the packet
128 uint32_t pid GNUNET_PACKED;
133 struct GNUNET_PeerIdentity oid;
142 * Message for mesh data traffic from a tunnel participant to origin.
144 struct GNUNET_MESH_ToOrigin
147 * Type: GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
149 struct GNUNET_MessageHeader header;
154 uint32_t tid GNUNET_PACKED;
157 * Number of hops to live
159 uint32_t ttl GNUNET_PACKED;
162 * Unique ID of the packet
164 uint32_t pid GNUNET_PACKED;
169 struct GNUNET_PeerIdentity oid;
178 * Message to acknowledge mesh data traffic.
180 struct GNUNET_MESH_ACK
183 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
185 struct GNUNET_MessageHeader header;
190 uint32_t tid GNUNET_PACKED;
195 struct GNUNET_PeerIdentity oid;
198 * Maximum packet ID authorized.
205 * Message to query a peer about its Flow Control status regarding a tunnel.
207 struct GNUNET_MESH_Poll
210 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
212 struct GNUNET_MessageHeader header;
217 uint32_t tid GNUNET_PACKED;
222 struct GNUNET_PeerIdentity oid;
226 * Message for ack'ing a path
228 struct GNUNET_MESH_PathACK
231 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
233 struct GNUNET_MessageHeader header;
238 uint32_t tid GNUNET_PACKED;
243 struct GNUNET_PeerIdentity oid;
248 struct GNUNET_PeerIdentity peer_id;
250 /* TODO: signature */
255 * Message for notifying a disconnection in a path
257 struct GNUNET_MESH_PathBroken
260 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_BROKEN
262 struct GNUNET_MessageHeader header;
267 uint32_t tid GNUNET_PACKED;
272 struct GNUNET_PeerIdentity oid;
277 struct GNUNET_PeerIdentity peer1;
282 struct GNUNET_PeerIdentity peer2;
284 /* TODO: signature */
289 * Message to destroy a tunnel
291 struct GNUNET_MESH_TunnelDestroy
294 * Type: GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY
296 struct GNUNET_MessageHeader header;
301 uint32_t tid GNUNET_PACKED;
306 struct GNUNET_PeerIdentity oid;
308 /* TODO: signature */
313 * Message to destroy a tunnel
315 struct GNUNET_MESH_TunnelKeepAlive
318 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_KEEPALIVE
320 struct GNUNET_MessageHeader header;
325 uint32_t tid GNUNET_PACKED;
330 struct GNUNET_PeerIdentity oid;
335 GNUNET_NETWORK_STRUCT_END
337 #if 0 /* keep Emacsens' auto-indent happy */
344 /* ifndef MESH_PROTOCOL_H */
346 /* end of mesh_protocol.h */