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.h84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.h b/src/cadet/gnunet-service-cadet_tunnel.h
index 16616de59..304015fa5 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.h
+++ b/src/cadet/gnunet-service-cadet_tunnel.h
@@ -123,13 +123,13 @@ struct CadetTunnel3Queue;
123 * @param type Type of message sent. 123 * @param type Type of message sent.
124 * @param size Size of the message. 124 * @param size Size of the message.
125 */ 125 */
126typedef void (*GMT_sent) (void *cls, 126typedef void (*GCT_sent) (void *cls,
127 struct CadetTunnel3 *t, 127 struct CadetTunnel3 *t,
128 struct CadetTunnel3Queue *q, 128 struct CadetTunnel3Queue *q,
129 uint16_t type, size_t size); 129 uint16_t type, size_t size);
130 130
131typedef void (*GMT_conn_iter) (void *cls, struct CadetConnection *c); 131typedef void (*GCT_conn_iter) (void *cls, struct CadetConnection *c);
132typedef void (*GMT_chan_iter) (void *cls, struct CadetChannel *ch); 132typedef void (*GCT_chan_iter) (void *cls, struct CadetChannel *ch);
133 133
134 134
135/******************************************************************************/ 135/******************************************************************************/
@@ -143,14 +143,14 @@ typedef void (*GMT_chan_iter) (void *cls, struct CadetChannel *ch);
143 * @param key ECC private key, to derive all other keys and do crypto. 143 * @param key ECC private key, to derive all other keys and do crypto.
144 */ 144 */
145void 145void
146GMT_init (const struct GNUNET_CONFIGURATION_Handle *c, 146GCT_init (const struct GNUNET_CONFIGURATION_Handle *c,
147 const struct GNUNET_CRYPTO_EddsaPrivateKey *key); 147 const struct GNUNET_CRYPTO_EddsaPrivateKey *key);
148 148
149/** 149/**
150 * Shut down the tunnel subsystem. 150 * Shut down the tunnel subsystem.
151 */ 151 */
152void 152void
153GMT_shutdown (void); 153GCT_shutdown (void);
154 154
155/** 155/**
156 * Create a tunnel. 156 * Create a tunnel.
@@ -158,7 +158,7 @@ GMT_shutdown (void);
158 * @param destination Peer this tunnel is towards. 158 * @param destination Peer this tunnel is towards.
159 */ 159 */
160struct CadetTunnel3 * 160struct CadetTunnel3 *
161GMT_new (struct CadetPeer *destination); 161GCT_new (struct CadetPeer *destination);
162 162
163/** 163/**
164 * Tunnel is empty: destroy it. 164 * Tunnel is empty: destroy it.
@@ -168,7 +168,7 @@ GMT_new (struct CadetPeer *destination);
168 * @param t Tunnel to destroy. 168 * @param t Tunnel to destroy.
169 */ 169 */
170void 170void
171GMT_destroy_empty (struct CadetTunnel3 *t); 171GCT_destroy_empty (struct CadetTunnel3 *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 @@ GMT_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
179GMT_destroy_if_empty (struct CadetTunnel3 *t); 179GCT_destroy_if_empty (struct CadetTunnel3 *t);
180 180
181/** 181/**
182 * Destroy the tunnel. 182 * Destroy the tunnel.
@@ -190,7 +190,7 @@ GMT_destroy_if_empty (struct CadetTunnel3 *t);
190 * @param t The tunnel to destroy. 190 * @param t The tunnel to destroy.
191 */ 191 */
192void 192void
193GMT_destroy (struct CadetTunnel3 *t); 193GCT_destroy (struct CadetTunnel3 *t);
194 194
195 195
196/** 196/**
@@ -200,7 +200,7 @@ GMT_destroy (struct CadetTunnel3 *t);
200 * @param cstate New connection state. 200 * @param cstate New connection state.
201 */ 201 */
202void 202void
203GMT_change_cstate (struct CadetTunnel3* t, enum CadetTunnel3CState cstate); 203GCT_change_cstate (struct CadetTunnel3* t, enum CadetTunnel3CState cstate);
204 204
205 205
206/** 206/**
@@ -210,7 +210,7 @@ GMT_change_cstate (struct CadetTunnel3* t, enum CadetTunnel3CState cstate);
210 * @param state New encryption state. 210 * @param state New encryption state.
211 */ 211 */
212void 212void
213GMT_change_estate (struct CadetTunnel3* t, enum CadetTunnel3EState state); 213GCT_change_estate (struct CadetTunnel3* t, enum CadetTunnel3EState state);
214 214
215/** 215/**
216 * Add a connection to a tunnel. 216 * Add a connection to a tunnel.
@@ -219,7 +219,7 @@ GMT_change_estate (struct CadetTunnel3* t, enum CadetTunnel3EState state);
219 * @param c Connection. 219 * @param c Connection.
220 */ 220 */
221void 221void
222GMT_add_connection (struct CadetTunnel3 *t, struct CadetConnection *c); 222GCT_add_connection (struct CadetTunnel3 *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 @@ GMT_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
231GMT_remove_path (struct CadetTunnel3 *t, struct CadetPeerPath *path); 231GCT_remove_path (struct CadetTunnel3 *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 @@ GMT_remove_path (struct CadetTunnel3 *t, struct CadetPeerPath *path);
237 * @param c Connection. 237 * @param c Connection.
238 */ 238 */
239void 239void
240GMT_remove_connection (struct CadetTunnel3 *t, struct CadetConnection *c); 240GCT_remove_connection (struct CadetTunnel3 *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 @@ GMT_remove_connection (struct CadetTunnel3 *t, struct CadetConnection *c);
246 * @param ch Channel. 246 * @param ch Channel.
247 */ 247 */
248void 248void
249GMT_add_channel (struct CadetTunnel3 *t, struct CadetChannel *ch); 249GCT_add_channel (struct CadetTunnel3 *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 @@ GMT_add_channel (struct CadetTunnel3 *t, struct CadetChannel *ch);
255 * @param ch Channel. 255 * @param ch Channel.
256 */ 256 */
257void 257void
258GMT_remove_channel (struct CadetTunnel3 *t, struct CadetChannel *ch); 258GCT_remove_channel (struct CadetTunnel3 *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 @@ GMT_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 *
269GMT_get_channel (struct CadetTunnel3 *t, CADET_ChannelNumber chid); 269GCT_get_channel (struct CadetTunnel3 *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 @@ GMT_get_channel (struct CadetTunnel3 *t, CADET_ChannelNumber chid);
277 * @param msg Message header. 277 * @param msg Message header.
278 */ 278 */
279void 279void
280GMT_handle_encrypted (struct CadetTunnel3 *t, 280GCT_handle_encrypted (struct CadetTunnel3 *t,
281 const struct GNUNET_CADET_Encrypted *msg); 281 const struct GNUNET_CADET_Encrypted *msg);
282 282
283/** 283/**
@@ -287,7 +287,7 @@ GMT_handle_encrypted (struct CadetTunnel3 *t,
287 * @param message KX message itself. 287 * @param message KX message itself.
288 */ 288 */
289void 289void
290GMT_handle_kx (struct CadetTunnel3 *t, 290GCT_handle_kx (struct CadetTunnel3 *t,
291 const struct GNUNET_MessageHeader *message); 291 const struct GNUNET_MessageHeader *message);
292 292
293/** 293/**
@@ -301,7 +301,7 @@ GMT_handle_kx (struct CadetTunnel3 *t,
301 * @return Connection created. 301 * @return Connection created.
302 */ 302 */
303struct CadetConnection * 303struct CadetConnection *
304GMT_use_path (struct CadetTunnel3 *t, struct CadetPeerPath *p); 304GCT_use_path (struct CadetTunnel3 *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 @@ GMT_use_path (struct CadetTunnel3 *t, struct CadetPeerPath *p);
311 * @return Number of connections. 311 * @return Number of connections.
312 */ 312 */
313unsigned int 313unsigned int
314GMT_count_connections (struct CadetTunnel3 *t); 314GCT_count_connections (struct CadetTunnel3 *t);
315 315
316/** 316/**
317 * Count channels of a tunnel. 317 * Count channels of a tunnel.
@@ -321,7 +321,7 @@ GMT_count_connections (struct CadetTunnel3 *t);
321 * @return Number of channels. 321 * @return Number of channels.
322 */ 322 */
323unsigned int 323unsigned int
324GMT_count_channels (struct CadetTunnel3 *t); 324GCT_count_channels (struct CadetTunnel3 *t);
325 325
326/** 326/**
327 * Get the connectivity state of a tunnel. 327 * Get the connectivity state of a tunnel.
@@ -331,7 +331,7 @@ GMT_count_channels (struct CadetTunnel3 *t);
331 * @return Tunnel's connectivity state. 331 * @return Tunnel's connectivity state.
332 */ 332 */
333enum CadetTunnel3CState 333enum CadetTunnel3CState
334GMT_get_cstate (struct CadetTunnel3 *t); 334GCT_get_cstate (struct CadetTunnel3 *t);
335 335
336/** 336/**
337 * Get the encryption state of a tunnel. 337 * Get the encryption state of a tunnel.
@@ -341,7 +341,7 @@ GMT_get_cstate (struct CadetTunnel3 *t);
341 * @return Tunnel's encryption state. 341 * @return Tunnel's encryption state.
342 */ 342 */
343enum CadetTunnel3EState 343enum CadetTunnel3EState
344GMT_get_estate (struct CadetTunnel3 *t); 344GCT_get_estate (struct CadetTunnel3 *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 @@ GMT_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
354GMT_get_channels_buffer (struct CadetTunnel3 *t); 354GCT_get_channels_buffer (struct CadetTunnel3 *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 @@ GMT_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
364GMT_get_connections_buffer (struct CadetTunnel3 *t); 364GCT_get_connections_buffer (struct CadetTunnel3 *t);
365 365
366/** 366/**
367 * Get the tunnel's destination. 367 * Get the tunnel's destination.
@@ -371,7 +371,7 @@ GMT_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 *
374GMT_get_destination (struct CadetTunnel3 *t); 374GCT_get_destination (struct CadetTunnel3 *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 @@ GMT_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
384GMT_get_next_chid (struct CadetTunnel3 *t); 384GCT_get_next_chid (struct CadetTunnel3 *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 @@ GMT_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
392GMT_unchoke_channels (struct CadetTunnel3 *t); 392GCT_unchoke_channels (struct CadetTunnel3 *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 @@ GMT_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
402GMT_send_connection_acks (struct CadetTunnel3 *t); 402GCT_send_connection_acks (struct CadetTunnel3 *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 @@ GMT_send_connection_acks (struct CadetTunnel3 *t);
411 * @param q Handle to the queue. 411 * @param q Handle to the queue.
412 */ 412 */
413void 413void
414GMT_cancel (struct CadetTunnel3Queue *q); 414GCT_cancel (struct CadetTunnel3Queue *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
@@ -427,9 +427,9 @@ GMT_cancel (struct CadetTunnel3Queue *q);
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 CadetTunnel3Queue *
430GMT_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 CadetTunnel3 *t, struct CadetConnection *c,
432 int force, GMT_sent cont, void *cont_cls); 432 int force, GCT_sent cont, void *cont_cls);
433 433
434/** 434/**
435 * Is the tunnel directed towards the local peer? 435 * Is the tunnel directed towards the local peer?
@@ -439,7 +439,7 @@ GMT_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
442GMT_is_loopback (const struct CadetTunnel3 *t); 442GCT_is_loopback (const struct CadetTunnel3 *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 @@ GMT_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
453GMT_is_path_used (const struct CadetTunnel3 *t, const struct CadetPeerPath *p); 453GCT_is_path_used (const struct CadetTunnel3 *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 @@ GMT_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
464GMT_get_path_cost (const struct CadetTunnel3 *t, 464GCT_get_path_cost (const struct CadetTunnel3 *t,
465 const struct CadetPeerPath *path); 465 const struct CadetPeerPath *path);
466 466
467/** 467/**
@@ -472,7 +472,7 @@ GMT_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 *
475GMT_2s (const struct CadetTunnel3 *t); 475GCT_2s (const struct CadetTunnel3 *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 @@ GMT_2s (const struct CadetTunnel3 *t);
480 * @param t Tunnel to debug. 480 * @param t Tunnel to debug.
481 */ 481 */
482void 482void
483GMT_debug (const struct CadetTunnel3 *t); 483GCT_debug (const struct CadetTunnel3 *t);
484 484
485/** 485/**
486 * Iterate all tunnels. 486 * Iterate all tunnels.
@@ -489,7 +489,7 @@ GMT_debug (const struct CadetTunnel3 *t);
489 * @param cls Closure for @c iter. 489 * @param cls Closure for @c iter.
490 */ 490 */
491void 491void
492GMT_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls); 492GCT_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls);
493 493
494/** 494/**
495 * Count all tunnels. 495 * Count all tunnels.
@@ -497,7 +497,7 @@ GMT_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls);
497 * @return Number of tunnels to remote peers kept by this peer. 497 * @return Number of tunnels to remote peers kept by this peer.
498 */ 498 */
499unsigned int 499unsigned int
500GMT_count_all (void); 500GCT_count_all (void);
501 501
502/** 502/**
503 * Iterate all connections of a tunnel. 503 * Iterate all connections of a tunnel.
@@ -507,7 +507,7 @@ GMT_count_all (void);
507 * @param cls Closure for @c iter. 507 * @param cls Closure for @c iter.
508 */ 508 */
509void 509void
510GMT_iterate_connections (struct CadetTunnel3 *t, GMT_conn_iter iter, void *cls); 510GCT_iterate_connections (struct CadetTunnel3 *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 @@ GMT_iterate_connections (struct CadetTunnel3 *t, GMT_conn_iter iter, void *cls);
517 * @param cls Closure for @c iter. 517 * @param cls Closure for @c iter.
518 */ 518 */
519void 519void
520GMT_iterate_channels (struct CadetTunnel3 *t, GMT_chan_iter iter, void *cls); 520GCT_iterate_channels (struct CadetTunnel3 *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{