diff options
-rw-r--r-- | src/include/gnunet_connection_lib.h | 19 | ||||
-rw-r--r-- | src/include/gnunet_transport_service.h | 184 |
2 files changed, 100 insertions, 103 deletions
diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index ed9ca9167..0051e5fb5 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h | |||
@@ -273,18 +273,19 @@ GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *connection); | |||
273 | 273 | ||
274 | 274 | ||
275 | /** | 275 | /** |
276 | * Function called to notify a client about the connection | 276 | * Function called to notify a client about the connection begin ready |
277 | * begin ready to queue more data. "buf" will be | 277 | * to queue more data. @a buf will be NULL and @a size zero if the |
278 | * NULL and "size" zero if the connection was closed for | 278 | * connection was closed for writing in the meantime. |
279 | * writing in the meantime. | ||
280 | * | 279 | * |
281 | * @param cls closure | 280 | * @param cls closure |
282 | * @param size number of bytes available in buf | 281 | * @param size number of bytes available in @a buf |
283 | * @param buf where the callee should write the message | 282 | * @param buf where the callee should write the message |
284 | * @return number of bytes written to buf | 283 | * @return number of bytes written to @a buf |
285 | */ | 284 | */ |
286 | typedef size_t (*GNUNET_CONNECTION_TransmitReadyNotify) (void *cls, size_t size, | 285 | typedef size_t |
287 | void *buf); | 286 | (*GNUNET_CONNECTION_TransmitReadyNotify) (void *cls, |
287 | size_t size, | ||
288 | void *buf); | ||
288 | 289 | ||
289 | 290 | ||
290 | /** | 291 | /** |
@@ -298,7 +299,7 @@ struct GNUNET_CONNECTION_TransmitHandle; | |||
298 | * are free in the transmission buffer. May call the notify | 299 | * are free in the transmission buffer. May call the notify |
299 | * method immediately if enough space is available. Note that | 300 | * method immediately if enough space is available. Note that |
300 | * this function will abort if "size" is greater than | 301 | * this function will abort if "size" is greater than |
301 | * GNUNET_SERVER_MAX_MESSAGE_SIZE. | 302 | * #GNUNET_SERVER_MAX_MESSAGE_SIZE. |
302 | * | 303 | * |
303 | * Note that "notify" will be called either when enough | 304 | * Note that "notify" will be called either when enough |
304 | * buffer space is available OR when the connection is destroyed. | 305 | * buffer space is available OR when the connection is destroyed. |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 989a33d16..7b94f2209 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors) | 3 | (C) 2009-2014 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -206,6 +206,7 @@ enum GNUNET_TRANSPORT_PeerState | |||
206 | GNUNET_TRANSPORT_PS_DISCONNECT_FINISHED | 206 | GNUNET_TRANSPORT_PS_DISCONNECT_FINISHED |
207 | }; | 207 | }; |
208 | 208 | ||
209 | |||
209 | /** | 210 | /** |
210 | * Current state of a validation process | 211 | * Current state of a validation process |
211 | */ | 212 | */ |
@@ -244,9 +245,10 @@ enum GNUNET_TRANSPORT_ValidationState | |||
244 | * | 245 | * |
245 | * The validation entry is getting removed due to a failed validation | 246 | * The validation entry is getting removed due to a failed validation |
246 | */ | 247 | */ |
247 | GNUNET_TRANSPORT_VS_REMOVE, | 248 | GNUNET_TRANSPORT_VS_REMOVE |
248 | }; | 249 | }; |
249 | 250 | ||
251 | |||
250 | /** | 252 | /** |
251 | * Function called by the transport for each received message. | 253 | * Function called by the transport for each received message. |
252 | * | 254 | * |
@@ -254,14 +256,12 @@ enum GNUNET_TRANSPORT_ValidationState | |||
254 | * @param peer (claimed) identity of the other peer | 256 | * @param peer (claimed) identity of the other peer |
255 | * @param message the message | 257 | * @param message the message |
256 | * @param ats performance data | 258 | * @param ats performance data |
257 | * @param ats_count number of entries in ats | 259 | * @param ats_count number of entries in @a ats |
258 | */ | 260 | */ |
259 | typedef void (*GNUNET_TRANSPORT_ReceiveCallback) (void *cls, | 261 | typedef void |
260 | const struct | 262 | (*GNUNET_TRANSPORT_ReceiveCallback) (void *cls, |
261 | GNUNET_PeerIdentity * peer, | 263 | const struct GNUNET_PeerIdentity *peer, |
262 | const struct | 264 | const struct GNUNET_MessageHeader *message); |
263 | GNUNET_MessageHeader * | ||
264 | message); | ||
265 | 265 | ||
266 | 266 | ||
267 | /** | 267 | /** |
@@ -277,11 +277,11 @@ struct GNUNET_TRANSPORT_Handle; | |||
277 | * @param cls closure | 277 | * @param cls closure |
278 | * @param peer the peer that connected | 278 | * @param peer the peer that connected |
279 | * @param ats performance data | 279 | * @param ats performance data |
280 | * @param ats_count number of entries in ats (excluding 0-termination) | 280 | * @param ats_count number of entries in @a ats (excluding 0-termination) |
281 | */ | 281 | */ |
282 | typedef void (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, | 282 | typedef void |
283 | const struct GNUNET_PeerIdentity | 283 | (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, |
284 | * peer); | 284 | const struct GNUNET_PeerIdentity *peer); |
285 | 285 | ||
286 | /** | 286 | /** |
287 | * Function called to notify transport users that another | 287 | * Function called to notify transport users that another |
@@ -290,9 +290,9 @@ typedef void (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, | |||
290 | * @param cls closure | 290 | * @param cls closure |
291 | * @param peer the peer that disconnected | 291 | * @param peer the peer that disconnected |
292 | */ | 292 | */ |
293 | typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls, | 293 | typedef void |
294 | const struct | 294 | (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls, |
295 | GNUNET_PeerIdentity * peer); | 295 | const struct GNUNET_PeerIdentity *peer); |
296 | 296 | ||
297 | 297 | ||
298 | /** | 298 | /** |
@@ -300,11 +300,12 @@ typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls, | |||
300 | * | 300 | * |
301 | * | 301 | * |
302 | * @param cls closure | 302 | * @param cls closure |
303 | * @param result GNUNET_OK if message was transmitted to transport service | 303 | * @param result #GNUNET_OK if message was transmitted to transport service |
304 | * GNUNET_SYSERR if message was not transmitted to transport service | 304 | * #GNUNET_SYSERR if message was not transmitted to transport service |
305 | */ | 305 | */ |
306 | typedef void (*GNUNET_TRANSPORT_TryConnectCallback) (void *cls, | 306 | typedef void |
307 | const int result); | 307 | (*GNUNET_TRANSPORT_TryConnectCallback) (void *cls, |
308 | const int result); | ||
308 | 309 | ||
309 | 310 | ||
310 | /** | 311 | /** |
@@ -317,14 +318,15 @@ typedef void (*GNUNET_TRANSPORT_TryConnectCallback) (void *cls, | |||
317 | * @param address NULL on error or end of iteration, | 318 | * @param address NULL on error or end of iteration, |
318 | * otherwise 0-terminated printable UTF-8 string | 319 | * otherwise 0-terminated printable UTF-8 string |
319 | */ | 320 | */ |
320 | typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls, | 321 | typedef void |
321 | const char *address); | 322 | (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls, |
323 | const char *address); | ||
322 | 324 | ||
323 | 325 | ||
324 | /** | 326 | /** |
325 | * Function to call with information about a peer | 327 | * Function to call with information about a peer |
326 | * | 328 | * |
327 | * If one_shot was set to GNUNET_YES to iterate over all peers once, | 329 | * If one_shot was set to #GNUNET_YES to iterate over all peers once, |
328 | * a final call with NULL for peer and address will follow when done. | 330 | * a final call with NULL for peer and address will follow when done. |
329 | * In this case state and timeout do not contain valid values. | 331 | * In this case state and timeout do not contain valid values. |
330 | * | 332 | * |
@@ -339,11 +341,12 @@ typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls, | |||
339 | * @param state current state this peer is in | 341 | * @param state current state this peer is in |
340 | * @param state_timeout timeout for the current state of the peer | 342 | * @param state_timeout timeout for the current state of the peer |
341 | */ | 343 | */ |
342 | typedef void (*GNUNET_TRANSPORT_PeerIterateCallback) (void *cls, | 344 | typedef void |
343 | const struct GNUNET_PeerIdentity *peer, | 345 | (*GNUNET_TRANSPORT_PeerIterateCallback) (void *cls, |
344 | const struct GNUNET_HELLO_Address *address, | 346 | const struct GNUNET_PeerIdentity *peer, |
345 | enum GNUNET_TRANSPORT_PeerState state, | 347 | const struct GNUNET_HELLO_Address *address, |
346 | struct GNUNET_TIME_Absolute state_timeout); | 348 | enum GNUNET_TRANSPORT_PeerState state, |
349 | struct GNUNET_TIME_Absolute state_timeout); | ||
347 | 350 | ||
348 | 351 | ||
349 | /** | 352 | /** |
@@ -365,14 +368,14 @@ typedef void (*GNUNET_TRANSPORT_PeerIterateCallback) (void *cls, | |||
365 | * @param next_validation time of the next validation operation | 368 | * @param next_validation time of the next validation operation |
366 | * | 369 | * |
367 | */ | 370 | */ |
368 | typedef void (*GNUNET_TRANSPORT_ValidationIterateCallback) (void *cls, | 371 | typedef void |
369 | const struct GNUNET_PeerIdentity *peer, | 372 | (*GNUNET_TRANSPORT_ValidationIterateCallback) (void *cls, |
370 | const struct GNUNET_HELLO_Address *address, | 373 | const struct GNUNET_PeerIdentity *peer, |
371 | struct GNUNET_TIME_Absolute last_validation, | 374 | const struct GNUNET_HELLO_Address *address, |
372 | struct GNUNET_TIME_Absolute valid_until, | 375 | struct GNUNET_TIME_Absolute last_validation, |
373 | struct GNUNET_TIME_Absolute next_validation, | 376 | struct GNUNET_TIME_Absolute valid_until, |
374 | enum GNUNET_TRANSPORT_ValidationState state); | 377 | struct GNUNET_TIME_Absolute next_validation, |
375 | 378 | enum GNUNET_TRANSPORT_ValidationState state); | |
376 | 379 | ||
377 | 380 | ||
378 | /** | 381 | /** |
@@ -390,7 +393,8 @@ typedef void (*GNUNET_TRANSPORT_ValidationIterateCallback) (void *cls, | |||
390 | */ | 393 | */ |
391 | struct GNUNET_TRANSPORT_Handle * | 394 | struct GNUNET_TRANSPORT_Handle * |
392 | GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 395 | GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
393 | const struct GNUNET_PeerIdentity *self, void *cls, | 396 | const struct GNUNET_PeerIdentity *self, |
397 | void *cls, | ||
394 | GNUNET_TRANSPORT_ReceiveCallback rec, | 398 | GNUNET_TRANSPORT_ReceiveCallback rec, |
395 | GNUNET_TRANSPORT_NotifyConnect nc, | 399 | GNUNET_TRANSPORT_NotifyConnect nc, |
396 | GNUNET_TRANSPORT_NotifyDisconnect nd); | 400 | GNUNET_TRANSPORT_NotifyDisconnect nd); |
@@ -419,9 +423,9 @@ struct GNUNET_TRANSPORT_TryConnectHandle; | |||
419 | * @param target who we should try to connect to | 423 | * @param target who we should try to connect to |
420 | * @param cb callback to be called when request was transmitted to transport | 424 | * @param cb callback to be called when request was transmitted to transport |
421 | * service | 425 | * service |
422 | * @param cb_cls closure for the callback | 426 | * @param cb_cls closure for the callback @a cb |
423 | * @return a GNUNET_TRANSPORT_TryConnectHandle handle or | 427 | * @return a `struct GNUNET_TRANSPORT_TryConnectHandle` handle or |
424 | * NULL on failure (cb will not be called) | 428 | * NULL on failure (@a cb will not be called) |
425 | */ | 429 | */ |
426 | struct GNUNET_TRANSPORT_TryConnectHandle * | 430 | struct GNUNET_TRANSPORT_TryConnectHandle * |
427 | GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, | 431 | GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, |
@@ -460,18 +464,19 @@ struct GNUNET_TRANSPORT_TransmitHandle; | |||
460 | * notify with buf NULL and size 0)? | 464 | * notify with buf NULL and size 0)? |
461 | * @param notify function to call when we are ready to | 465 | * @param notify function to call when we are ready to |
462 | * send such a message | 466 | * send such a message |
463 | * @param notify_cls closure for notify | 467 | * @param notify_cls closure for @a notify |
464 | * @return NULL if someone else is already waiting to be notified | 468 | * @return NULL if someone else is already waiting to be notified |
465 | * non-NULL if the notify callback was queued (can be used to cancel | 469 | * non-NULL if the notify callback was queued (can be used to cancel |
466 | * using GNUNET_TRANSPORT_notify_transmit_ready_cancel) | 470 | * using GNUNET_TRANSPORT_notify_transmit_ready_cancel) |
467 | */ | 471 | */ |
468 | struct GNUNET_TRANSPORT_TransmitHandle * | 472 | struct GNUNET_TRANSPORT_TransmitHandle * |
469 | GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle, | 473 | GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle, |
470 | const struct GNUNET_PeerIdentity | 474 | const struct GNUNET_PeerIdentity *target, |
471 | *target, size_t size, uint32_t priority, | 475 | size_t size, |
476 | uint32_t priority, | ||
472 | struct GNUNET_TIME_Relative timeout, | 477 | struct GNUNET_TIME_Relative timeout, |
473 | GNUNET_CONNECTION_TransmitReadyNotify | 478 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
474 | notify, void *notify_cls); | 479 | void *notify_cls); |
475 | 480 | ||
476 | 481 | ||
477 | /** | 482 | /** |
@@ -480,10 +485,7 @@ GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle, | |||
480 | * @param th handle of the transmission notification request to cancel | 485 | * @param th handle of the transmission notification request to cancel |
481 | */ | 486 | */ |
482 | void | 487 | void |
483 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct | 488 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct GNUNET_TRANSPORT_TransmitHandle *th); |
484 | GNUNET_TRANSPORT_TransmitHandle | ||
485 | *th); | ||
486 | |||
487 | 489 | ||
488 | 490 | ||
489 | /** | 491 | /** |
@@ -493,14 +495,13 @@ GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct | |||
493 | * @param cls closure | 495 | * @param cls closure |
494 | * @param hello our updated HELLO | 496 | * @param hello our updated HELLO |
495 | */ | 497 | */ |
496 | typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback) (void *cls, | 498 | typedef void |
497 | const struct | 499 | (*GNUNET_TRANSPORT_HelloUpdateCallback) (void *cls, |
498 | GNUNET_MessageHeader * | 500 | const struct GNUNET_MessageHeader *hello); |
499 | hello); | ||
500 | 501 | ||
501 | 502 | ||
502 | /** | 503 | /** |
503 | * Handle to cancel a 'GNUNET_TRANSPORT_get_hello' operation. | 504 | * Handle to cancel a #GNUNET_TRANSPORT_get_hello() operation. |
504 | */ | 505 | */ |
505 | struct GNUNET_TRANSPORT_GetHelloHandle; | 506 | struct GNUNET_TRANSPORT_GetHelloHandle; |
506 | 507 | ||
@@ -514,7 +515,7 @@ struct GNUNET_TRANSPORT_GetHelloHandle; | |||
514 | */ | 515 | */ |
515 | int | 516 | int |
516 | GNUNET_TRANSPORT_check_peer_connected (struct GNUNET_TRANSPORT_Handle *handle, | 517 | GNUNET_TRANSPORT_check_peer_connected (struct GNUNET_TRANSPORT_Handle *handle, |
517 | const struct GNUNET_PeerIdentity *peer); | 518 | const struct GNUNET_PeerIdentity *peer); |
518 | 519 | ||
519 | 520 | ||
520 | /** | 521 | /** |
@@ -522,14 +523,14 @@ GNUNET_TRANSPORT_check_peer_connected (struct GNUNET_TRANSPORT_Handle *handle, | |||
522 | * | 523 | * |
523 | * @param handle transport handle | 524 | * @param handle transport handle |
524 | * @param peer the peer to set the metric for | 525 | * @param peer the peer to set the metric for |
525 | * @param inbound set inbound direction (GNUNET_YES or GNUNET_NO) | 526 | * @param inbound set inbound direction (#GNUNET_YES or #GNUNET_NO) |
526 | * @param outbound set outbound direction (GNUNET_YES or GNUNET_NO) | 527 | * @param outbound set outbound direction (#GNUNET_YES or #GNUNET_NO) |
527 | * @param ats the metric as ATS information | 528 | * @param ats the metric as ATS information |
528 | * @param ats_count the number of metrics | 529 | * @param ats_count the number of metrics |
529 | * | 530 | * |
530 | * Supported ATS values: | 531 | * Supported ATS values: |
531 | * GNUNET_ATS_QUALITY_NET_DELAY (value in ms) | 532 | * #GNUNET_ATS_QUALITY_NET_DELAY (value in ms) |
532 | * GNUNET_ATS_QUALITY_NET_DISTANCE (value in count(hops)) | 533 | * #GNUNET_ATS_QUALITY_NET_DISTANCE (value in count(hops)) |
533 | * | 534 | * |
534 | * Example | 535 | * Example |
535 | * To enforce a delay of 10 ms for peer p1 in sending direction use: | 536 | * To enforce a delay of 10 ms for peer p1 in sending direction use: |
@@ -558,7 +559,7 @@ GNUNET_TRANSPORT_set_traffic_metric (struct GNUNET_TRANSPORT_Handle *handle, | |||
558 | * | 559 | * |
559 | * @param handle connection to transport service | 560 | * @param handle connection to transport service |
560 | * @param rec function to call with the HELLO | 561 | * @param rec function to call with the HELLO |
561 | * @param rec_cls closure for rec | 562 | * @param rec_cls closure for @a rec |
562 | * @return handle to cancel the operation | 563 | * @return handle to cancel the operation |
563 | */ | 564 | */ |
564 | struct GNUNET_TRANSPORT_GetHelloHandle * | 565 | struct GNUNET_TRANSPORT_GetHelloHandle * |
@@ -584,8 +585,8 @@ GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_GetHelloHandle *ghh); | |||
584 | * @param handle connection to transport service | 585 | * @param handle connection to transport service |
585 | * @param hello the hello message | 586 | * @param hello the hello message |
586 | * @param cont continuation to call when HELLO has been sent, | 587 | * @param cont continuation to call when HELLO has been sent, |
587 | * tc reason GNUNET_SCHEDULER_REASON_TIMEOUT for fail | 588 | * tc reason #GNUNET_SCHEDULER_REASON_TIMEOUT for fail |
588 | * tc reasong GNUNET_SCHEDULER_REASON_READ_READY for success | 589 | * tc reasong #GNUNET_SCHEDULER_REASON_READ_READY for success |
589 | * @param cls closure for continuation | 590 | * @param cls closure for continuation |
590 | * @return a GNUNET_TRANSPORT_OfferHelloHandle handle or NULL on failure, | 591 | * @return a GNUNET_TRANSPORT_OfferHelloHandle handle or NULL on failure, |
591 | * in case of failure cont will not be called | 592 | * in case of failure cont will not be called |
@@ -600,7 +601,7 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
600 | /** | 601 | /** |
601 | * Cancel the request to transport to offer the HELLO message | 602 | * Cancel the request to transport to offer the HELLO message |
602 | * | 603 | * |
603 | * @param ohh the GNUNET_TRANSPORT_OfferHelloHandle to cancel | 604 | * @param ohh the `struct GNUNET_TRANSPORT_OfferHelloHandle` to cancel |
604 | */ | 605 | */ |
605 | void | 606 | void |
606 | GNUNET_TRANSPORT_offer_hello_cancel (struct GNUNET_TRANSPORT_OfferHelloHandle *ohh); | 607 | GNUNET_TRANSPORT_offer_hello_cancel (struct GNUNET_TRANSPORT_OfferHelloHandle *ohh); |
@@ -621,17 +622,16 @@ struct GNUNET_TRANSPORT_AddressToStringContext; | |||
621 | * (otherwise do reverse DNS lookup) | 622 | * (otherwise do reverse DNS lookup) |
622 | * @param timeout how long is the lookup allowed to take at most | 623 | * @param timeout how long is the lookup allowed to take at most |
623 | * @param aluc function to call with the results | 624 | * @param aluc function to call with the results |
624 | * @param aluc_cls closure for aluc | 625 | * @param aluc_cls closure for @a aluc |
625 | * @return handle to cancel the operation, NULL on error | 626 | * @return handle to cancel the operation, NULL on error |
626 | */ | 627 | */ |
627 | struct GNUNET_TRANSPORT_AddressToStringContext * | 628 | struct GNUNET_TRANSPORT_AddressToStringContext * |
628 | GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle | 629 | GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cfg, |
629 | *cfg, | ||
630 | const struct GNUNET_HELLO_Address *address, | 630 | const struct GNUNET_HELLO_Address *address, |
631 | int numeric, | 631 | int numeric, |
632 | struct GNUNET_TIME_Relative timeout, | 632 | struct GNUNET_TIME_Relative timeout, |
633 | GNUNET_TRANSPORT_AddressToStringCallback | 633 | GNUNET_TRANSPORT_AddressToStringCallback aluc, |
634 | aluc, void *aluc_cls); | 634 | void *aluc_cls); |
635 | 635 | ||
636 | 636 | ||
637 | /** | 637 | /** |
@@ -640,9 +640,8 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle | |||
640 | * @param pic the context handle | 640 | * @param pic the context handle |
641 | */ | 641 | */ |
642 | void | 642 | void |
643 | GNUNET_TRANSPORT_address_to_string_cancel (struct | 643 | GNUNET_TRANSPORT_address_to_string_cancel (struct GNUNET_TRANSPORT_AddressToStringContext *pic); |
644 | GNUNET_TRANSPORT_AddressToStringContext | 644 | |
645 | *pic); | ||
646 | 645 | ||
647 | /** | 646 | /** |
648 | * Convert a transport state to a human readable string. | 647 | * Convert a transport state to a human readable string. |
@@ -657,7 +656,7 @@ GNUNET_TRANSPORT_ps2s (enum GNUNET_TRANSPORT_PeerState state); | |||
657 | * Check if a state is defined as connected | 656 | * Check if a state is defined as connected |
658 | * | 657 | * |
659 | * @param state the state value | 658 | * @param state the state value |
660 | * @return GNUNET_YES or GNUNET_NO | 659 | * @return #GNUNET_YES or #GNUNET_NO |
661 | */ | 660 | */ |
662 | int | 661 | int |
663 | GNUNET_TRANSPORT_is_connected (enum GNUNET_TRANSPORT_PeerState state); | 662 | GNUNET_TRANSPORT_is_connected (enum GNUNET_TRANSPORT_PeerState state); |
@@ -694,15 +693,14 @@ GNUNET_TRANSPORT_vs2s (enum GNUNET_TRANSPORT_ValidationState state); | |||
694 | * @param cfg configuration to use | 693 | * @param cfg configuration to use |
695 | * @param peer a specific peer identity to obtain information for, | 694 | * @param peer a specific peer identity to obtain information for, |
696 | * NULL for all peers | 695 | * NULL for all peers |
697 | * @param one_shot GNUNET_YES to return the current state and then end (with NULL+NULL), | 696 | * @param one_shot #GNUNET_YES to return the current state and then end (with NULL+NULL), |
698 | * GNUNET_NO to monitor peers continuously | 697 | * #GNUNET_NO to monitor peers continuously |
699 | * @param timeout how long is the lookup allowed to take at most | 698 | * @param timeout how long is the lookup allowed to take at most |
700 | * @param peer_callback function to call with the results | 699 | * @param peer_callback function to call with the results |
701 | * @param peer_callback_cls closure for peer_address_callback | 700 | * @param peer_callback_cls closure for @a peer_callback |
702 | */ | 701 | */ |
703 | struct GNUNET_TRANSPORT_PeerMonitoringContext * | 702 | struct GNUNET_TRANSPORT_PeerMonitoringContext * |
704 | GNUNET_TRANSPORT_monitor_peers (const struct | 703 | GNUNET_TRANSPORT_monitor_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, |
705 | GNUNET_CONFIGURATION_Handle *cfg, | ||
706 | const struct GNUNET_PeerIdentity *peer, | 704 | const struct GNUNET_PeerIdentity *peer, |
707 | int one_shot, | 705 | int one_shot, |
708 | struct GNUNET_TIME_Relative timeout, | 706 | struct GNUNET_TIME_Relative timeout, |
@@ -719,7 +717,6 @@ void | |||
719 | GNUNET_TRANSPORT_monitor_peers_cancel (struct GNUNET_TRANSPORT_PeerMonitoringContext *pic); | 717 | GNUNET_TRANSPORT_monitor_peers_cancel (struct GNUNET_TRANSPORT_PeerMonitoringContext *pic); |
720 | 718 | ||
721 | 719 | ||
722 | |||
723 | /** | 720 | /** |
724 | * Return information about pending address validation operations for a specific | 721 | * Return information about pending address validation operations for a specific |
725 | * or all peers | 722 | * or all peers |
@@ -727,20 +724,19 @@ GNUNET_TRANSPORT_monitor_peers_cancel (struct GNUNET_TRANSPORT_PeerMonitoringCon | |||
727 | * @param cfg configuration to use | 724 | * @param cfg configuration to use |
728 | * @param peer a specific peer identity to obtain validation entries for, | 725 | * @param peer a specific peer identity to obtain validation entries for, |
729 | * NULL for all peers | 726 | * NULL for all peers |
730 | * @param one_shot GNUNET_YES to return all entries and then end (with NULL+NULL), | 727 | * @param one_shot #GNUNET_YES to return all entries and then end (with NULL+NULL), |
731 | * GNUNET_NO to monitor validation entries continuously | 728 | * #GNUNET_NO to monitor validation entries continuously |
732 | * @param timeout how long is the lookup allowed to take at most | 729 | * @param timeout how long is the lookup allowed to take at most |
733 | * @param validation_callback function to call with the results | 730 | * @param validation_callback function to call with the results |
734 | * @param validation_callback_cls closure for peer_address_callback | 731 | * @param validation_callback_cls closure for @a validation_callback |
735 | */ | 732 | */ |
736 | struct GNUNET_TRANSPORT_ValidationMonitoringContext * | 733 | struct GNUNET_TRANSPORT_ValidationMonitoringContext * |
737 | GNUNET_TRANSPORT_monitor_validation_entries (const struct | 734 | GNUNET_TRANSPORT_monitor_validation_entries (const struct GNUNET_CONFIGURATION_Handle *cfg, |
738 | GNUNET_CONFIGURATION_Handle *cfg, | 735 | const struct GNUNET_PeerIdentity *peer, |
739 | const struct GNUNET_PeerIdentity *peer, | 736 | int one_shot, |
740 | int one_shot, | 737 | struct GNUNET_TIME_Relative timeout, |
741 | struct GNUNET_TIME_Relative timeout, | 738 | GNUNET_TRANSPORT_ValidationIterateCallback validation_callback, |
742 | GNUNET_TRANSPORT_ValidationIterateCallback validation_callback, | 739 | void *validation_callback_cls); |
743 | void *validation_callback_cls); | ||
744 | 740 | ||
745 | 741 | ||
746 | /** | 742 | /** |
@@ -752,7 +748,6 @@ void | |||
752 | GNUNET_TRANSPORT_monitor_validation_entries_cancel (struct GNUNET_TRANSPORT_ValidationMonitoringContext *vic); | 748 | GNUNET_TRANSPORT_monitor_validation_entries_cancel (struct GNUNET_TRANSPORT_ValidationMonitoringContext *vic); |
753 | 749 | ||
754 | 750 | ||
755 | |||
756 | /** | 751 | /** |
757 | * Handle for blacklisting peers. | 752 | * Handle for blacklisting peers. |
758 | */ | 753 | */ |
@@ -764,11 +759,12 @@ struct GNUNET_TRANSPORT_Blacklist; | |||
764 | * | 759 | * |
765 | * @param cls closure | 760 | * @param cls closure |
766 | * @param pid peer to approve or disapproave | 761 | * @param pid peer to approve or disapproave |
767 | * @return GNUNET_OK if the connection is allowed, GNUNET_SYSERR if not | 762 | * @return #GNUNET_OK if the connection is allowed, #GNUNET_SYSERR if not |
768 | */ | 763 | */ |
769 | typedef int (*GNUNET_TRANSPORT_BlacklistCallback) (void *cls, | 764 | typedef int |
770 | const struct | 765 | (*GNUNET_TRANSPORT_BlacklistCallback) (void *cls, |
771 | GNUNET_PeerIdentity * pid); | 766 | const struct |
767 | GNUNET_PeerIdentity * pid); | ||
772 | 768 | ||
773 | 769 | ||
774 | /** | 770 | /** |
@@ -782,7 +778,7 @@ typedef int (*GNUNET_TRANSPORT_BlacklistCallback) (void *cls, | |||
782 | * | 778 | * |
783 | * @param cfg configuration to use | 779 | * @param cfg configuration to use |
784 | * @param cb callback to invoke to check if connections are allowed | 780 | * @param cb callback to invoke to check if connections are allowed |
785 | * @param cb_cls closure for cb | 781 | * @param cb_cls closure for @a cb |
786 | * @return NULL on error, otherwise handle for cancellation | 782 | * @return NULL on error, otherwise handle for cancellation |
787 | */ | 783 | */ |
788 | struct GNUNET_TRANSPORT_Blacklist * | 784 | struct GNUNET_TRANSPORT_Blacklist * |