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_enc.h
26 #ifndef MESH_PROTOCOL_ENC_H_
27 #define MESH_PROTOCOL_ENC_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 * TODO 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]; */
83 * Message for mesh data traffic.
85 struct GNUNET_MESH_Data
88 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST,
89 * GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
91 struct GNUNET_MessageHeader header;
96 uint32_t tid GNUNET_PACKED;
99 * Number of hops to live
101 uint32_t ttl GNUNET_PACKED;
106 uint32_t pid GNUNET_PACKED;
111 struct GNUNET_PeerIdentity oid;
114 * Unique ID of the payload message
116 uint32_t mid GNUNET_PACKED;
125 * Message to acknowledge end-to-end data.
127 struct GNUNET_MESH_DataACK
130 * Type: GNUNET_MESSAGE_TYPE_MESH_DATA_ACK
132 struct GNUNET_MessageHeader header;
137 uint32_t tid GNUNET_PACKED;
142 struct GNUNET_PeerIdentity oid;
145 * Bitfield of already-received newer messages
149 uint64_t futures GNUNET_PACKED;
152 * Last message ID received.
154 uint32_t mid GNUNET_PACKED;
159 * Message to acknowledge mesh data traffic.
161 struct GNUNET_MESH_ACK
164 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
166 struct GNUNET_MessageHeader header;
171 uint32_t tid GNUNET_PACKED;
176 struct GNUNET_PeerIdentity oid;
179 * Maximum packet ID authorized.
181 uint32_t pid GNUNET_PACKED;
186 * Message to query a peer about its Flow Control status regarding a tunnel.
188 struct GNUNET_MESH_Poll
191 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
193 struct GNUNET_MessageHeader header;
198 uint32_t tid GNUNET_PACKED;
203 struct GNUNET_PeerIdentity oid;
208 uint32_t pid GNUNET_PACKED;
212 * Message for ack'ing a path
214 struct GNUNET_MESH_PathACK
217 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
219 struct GNUNET_MessageHeader header;
224 uint32_t tid GNUNET_PACKED;
229 struct GNUNET_PeerIdentity oid;
234 struct GNUNET_PeerIdentity peer_id;
237 * Initial ACK value for payload.
239 uint32_t ack GNUNET_PACKED;
241 /* TODO: signature */
246 * Message for notifying a disconnection in a path
248 struct GNUNET_MESH_PathBroken
251 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_BROKEN
253 struct GNUNET_MessageHeader header;
258 uint32_t tid GNUNET_PACKED;
263 struct GNUNET_PeerIdentity oid;
268 struct GNUNET_PeerIdentity peer1;
273 struct GNUNET_PeerIdentity peer2;
275 /* TODO: signature */
280 * Message to destroy a tunnel
282 struct GNUNET_MESH_TunnelDestroy
285 * Type: GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY
287 struct GNUNET_MessageHeader header;
292 uint32_t tid GNUNET_PACKED;
297 struct GNUNET_PeerIdentity oid;
299 /* TODO: signature */
304 * Message to destroy a tunnel
306 struct GNUNET_MESH_TunnelKeepAlive
309 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_(FWD|BCK)_KEEPALIVE
311 struct GNUNET_MessageHeader header;
316 uint32_t tid GNUNET_PACKED;
321 struct GNUNET_PeerIdentity oid;
326 GNUNET_NETWORK_STRUCT_END
328 #if 0 /* keep Emacsens' auto-indent happy */
335 /* ifndef MESH_PROTOCOL_H */
337 /* end of mesh_protocol.h */