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.
47 struct GNUNET_MESH_ConnectionCreate
50 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE
52 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
53 * path_length * sizeof (struct GNUNET_PeerIdentity)
55 struct GNUNET_MessageHeader header;
58 * ID of the connection for that tunnel.
60 uint32_t cid GNUNET_PACKED;
63 * Tunnel options (GNUNET_MESH_OPTION_*).
65 uint32_t opt GNUNET_PACKED;
70 uint32_t reserved GNUNET_PACKED;
73 * path_length structs defining the *whole* path from the origin [0] to the
74 * final destination [path_length-1].
76 /* struct GNUNET_PeerIdentity peers[path_length]; */
80 * Message for ack'ing a connection
82 struct GNUNET_MESH_ConnectionACK
85 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_ACK
87 struct GNUNET_MessageHeader header;
90 * CID of the connection
92 uint32_t cid GNUNET_PACKED;
97 struct GNUNET_PeerIdentity tid;
104 * Message for mesh data traffic.
106 struct GNUNET_MESH_Data
109 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST,
110 * GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
112 struct GNUNET_MessageHeader header;
117 uint32_t tid GNUNET_PACKED;
120 * Number of hops to live
122 uint32_t ttl GNUNET_PACKED;
127 uint32_t pid GNUNET_PACKED;
132 struct GNUNET_PeerIdentity oid;
135 * Unique ID of the payload message
137 uint32_t mid GNUNET_PACKED;
146 * Message to acknowledge end-to-end data.
148 struct GNUNET_MESH_DataACK
151 * Type: GNUNET_MESSAGE_TYPE_MESH_DATA_ACK
153 struct GNUNET_MessageHeader header;
158 uint32_t tid GNUNET_PACKED;
163 struct GNUNET_PeerIdentity oid;
166 * Bitfield of already-received newer messages
170 uint64_t futures GNUNET_PACKED;
173 * Last message ID received.
175 uint32_t mid GNUNET_PACKED;
180 * Message to acknowledge mesh data traffic.
182 struct GNUNET_MESH_ACK
185 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
187 struct GNUNET_MessageHeader header;
192 uint32_t tid GNUNET_PACKED;
197 struct GNUNET_PeerIdentity oid;
200 * Maximum packet ID authorized.
202 uint32_t pid GNUNET_PACKED;
207 * Message to query a peer about its Flow Control status regarding a tunnel.
209 struct GNUNET_MESH_Poll
212 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
214 struct GNUNET_MessageHeader header;
219 uint32_t tid GNUNET_PACKED;
224 struct GNUNET_PeerIdentity oid;
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;
246 uint32_t tid GNUNET_PACKED;
251 struct GNUNET_PeerIdentity oid;
256 struct GNUNET_PeerIdentity peer1;
261 struct GNUNET_PeerIdentity peer2;
263 /* TODO: signature */
268 * Message to destroy a tunnel
270 struct GNUNET_MESH_ConnectionDestroy
273 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY
275 struct GNUNET_MessageHeader header;
280 uint32_t tid GNUNET_PACKED;
285 struct GNUNET_PeerIdentity oid;
287 /* TODO: signature */
292 * Message to destroy a tunnel
294 struct GNUNET_MESH_ConnectionKeepAlive
297 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_(FWD|BCK)_KEEPALIVE
299 struct GNUNET_MessageHeader header;
304 uint32_t tid GNUNET_PACKED;
309 struct GNUNET_PeerIdentity oid;
314 GNUNET_NETWORK_STRUCT_END
316 #if 0 /* keep Emacsens' auto-indent happy */
323 /* ifndef MESH_PROTOCOL_H */
325 /* end of mesh_protocol.h */