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_
30 #include "gnunet_util_lib.h"
35 struct GNUNET_MESH_TunnelMessage;
39 /* keep Emacsens' auto-indent happy */
44 /******************************************************************************/
45 /******************** MESH NETWORK MESSAGES **************************/
46 /******************************************************************************/
48 GNUNET_NETWORK_STRUCT_BEGIN
51 * Message for mesh connection creation.
52 * TODO onionify path, add random tunnel ID
54 struct GNUNET_MESH_ConnectionCreate
57 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE
59 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
60 * path_length * sizeof (struct GNUNET_PeerIdentity)
62 struct GNUNET_MessageHeader header;
65 * ID of the connection for that tunnel.
67 uint32_t cid GNUNET_PACKED;
72 struct GNUNET_HashCode tid;
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 ack'ing a connection
84 struct GNUNET_MESH_ConnectionACK
87 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_ACK
89 struct GNUNET_MessageHeader header;
92 * ID of the connection
94 uint32_t cid GNUNET_PACKED;
99 struct GNUNET_HashCode tid;
101 /* TODO: signature */
105 * Tunnel(ed) message.
107 struct GNUNET_MESH_Encrypted
110 * Type: GNUNET_MESSAGE_TYPE_MESH_{FWD,BCK}
112 struct GNUNET_MessageHeader header;
115 * ID of the connection.
117 uint32_t cid GNUNET_PACKED;
122 struct GNUNET_HashCode tid;
125 * ID of the packet (hop by hop).
127 uint32_t pid GNUNET_PACKED;
130 * Number of hops to live.
132 uint32_t ttl GNUNET_PACKED;
135 * Initialization Vector for payload encryption.
140 * Encrypted content follows.
144 struct GNUNET_MESH_ChannelCreate
147 * Type: GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE
149 struct GNUNET_MessageHeader header;
154 MESH_ChannelNumber chid GNUNET_PACKED;
159 uint32_t opt GNUNET_PACKED;
162 struct GNUNET_MESH_ChannelDestroy
165 * Type: GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY
167 struct GNUNET_MessageHeader header;
172 MESH_ChannelNumber chid GNUNET_PACKED;
176 * Message for mesh data traffic.
178 struct GNUNET_MESH_Data
181 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST,
182 * GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
184 struct GNUNET_MessageHeader header;
187 * Unique ID of the payload message
189 uint32_t mid GNUNET_PACKED;
194 MESH_ChannelNumber chid GNUNET_PACKED;
203 * Message to acknowledge end-to-end data.
205 struct GNUNET_MESH_DataACK
208 * Type: GNUNET_MESSAGE_TYPE_MESH_DATA_ACK
210 struct GNUNET_MessageHeader header;
215 MESH_ChannelNumber chid GNUNET_PACKED;
218 * Bitfield of already-received newer messages
222 uint64_t futures GNUNET_PACKED;
225 * Last message ID received.
227 uint32_t mid GNUNET_PACKED;
232 * Message to acknowledge mesh data traffic.
234 struct GNUNET_MESH_ACK
237 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
239 struct GNUNET_MessageHeader header;
242 * Maximum packet ID authorized.
244 uint32_t ack GNUNET_PACKED;
249 struct GNUNET_HashCode tid;
252 * ID of the connection
254 uint32_t cid GNUNET_PACKED;
259 * Message to query a peer about its Flow Control status regarding a tunnel.
261 struct GNUNET_MESH_Poll
264 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
266 struct GNUNET_MessageHeader header;
271 uint32_t pid GNUNET_PACKED;
276 struct GNUNET_HashCode tid;
279 * ID of the connection
281 uint32_t cid GNUNET_PACKED;
286 * Message for notifying a disconnection in a path
288 struct GNUNET_MESH_ConnectionBroken
291 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN
293 struct GNUNET_MessageHeader header;
296 * ID of the connection.
298 uint32_t cid GNUNET_PACKED;
303 struct GNUNET_HashCode tid;
308 struct GNUNET_PeerIdentity peer1;
313 struct GNUNET_PeerIdentity peer2;
315 /* TODO: signature */
320 * Message to destroy a connection.
322 struct GNUNET_MESH_ConnectionDestroy
325 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY
327 struct GNUNET_MessageHeader header;
330 * ID of the connection.
332 uint32_t cid GNUNET_PACKED;
337 struct GNUNET_HashCode tid;
339 /* TODO: signature */
344 * Message to keep a connection alive.
346 struct GNUNET_MESH_ConnectionKeepAlive
349 * Type: GNUNET_MESSAGE_TYPE_MESH_(FWD|BCK)_KEEPALIVE
351 struct GNUNET_MessageHeader header;
354 * ID of the connection
356 uint32_t cid GNUNET_PACKED;
361 struct GNUNET_HashCode tid;
366 GNUNET_NETWORK_STRUCT_END
368 #if 0 /* keep Emacsens' auto-indent happy */
375 /* ifndef MESH_PROTOCOL_H */
377 /* end of mesh_protocol.h */