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"
34 struct GNUNET_MESH_TunnelMessage;
38 /* keep Emacsens' auto-indent happy */
43 /******************************************************************************/
44 /******************** MESH NETWORK MESSAGES **************************/
45 /******************************************************************************/
47 GNUNET_NETWORK_STRUCT_BEGIN
50 * Message for mesh connection creation.
51 * TODO onionify path, add random tunnel ID
53 struct GNUNET_MESH_ConnectionCreate
56 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE
58 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
59 * path_length * sizeof (struct GNUNET_PeerIdentity)
61 struct GNUNET_MessageHeader header;
64 * ID of the connection for that tunnel.
66 uint32_t cid GNUNET_PACKED;
71 struct GNUNET_HashCode tid;
74 * path_length structs defining the *whole* path from the origin [0] to the
75 * final destination [path_length-1].
77 /* struct GNUNET_PeerIdentity peers[path_length]; */
81 * Message for ack'ing a connection
83 struct GNUNET_MESH_ConnectionACK
86 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_ACK
88 struct GNUNET_MessageHeader header;
91 * ID of the connection
93 uint32_t cid GNUNET_PACKED;
98 struct GNUNET_HashCode tid;
100 /* TODO: signature */
104 * Tunnel(ed) message.
106 struct GNUNET_MESH_Encrypted
109 * Type: GNUNET_MESSAGE_TYPE_MESH_{FWD,BCK}
111 struct GNUNET_MessageHeader header;
114 * ID of the connection.
116 uint32_t cid GNUNET_PACKED;
121 struct GNUNET_HashCode tid;
124 * ID of the packet (hop by hop).
126 uint32_t pid GNUNET_PACKED;
129 * Number of hops to live.
131 uint32_t ttl GNUNET_PACKED;
134 * Initialization Vector for payload encryption.
139 * Encrypted content follows.
144 * Message for mesh data traffic.
146 struct GNUNET_MESH_Data
149 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST,
150 * GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
152 struct GNUNET_MessageHeader header;
155 * Unique ID of the payload message
157 uint32_t mid GNUNET_PACKED;
162 uint32_t chid GNUNET_PACKED;
171 * Message to acknowledge end-to-end data.
173 struct GNUNET_MESH_DataACK
176 * Type: GNUNET_MESSAGE_TYPE_MESH_DATA_ACK
178 struct GNUNET_MessageHeader header;
183 uint32_t chid GNUNET_PACKED;
186 * Bitfield of already-received newer messages
190 uint64_t futures GNUNET_PACKED;
193 * Last message ID received.
195 uint32_t mid GNUNET_PACKED;
200 * Message to acknowledge mesh data traffic.
202 struct GNUNET_MESH_ACK
205 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
207 struct GNUNET_MessageHeader header;
210 * Maximum packet ID authorized.
212 uint32_t ack GNUNET_PACKED;
217 * Message to query a peer about its Flow Control status regarding a tunnel.
219 struct GNUNET_MESH_Poll
222 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
224 struct GNUNET_MessageHeader header;
229 uint32_t pid GNUNET_PACKED;
234 * Message for notifying a disconnection in a path
236 struct GNUNET_MESH_ConnectionBroken
239 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN
241 struct GNUNET_MessageHeader header;
244 * ID of the connection.
246 uint32_t cid GNUNET_PACKED;
251 struct GNUNET_HashCode tid;
256 struct GNUNET_PeerIdentity peer1;
261 struct GNUNET_PeerIdentity peer2;
263 /* TODO: signature */
268 * Message to destroy a connection.
270 struct GNUNET_MESH_ConnectionDestroy
273 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY
275 struct GNUNET_MessageHeader header;
278 * ID of the connection.
280 uint32_t cid GNUNET_PACKED;
285 struct GNUNET_HashCode tid;
287 /* TODO: signature */
292 * Message to keep a connection alive.
294 struct GNUNET_MESH_ConnectionKeepAlive
297 * Type: GNUNET_MESSAGE_TYPE_MESH_(FWD|BCK)_KEEPALIVE
299 struct GNUNET_MessageHeader header;
302 * ID of the connection
304 uint32_t cid GNUNET_PACKED;
309 struct GNUNET_HashCode tid;
314 GNUNET_NETWORK_STRUCT_END
316 #if 0 /* keep Emacsens' auto-indent happy */
323 /* ifndef MESH_PROTOCOL_H */
325 /* end of mesh_protocol.h */