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_SPEED_MIN 0x1
39 #define MESH_TUNNEL_OPT_NOBUFFER 0x2
42 /******************************************************************************/
43 /******************** MESH NETWORK MESSAGES **************************/
44 /******************************************************************************/
46 GNUNET_NETWORK_STRUCT_BEGIN
49 * Message for mesh path management
51 struct GNUNET_MESH_ManipulatePath
54 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_[CREATE|CHANGE|ADD|DESTROY]
56 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
57 * path_length * sizeof (struct GNUNET_PeerIdentity)
59 struct GNUNET_MessageHeader header;
62 * Global id of the tunnel this path belongs to,
63 * unique in conjunction with the origin.
65 uint32_t tid GNUNET_PACKED;
68 * Tunnel options (MESH_TUNNEL_OPT_*).
70 uint32_t opt GNUNET_PACKED;
73 * 64 bit alignment padding.
75 uint32_t reserved GNUNET_PACKED;
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]; */
86 * Message for mesh data traffic to a particular destination from origin.
88 struct GNUNET_MESH_Unicast
91 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST
93 struct GNUNET_MessageHeader header;
98 uint32_t tid GNUNET_PACKED;
101 * Number of hops to live
103 uint32_t ttl GNUNET_PACKED;
106 * Unique ID of the packet
108 uint32_t pid GNUNET_PACKED;
113 struct GNUNET_PeerIdentity oid;
122 * Message for mesh data traffic from a tunnel participant to origin.
124 struct GNUNET_MESH_ToOrigin
127 * Type: GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
129 struct GNUNET_MessageHeader header;
134 uint32_t tid GNUNET_PACKED;
137 * Number of hops to live
139 uint32_t ttl GNUNET_PACKED;
142 * Unique ID of the packet
144 uint32_t pid GNUNET_PACKED;
149 struct GNUNET_PeerIdentity oid;
158 * Message to acknowledge mesh data traffic.
160 struct GNUNET_MESH_ACK
163 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
165 struct GNUNET_MessageHeader header;
170 uint32_t tid GNUNET_PACKED;
175 struct GNUNET_PeerIdentity oid;
178 * Maximum packet ID authorized.
185 * Message to query a peer about its Flow Control status regarding a tunnel.
187 struct GNUNET_MESH_Poll
190 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
192 struct GNUNET_MessageHeader header;
197 uint32_t tid GNUNET_PACKED;
202 struct GNUNET_PeerIdentity oid;
211 * Message for ack'ing a path
213 struct GNUNET_MESH_PathACK
216 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
218 struct GNUNET_MessageHeader header;
223 uint32_t tid GNUNET_PACKED;
228 struct GNUNET_PeerIdentity oid;
233 struct GNUNET_PeerIdentity peer_id;
235 /* TODO: signature */
240 * Message for notifying a disconnection in a path
242 struct GNUNET_MESH_PathBroken
245 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_BROKEN
247 struct GNUNET_MessageHeader header;
252 uint32_t tid GNUNET_PACKED;
257 struct GNUNET_PeerIdentity oid;
262 struct GNUNET_PeerIdentity peer1;
267 struct GNUNET_PeerIdentity peer2;
269 /* TODO: signature */
274 * Message to destroy a tunnel
276 struct GNUNET_MESH_TunnelDestroy
279 * Type: GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY
281 struct GNUNET_MessageHeader header;
286 uint32_t tid GNUNET_PACKED;
291 struct GNUNET_PeerIdentity oid;
293 /* TODO: signature */
298 * Message to destroy a tunnel
300 struct GNUNET_MESH_TunnelKeepAlive
303 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_KEEPALIVE
305 struct GNUNET_MessageHeader header;
310 uint32_t tid GNUNET_PACKED;
315 struct GNUNET_PeerIdentity oid;
320 GNUNET_NETWORK_STRUCT_END
322 #if 0 /* keep Emacsens' auto-indent happy */
329 /* ifndef MESH_PROTOCOL_H */
331 /* end of mesh_protocol.h */