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 * Message to query a peer about its Flow Control status regarding a tunnel.
251 struct GNUNET_MESH_Poll
254 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
256 struct GNUNET_MessageHeader header;
261 uint32_t pid GNUNET_PACKED;
266 * Message for notifying a disconnection in a path
268 struct GNUNET_MESH_ConnectionBroken
271 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN
273 struct GNUNET_MessageHeader header;
276 * ID of the connection.
278 uint32_t cid GNUNET_PACKED;
283 struct GNUNET_HashCode tid;
288 struct GNUNET_PeerIdentity peer1;
293 struct GNUNET_PeerIdentity peer2;
295 /* TODO: signature */
300 * Message to destroy a connection.
302 struct GNUNET_MESH_ConnectionDestroy
305 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY
307 struct GNUNET_MessageHeader header;
310 * ID of the connection.
312 uint32_t cid GNUNET_PACKED;
317 struct GNUNET_HashCode tid;
319 /* TODO: signature */
324 * Message to keep a connection alive.
326 struct GNUNET_MESH_ConnectionKeepAlive
329 * Type: GNUNET_MESSAGE_TYPE_MESH_(FWD|BCK)_KEEPALIVE
331 struct GNUNET_MessageHeader header;
334 * ID of the connection
336 uint32_t cid GNUNET_PACKED;
341 struct GNUNET_HashCode tid;
346 GNUNET_NETWORK_STRUCT_END
348 #if 0 /* keep Emacsens' auto-indent happy */
355 /* ifndef MESH_PROTOCOL_H */
357 /* end of mesh_protocol.h */