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 connection creation.
46 * TODO onionify path, add random tunnel ID
48 struct GNUNET_MESH_ConnectionCreate
51 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE
53 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
54 * path_length * sizeof (struct GNUNET_PeerIdentity)
56 struct GNUNET_MessageHeader header;
59 * ID of the connection for that tunnel.
61 uint32_t cid GNUNET_PACKED;
64 * path_length structs defining the *whole* path from the origin [0] to the
65 * final destination [path_length-1].
67 /* struct GNUNET_PeerIdentity peers[path_length]; */
71 * Message for ack'ing a connection
73 struct GNUNET_MESH_ConnectionACK
76 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_ACK
78 struct GNUNET_MessageHeader header;
81 * CID of the connection
83 uint32_t cid GNUNET_PACKED;
88 struct GNUNET_PeerIdentity tid;
95 * Message for mesh data traffic.
97 struct GNUNET_MESH_Data
100 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST,
101 * GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
103 struct GNUNET_MessageHeader header;
108 uint32_t tid GNUNET_PACKED;
111 * Number of hops to live
113 uint32_t ttl GNUNET_PACKED;
118 uint32_t pid GNUNET_PACKED;
123 struct GNUNET_PeerIdentity oid;
126 * Unique ID of the payload message
128 uint32_t mid GNUNET_PACKED;
137 * Message to acknowledge end-to-end data.
139 struct GNUNET_MESH_DataACK
142 * Type: GNUNET_MESSAGE_TYPE_MESH_DATA_ACK
144 struct GNUNET_MessageHeader header;
149 uint32_t tid GNUNET_PACKED;
154 struct GNUNET_PeerIdentity oid;
157 * Bitfield of already-received newer messages
161 uint64_t futures GNUNET_PACKED;
164 * Last message ID received.
166 uint32_t mid GNUNET_PACKED;
171 * Message to acknowledge mesh data traffic.
173 struct GNUNET_MESH_ACK
176 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
178 struct GNUNET_MessageHeader header;
181 * Maximum packet ID authorized.
183 uint32_t pid GNUNET_PACKED;
188 struct GNUNET_PeerIdentity oid;
194 * Message to query a peer about its Flow Control status regarding a tunnel.
196 struct GNUNET_MESH_Poll
199 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
201 struct GNUNET_MessageHeader header;
206 uint32_t tid GNUNET_PACKED;
211 struct GNUNET_PeerIdentity oid;
216 uint32_t pid GNUNET_PACKED;
221 * Message for notifying a disconnection in a path
223 struct GNUNET_MESH_ConnectionBroken
226 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN
228 struct GNUNET_MessageHeader header;
233 uint32_t tid GNUNET_PACKED;
238 struct GNUNET_PeerIdentity oid;
243 struct GNUNET_PeerIdentity peer1;
248 struct GNUNET_PeerIdentity peer2;
250 /* TODO: signature */
255 * Message to destroy a tunnel
257 struct GNUNET_MESH_ConnectionDestroy
260 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY
262 struct GNUNET_MessageHeader header;
267 uint32_t tid GNUNET_PACKED;
272 struct GNUNET_PeerIdentity oid;
274 /* TODO: signature */
279 * Message to destroy a tunnel
281 struct GNUNET_MESH_ConnectionKeepAlive
284 * Type: GNUNET_MESSAGE_TYPE_MESH_(FWD|BCK)_KEEPALIVE
286 struct GNUNET_MessageHeader header;
289 * ID of the connection
291 uint32_t cid GNUNET_PACKED;
296 struct GNUNET_HashCode tid;
301 GNUNET_NETWORK_STRUCT_END
303 #if 0 /* keep Emacsens' auto-indent happy */
310 /* ifndef MESH_PROTOCOL_H */
312 /* end of mesh_protocol.h */