aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_tunnel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-service-cadet_tunnel.h')
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.h86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.h b/src/cadet/gnunet-service-cadet_tunnel.h
index 304015fa5..aa09ac683 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.h
+++ b/src/cadet/gnunet-service-cadet_tunnel.h
@@ -43,7 +43,7 @@ extern "C"
43/** 43/**
44 * All the connectivity states a tunnel can be in. 44 * All the connectivity states a tunnel can be in.
45 */ 45 */
46enum CadetTunnel3CState 46enum CadetTunnelCState
47{ 47{
48 /** 48 /**
49 * Uninitialized status, should never appear in operation. 49 * Uninitialized status, should never appear in operation.
@@ -75,7 +75,7 @@ enum CadetTunnel3CState
75/** 75/**
76 * All the encryption states a tunnel can be in. 76 * All the encryption states a tunnel can be in.
77 */ 77 */
78enum CadetTunnel3EState 78enum CadetTunnelEState
79{ 79{
80 /** 80 /**
81 * Uninitialized status, should never appear in operation. 81 * Uninitialized status, should never appear in operation.
@@ -103,7 +103,7 @@ enum CadetTunnel3EState
103/** 103/**
104 * Struct containing all information regarding a given peer 104 * Struct containing all information regarding a given peer
105 */ 105 */
106struct CadetTunnel3; 106struct CadetTunnel;
107 107
108 108
109#include "gnunet-service-cadet_channel.h" 109#include "gnunet-service-cadet_channel.h"
@@ -113,7 +113,7 @@ struct CadetTunnel3;
113/** 113/**
114 * Handle for messages queued but not yet sent. 114 * Handle for messages queued but not yet sent.
115 */ 115 */
116struct CadetTunnel3Queue; 116struct CadetTunnelQueue;
117 117
118/** 118/**
119 * Callback called when a queued message is sent. 119 * Callback called when a queued message is sent.
@@ -124,8 +124,8 @@ struct CadetTunnel3Queue;
124 * @param size Size of the message. 124 * @param size Size of the message.
125 */ 125 */
126typedef void (*GCT_sent) (void *cls, 126typedef void (*GCT_sent) (void *cls,
127 struct CadetTunnel3 *t, 127 struct CadetTunnel *t,
128 struct CadetTunnel3Queue *q, 128 struct CadetTunnelQueue *q,
129 uint16_t type, size_t size); 129 uint16_t type, size_t size);
130 130
131typedef void (*GCT_conn_iter) (void *cls, struct CadetConnection *c); 131typedef void (*GCT_conn_iter) (void *cls, struct CadetConnection *c);
@@ -157,7 +157,7 @@ GCT_shutdown (void);
157 * 157 *
158 * @param destination Peer this tunnel is towards. 158 * @param destination Peer this tunnel is towards.
159 */ 159 */
160struct CadetTunnel3 * 160struct CadetTunnel *
161GCT_new (struct CadetPeer *destination); 161GCT_new (struct CadetPeer *destination);
162 162
163/** 163/**
@@ -168,7 +168,7 @@ GCT_new (struct CadetPeer *destination);
168 * @param t Tunnel to destroy. 168 * @param t Tunnel to destroy.
169 */ 169 */
170void 170void
171GCT_destroy_empty (struct CadetTunnel3 *t); 171GCT_destroy_empty (struct CadetTunnel *t);
172 172
173/** 173/**
174 * Destroy tunnel if empty (no more channels). 174 * Destroy tunnel if empty (no more channels).
@@ -176,7 +176,7 @@ GCT_destroy_empty (struct CadetTunnel3 *t);
176 * @param t Tunnel to destroy if empty. 176 * @param t Tunnel to destroy if empty.
177 */ 177 */
178void 178void
179GCT_destroy_if_empty (struct CadetTunnel3 *t); 179GCT_destroy_if_empty (struct CadetTunnel *t);
180 180
181/** 181/**
182 * Destroy the tunnel. 182 * Destroy the tunnel.
@@ -190,7 +190,7 @@ GCT_destroy_if_empty (struct CadetTunnel3 *t);
190 * @param t The tunnel to destroy. 190 * @param t The tunnel to destroy.
191 */ 191 */
192void 192void
193GCT_destroy (struct CadetTunnel3 *t); 193GCT_destroy (struct CadetTunnel *t);
194 194
195 195
196/** 196/**
@@ -200,7 +200,7 @@ GCT_destroy (struct CadetTunnel3 *t);
200 * @param cstate New connection state. 200 * @param cstate New connection state.
201 */ 201 */
202void 202void
203GCT_change_cstate (struct CadetTunnel3* t, enum CadetTunnel3CState cstate); 203GCT_change_cstate (struct CadetTunnel* t, enum CadetTunnelCState cstate);
204 204
205 205
206/** 206/**
@@ -210,7 +210,7 @@ GCT_change_cstate (struct CadetTunnel3* t, enum CadetTunnel3CState cstate);
210 * @param state New encryption state. 210 * @param state New encryption state.
211 */ 211 */
212void 212void
213GCT_change_estate (struct CadetTunnel3* t, enum CadetTunnel3EState state); 213GCT_change_estate (struct CadetTunnel* t, enum CadetTunnelEState state);
214 214
215/** 215/**
216 * Add a connection to a tunnel. 216 * Add a connection to a tunnel.
@@ -219,7 +219,7 @@ GCT_change_estate (struct CadetTunnel3* t, enum CadetTunnel3EState state);
219 * @param c Connection. 219 * @param c Connection.
220 */ 220 */
221void 221void
222GCT_add_connection (struct CadetTunnel3 *t, struct CadetConnection *c); 222GCT_add_connection (struct CadetTunnel *t, struct CadetConnection *c);
223 223
224/** 224/**
225 * Mark a path as no longer valid for this tunnel: has been tried and failed. 225 * Mark a path as no longer valid for this tunnel: has been tried and failed.
@@ -228,7 +228,7 @@ GCT_add_connection (struct CadetTunnel3 *t, struct CadetConnection *c);
228 * @param path Invalid path to remove. Is destroyed after removal. 228 * @param path Invalid path to remove. Is destroyed after removal.
229 */ 229 */
230void 230void
231GCT_remove_path (struct CadetTunnel3 *t, struct CadetPeerPath *path); 231GCT_remove_path (struct CadetTunnel *t, struct CadetPeerPath *path);
232 232
233/** 233/**
234 * Remove a connection from a tunnel. 234 * Remove a connection from a tunnel.
@@ -237,7 +237,7 @@ GCT_remove_path (struct CadetTunnel3 *t, struct CadetPeerPath *path);
237 * @param c Connection. 237 * @param c Connection.
238 */ 238 */
239void 239void
240GCT_remove_connection (struct CadetTunnel3 *t, struct CadetConnection *c); 240GCT_remove_connection (struct CadetTunnel *t, struct CadetConnection *c);
241 241
242/** 242/**
243 * Add a channel to a tunnel. 243 * Add a channel to a tunnel.
@@ -246,7 +246,7 @@ GCT_remove_connection (struct CadetTunnel3 *t, struct CadetConnection *c);
246 * @param ch Channel. 246 * @param ch Channel.
247 */ 247 */
248void 248void
249GCT_add_channel (struct CadetTunnel3 *t, struct CadetChannel *ch); 249GCT_add_channel (struct CadetTunnel *t, struct CadetChannel *ch);
250 250
251/** 251/**
252 * Remove a channel from a tunnel. 252 * Remove a channel from a tunnel.
@@ -255,7 +255,7 @@ GCT_add_channel (struct CadetTunnel3 *t, struct CadetChannel *ch);
255 * @param ch Channel. 255 * @param ch Channel.
256 */ 256 */
257void 257void
258GCT_remove_channel (struct CadetTunnel3 *t, struct CadetChannel *ch); 258GCT_remove_channel (struct CadetTunnel *t, struct CadetChannel *ch);
259 259
260/** 260/**
261 * Search for a channel by global ID. 261 * Search for a channel by global ID.
@@ -266,7 +266,7 @@ GCT_remove_channel (struct CadetTunnel3 *t, struct CadetChannel *ch);
266 * @return channel handler, NULL if doesn't exist 266 * @return channel handler, NULL if doesn't exist
267 */ 267 */
268struct CadetChannel * 268struct CadetChannel *
269GCT_get_channel (struct CadetTunnel3 *t, CADET_ChannelNumber chid); 269GCT_get_channel (struct CadetTunnel *t, CADET_ChannelNumber chid);
270 270
271/** 271/**
272 * Decrypt and demultiplex by message type. Call appropriate handler 272 * Decrypt and demultiplex by message type. Call appropriate handler
@@ -277,7 +277,7 @@ GCT_get_channel (struct CadetTunnel3 *t, CADET_ChannelNumber chid);
277 * @param msg Message header. 277 * @param msg Message header.
278 */ 278 */
279void 279void
280GCT_handle_encrypted (struct CadetTunnel3 *t, 280GCT_handle_encrypted (struct CadetTunnel *t,
281 const struct GNUNET_CADET_Encrypted *msg); 281 const struct GNUNET_CADET_Encrypted *msg);
282 282
283/** 283/**
@@ -287,7 +287,7 @@ GCT_handle_encrypted (struct CadetTunnel3 *t,
287 * @param message KX message itself. 287 * @param message KX message itself.
288 */ 288 */
289void 289void
290GCT_handle_kx (struct CadetTunnel3 *t, 290GCT_handle_kx (struct CadetTunnel *t,
291 const struct GNUNET_MessageHeader *message); 291 const struct GNUNET_MessageHeader *message);
292 292
293/** 293/**
@@ -301,7 +301,7 @@ GCT_handle_kx (struct CadetTunnel3 *t,
301 * @return Connection created. 301 * @return Connection created.
302 */ 302 */
303struct CadetConnection * 303struct CadetConnection *
304GCT_use_path (struct CadetTunnel3 *t, struct CadetPeerPath *p); 304GCT_use_path (struct CadetTunnel *t, struct CadetPeerPath *p);
305 305
306/** 306/**
307 * Count established (ready) connections of a tunnel. 307 * Count established (ready) connections of a tunnel.
@@ -311,7 +311,7 @@ GCT_use_path (struct CadetTunnel3 *t, struct CadetPeerPath *p);
311 * @return Number of connections. 311 * @return Number of connections.
312 */ 312 */
313unsigned int 313unsigned int
314GCT_count_connections (struct CadetTunnel3 *t); 314GCT_count_connections (struct CadetTunnel *t);
315 315
316/** 316/**
317 * Count channels of a tunnel. 317 * Count channels of a tunnel.
@@ -321,7 +321,7 @@ GCT_count_connections (struct CadetTunnel3 *t);
321 * @return Number of channels. 321 * @return Number of channels.
322 */ 322 */
323unsigned int 323unsigned int
324GCT_count_channels (struct CadetTunnel3 *t); 324GCT_count_channels (struct CadetTunnel *t);
325 325
326/** 326/**
327 * Get the connectivity state of a tunnel. 327 * Get the connectivity state of a tunnel.
@@ -330,8 +330,8 @@ GCT_count_channels (struct CadetTunnel3 *t);
330 * 330 *
331 * @return Tunnel's connectivity state. 331 * @return Tunnel's connectivity state.
332 */ 332 */
333enum CadetTunnel3CState 333enum CadetTunnelCState
334GCT_get_cstate (struct CadetTunnel3 *t); 334GCT_get_cstate (struct CadetTunnel *t);
335 335
336/** 336/**
337 * Get the encryption state of a tunnel. 337 * Get the encryption state of a tunnel.
@@ -340,8 +340,8 @@ GCT_get_cstate (struct CadetTunnel3 *t);
340 * 340 *
341 * @return Tunnel's encryption state. 341 * @return Tunnel's encryption state.
342 */ 342 */
343enum CadetTunnel3EState 343enum CadetTunnelEState
344GCT_get_estate (struct CadetTunnel3 *t); 344GCT_get_estate (struct CadetTunnel *t);
345 345
346/** 346/**
347 * Get the maximum buffer space for a tunnel towards a local client. 347 * Get the maximum buffer space for a tunnel towards a local client.
@@ -351,7 +351,7 @@ GCT_get_estate (struct CadetTunnel3 *t);
351 * @return Biggest buffer space offered by any channel in the tunnel. 351 * @return Biggest buffer space offered by any channel in the tunnel.
352 */ 352 */
353unsigned int 353unsigned int
354GCT_get_channels_buffer (struct CadetTunnel3 *t); 354GCT_get_channels_buffer (struct CadetTunnel *t);
355 355
356/** 356/**
357 * Get the total buffer space for a tunnel for P2P traffic. 357 * Get the total buffer space for a tunnel for P2P traffic.
@@ -361,7 +361,7 @@ GCT_get_channels_buffer (struct CadetTunnel3 *t);
361 * @return Buffer space offered by all connections in the tunnel. 361 * @return Buffer space offered by all connections in the tunnel.
362 */ 362 */
363unsigned int 363unsigned int
364GCT_get_connections_buffer (struct CadetTunnel3 *t); 364GCT_get_connections_buffer (struct CadetTunnel *t);
365 365
366/** 366/**
367 * Get the tunnel's destination. 367 * Get the tunnel's destination.
@@ -371,7 +371,7 @@ GCT_get_connections_buffer (struct CadetTunnel3 *t);
371 * @return ID of the destination peer. 371 * @return ID of the destination peer.
372 */ 372 */
373const struct GNUNET_PeerIdentity * 373const struct GNUNET_PeerIdentity *
374GCT_get_destination (struct CadetTunnel3 *t); 374GCT_get_destination (struct CadetTunnel *t);
375 375
376/** 376/**
377 * Get the tunnel's next free Channel ID. 377 * Get the tunnel's next free Channel ID.
@@ -381,7 +381,7 @@ GCT_get_destination (struct CadetTunnel3 *t);
381 * @return ID of a channel free to use. 381 * @return ID of a channel free to use.
382 */ 382 */
383CADET_ChannelNumber 383CADET_ChannelNumber
384GCT_get_next_chid (struct CadetTunnel3 *t); 384GCT_get_next_chid (struct CadetTunnel *t);
385 385
386/** 386/**
387 * Send ACK on one or more channels due to buffer in connections. 387 * Send ACK on one or more channels due to buffer in connections.
@@ -389,7 +389,7 @@ GCT_get_next_chid (struct CadetTunnel3 *t);
389 * @param t Channel which has some free buffer space. 389 * @param t Channel which has some free buffer space.
390 */ 390 */
391void 391void
392GCT_unchoke_channels (struct CadetTunnel3 *t); 392GCT_unchoke_channels (struct CadetTunnel *t);
393 393
394/** 394/**
395 * Send ACK on one or more connections due to buffer space to the client. 395 * Send ACK on one or more connections due to buffer space to the client.
@@ -399,7 +399,7 @@ GCT_unchoke_channels (struct CadetTunnel3 *t);
399 * @param t Tunnel which has some free buffer space. 399 * @param t Tunnel which has some free buffer space.
400 */ 400 */
401void 401void
402GCT_send_connection_acks (struct CadetTunnel3 *t); 402GCT_send_connection_acks (struct CadetTunnel *t);
403 403
404/** 404/**
405 * Cancel a previously sent message while it's in the queue. 405 * Cancel a previously sent message while it's in the queue.
@@ -411,7 +411,7 @@ GCT_send_connection_acks (struct CadetTunnel3 *t);
411 * @param q Handle to the queue. 411 * @param q Handle to the queue.
412 */ 412 */
413void 413void
414GCT_cancel (struct CadetTunnel3Queue *q); 414GCT_cancel (struct CadetTunnelQueue *q);
415 415
416/** 416/**
417 * Sends an already built message on a tunnel, encrypting it and 417 * Sends an already built message on a tunnel, encrypting it and
@@ -426,9 +426,9 @@ GCT_cancel (struct CadetTunnel3Queue *q);
426 * 426 *
427 * @return Handle to cancel message. NULL if @c cont is NULL. 427 * @return Handle to cancel message. NULL if @c cont is NULL.
428 */ 428 */
429struct CadetTunnel3Queue * 429struct CadetTunnelQueue *
430GCT_send_prebuilt_message (const struct GNUNET_MessageHeader *message, 430GCT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
431 struct CadetTunnel3 *t, struct CadetConnection *c, 431 struct CadetTunnel *t, struct CadetConnection *c,
432 int force, GCT_sent cont, void *cont_cls); 432 int force, GCT_sent cont, void *cont_cls);
433 433
434/** 434/**
@@ -439,7 +439,7 @@ GCT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
439 * @return #GNUNET_YES if it is loopback. 439 * @return #GNUNET_YES if it is loopback.
440 */ 440 */
441int 441int
442GCT_is_loopback (const struct CadetTunnel3 *t); 442GCT_is_loopback (const struct CadetTunnel *t);
443 443
444/** 444/**
445 * Is the tunnel using this path already? 445 * Is the tunnel using this path already?
@@ -450,7 +450,7 @@ GCT_is_loopback (const struct CadetTunnel3 *t);
450 * @return #GNUNET_YES a connection uses this path. 450 * @return #GNUNET_YES a connection uses this path.
451 */ 451 */
452int 452int
453GCT_is_path_used (const struct CadetTunnel3 *t, const struct CadetPeerPath *p); 453GCT_is_path_used (const struct CadetTunnel *t, const struct CadetPeerPath *p);
454 454
455/** 455/**
456 * Get a cost of a path for a tunnel considering existing connections. 456 * Get a cost of a path for a tunnel considering existing connections.
@@ -461,7 +461,7 @@ GCT_is_path_used (const struct CadetTunnel3 *t, const struct CadetPeerPath *p);
461 * @return Cost of the path (path length + number of overlapping nodes) 461 * @return Cost of the path (path length + number of overlapping nodes)
462 */ 462 */
463unsigned int 463unsigned int
464GCT_get_path_cost (const struct CadetTunnel3 *t, 464GCT_get_path_cost (const struct CadetTunnel *t,
465 const struct CadetPeerPath *path); 465 const struct CadetPeerPath *path);
466 466
467/** 467/**
@@ -472,7 +472,7 @@ GCT_get_path_cost (const struct CadetTunnel3 *t,
472 * @return Static string the destination peer's ID. 472 * @return Static string the destination peer's ID.
473 */ 473 */
474const char * 474const char *
475GCT_2s (const struct CadetTunnel3 *t); 475GCT_2s (const struct CadetTunnel *t);
476 476
477/** 477/**
478 * Log all possible info about the tunnel state. 478 * Log all possible info about the tunnel state.
@@ -480,7 +480,7 @@ GCT_2s (const struct CadetTunnel3 *t);
480 * @param t Tunnel to debug. 480 * @param t Tunnel to debug.
481 */ 481 */
482void 482void
483GCT_debug (const struct CadetTunnel3 *t); 483GCT_debug (const struct CadetTunnel *t);
484 484
485/** 485/**
486 * Iterate all tunnels. 486 * Iterate all tunnels.
@@ -507,7 +507,7 @@ GCT_count_all (void);
507 * @param cls Closure for @c iter. 507 * @param cls Closure for @c iter.
508 */ 508 */
509void 509void
510GCT_iterate_connections (struct CadetTunnel3 *t, GCT_conn_iter iter, void *cls); 510GCT_iterate_connections (struct CadetTunnel *t, GCT_conn_iter iter, void *cls);
511 511
512/** 512/**
513 * Iterate all channels of a tunnel. 513 * Iterate all channels of a tunnel.
@@ -517,7 +517,7 @@ GCT_iterate_connections (struct CadetTunnel3 *t, GCT_conn_iter iter, void *cls);
517 * @param cls Closure for @c iter. 517 * @param cls Closure for @c iter.
518 */ 518 */
519void 519void
520GCT_iterate_channels (struct CadetTunnel3 *t, GCT_chan_iter iter, void *cls); 520GCT_iterate_channels (struct CadetTunnel *t, GCT_chan_iter iter, void *cls);
521 521
522#if 0 /* keep Emacsens' auto-indent happy */ 522#if 0 /* keep Emacsens' auto-indent happy */
523{ 523{