aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-service-cadet_connection.h')
-rw-r--r--src/cadet/gnunet-service-cadet_connection.h605
1 files changed, 184 insertions, 421 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.h b/src/cadet/gnunet-service-cadet_connection.h
index 307cb42c2..fdb184366 100644
--- a/src/cadet/gnunet-service-cadet_connection.h
+++ b/src/cadet/gnunet-service-cadet_connection.h
@@ -1,6 +1,7 @@
1
1/* 2/*
2 This file is part of GNUnet. 3 This file is part of GNUnet.
3 Copyright (C) 2013 GNUnet e.V. 4 Copyright (C) 2001-2017 GNUnet e.V.
4 5
5 GNUnet is free software; you can redistribute it and/or modify 6 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 it under the terms of the GNU General Public License as published
@@ -20,557 +21,319 @@
20 21
21/** 22/**
22 * @file cadet/gnunet-service-cadet_connection.h 23 * @file cadet/gnunet-service-cadet_connection.h
23 * @brief cadet service; dealing with connections 24 * @brief A connection is a live end-to-end messaging mechanism
25 * where the peers are identified by a path and know how
26 * to forward along the route using a connection identifier
27 * for routing the data.
24 * @author Bartlomiej Polot 28 * @author Bartlomiej Polot
25 * 29 * @author Christian Grothoff
26 * All functions in this file use the prefix GCC (GNUnet Cadet Connection)
27 */ 30 */
28
29#ifndef GNUNET_SERVICE_CADET_CONNECTION_H 31#ifndef GNUNET_SERVICE_CADET_CONNECTION_H
30#define GNUNET_SERVICE_CADET_CONNECTION_H 32#define GNUNET_SERVICE_CADET_CONNECTION_H
31 33
32#ifdef __cplusplus
33extern "C"
34{
35#if 0 /* keep Emacsens' auto-indent happy */
36}
37#endif
38#endif
39
40#include "gnunet_util_lib.h" 34#include "gnunet_util_lib.h"
41 35#include "gnunet-service-cadet.h"
42
43/**
44 * All the states a connection can be in.
45 */
46enum CadetConnectionState
47{
48 /**
49 * Uninitialized status, should never appear in operation.
50 */
51 CADET_CONNECTION_NEW,
52
53 /**
54 * Connection create message sent, waiting for ACK.
55 */
56 CADET_CONNECTION_SENT,
57
58 /**
59 * Connection ACK sent, waiting for ACK.
60 */
61 CADET_CONNECTION_ACK,
62
63 /**
64 * Connection confirmed, ready to carry traffic.
65 */
66 CADET_CONNECTION_READY,
67
68 /**
69 * Connection to be destroyed, just waiting to empty queues.
70 */
71 CADET_CONNECTION_DESTROYED,
72
73 /**
74 * Connection to be destroyed because of a distant peer, same as DESTROYED.
75 */
76 CADET_CONNECTION_BROKEN,
77};
78
79
80/**
81 * Struct containing all information regarding a connection to a peer.
82 */
83struct CadetConnection;
84
85/**
86 * Handle for messages queued but not yet sent.
87 */
88struct CadetConnectionQueue;
89
90#include "cadet_path.h"
91#include "gnunet-service-cadet_channel.h"
92#include "gnunet-service-cadet_peer.h" 36#include "gnunet-service-cadet_peer.h"
37#include "cadet_protocol.h"
93 38
94 39
95/** 40/**
96 * Check invariants for all connections using #check_neighbours(). 41 * Function called to notify tunnel about change in our readyness.
97 */
98void
99GCC_check_connections (void);
100
101
102/**
103 * Callback called when a queued message is sent.
104 * 42 *
105 * @param cls Closure. 43 * @param cls closure
106 * @param c Connection this message was on. 44 * @param is_ready #GNUNET_YES if the connection is now ready for transmission,
107 * @param type Type of message sent. 45 * #GNUNET_NO if the connection is no longer ready for transmission
108 * @param fwd Was this a FWD going message?
109 * @param size Size of the message.
110 */ 46 */
111typedef void 47typedef void
112(*GCC_sent) (void *cls, 48(*GCC_ReadyCallback)(void *cls,
113 struct CadetConnection *c, 49 int is_ready);
114 struct CadetConnectionQueue *q,
115 uint16_t type,
116 int fwd,
117 size_t size);
118 50
119 51
120/** 52/**
121 * Handler for connection creation. 53 * Destroy a connection, called when the CORE layer is already done
54 * (i.e. has received a BROKEN message), but if we still have to
55 * communicate the destruction of the connection to the tunnel (if one
56 * exists).
122 * 57 *
123 * @param peer Message sender (neighbor). 58 * @param cc connection to destroy
124 * @param msg Message itself.
125 */ 59 */
126void 60void
127GCC_handle_create (struct CadetPeer *peer, 61GCC_destroy_without_core (struct CadetConnection *cc);
128 const struct GNUNET_CADET_ConnectionCreateMessage *msg);
129 62
130 63
131/** 64/**
132 * Handler for connection confirmations. 65 * Destroy a connection, called if the tunnel association with the
66 * connection was already broken, but we still need to notify the CORE
67 * layer about the breakage.
133 * 68 *
134 * @param peer Message sender (neighbor). 69 * @param cc connection to destroy
135 * @param msg Message itself.
136 */ 70 */
137void 71void
138GCC_handle_confirm (struct CadetPeer *peer, 72GCC_destroy_without_tunnel (struct CadetConnection *cc);
139 const struct GNUNET_CADET_ConnectionCreateAckMessage *msg);
140 73
141 74
142/** 75/**
143 * Handler for notifications of broken connections. 76 * Lookup a connection by its identifier.
144 * 77 *
145 * @param peer Message sender (neighbor). 78 * @param cid identifier to resolve
146 * @param msg Message itself. 79 * @return NULL if connection was not found
147 */ 80 */
148void 81struct CadetConnection *
149GCC_handle_broken (struct CadetPeer *peer, 82GCC_lookup (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid);
150 const struct GNUNET_CADET_ConnectionBrokenMessage *msg);
151 83
152/**
153 * Handler for notifications of destroyed connections.
154 *
155 * @param peer Message sender (neighbor).
156 * @param msg Message itself.
157 */
158void
159GCC_handle_destroy (struct CadetPeer *peer,
160 const struct GNUNET_CADET_ConnectionDestroyMessage *msg);
161 84
162/** 85/**
163 * Handler for cadet network traffic hop-by-hop acks. 86 * Create a connection to @a destination via @a path and
87 * notify @a cb whenever we are ready for more data.
164 * 88 *
165 * @param peer Message sender (neighbor). 89 * @param destination where to go
166 * @param msg Message itself. 90 * @param path which path to take (may not be the full path)
91 * @param off offset of @a destination on @a path
92 * @param options options for the connection
93 * @param ct which tunnel uses this connection
94 * @param ready_cb function to call when ready to transmit
95 * @param ready_cb_cls closure for @a cb
96 * @return handle to the connection
167 */ 97 */
168void 98struct CadetConnection *
169GCC_handle_ack (struct CadetPeer *peer, 99GCC_create (struct CadetPeer *destination,
170 const struct GNUNET_CADET_ConnectionEncryptedAckMessage *msg); 100 struct CadetPeerPath *path,
101 unsigned int off,
102 enum GNUNET_CADET_ChannelOption options,
103 struct CadetTConnection *ct,
104 GCC_ReadyCallback ready_cb,
105 void *ready_cb_cls);
171 106
172/**
173 * Handler for cadet network traffic hop-by-hop data counter polls.
174 *
175 * @param peer Message sender (neighbor).
176 * @param msg Message itself.
177 */
178void
179GCC_handle_poll (struct CadetPeer *peer,
180 const struct GNUNET_CADET_ConnectionHopByHopPollMessage *msg);
181 107
182/** 108/**
183 * Handler for key exchange traffic (Axolotl KX). 109 * Create a connection to @a destination via @a path and
110 * notify @a cb whenever we are ready for more data. This
111 * is an inbound tunnel, so we must use the existing @a cid
184 * 112 *
185 * @param peer Message sender (neighbor). 113 * @param destination where to go
186 * @param msg Message itself. 114 * @param path which path to take (may not be the full path)
115 * @param options options for the connection
116 * @param ct which tunnel uses this connection
117 * @param ready_cb function to call when ready to transmit
118 * @param ready_cb_cls closure for @a cb
119 * @return handle to the connection, NULL if we already have
120 * a connection that takes precedence on @a path
187 */ 121 */
188void 122struct CadetConnection *
189GCC_handle_kx (struct CadetPeer *peer, 123GCC_create_inbound (struct CadetPeer *destination,
190 const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg); 124 struct CadetPeerPath *path,
125 enum GNUNET_CADET_ChannelOption options,
126 struct CadetTConnection *ct,
127 const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid,
128 GCC_ReadyCallback ready_cb,
129 void *ready_cb_cls);
130
191 131
192/** 132/**
193 * Handler for encrypted cadet network traffic (channel mgmt, data). 133 * Transmit message @a msg via connection @a cc. Must only be called
134 * (once) after the connection has signalled that it is ready via the
135 * `ready_cb`. Clients can also use #GCC_is_ready() to check if the
136 * connection is right now ready for transmission.
194 * 137 *
195 * @param peer Message sender (neighbor). 138 * @param cc connection identification
196 * @param msg Message itself. 139 * @param env envelope with message to transmit;
140 * the #GNUNET_MQ_notify_send() must not have yet been used
141 * for the envelope. Also, the message better match the
142 * connection identifier of this connection...
197 */ 143 */
198void 144void
199GCC_handle_encrypted (struct CadetPeer *peer, 145GCC_transmit (struct CadetConnection *cc,
200 const struct GNUNET_CADET_TunnelEncryptedMessage *msg); 146 struct GNUNET_MQ_Envelope *env);
201 147
202/**
203 * Core handler for axolotl key exchange traffic.
204 *
205 * @param cls Closure (unused).
206 * @param message Message received.
207 * @param peer Neighbor who sent the message.
208 *
209 * @return GNUNET_OK, to keep the connection open.
210 */
211int
212GCC_handle_ax_kx (void *cls, const struct GNUNET_PeerIdentity *peer,
213 const struct GNUNET_MessageHeader *message);
214 148
215/** 149/**
216 * Core handler for axolotl encrypted cadet network traffic. 150 * A CREATE_ACK was received for this connection, process it.
217 * 151 *
218 * @param cls Closure (unused). 152 * @param cc the connection that got the ACK.
219 * @param message Message received.
220 * @param peer Neighbor who sent the message.
221 *
222 * @return GNUNET_OK, to keep the connection open.
223 */ 153 */
224int 154void
225GCC_handle_ax (void *cls, const struct GNUNET_PeerIdentity *peer, 155GCC_handle_connection_create_ack (struct CadetConnection *cc);
226 struct GNUNET_MessageHeader *message);
227 156
228/**
229 * Core handler for cadet keepalives.
230 *
231 * @param cls closure
232 * @param message message
233 * @param peer peer identity this notification is about
234 * @return GNUNET_OK to keep the connection open,
235 * GNUNET_SYSERR to close it (signal serious error)
236 *
237 * TODO: Check who we got this from, to validate route.
238 */
239int
240GCC_handle_keepalive (void *cls, const struct GNUNET_PeerIdentity *peer,
241 const struct GNUNET_MessageHeader *message);
242 157
243/** 158/**
244 * Send an ACK on the appropriate connection/channel, depending on 159 * We got a #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE for a
245 * the direction and the position of the peer. 160 * connection that we already have. Either our ACK got lost
161 * or something is fishy. Consider retransmitting the ACK.
246 * 162 *
247 * @param c Which connection to send the hop-by-hop ACK. 163 * @param cc connection that got the duplicate CREATE
248 * @param fwd Is this a fwd ACK? (will go dest->root).
249 * @param force Send the ACK even if suboptimal (e.g. requested by POLL).
250 */ 164 */
251void 165void
252GCC_send_ack (struct CadetConnection *c, int fwd, int force); 166GCC_handle_duplicate_create (struct CadetConnection *cc);
253 167
254/**
255 * Initialize the connections subsystem
256 *
257 * @param c Configuration handle.
258 */
259void
260GCC_init (const struct GNUNET_CONFIGURATION_Handle *c);
261 168
262/** 169/**
263 * Shut down the connections subsystem. 170 * Handle KX message.
171 *
172 * @param cc connection that received encrypted message
173 * @param msg the key exchange message
264 */ 174 */
265void 175void
266GCC_shutdown (void); 176GCC_handle_kx (struct CadetConnection *cc,
177 const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg);
267 178
268/**
269 * Create a connection.
270 *
271 * @param cid Connection ID (either created locally or imposed remotely).
272 * @param t Tunnel this connection belongs to (or NULL for transit connections);
273 * @param path Path this connection has to use (copy is made).
274 * @param own_pos Own position in the @c path path.
275 *
276 * @return Newly created connection.
277 * NULL in case of error: own id not in path, wrong neighbors, ...
278 */
279struct CadetConnection *
280GCC_new (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid,
281 struct CadetTunnel *t,
282 struct CadetPeerPath *path,
283 unsigned int own_pos);
284 179
285/** 180/**
286 * Connection is no longer needed: destroy it. 181 * Handle KX_AUTH message.
287 *
288 * Cancels all pending traffic (including possible DESTROY messages), all
289 * maintenance tasks and removes the connection from neighbor peers and tunnel.
290 * 182 *
291 * @param c Connection to destroy. 183 * @param cc connection that received encrypted message
184 * @param msg the key exchange message
292 */ 185 */
293void 186void
294GCC_destroy (struct CadetConnection *c); 187GCC_handle_kx_auth (struct CadetConnection *cc,
295 188 const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg);
296/**
297 * Get the connection ID.
298 *
299 * @param c Connection to get the ID from.
300 *
301 * @return ID of the connection.
302 */
303const struct GNUNET_CADET_ConnectionTunnelIdentifier *
304GCC_get_id (const struct CadetConnection *c);
305 189
306 190
307/** 191/**
308 * Get the connection path. 192 * Performance metrics for a connection.
309 *
310 * @param c Connection to get the path from.
311 *
312 * @return path used by the connection.
313 */ 193 */
314const struct CadetPeerPath * 194struct CadetConnectionMetrics
315GCC_get_path (const struct CadetConnection *c); 195{
316 196
317/** 197 /**
318 * Get the connection state. 198 * Our current best estimate of the latency, based on a weighted
319 * 199 * average of at least @a latency_datapoints values.
320 * @param c Connection to get the state from. 200 */
321 * 201 struct GNUNET_TIME_Relative aged_latency;
322 * @return state of the connection.
323 */
324enum CadetConnectionState
325GCC_get_state (const struct CadetConnection *c);
326 202
327/** 203 /**
328 * Get the connection tunnel. 204 * When was this connection first established? (by us sending or
329 * 205 * receiving the CREATE_ACK for the first time)
330 * @param c Connection to get the tunnel from. 206 */
331 * 207 struct GNUNET_TIME_Absolute age;
332 * @return tunnel of the connection.
333 */
334struct CadetTunnel *
335GCC_get_tunnel (const struct CadetConnection *c);
336 208
337/** 209 /**
338 * Get free buffer space in a connection. 210 * When was this connection last used? (by us sending or
339 * 211 * receiving a PAYLOAD message on it)
340 * @param c Connection. 212 */
341 * @param fwd Is query about FWD traffic? 213 struct GNUNET_TIME_Absolute last_use;
342 *
343 * @return Free buffer space [0 - max_msgs_queue/max_connections]
344 */
345unsigned int
346GCC_get_buffer (struct CadetConnection *c, int fwd);
347 214
348/** 215 /**
349 * Get how many messages have we allowed to send to us from a direction. 216 * How many packets that ought to generate an ACK did we send via
350 * 217 * this connection?
351 * @param c Connection. 218 */
352 * @param fwd Are we asking about traffic from FWD (BCK messages)? 219 unsigned long long num_acked_transmissions;
353 *
354 * @return last_ack_sent - last_pid_recv
355 */
356unsigned int
357GCC_get_allowed (struct CadetConnection *c, int fwd);
358 220
359/** 221 /**
360 * Get messages queued in a connection. 222 * Number of packets that were sent via this connection did actually
361 * 223 * receive an ACK? (Note: ACKs may be transmitted and lost via
362 * @param c Connection. 224 * other connections, so this value should only be interpreted
363 * @param fwd Is query about FWD traffic? 225 * relative to @e num_acked_transmissions and in relation to other
364 * 226 * connections.)
365 * @return Number of messages queued. 227 */
366 */ 228 unsigned long long num_successes;
367unsigned int
368GCC_get_qn (struct CadetConnection *c, int fwd);
369 229
370/** 230};
371 * Get next PID to use.
372 *
373 * @param c Connection.
374 * @param fwd Is query about FWD traffic?
375 * @return Next PID to use.
376 */
377struct CadetEncryptedMessageIdentifier
378GCC_get_pid (struct CadetConnection *c, int fwd);
379 231
380/**
381 * Allow the connection to advertise a buffer of the given size.
382 *
383 * The connection will send an @c fwd ACK message (so: in direction !fwd)
384 * allowing up to last_pid_recv + buffer.
385 *
386 * @param c Connection.
387 * @param buffer How many more messages the connection can accept.
388 * @param fwd Is this about FWD traffic? (The ack will go dest->root).
389 */
390void
391GCC_allow (struct CadetConnection *c, unsigned int buffer, int fwd);
392 232
393/** 233/**
394 * Send FWD keepalive packets for a connection. 234 * Obtain performance @a metrics from @a cc.
395 * 235 *
396 * @param cls Closure (connection for which to send the keepalive). 236 * @param cc connection to query
397 * @param tc Notification context. 237 * @return the metrics
398 */ 238 */
399void 239const struct CadetConnectionMetrics *
400GCC_fwd_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 240GCC_get_metrics (struct CadetConnection *cc);
241
401 242
402/** 243/**
403 * Send BCK keepalive packets for a connection. 244 * Handle encrypted message.
404 * 245 *
405 * @param cls Closure (connection for which to send the keepalive). 246 * @param cc connection that received encrypted message
406 * @param tc Notification context. 247 * @param msg the encrypted message to decrypt
407 */ 248 */
408void 249void
409GCC_bck_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 250GCC_handle_encrypted (struct CadetConnection *cc,
251 const struct GNUNET_CADET_TunnelEncryptedMessage *msg);
410 252
411 253
412/** 254/**
413 * Notify other peers on a connection of a broken link. Mark connections 255 * We sent a message for which we expect to receive an ACK via
414 * to destroy after all traffic has been sent. 256 * the connection identified by @a cti.
415 * 257 *
416 * @param c Connection on which there has been a disconnection. 258 * @param cid connection identifier where we expect an ACK
417 * @param peer Peer that disconnected.
418 */ 259 */
419void 260void
420GCC_neighbor_disconnected (struct CadetConnection *c, struct CadetPeer *peer); 261GCC_ack_expected (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid);
421 262
422/**
423 * Is this peer the first one on the connection?
424 *
425 * @param c Connection.
426 * @param fwd Is this about fwd traffic?
427 *
428 * @return #GNUNET_YES if origin, #GNUNET_NO if relay/terminal.
429 */
430int
431GCC_is_origin (struct CadetConnection *c, int fwd);
432 263
433/** 264/**
434 * Is this peer the last one on the connection? 265 * We observed an ACK for a message that was originally sent via
435 * 266 * the connection identified by @a cti.
436 * @param c Connection.
437 * @param fwd Is this about fwd traffic?
438 * Note that the ROOT is the terminal for BCK traffic!
439 * 267 *
440 * @return #GNUNET_YES if terminal, #GNUNET_NO if relay/origin. 268 * @param cid connection identifier where we got an ACK for a message
269 * that was originally sent via this connection (the ACK
270 * may have gotten back to us via a different connection).
441 */ 271 */
442int 272void
443GCC_is_terminal (struct CadetConnection *c, int fwd); 273GCC_ack_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid);
444
445/**
446 * See if we are allowed to send by the next hop in the given direction.
447 *
448 * @param c Connection.
449 * @param fwd Is this about fwd traffic?
450 *
451 * @return #GNUNET_YES in case it's OK to send.
452 */
453int
454GCC_is_sendable (struct CadetConnection *c, int fwd);
455 274
456/**
457 * Check if this connection is a direct one (never trim a direct connection).
458 *
459 * @param c Connection.
460 *
461 * @return #GNUNET_YES in case it's a direct connection, #GNUNET_NO otherwise.
462 */
463int
464GCC_is_direct (struct CadetConnection *c);
465 275
466/** 276/**
467 * Cancel a previously sent message while it's in the queue. 277 * We observed some the given @a latency on the connection
278 * identified by @a cti. (The same connection was taken
279 * in both directions.)
468 * 280 *
469 * ONLY can be called before the continuation given to the send function 281 * @param cti connection identifier where we measured latency
470 * is called. Once the continuation is called, the message is no longer in the 282 * @param latency the observed latency
471 * queue.
472 *
473 * @param q Handle to the queue.
474 */ 283 */
475void 284void
476GCC_cancel (struct CadetConnectionQueue *q); 285GCC_latency_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti,
286 struct GNUNET_TIME_Relative latency);
477 287
478/**
479 * Sends an already built message on a connection, properly registering
480 * all used resources.
481 *
482 * @param message Message to send.
483 * @param payload_type Type of payload, in case the message is encrypted.
484 * 0 for restransmissions (when type is no longer known)
485 * UINT16_MAX when not applicable.
486 * @param payload_id ID of the payload (PID, ACK, ...).
487 * @param c Connection on which this message is transmitted.
488 * @param fwd Is this a fwd message?
489 * @param force Force the connection to accept the message (buffer overfill).
490 * @param cont Continuation called once message is sent. Can be NULL.
491 * @param cont_cls Closure for @c cont.
492 *
493 * @return Handle to cancel the message before it's sent.
494 * NULL on error.
495 * Invalid on @c cont call.
496 */
497struct CadetConnectionQueue *
498GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
499 uint16_t payload_type,
500 struct CadetEncryptedMessageIdentifier payload_id,
501 struct CadetConnection *c, int fwd, int force,
502 GCC_sent cont, void *cont_cls);
503 288
504/** 289/**
505 * Sends a CREATE CONNECTION message for a path to a peer. 290 * Return the tunnel associated with this connection.
506 * Changes the connection and tunnel states if necessary.
507 * 291 *
508 * @param connection Connection to create. 292 * @param cc connection to query
293 * @return corresponding entry in the tunnel's connection list
509 */ 294 */
510void 295struct CadetTConnection *
511GCC_send_create (struct CadetConnection *connection); 296GCC_get_ct (struct CadetConnection *cc);
512 297
513/**
514 * Send a message to all peers in this connection that the connection
515 * is no longer valid.
516 *
517 * If some peer should not receive the message, it should be zero'ed out
518 * before calling this function.
519 *
520 * @param c The connection whose peers to notify.
521 */
522void
523GCC_send_destroy (struct CadetConnection *c);
524 298
525/** 299/**
526 * @brief Start a polling timer for the connection. 300 * Obtain the path used by this connection.
527 * 301 *
528 * When a neighbor does not accept more traffic on the connection it could be 302 * @param cc connection
529 * caused by a simple congestion or by a lost ACK. Polling enables to check 303 * @return path to @a cc
530 * for the lastest ACK status for a connection.
531 *
532 * @param c Connection.
533 * @param fwd Should we poll in the FWD direction?
534 */ 304 */
535void 305struct CadetPeerPath *
536GCC_start_poll (struct CadetConnection *c, int fwd); 306GCC_get_path (struct CadetConnection *cc);
537 307
538 308
539/** 309/**
540 * @brief Stop polling a connection for ACKs. 310 * Obtain unique ID for the connection.
541 *
542 * Once we have enough ACKs for future traffic, polls are no longer necessary.
543 * 311 *
544 * @param c Connection. 312 * @param cc connection.
545 * @param fwd Should we stop the poll in the FWD direction? 313 * @return unique number of the connection
546 */ 314 */
547void 315const struct GNUNET_CADET_ConnectionTunnelIdentifier *
548GCC_stop_poll (struct CadetConnection *c, int fwd); 316GCC_get_id (struct CadetConnection *cc);
317
549 318
550/** 319/**
551 * Get a (static) string for a connection. 320 * Get a (static) string for a connection.
552 * 321 *
553 * @param c Connection. 322 * @param cc Connection.
554 */ 323 */
555const char * 324const char *
556GCC_2s (const struct CadetConnection *c); 325GCC_2s (const struct CadetConnection *cc);
326
557 327
558/** 328/**
559 * Log all possible info about the connection state. 329 * Log connection info.
560 * 330 *
561 * @param c Connection to debug. 331 * @param cc connection
562 * @param level Debug level to use. 332 * @param level Debug level to use.
563 */ 333 */
564void 334void
565GCC_debug (const struct CadetConnection *c, enum GNUNET_ErrorType level); 335GCC_debug (struct CadetConnection *cc,
336 enum GNUNET_ErrorType level);
566 337
567#if 0 /* keep Emacsens' auto-indent happy */
568{
569#endif
570#ifdef __cplusplus
571}
572#endif
573 338
574/* ifndef GNUNET_SERVICE_CADET_CONNECTION_H */
575#endif 339#endif
576/* end of gnunet-service-cadet_connection.h */