aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-07-24 13:49:03 +0000
committerBart Polot <bart@net.in.tum.de>2013-07-24 13:49:03 +0000
commitbe706094a76fcc17c37a929fec458c20bc9845fe (patch)
treefd82094469124d477ed69f04d0c5767b45ea313e /src/mesh
parent82e1f94b55dfeb6eb73a730289d3e93e28220d42 (diff)
downloadgnunet-be706094a76fcc17c37a929fec458c20bc9845fe.tar.gz
gnunet-be706094a76fcc17c37a929fec458c20bc9845fe.zip
- new P2P messages
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/mesh_protocol_enc.h91
1 files changed, 45 insertions, 46 deletions
diff --git a/src/mesh/mesh_protocol_enc.h b/src/mesh/mesh_protocol_enc.h
index f739897ee..7c7e3983a 100644
--- a/src/mesh/mesh_protocol_enc.h
+++ b/src/mesh/mesh_protocol_enc.h
@@ -44,10 +44,10 @@ GNUNET_NETWORK_STRUCT_BEGIN
44/** 44/**
45 * Message for mesh path creation. 45 * Message for mesh path creation.
46 */ 46 */
47struct GNUNET_MESH_CreateTunnel 47struct GNUNET_MESH_ConnectionCreate
48{ 48{
49 /** 49 /**
50 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE 50 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE
51 * 51 *
52 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) + 52 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) +
53 * path_length * sizeof (struct GNUNET_PeerIdentity) 53 * path_length * sizeof (struct GNUNET_PeerIdentity)
@@ -55,10 +55,9 @@ struct GNUNET_MESH_CreateTunnel
55 struct GNUNET_MessageHeader header; 55 struct GNUNET_MessageHeader header;
56 56
57 /** 57 /**
58 * Global id of the tunnel this path belongs to, 58 * Global id of the connection.
59 * unique in conjunction with the origin.
60 */ 59 */
61 uint32_t tid GNUNET_PACKED; 60 uint32_t cid GNUNET_PACKED;
62 61
63 /** 62 /**
64 * Tunnel options (GNUNET_MESH_OPTION_*). 63 * Tunnel options (GNUNET_MESH_OPTION_*).
@@ -66,9 +65,9 @@ struct GNUNET_MESH_CreateTunnel
66 uint32_t opt GNUNET_PACKED; 65 uint32_t opt GNUNET_PACKED;
67 66
68 /** 67 /**
69 * Destination port. 68 * Reserved, always 0.
70 */ 69 */
71 uint32_t port GNUNET_PACKED; 70 uint32_t reserved GNUNET_PACKED;
72 71
73 /** 72 /**
74 * TODO do not add the first hop 73 * TODO do not add the first hop
@@ -78,6 +77,39 @@ struct GNUNET_MESH_CreateTunnel
78 /* struct GNUNET_PeerIdentity peers[path_length]; */ 77 /* struct GNUNET_PeerIdentity peers[path_length]; */
79}; 78};
80 79
80/**
81 * Message for ack'ing a path
82 */
83struct GNUNET_MESH_ConnnectionACK
84{
85 /**
86 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
87 */
88 struct GNUNET_MessageHeader header;
89
90 /**
91 * CID of the connection
92 */
93 uint32_t cid GNUNET_PACKED;
94
95 /**
96 * OID of the tunnel
97 */
98 struct GNUNET_PeerIdentity oid;
99
100 /**
101 * ID of the endpoint
102 */
103 struct GNUNET_PeerIdentity peer_id;
104
105 /**
106 * Initial ACK value for payload.
107 */
108 uint32_t ack GNUNET_PACKED;
109
110 /* TODO: signature */
111};
112
81 113
82/** 114/**
83 * Message for mesh data traffic. 115 * Message for mesh data traffic.
@@ -208,47 +240,14 @@ struct GNUNET_MESH_Poll
208 uint32_t pid GNUNET_PACKED; 240 uint32_t pid GNUNET_PACKED;
209}; 241};
210 242
211/**
212 * Message for ack'ing a path
213 */
214struct GNUNET_MESH_PathACK
215{
216 /**
217 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_ACK
218 */
219 struct GNUNET_MessageHeader header;
220
221 /**
222 * TID of the tunnel
223 */
224 uint32_t tid GNUNET_PACKED;
225
226 /**
227 * OID of the tunnel
228 */
229 struct GNUNET_PeerIdentity oid;
230
231 /**
232 * ID of the endpoint
233 */
234 struct GNUNET_PeerIdentity peer_id;
235
236 /**
237 * Initial ACK value for payload.
238 */
239 uint32_t ack GNUNET_PACKED;
240
241 /* TODO: signature */
242};
243
244 243
245/** 244/**
246 * Message for notifying a disconnection in a path 245 * Message for notifying a disconnection in a path
247 */ 246 */
248struct GNUNET_MESH_PathBroken 247struct GNUNET_MESH_ConnectionBroken
249{ 248{
250 /** 249 /**
251 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_BROKEN 250 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN
252 */ 251 */
253 struct GNUNET_MessageHeader header; 252 struct GNUNET_MessageHeader header;
254 253
@@ -279,10 +278,10 @@ struct GNUNET_MESH_PathBroken
279/** 278/**
280 * Message to destroy a tunnel 279 * Message to destroy a tunnel
281 */ 280 */
282struct GNUNET_MESH_TunnelDestroy 281struct GNUNET_MESH_ConnectionDestroy
283{ 282{
284 /** 283 /**
285 * Type: GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY 284 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY
286 */ 285 */
287 struct GNUNET_MessageHeader header; 286 struct GNUNET_MessageHeader header;
288 287
@@ -303,10 +302,10 @@ struct GNUNET_MESH_TunnelDestroy
303/** 302/**
304 * Message to destroy a tunnel 303 * Message to destroy a tunnel
305 */ 304 */
306struct GNUNET_MESH_TunnelKeepAlive 305struct GNUNET_MESH_ConnectionKeepAlive
307{ 306{
308 /** 307 /**
309 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_(FWD|BCK)_KEEPALIVE 308 * Type: GNUNET_MESSAGE_TYPE_MESH_CONNECTION_(FWD|BCK)_KEEPALIVE
310 */ 309 */
311 struct GNUNET_MessageHeader header; 310 struct GNUNET_MessageHeader header;
312 311