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 path 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 * Global id of the connection.
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 * TODO do not add the first hop
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 path
83 struct GNUNET_MESH_ConnnectionACK
86 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
88 struct GNUNET_MessageHeader header;
91 * CID of the connection
93 uint32_t cid GNUNET_PACKED;
98 struct GNUNET_PeerIdentity oid;
103 struct GNUNET_PeerIdentity peer_id;
106 * Initial ACK value for payload.
108 uint32_t ack GNUNET_PACKED;
110 /* TODO: signature */
115 * Message for mesh data traffic.
117 struct GNUNET_MESH_Data
120 * Type: GNUNET_MESSAGE_TYPE_MESH_UNICAST,
121 * GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN
123 struct GNUNET_MessageHeader header;
128 uint32_t tid GNUNET_PACKED;
131 * Number of hops to live
133 uint32_t ttl GNUNET_PACKED;
138 uint32_t pid GNUNET_PACKED;
143 struct GNUNET_PeerIdentity oid;
146 * Unique ID of the payload message
148 uint32_t mid GNUNET_PACKED;
157 * Message to acknowledge end-to-end data.
159 struct GNUNET_MESH_DataACK
162 * Type: GNUNET_MESSAGE_TYPE_MESH_DATA_ACK
164 struct GNUNET_MessageHeader header;
169 uint32_t tid GNUNET_PACKED;
174 struct GNUNET_PeerIdentity oid;
177 * Bitfield of already-received newer messages
181 uint64_t futures GNUNET_PACKED;
184 * Last message ID received.
186 uint32_t mid GNUNET_PACKED;
191 * Message to acknowledge mesh data traffic.
193 struct GNUNET_MESH_ACK
196 * Type: GNUNET_MESSAGE_TYPE_MESH_ACK
198 struct GNUNET_MessageHeader header;
203 uint32_t tid GNUNET_PACKED;
208 struct GNUNET_PeerIdentity oid;
211 * Maximum packet ID authorized.
213 uint32_t pid GNUNET_PACKED;
218 * Message to query a peer about its Flow Control status regarding a tunnel.
220 struct GNUNET_MESH_Poll
223 * Type: GNUNET_MESSAGE_TYPE_MESH_POLL
225 struct GNUNET_MessageHeader header;
230 uint32_t tid GNUNET_PACKED;
235 struct GNUNET_PeerIdentity oid;
240 uint32_t pid GNUNET_PACKED;
245 * Message for notifying a disconnection in a path
247 struct GNUNET_MESH_ConnectionBroken
250 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN
252 struct GNUNET_MessageHeader header;
257 uint32_t tid GNUNET_PACKED;
262 struct GNUNET_PeerIdentity oid;
267 struct GNUNET_PeerIdentity peer1;
272 struct GNUNET_PeerIdentity peer2;
274 /* TODO: signature */
279 * Message to destroy a tunnel
281 struct GNUNET_MESH_ConnectionDestroy
284 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY
286 struct GNUNET_MessageHeader header;
291 uint32_t tid GNUNET_PACKED;
296 struct GNUNET_PeerIdentity oid;
298 /* TODO: signature */
303 * Message to destroy a tunnel
305 struct GNUNET_MESH_ConnectionKeepAlive
308 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_(FWD|BCK)_KEEPALIVE
310 struct GNUNET_MessageHeader header;
315 uint32_t tid GNUNET_PACKED;
320 struct GNUNET_PeerIdentity oid;
325 GNUNET_NETWORK_STRUCT_END
327 #if 0 /* keep Emacsens' auto-indent happy */
334 /* ifndef MESH_PROTOCOL_H */
336 /* end of mesh_protocol.h */