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;
126 uint32_t pid GNUNET_PACKED;
131 struct GNUNET_PeerIdentity oid;
134 * Unique ID of the payload message
136 uint32_t mid GNUNET_PACKED;
145 * Message to acknowledge end-to-end data.
147 struct GNUNET_MESH_DataACK
150 * Type: GNUNET_MESSAGE_TYPE_MESH_DATA_ACK
152 struct GNUNET_MessageHeader header;
157 uint32_t tid GNUNET_PACKED;
162 struct GNUNET_PeerIdentity oid;
165 * Bitfield of already-received newer messages
169 uint64_t futures GNUNET_PACKED;
172 * Last message ID received.
174 uint32_t mid GNUNET_PACKED;
179 * Message to acknowledge 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 * Maximum packet ID authorized.
201 uint32_t pid GNUNET_PACKED;
206 * Message to query a peer about its Flow Control status regarding a tunnel.
208 struct GNUNET_MESH_Poll
211 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
213 struct GNUNET_MessageHeader header;
218 uint32_t tid GNUNET_PACKED;
223 struct GNUNET_PeerIdentity oid;
228 uint32_t pid GNUNET_PACKED;
232 * Message for ack'ing a path
234 struct GNUNET_MESH_PathACK
237 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
239 struct GNUNET_MessageHeader header;
244 uint32_t tid GNUNET_PACKED;
249 struct GNUNET_PeerIdentity oid;
254 struct GNUNET_PeerIdentity peer_id;
257 * Initial ACK value for payload.
259 uint32_t ack GNUNET_PACKED;
261 /* TODO: signature */
266 * Message for notifying a disconnection in a path
268 struct GNUNET_MESH_PathBroken
271 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_BROKEN
273 struct GNUNET_MessageHeader header;
278 uint32_t tid GNUNET_PACKED;
283 struct GNUNET_PeerIdentity oid;
288 struct GNUNET_PeerIdentity peer1;
293 struct GNUNET_PeerIdentity peer2;
295 /* TODO: signature */
300 * Message to destroy a tunnel
302 struct GNUNET_MESH_TunnelDestroy
305 * Type: GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY
307 struct GNUNET_MessageHeader header;
312 uint32_t tid GNUNET_PACKED;
317 struct GNUNET_PeerIdentity oid;
319 /* TODO: signature */
324 * Message to destroy a tunnel
326 struct GNUNET_MESH_TunnelKeepAlive
329 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_KEEPALIVE
331 struct GNUNET_MessageHeader header;
336 uint32_t tid GNUNET_PACKED;
341 struct GNUNET_PeerIdentity oid;
346 GNUNET_NETWORK_STRUCT_END
348 #if 0 /* keep Emacsens' auto-indent happy */
355 /* ifndef MESH_PROTOCOL_H */
357 /* end of mesh_protocol.h */