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 management
50 struct GNUNET_MESH_ManipulatePath
53 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_[CREATE|CHANGE|ADD|DESTROY]
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;
72 * 64 bit alignment padding.
74 uint32_t reserved GNUNET_PACKED;
77 * path_length structs defining the *whole* path from the origin [0] to the
78 * final destination [path_length-1].
80 /* struct GNUNET_PeerIdentity peers[path_length]; */
85 * Message for mesh data traffic to a particular destination from origin.
87 struct GNUNET_MESH_Unicast
90 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST
92 struct GNUNET_MessageHeader header;
97 uint32_t tid GNUNET_PACKED;
100 * Number of hops to live
102 uint32_t ttl GNUNET_PACKED;
105 * Unique ID of the packet
107 uint32_t pid GNUNET_PACKED;
112 struct GNUNET_PeerIdentity oid;
121 * Message for mesh data traffic from a tunnel participant to origin.
123 struct GNUNET_MESH_ToOrigin
126 * Type: GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
128 struct GNUNET_MessageHeader header;
133 uint32_t tid GNUNET_PACKED;
136 * Number of hops to live
138 uint32_t ttl GNUNET_PACKED;
141 * Unique ID of the packet
143 uint32_t pid GNUNET_PACKED;
148 struct GNUNET_PeerIdentity oid;
157 * Message to acknowledge mesh data traffic.
159 struct GNUNET_MESH_ACK
162 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
164 struct GNUNET_MessageHeader header;
169 uint32_t tid GNUNET_PACKED;
174 struct GNUNET_PeerIdentity oid;
177 * Maximum packet ID authorized.
184 * Message to query a peer about its Flow Control status regarding a tunnel.
186 struct GNUNET_MESH_Poll
189 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
191 struct GNUNET_MessageHeader header;
196 uint32_t tid GNUNET_PACKED;
201 struct GNUNET_PeerIdentity oid;
210 * Message for ack'ing a path
212 struct GNUNET_MESH_PathACK
215 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
217 struct GNUNET_MessageHeader header;
222 uint32_t tid GNUNET_PACKED;
227 struct GNUNET_PeerIdentity oid;
232 struct GNUNET_PeerIdentity peer_id;
234 /* TODO: signature */
239 * Message for notifying a disconnection in a path
241 struct GNUNET_MESH_PathBroken
244 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_BROKEN
246 struct GNUNET_MessageHeader header;
251 uint32_t tid GNUNET_PACKED;
256 struct GNUNET_PeerIdentity oid;
261 struct GNUNET_PeerIdentity peer1;
266 struct GNUNET_PeerIdentity peer2;
268 /* TODO: signature */
273 * Message to destroy a tunnel
275 struct GNUNET_MESH_TunnelDestroy
278 * Type: GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY
280 struct GNUNET_MessageHeader header;
285 uint32_t tid GNUNET_PACKED;
290 struct GNUNET_PeerIdentity oid;
292 /* TODO: signature */
297 * Message to destroy a tunnel
299 struct GNUNET_MESH_TunnelKeepAlive
302 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_KEEPALIVE
304 struct GNUNET_MessageHeader header;
309 uint32_t tid GNUNET_PACKED;
314 struct GNUNET_PeerIdentity oid;
319 GNUNET_NETWORK_STRUCT_END
321 #if 0 /* keep Emacsens' auto-indent happy */
328 /* ifndef MESH_PROTOCOL_H */
330 /* end of mesh_protocol.h */