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 creation.
47 struct GNUNET_MESH_CreateTunnel
50 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE
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 * Tunnel options (GNUNET_MESH_OPTION_*).
66 uint32_t opt GNUNET_PACKED;
71 uint32_t port GNUNET_PACKED;
74 * FIXME do not add the first hop
75 * path_length structs defining the *whole* path from the origin [0] to the
76 * final destination [path_length-1].
78 /* struct GNUNET_PeerIdentity peers[path_length]; */
82 * Message for mesh path destruction.
84 struct GNUNET_MESH_DestroyTunnel
87 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_DESTROY
89 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
90 * path_length * sizeof (struct GNUNET_PeerIdentity)
92 struct GNUNET_MessageHeader header;
95 * Global id of the tunnel this path belongs to,
96 * unique in conjunction with the origin.
98 uint32_t tid GNUNET_PACKED;
103 * Message for mesh data traffic.
105 struct GNUNET_MESH_Data
108 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST,
109 * GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
111 struct GNUNET_MessageHeader header;
116 uint32_t tid GNUNET_PACKED;
119 * Number of hops to live
121 uint32_t ttl GNUNET_PACKED;
124 * Unique ID of the packet
126 uint32_t pid GNUNET_PACKED;
131 struct GNUNET_PeerIdentity oid;
140 * Message to acknowledge end-to-end data.
142 struct GNUNET_MESH_DataACK
145 * Type: GNUNET_MESSAGE_TYPE_MESH_DATA_ACK
147 struct GNUNET_MessageHeader header;
152 uint32_t tid GNUNET_PACKED;
157 struct GNUNET_PeerIdentity oid;
160 * Maximum packet ID acknowledged.
165 * Bitfield of already-received newer messages // TODO implement and use
174 * Message to acknowledge mesh data traffic.
176 struct GNUNET_MESH_ACK
179 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
181 struct GNUNET_MessageHeader header;
186 uint32_t tid GNUNET_PACKED;
191 struct GNUNET_PeerIdentity oid;
194 * Maximum packet ID authorized.
201 * Message to query a peer about its Flow Control status regarding a tunnel.
203 struct GNUNET_MESH_Poll
206 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
208 struct GNUNET_MessageHeader header;
213 uint32_t tid GNUNET_PACKED;
218 struct GNUNET_PeerIdentity oid;
223 uint32_t pid GNUNET_PACKED;
227 * Message for ack'ing a path
229 struct GNUNET_MESH_PathACK
232 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
234 struct GNUNET_MessageHeader header;
239 uint32_t tid GNUNET_PACKED;
244 struct GNUNET_PeerIdentity oid;
249 struct GNUNET_PeerIdentity peer_id;
252 * Initial ACK value for payload.
254 uint32_t ack GNUNET_PACKED;
256 /* TODO: signature */
261 * Message for notifying a disconnection in a path
263 struct GNUNET_MESH_PathBroken
266 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_BROKEN
268 struct GNUNET_MessageHeader header;
273 uint32_t tid GNUNET_PACKED;
278 struct GNUNET_PeerIdentity oid;
283 struct GNUNET_PeerIdentity peer1;
288 struct GNUNET_PeerIdentity peer2;
290 /* TODO: signature */
295 * Message to destroy a tunnel
297 struct GNUNET_MESH_TunnelDestroy
300 * Type: GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY
302 struct GNUNET_MessageHeader header;
307 uint32_t tid GNUNET_PACKED;
312 struct GNUNET_PeerIdentity oid;
314 /* TODO: signature */
319 * Message to destroy a tunnel
321 struct GNUNET_MESH_TunnelKeepAlive
324 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_KEEPALIVE
326 struct GNUNET_MessageHeader header;
331 uint32_t tid GNUNET_PACKED;
336 struct GNUNET_PeerIdentity oid;
341 GNUNET_NETWORK_STRUCT_END
343 #if 0 /* keep Emacsens' auto-indent happy */
350 /* ifndef MESH_PROTOCOL_H */
352 /* end of mesh_protocol.h */