aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport_api_monitoring.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport_api_monitoring.c')
-rw-r--r--src/transport/transport_api_monitoring.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/transport/transport_api_monitoring.c b/src/transport/transport_api_monitoring.c
index 31f3d4f90..b44bf51b8 100644
--- a/src/transport/transport_api_monitoring.c
+++ b/src/transport/transport_api_monitoring.c
@@ -516,9 +516,12 @@ val_response_processor (void *cls,
516 GNUNET_break (0); 516 GNUNET_break (0);
517 if (val_ctx->one_shot) 517 if (val_ctx->one_shot)
518 { 518 {
519 val_ctx->cb (val_ctx->cb_cls, NULL, NULL, 519 val_ctx->cb (val_ctx->cb_cls,
520 GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_TIME_UNIT_ZERO_ABS, 520 NULL, NULL,
521 GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_TRANSPORT_VS_NONE); 521 GNUNET_TIME_UNIT_ZERO_ABS,
522 GNUNET_TIME_UNIT_ZERO_ABS,
523 GNUNET_TIME_UNIT_ZERO_ABS,
524 GNUNET_TRANSPORT_VS_NONE);
522 GNUNET_TRANSPORT_monitor_validation_entries_cancel (val_ctx); 525 GNUNET_TRANSPORT_monitor_validation_entries_cancel (val_ctx);
523 } 526 }
524 else 527 else
@@ -530,12 +533,16 @@ val_response_processor (void *cls,
530 533
531 /* notify client */ 534 /* notify client */
532 address = GNUNET_HELLO_address_allocate (&vr_msg->peer, 535 address = GNUNET_HELLO_address_allocate (&vr_msg->peer,
533 transport_name, addr, alen, ntohl(vr_msg->local_address_info)); 536 transport_name,
534 val_ctx->cb (val_ctx->cb_cls, &vr_msg->peer, address, 537 addr, alen,
535 GNUNET_TIME_absolute_ntoh(vr_msg->last_validation), 538 ntohl (vr_msg->local_address_info));
536 GNUNET_TIME_absolute_ntoh(vr_msg->valid_until), 539 val_ctx->cb (val_ctx->cb_cls,
537 GNUNET_TIME_absolute_ntoh(vr_msg->next_validation), 540 &vr_msg->peer,
538 ntohl(vr_msg->state)); 541 address,
542 GNUNET_TIME_absolute_ntoh (vr_msg->last_validation),
543 GNUNET_TIME_absolute_ntoh (vr_msg->valid_until),
544 GNUNET_TIME_absolute_ntoh (vr_msg->next_validation),
545 ntohl(vr_msg->state));
539 GNUNET_HELLO_address_free (address); 546 GNUNET_HELLO_address_free (address);
540 } 547 }
541 /* expect more replies */ 548 /* expect more replies */
@@ -777,20 +784,19 @@ GNUNET_TRANSPORT_monitor_peers_cancel (struct GNUNET_TRANSPORT_PeerMonitoringCon
777 * @param cfg configuration to use 784 * @param cfg configuration to use
778 * @param peer a specific peer identity to obtain validation entries for, 785 * @param peer a specific peer identity to obtain validation entries for,
779 * NULL for all peers 786 * NULL for all peers
780 * @param one_shot GNUNET_YES to return all entries and then end (with NULL+NULL), 787 * @param one_shot #GNUNET_YES to return all entries and then end (with NULL+NULL),
781 * GNUNET_NO to monitor validation entries continuously 788 * #GNUNET_NO to monitor validation entries continuously
782 * @param timeout how long is the lookup allowed to take at most 789 * @param timeout how long is the lookup allowed to take at most
783 * @param validation_callback function to call with the results 790 * @param validation_callback function to call with the results
784 * @param validation_callback_cls closure for peer_address_callback 791 * @param validation_callback_cls closure for peer_address_callback
785 */ 792 */
786struct GNUNET_TRANSPORT_ValidationMonitoringContext * 793struct GNUNET_TRANSPORT_ValidationMonitoringContext *
787GNUNET_TRANSPORT_monitor_validation_entries (const struct 794GNUNET_TRANSPORT_monitor_validation_entries (const struct GNUNET_CONFIGURATION_Handle *cfg,
788 GNUNET_CONFIGURATION_Handle *cfg, 795 const struct GNUNET_PeerIdentity *peer,
789 const struct GNUNET_PeerIdentity *peer, 796 int one_shot,
790 int one_shot, 797 struct GNUNET_TIME_Relative timeout,
791 struct GNUNET_TIME_Relative timeout, 798 GNUNET_TRANSPORT_ValidationIterateCallback validation_callback,
792 GNUNET_TRANSPORT_ValidationIterateCallback validation_callback, 799 void *validation_callback_cls)
793 void *validation_callback_cls)
794{ 800{
795 struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx; 801 struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx;
796 struct GNUNET_CLIENT_Connection *client; 802 struct GNUNET_CLIENT_Connection *client;