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 id GNUNET_PACKED;
152 * Bitfield of already-received newer messages
156 uint64_t futures GNUNET_PACKED;
159 * Last message ID received.
161 uint32_t mid GNUNET_PACKED;
166 * Message to acknowledge mesh data traffic.
168 struct GNUNET_MESH_ACK
171 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
173 struct GNUNET_MessageHeader header;
176 * Maximum packet ID authorized.
178 uint32_t ack GNUNET_PACKED;
183 struct GNUNET_PeerIdentity oid;
189 * Message to query a peer about its Flow Control status regarding a tunnel.
191 struct GNUNET_MESH_Poll
194 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
196 struct GNUNET_MessageHeader header;
201 uint32_t pid GNUNET_PACKED;
206 * Message for notifying a disconnection in a path
208 struct GNUNET_MESH_ConnectionBroken
211 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN
213 struct GNUNET_MessageHeader header;
218 uint32_t tid GNUNET_PACKED;
223 struct GNUNET_PeerIdentity oid;
228 struct GNUNET_PeerIdentity peer1;
233 struct GNUNET_PeerIdentity peer2;
235 /* TODO: signature */
240 * Message to destroy a tunnel
242 struct GNUNET_MESH_ConnectionDestroy
245 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY
247 struct GNUNET_MessageHeader header;
252 uint32_t tid GNUNET_PACKED;
257 struct GNUNET_PeerIdentity oid;
259 /* TODO: signature */
264 * Message to destroy a tunnel
266 struct GNUNET_MESH_ConnectionKeepAlive
269 * Type: GNUNET_MESSAGE_TYPE_MESH_(FWD|BCK)_KEEPALIVE
271 struct GNUNET_MessageHeader header;
274 * ID of the connection
276 uint32_t cid GNUNET_PACKED;
281 struct GNUNET_HashCode tid;
286 GNUNET_NETWORK_STRUCT_END
288 #if 0 /* keep Emacsens' auto-indent happy */
295 /* ifndef MESH_PROTOCOL_H */
297 /* end of mesh_protocol.h */