diff options
Diffstat (limited to 'src/cadet/gnunet-service-cadet_connection.h')
-rw-r--r-- | src/cadet/gnunet-service-cadet_connection.h | 80 |
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 | */ |
100 | typedef void (*GMC_sent) (void *cls, | 100 | typedef 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 | */ |
115 | int | 115 | int |
116 | GMC_handle_create (void *cls, const struct GNUNET_PeerIdentity *peer, | 116 | GCC_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 | */ |
129 | int | 129 | int |
130 | GMC_handle_confirm (void *cls, const struct GNUNET_PeerIdentity *peer, | 130 | GCC_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 | */ |
143 | int | 143 | int |
144 | GMC_handle_broken (void* cls, | 144 | GCC_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 | */ |
158 | int | 158 | int |
159 | GMC_handle_destroy (void *cls, const struct GNUNET_PeerIdentity *peer, | 159 | GCC_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 | */ |
172 | int | 172 | int |
173 | GMC_handle_encrypted (void *cls, const struct GNUNET_PeerIdentity *peer, | 173 | GCC_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 | */ |
186 | int | 186 | int |
187 | GMC_handle_kx (void *cls, const struct GNUNET_PeerIdentity *peer, | 187 | GCC_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 | */ |
200 | int | 200 | int |
201 | GMC_handle_ack (void *cls, const struct GNUNET_PeerIdentity *peer, | 201 | GCC_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 | */ |
214 | int | 214 | int |
215 | GMC_handle_poll (void *cls, const struct GNUNET_PeerIdentity *peer, | 215 | GCC_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 | */ |
229 | int | 229 | int |
230 | GMC_handle_keepalive (void *cls, const struct GNUNET_PeerIdentity *peer, | 230 | GCC_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 | */ |
241 | void | 241 | void |
242 | GMC_send_ack (struct CadetConnection *c, int fwd, int force); | 242 | GCC_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 | */ |
249 | void | 249 | void |
250 | GMC_init (const struct GNUNET_CONFIGURATION_Handle *c); | 250 | GCC_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 | */ |
255 | void | 255 | void |
256 | GMC_shutdown (void); | 256 | GCC_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 | */ |
268 | struct CadetConnection * | 268 | struct CadetConnection * |
269 | GMC_new (const struct GNUNET_CADET_Hash *cid, | 269 | GCC_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 | */ |
282 | void | 282 | void |
283 | GMC_destroy (struct CadetConnection *c); | 283 | GCC_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 | */ |
292 | const struct GNUNET_CADET_Hash * | 292 | const struct GNUNET_CADET_Hash * |
293 | GMC_get_id (const struct CadetConnection *c); | 293 | GCC_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 | */ |
303 | const struct GNUNET_HashCode * | 303 | const struct GNUNET_HashCode * |
304 | GMC_get_h (const struct CadetConnection *c); | 304 | GCC_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 | */ |
314 | const struct CadetPeerPath * | 314 | const struct CadetPeerPath * |
315 | GMC_get_path (const struct CadetConnection *c); | 315 | GCC_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 | */ |
324 | enum CadetConnectionState | 324 | enum CadetConnectionState |
325 | GMC_get_state (const struct CadetConnection *c); | 325 | GCC_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 | */ |
334 | struct CadetTunnel3 * | 334 | struct CadetTunnel3 * |
335 | GMC_get_tunnel (const struct CadetConnection *c); | 335 | GCC_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 | */ |
345 | unsigned int | 345 | unsigned int |
346 | GMC_get_buffer (struct CadetConnection *c, int fwd); | 346 | GCC_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 | */ |
356 | unsigned int | 356 | unsigned int |
357 | GMC_get_allowed (struct CadetConnection *c, int fwd); | 357 | GCC_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 | */ |
367 | unsigned int | 367 | unsigned int |
368 | GMC_get_qn (struct CadetConnection *c, int fwd); | 368 | GCC_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 | */ |
378 | unsigned int | 378 | unsigned int |
379 | GMC_get_pid (struct CadetConnection *c, int fwd); | 379 | GCC_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 | */ |
391 | void | 391 | void |
392 | GMC_allow (struct CadetConnection *c, unsigned int buffer, int fwd); | 392 | GCC_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 | */ |
400 | void | 400 | void |
401 | GMC_fwd_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 401 | GCC_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 | */ |
409 | void | 409 | void |
410 | GMC_bck_keepalive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 410 | GCC_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 | */ |
420 | void | 420 | void |
421 | GMC_notify_broken (struct CadetConnection *c, | 421 | GCC_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 | */ |
432 | int | 432 | int |
433 | GMC_is_origin (struct CadetConnection *c, int fwd); | 433 | GCC_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 | */ |
444 | int | 444 | int |
445 | GMC_is_terminal (struct CadetConnection *c, int fwd); | 445 | GCC_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 | */ |
455 | int | 455 | int |
456 | GMC_is_sendable (struct CadetConnection *c, int fwd); | 456 | GCC_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 | */ |
465 | int | 465 | int |
466 | GMC_is_direct (struct CadetConnection *c); | 466 | GCC_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 | */ |
477 | void | 477 | void |
478 | GMC_cancel (struct CadetConnectionQueue *q); | 478 | GCC_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 | */ |
497 | struct CadetConnectionQueue * | 497 | struct CadetConnectionQueue * |
498 | GMC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | 498 | GCC_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 | */ |
509 | void | 509 | void |
510 | GMC_send_create (struct CadetConnection *connection); | 510 | GCC_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 | */ |
521 | void | 521 | void |
522 | GMC_send_destroy (struct CadetConnection *c); | 522 | GCC_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 | */ |
534 | void | 534 | void |
535 | GMC_start_poll (struct CadetConnection *c, int fwd); | 535 | GCC_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 | */ |
546 | void | 546 | void |
547 | GMC_stop_poll (struct CadetConnection *c, int fwd); | 547 | GCC_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 | */ |
554 | const char * | 554 | const char * |
555 | GMC_2s (const struct CadetConnection *c); | 555 | GCC_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 | { |