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.h80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.h b/src/cadet/gnunet-service-cadet_connection.h
index 4e1104c2b..535488260 100644
--- a/src/cadet/gnunet-service-cadet_connection.h
+++ b/src/cadet/gnunet-service-cadet_connection.h
@@ -97,7 +97,7 @@ struct CadetConnectionQueue;
97 * @param fwd Was this a FWD going message? 97 * @param fwd Was this a FWD going message?
98 * @param size Size of the message. 98 * @param size Size of the message.
99 */ 99 */
100typedef void (*GMC_sent) (void *cls, 100typedef void (*GCC_sent) (void *cls,
101 struct CadetConnection *c, 101 struct CadetConnection *c,
102 struct CadetConnectionQueue *q, 102 struct CadetConnectionQueue *q,
103 uint16_t type, int fwd, size_t size); 103 uint16_t type, int fwd, size_t size);
@@ -113,7 +113,7 @@ typedef void (*GMC_sent) (void *cls,
113 * GNUNET_SYSERR to close it (signal serious error) 113 * GNUNET_SYSERR to close it (signal serious error)
114 */ 114 */
115int 115int
116GMC_handle_create (void *cls, const struct GNUNET_PeerIdentity *peer, 116GCC_handle_create (void *cls, const struct GNUNET_PeerIdentity *peer,
117 const struct GNUNET_MessageHeader *message); 117 const struct GNUNET_MessageHeader *message);
118 118
119/** 119/**
@@ -127,7 +127,7 @@ GMC_handle_create (void *cls, const struct GNUNET_PeerIdentity *peer,
127 * GNUNET_SYSERR to close it (signal serious error) 127 * GNUNET_SYSERR to close it (signal serious error)
128 */ 128 */
129int 129int
130GMC_handle_confirm (void *cls, const struct GNUNET_PeerIdentity *peer, 130GCC_handle_confirm (void *cls, const struct GNUNET_PeerIdentity *peer,
131 const struct GNUNET_MessageHeader *message); 131 const struct GNUNET_MessageHeader *message);
132 132
133/** 133/**
@@ -141,7 +141,7 @@ GMC_handle_confirm (void *cls, const struct GNUNET_PeerIdentity *peer,
141 * GNUNET_SYSERR to close it (signal serious error) 141 * GNUNET_SYSERR to close it (signal serious error)
142 */ 142 */
143int 143int
144GMC_handle_broken (void* cls, 144GCC_handle_broken (void* cls,
145 const struct GNUNET_PeerIdentity* id, 145 const struct GNUNET_PeerIdentity* id,
146 const struct GNUNET_MessageHeader* message); 146 const struct GNUNET_MessageHeader* message);
147 147
@@ -156,7 +156,7 @@ GMC_handle_broken (void* cls,
156 * GNUNET_SYSERR to close it (signal serious error) 156 * GNUNET_SYSERR to close it (signal serious error)
157 */ 157 */
158int 158int
159GMC_handle_destroy (void *cls, const struct GNUNET_PeerIdentity *peer, 159GCC_handle_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
160 const struct GNUNET_MessageHeader *message); 160 const struct GNUNET_MessageHeader *message);
161 161
162/** 162/**
@@ -170,7 +170,7 @@ GMC_handle_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
170 * GNUNET_SYSERR to close it (signal serious error) 170 * GNUNET_SYSERR to close it (signal serious error)
171 */ 171 */
172int 172int
173GMC_handle_encrypted (void *cls, const struct GNUNET_PeerIdentity *peer, 173GCC_handle_encrypted (void *cls, const struct GNUNET_PeerIdentity *peer,
174 const struct GNUNET_MessageHeader *message); 174 const struct GNUNET_MessageHeader *message);
175 175
176/** 176/**
@@ -184,7 +184,7 @@ GMC_handle_encrypted (void *cls, const struct GNUNET_PeerIdentity *peer,
184 * GNUNET_SYSERR to close it (signal serious error) 184 * GNUNET_SYSERR to close it (signal serious error)
185 */ 185 */
186int 186int
187GMC_handle_kx (void *cls, const struct GNUNET_PeerIdentity *peer, 187GCC_handle_kx (void *cls, const struct GNUNET_PeerIdentity *peer,
188 const struct GNUNET_MessageHeader *message); 188 const struct GNUNET_MessageHeader *message);
189 189
190/** 190/**
@@ -198,7 +198,7 @@ GMC_handle_kx (void *cls, const struct GNUNET_PeerIdentity *peer,
198 * GNUNET_SYSERR to close it (signal serious error) 198 * GNUNET_SYSERR to close it (signal serious error)
199 */ 199 */
200int 200int
201GMC_handle_ack (void *cls, const struct GNUNET_PeerIdentity *peer, 201GCC_handle_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
202 const struct GNUNET_MessageHeader *message); 202 const struct GNUNET_MessageHeader *message);
203 203
204/** 204/**
@@ -212,7 +212,7 @@ GMC_handle_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
212 * GNUNET_SYSERR to close it (signal serious error) 212 * GNUNET_SYSERR to close it (signal serious error)
213 */ 213 */
214int 214int
215GMC_handle_poll (void *cls, const struct GNUNET_PeerIdentity *peer, 215GCC_handle_poll (void *cls, const struct GNUNET_PeerIdentity *peer,
216 const struct GNUNET_MessageHeader *message); 216 const struct GNUNET_MessageHeader *message);
217 217
218/** 218/**
@@ -227,7 +227,7 @@ GMC_handle_poll (void *cls, const struct GNUNET_PeerIdentity *peer,
227 * TODO: Check who we got this from, to validate route. 227 * TODO: Check who we got this from, to validate route.
228 */ 228 */
229int 229int
230GMC_handle_keepalive (void *cls, const struct GNUNET_PeerIdentity *peer, 230GCC_handle_keepalive (void *cls, const struct GNUNET_PeerIdentity *peer,
231 const struct GNUNET_MessageHeader *message); 231 const struct GNUNET_MessageHeader *message);
232 232
233/** 233/**
@@ -239,7 +239,7 @@ GMC_handle_keepalive (void *cls, const struct GNUNET_PeerIdentity *peer,
239 * @param force Send the ACK even if suboptimal (e.g. requested by POLL). 239 * @param force Send the ACK even if suboptimal (e.g. requested by POLL).
240 */ 240 */
241void 241void
242GMC_send_ack (struct CadetConnection *c, int fwd, int force); 242GCC_send_ack (struct CadetConnection *c, int fwd, int force);
243 243
244/** 244/**
245 * Initialize the connections subsystem 245 * Initialize the connections subsystem
@@ -247,13 +247,13 @@ GMC_send_ack (struct CadetConnection *c, int fwd, int force);
247 * @param c Configuration handle. 247 * @param c Configuration handle.
248 */ 248 */
249void 249void
250GMC_init (const struct GNUNET_CONFIGURATION_Handle *c); 250GCC_init (const struct GNUNET_CONFIGURATION_Handle *c);
251 251
252/** 252/**
253 * Shut down the connections subsystem. 253 * Shut down the connections subsystem.
254 */ 254 */
255void 255void
256GMC_shutdown (void); 256GCC_shutdown (void);
257 257
258/** 258/**
259 * Create a connection. 259 * Create a connection.
@@ -266,7 +266,7 @@ GMC_shutdown (void);
266 * @return Newly created connection, NULL in case of error (own id not in path). 266 * @return Newly created connection, NULL in case of error (own id not in path).
267 */ 267 */
268struct CadetConnection * 268struct CadetConnection *
269GMC_new (const struct GNUNET_CADET_Hash *cid, 269GCC_new (const struct GNUNET_CADET_Hash *cid,
270 struct CadetTunnel3 *t, 270 struct CadetTunnel3 *t,
271 struct CadetPeerPath *p, 271 struct CadetPeerPath *p,
272 unsigned int own_pos); 272 unsigned int own_pos);
@@ -280,7 +280,7 @@ GMC_new (const struct GNUNET_CADET_Hash *cid,
280 * @param c Connection to destroy. 280 * @param c Connection to destroy.
281 */ 281 */
282void 282void
283GMC_destroy (struct CadetConnection *c); 283GCC_destroy (struct CadetConnection *c);
284 284
285/** 285/**
286 * Get the connection ID. 286 * Get the connection ID.
@@ -290,7 +290,7 @@ GMC_destroy (struct CadetConnection *c);
290 * @return ID of the connection. 290 * @return ID of the connection.
291 */ 291 */
292const struct GNUNET_CADET_Hash * 292const struct GNUNET_CADET_Hash *
293GMC_get_id (const struct CadetConnection *c); 293GCC_get_id (const struct CadetConnection *c);
294 294
295 295
296/** 296/**
@@ -301,7 +301,7 @@ GMC_get_id (const struct CadetConnection *c);
301 * @return Hash expanded from the ID of the connection. 301 * @return Hash expanded from the ID of the connection.
302 */ 302 */
303const struct GNUNET_HashCode * 303const struct GNUNET_HashCode *
304GMC_get_h (const struct CadetConnection *c); 304GCC_get_h (const struct CadetConnection *c);
305 305
306 306
307/** 307/**
@@ -312,7 +312,7 @@ GMC_get_h (const struct CadetConnection *c);
312 * @return path used by the connection. 312 * @return path used by the connection.
313 */ 313 */
314const struct CadetPeerPath * 314const struct CadetPeerPath *
315GMC_get_path (const struct CadetConnection *c); 315GCC_get_path (const struct CadetConnection *c);
316 316
317/** 317/**
318 * Get the connection state. 318 * Get the connection state.
@@ -322,7 +322,7 @@ GMC_get_path (const struct CadetConnection *c);
322 * @return state of the connection. 322 * @return state of the connection.
323 */ 323 */
324enum CadetConnectionState 324enum CadetConnectionState
325GMC_get_state (const struct CadetConnection *c); 325GCC_get_state (const struct CadetConnection *c);
326 326
327/** 327/**
328 * Get the connection tunnel. 328 * Get the connection tunnel.
@@ -332,7 +332,7 @@ GMC_get_state (const struct CadetConnection *c);
332 * @return tunnel of the connection. 332 * @return tunnel of the connection.
333 */ 333 */
334struct CadetTunnel3 * 334struct CadetTunnel3 *
335GMC_get_tunnel (const struct CadetConnection *c); 335GCC_get_tunnel (const struct CadetConnection *c);
336 336
337/** 337/**
338 * Get free buffer space in a connection. 338 * Get free buffer space in a connection.
@@ -343,7 +343,7 @@ GMC_get_tunnel (const struct CadetConnection *c);
343 * @return Free buffer space [0 - max_msgs_queue/max_connections] 343 * @return Free buffer space [0 - max_msgs_queue/max_connections]
344 */ 344 */
345unsigned int 345unsigned int
346GMC_get_buffer (struct CadetConnection *c, int fwd); 346GCC_get_buffer (struct CadetConnection *c, int fwd);
347 347
348/** 348/**
349 * Get how many messages have we allowed to send to us from a direction. 349 * Get how many messages have we allowed to send to us from a direction.
@@ -354,7 +354,7 @@ GMC_get_buffer (struct CadetConnection *c, int fwd);
354 * @return last_ack_sent - last_pid_recv 354 * @return last_ack_sent - last_pid_recv
355 */ 355 */
356unsigned int 356unsigned int
357GMC_get_allowed (struct CadetConnection *c, int fwd); 357GCC_get_allowed (struct CadetConnection *c, int fwd);
358 358
359/** 359/**
360 * Get messages queued in a connection. 360 * Get messages queued in a connection.
@@ -365,7 +365,7 @@ GMC_get_allowed (struct CadetConnection *c, int fwd);
365 * @return Number of messages queued. 365 * @return Number of messages queued.
366 */ 366 */
367unsigned int 367unsigned int
368GMC_get_qn (struct CadetConnection *c, int fwd); 368GCC_get_qn (struct CadetConnection *c, int fwd);
369 369
370/** 370/**
371 * Get next PID to use. 371 * Get next PID to use.
@@ -376,7 +376,7 @@ GMC_get_qn (struct CadetConnection *c, int fwd);
376 * @return Last PID used + 1. 376 * @return Last PID used + 1.
377 */ 377 */
378unsigned int 378unsigned int
379GMC_get_pid (struct CadetConnection *c, int fwd); 379GCC_get_pid (struct CadetConnection *c, int fwd);
380 380
381/** 381/**
382 * Allow the connection to advertise a buffer of the given size. 382 * Allow the connection to advertise a buffer of the given size.
@@ -389,7 +389,7 @@ GMC_get_pid (struct CadetConnection *c, int fwd);
389 * @param fwd Is this about FWD traffic? (The ack will go dest->root). 389 * @param fwd Is this about FWD traffic? (The ack will go dest->root).
390 */ 390 */
391void 391void
392GMC_allow (struct CadetConnection *c, unsigned int buffer, int fwd); 392GCC_allow (struct CadetConnection *c, unsigned int buffer, int fwd);
393 393
394/** 394/**
395 * Send FWD keepalive packets for a connection. 395 * Send FWD keepalive packets for a connection.
@@ -398,7 +398,7 @@ GMC_allow (struct CadetConnection *c, unsigned int buffer, int fwd);
398 * @param tc Notification context. 398 * @param tc Notification context.
399 */ 399 */
400void 400void
401GMC_fwd_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 401GCC_fwd_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
402 402
403/** 403/**
404 * Send BCK keepalive packets for a connection. 404 * Send BCK keepalive packets for a connection.
@@ -407,7 +407,7 @@ GMC_fwd_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
407 * @param tc Notification context. 407 * @param tc Notification context.
408 */ 408 */
409void 409void
410GMC_bck_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 410GCC_bck_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
411 411
412 412
413/** 413/**
@@ -418,7 +418,7 @@ GMC_bck_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
418 * @param peer Peer that disconnected. 418 * @param peer Peer that disconnected.
419 */ 419 */
420void 420void
421GMC_notify_broken (struct CadetConnection *c, 421GCC_notify_broken (struct CadetConnection *c,
422 struct CadetPeer *peer); 422 struct CadetPeer *peer);
423 423
424/** 424/**
@@ -430,7 +430,7 @@ GMC_notify_broken (struct CadetConnection *c,
430 * @return #GNUNET_YES if origin, #GNUNET_NO if relay/terminal. 430 * @return #GNUNET_YES if origin, #GNUNET_NO if relay/terminal.
431 */ 431 */
432int 432int
433GMC_is_origin (struct CadetConnection *c, int fwd); 433GCC_is_origin (struct CadetConnection *c, int fwd);
434 434
435/** 435/**
436 * Is this peer the last one on the connection? 436 * Is this peer the last one on the connection?
@@ -442,7 +442,7 @@ GMC_is_origin (struct CadetConnection *c, int fwd);
442 * @return #GNUNET_YES if terminal, #GNUNET_NO if relay/origin. 442 * @return #GNUNET_YES if terminal, #GNUNET_NO if relay/origin.
443 */ 443 */
444int 444int
445GMC_is_terminal (struct CadetConnection *c, int fwd); 445GCC_is_terminal (struct CadetConnection *c, int fwd);
446 446
447/** 447/**
448 * See if we are allowed to send by the next hop in the given direction. 448 * See if we are allowed to send by the next hop in the given direction.
@@ -453,7 +453,7 @@ GMC_is_terminal (struct CadetConnection *c, int fwd);
453 * @return #GNUNET_YES in case it's OK to send. 453 * @return #GNUNET_YES in case it's OK to send.
454 */ 454 */
455int 455int
456GMC_is_sendable (struct CadetConnection *c, int fwd); 456GCC_is_sendable (struct CadetConnection *c, int fwd);
457 457
458/** 458/**
459 * Check if this connection is a direct one (never trim a direct connection). 459 * Check if this connection is a direct one (never trim a direct connection).
@@ -463,7 +463,7 @@ GMC_is_sendable (struct CadetConnection *c, int fwd);
463 * @return #GNUNET_YES in case it's a direct connection, #GNUNET_NO otherwise. 463 * @return #GNUNET_YES in case it's a direct connection, #GNUNET_NO otherwise.
464 */ 464 */
465int 465int
466GMC_is_direct (struct CadetConnection *c); 466GCC_is_direct (struct CadetConnection *c);
467 467
468/** 468/**
469 * Cancel a previously sent message while it's in the queue. 469 * Cancel a previously sent message while it's in the queue.
@@ -475,7 +475,7 @@ GMC_is_direct (struct CadetConnection *c);
475 * @param q Handle to the queue. 475 * @param q Handle to the queue.
476 */ 476 */
477void 477void
478GMC_cancel (struct CadetConnectionQueue *q); 478GCC_cancel (struct CadetConnectionQueue *q);
479 479
480/** 480/**
481 * Sends an already built message on a connection, properly registering 481 * Sends an already built message on a connection, properly registering
@@ -495,10 +495,10 @@ GMC_cancel (struct CadetConnectionQueue *q);
495 * Invalid on @c cont call. 495 * Invalid on @c cont call.
496 */ 496 */
497struct CadetConnectionQueue * 497struct CadetConnectionQueue *
498GMC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, 498GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
499 uint16_t payload_type, uint32_t payload_id, 499 uint16_t payload_type, uint32_t payload_id,
500 struct CadetConnection *c, int fwd, int force, 500 struct CadetConnection *c, int fwd, int force,
501 GMC_sent cont, void *cont_cls); 501 GCC_sent cont, void *cont_cls);
502 502
503/** 503/**
504 * Sends a CREATE CONNECTION message for a path to a peer. 504 * Sends a CREATE CONNECTION message for a path to a peer.
@@ -507,7 +507,7 @@ GMC_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
507 * @param connection Connection to create. 507 * @param connection Connection to create.
508 */ 508 */
509void 509void
510GMC_send_create (struct CadetConnection *connection); 510GCC_send_create (struct CadetConnection *connection);
511 511
512/** 512/**
513 * Send a message to all peers in this connection that the connection 513 * Send a message to all peers in this connection that the connection
@@ -519,7 +519,7 @@ GMC_send_create (struct CadetConnection *connection);
519 * @param c The connection whose peers to notify. 519 * @param c The connection whose peers to notify.
520 */ 520 */
521void 521void
522GMC_send_destroy (struct CadetConnection *c); 522GCC_send_destroy (struct CadetConnection *c);
523 523
524/** 524/**
525 * @brief Start a polling timer for the connection. 525 * @brief Start a polling timer for the connection.
@@ -532,7 +532,7 @@ GMC_send_destroy (struct CadetConnection *c);
532 * @param fwd Should we poll in the FWD direction? 532 * @param fwd Should we poll in the FWD direction?
533 */ 533 */
534void 534void
535GMC_start_poll (struct CadetConnection *c, int fwd); 535GCC_start_poll (struct CadetConnection *c, int fwd);
536 536
537 537
538/** 538/**
@@ -544,7 +544,7 @@ GMC_start_poll (struct CadetConnection *c, int fwd);
544 * @param fwd Should we stop the poll in the FWD direction? 544 * @param fwd Should we stop the poll in the FWD direction?
545 */ 545 */
546void 546void
547GMC_stop_poll (struct CadetConnection *c, int fwd); 547GCC_stop_poll (struct CadetConnection *c, int fwd);
548 548
549/** 549/**
550 * Get a (static) string for a connection. 550 * Get a (static) string for a connection.
@@ -552,7 +552,7 @@ GMC_stop_poll (struct CadetConnection *c, int fwd);
552 * @param c Connection. 552 * @param c Connection.
553 */ 553 */
554const char * 554const char *
555GMC_2s (const struct CadetConnection *c); 555GCC_2s (const struct CadetConnection *c);
556 556
557#if 0 /* keep Emacsens' auto-indent happy */ 557#if 0 /* keep Emacsens' auto-indent happy */
558{ 558{