From 180f2e637029d045e3c72dc3e13fddb1f9f30141 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 12 Aug 2011 10:00:39 +0000 Subject: [PATCH] moving API around to make ATS implementable and separable --- .../gnunet-service-transport_ats-new.c | 166 +++++++++++++++++- .../gnunet-service-transport_ats-new.h | 58 ++++++ .../gnunet-service-transport_clients.c | 7 +- .../gnunet-service-transport_neighbours.c | 38 ++-- .../gnunet-service-transport_validation.c | 162 ++++++----------- .../gnunet-service-transport_validation.h | 22 +-- 6 files changed, 293 insertions(+), 160 deletions(-) diff --git a/src/transport/gnunet-service-transport_ats-new.c b/src/transport/gnunet-service-transport_ats-new.c index 7d99ab913..3a8bc7497 100644 --- a/src/transport/gnunet-service-transport_ats-new.c +++ b/src/transport/gnunet-service-transport_ats-new.c @@ -33,6 +33,11 @@ struct AllocationRecord { + /** + * Public key of the peer. + */ + struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; + /** * Performance information associated with this address (array). */ @@ -76,6 +81,35 @@ struct AllocationRecord }; +/** + * Opaque handle to stop incremental validation address callbacks. + */ +struct GST_AtsSuggestionContext +{ + + /** + * Function to call with our final suggestion. + */ + GST_AtsAddressSuggestionCallback cb; + + /** + * Closure for 'cb'. + */ + void *cb_cls; + + /** + * Global ATS handle. + */ + struct GST_AtsHandle *atc; + + /** + * Which peer are we monitoring? + */ + struct GNUNET_PeerIdentity target; + +}; + + /** * Handle to the ATS subsystem. */ @@ -102,6 +136,12 @@ struct GST_AtsHandle */ struct GNUNET_CONTAINER_MultiHashMap *peers; + /** + * Map of PeerIdentities to 'struct GST_AtsSuggestionContext's. + */ + struct GNUNET_CONTAINER_MultiHashMap *notify_map; + + /** * Task scheduled to update our bandwidth assignment. */ @@ -227,6 +267,82 @@ update_bandwidth_assignment (struct GST_AtsHandle *atc, } +/** + * Function called with feasbile addresses we might want to suggest. + * + * @param cls the 'struct GST_AtsSuggestionContext' + * @param key identity of the peer + * @param value a 'struct AllocationRecord' for the peer + * @return GNUNET_NO if we're done, GNUNET_YES if we did not suggest an address yet + */ +static int +suggest_address (void *cls, + const GNUNET_HashCode *key, + void *value) +{ + struct GST_AtsSuggestionContest *asc = cls; + struct AllocationRecord *ar = value; + + // FIXME... + return GNUNET_YES; +} + + +/** + * We would like to establish a new connection with a peer. + * ATS should suggest a good address to begin with. + * + * @param atc handle + * @param peer identity of the new peer + * @param cb function to call with the address + * @param cb_cls closure for cb + */ +struct GST_AtsSuggestionContext * +GST_ats_suggest_address (struct GST_AtsHandle *atc, + const struct GNUNET_PeerIdentity *peer, + GST_AtsAddressSuggestionCallback cb, + void *cb_cls) +{ + struct GST_AtsSuggestionContext *asc; + + asc = GNUNET_malloc (sizeof (struct GST_AtsSuggestionContext)); + asc->cb = cb; + asc->cb_cls = cb_cls; + asc->atc = atc; + asc->target = *peer; + GNUNET_CONTAINER_multihashmap_get_multiple (atc->peers, + &peer->hashPubKey, + &suggest_address, + asc); + if (NULL == asc->cb) + { + GNUNET_free (asc); + return NULL; + } + GNUNET_CONTAINER_multihashmap_put (atc->notify_map, + &peer->hashPubKey, + asc, + GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); + return asc; +} + + +/** + * Cancel suggestion request. + * + * @param asc handle of the request to cancel + */ +void +GST_ats_suggest_address_cancel (struct GST_AtsSuggestionContext *asc) +{ + GNUNET_assert (GNUNET_OK == + GNUNET_CONTAINER_multihashmap_remove (asc->atc->notify_map, + &asc->target.hashPubKey, + asc)); + GNUNET_free (asc); +} + + /** * Initialize the ATS subsystem. * @@ -294,6 +410,9 @@ GST_ats_shutdown (struct GST_AtsHandle *atc) &destroy_allocation_record, NULL); GNUNET_CONTAINER_multihashmap_destroy (atc->peers); + GNUNET_assert (GNUNET_CONTAINER_multihashmap_size (atc->notify_map) == 0); + GNUNET_CONTAINER_multihashmap_destroy (atc->notify_map); + atc->notify_map = NULL; GNUNET_free (atc); } @@ -377,7 +496,8 @@ update_session (void *cls, * @param ats_count number of performance records in 'ats' */ static struct AllocationRecord * -create_allocation_record (const char *plugin_name, +create_allocation_record (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, + const char *plugin_name, struct Session *session, const void *plugin_addr, size_t plugin_addr_len, @@ -387,6 +507,7 @@ create_allocation_record (const char *plugin_name, struct AllocationRecord *ar; ar = GNUNET_malloc (sizeof (struct AllocationRecord) + plugin_addr_len); + ar->public_key = *public_key; ar->plugin_name = GNUNET_strdup (plugin_name); ar->plugin_addr = &ar[1]; memcpy (&ar[1], plugin_addr, plugin_addr_len); @@ -433,6 +554,7 @@ disconnect_peer (void *cls, * Calculate bandwidth assignments including the new peer. * * @param atc handle + * @param public_key public key of the peer * @param peer identity of the new peer * @param plugin_name name of the currently used transport plugin * @param session session in use (if available) @@ -443,6 +565,7 @@ disconnect_peer (void *cls, */ void GST_ats_peer_connect (struct GST_AtsHandle *atc, + const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, const struct GNUNET_PeerIdentity *peer, const char *plugin_name, struct Session *session, @@ -457,7 +580,8 @@ GST_ats_peer_connect (struct GST_AtsHandle *atc, (void) GNUNET_CONTAINER_multihashmap_iterate (atc->peers, &disconnect_peer, atc); - ar = create_allocation_record (plugin_name, + ar = create_allocation_record (public_key, + plugin_name, session, plugin_addr, plugin_addr_len, @@ -575,6 +699,33 @@ GST_ats_session_destroyed (struct GST_AtsHandle *atc, } +/** + * Notify validation watcher that an entry is now valid + * + * @param cls 'struct ValidationEntry' that is now valid + * @param key peer identity (unused) + * @param value a 'GST_ValidationIteratorContext' to notify + * @return GNUNET_YES (continue to iterate) + */ +static int +notify_valid (void *cls, + const GNUNET_HashCode *key, + void *value) +{ + struct AllocationRecord *ar = cls; + struct GST_AtsSuggestionContext *asc = value; + + asc->cb (asc->cb_cls, + &ar->public_key, + &asc->target, + ar->plugin_name, + ar->plugin_addr, + ar->plugin_addr_len, + ar->ats, ar->ats_count); + return GNUNET_OK; +} + + /** * We have updated performance statistics for a given address. Note * that this function can be called for addresses that are currently @@ -584,7 +735,8 @@ GST_ats_session_destroyed (struct GST_AtsHandle *atc, * for later use). Update bandwidth assignments. * * @param atc handle - * @param peer identity of the new peer + * @param public_key public key of the peer + * @param peer identity of the peer * @param plugin_name name of the transport plugin * @param session session handle (if available) * @param plugin_addr address (if available) @@ -594,6 +746,7 @@ GST_ats_session_destroyed (struct GST_AtsHandle *atc, */ void GST_ats_address_update (struct GST_AtsHandle *atc, + const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, const struct GNUNET_PeerIdentity *peer, const char *plugin_name, struct Session *session, @@ -605,7 +758,8 @@ GST_ats_address_update (struct GST_AtsHandle *atc, struct AllocationRecord *ar; struct UpdateSessionContext usc; - ar = create_allocation_record (plugin_name, + ar = create_allocation_record (public_key, + plugin_name, session, plugin_addr, plugin_addr_len, @@ -626,6 +780,10 @@ GST_ats_address_update (struct GST_AtsHandle *atc, &peer->hashPubKey, ar, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE)); + GNUNET_CONTAINER_multihashmap_get_multiple (atc->notify_map, + &peer->hashPubKey, + ¬ify_valid, + ar); } /* end of file gnunet-service-transport_ats.c */ diff --git a/src/transport/gnunet-service-transport_ats-new.h b/src/transport/gnunet-service-transport_ats-new.h index b3f004989..ed72dd171 100644 --- a/src/transport/gnunet-service-transport_ats-new.h +++ b/src/transport/gnunet-service-transport_ats-new.h @@ -80,6 +80,7 @@ GST_ats_init (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb, void *alloc_cb_cls); + /** * Shutdown the ATS subsystem. * @@ -89,12 +90,66 @@ void GST_ats_shutdown (struct GST_AtsHandle *atc); +/** + * Signature of a function that takes an address suggestion + * + * @param cls closure + * @param public_key public key of the peer + * @param peer identity of the new peer + * @param plugin_name name of the plugin, NULL if we have no suggestion + * @param plugin_addr suggested address, NULL if we have no suggestion + * @param plugin_addr_len number of bytes in plugin_addr + * @param ats performance data for the address (as far as known) + * @param ats_count number of performance records in 'ats' + */ +typedef void (*GST_AtsAddressSuggestionCallback)(void *cls, + const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, + const struct GNUNET_PeerIdentity *peer, + const char *plugin_name, + const void *plugin_addr, + size_t plugin_addr_len, + const struct GNUNET_TRANSPORT_ATS_Information *ats, + uint32_t ats_count); + + +/** + * Handle to cancel suggestion request. + */ +struct GST_AtsSuggestionContext; + + +/** + * We would like to establish a new connection with a peer. + * ATS should suggest a good address to begin with. + * + * @param atc handle + * @param peer identity of the new peer + * @param cb function to call with the address + * @param cb_cls closure for cb + */ +struct GST_AtsSuggestionContext * +GST_ats_suggest_address (struct GST_AtsHandle *atc, + const struct GNUNET_PeerIdentity *peer, + GST_AtsAddressSuggestionCallback cb, + void *cb_cls); + + +/** + * Cancel suggestion request. + * + * @param asc handle of the request to cancel + */ +void +GST_ats_suggest_address_cancel (struct GST_AtsSuggestionContext *asc); + + /** * We established a new connection with a peer (for example, because * core asked for it or because the other peer connected to us). * Calculate bandwidth assignments including the new peer. * * @param atc handle + * @param public_key public key of the peer * @param peer identity of the new peer * @param plugin_name name of the currently used transport plugin * @param session session in use (if available) @@ -105,6 +160,7 @@ GST_ats_shutdown (struct GST_AtsHandle *atc); */ void GST_ats_peer_connect (struct GST_AtsHandle *atc, + const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, const struct GNUNET_PeerIdentity *peer, const char *plugin_name, struct Session *session, @@ -149,6 +205,7 @@ GST_ats_session_destroyed (struct GST_AtsHandle *atc, * for later use). Update bandwidth assignments. * * @param atc handle + * @param public_key public key of the peer * @param peer identity of the new peer * @param plugin_name name of the transport plugin * @param session session handle (if available) @@ -159,6 +216,7 @@ GST_ats_session_destroyed (struct GST_AtsHandle *atc, */ void GST_ats_address_update (struct GST_AtsHandle *atc, + const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, const struct GNUNET_PeerIdentity *peer, const char *plugin_name, struct Session *session, diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index 209b507cc..64592d5d6 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c @@ -745,10 +745,9 @@ GST_clients_handle_peer_address_lookup (void *cls, peer_address_lookup = (const struct PeerAddressLookupMessage *) message; GNUNET_break (ntohl (peer_address_lookup->reserved) == 0); tc = GNUNET_SERVER_transmit_context_create (client); - (void) GST_validation_get_addresses (&peer_address_lookup->peer, - GNUNET_YES, - &send_address_to_client, - tc); + GST_validation_get_addresses (&peer_address_lookup->peer, + &send_address_to_client, + tc); GNUNET_SERVER_transmit_context_append_data (tc, NULL, 0, GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_REPLY); diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index a7c1136f2..cff2bb595 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -126,10 +126,10 @@ struct NeighbourMapEntry struct MessageQueue *messages_tail; /** - * Context for validation address iteration. + * Context for address suggestion. * NULL after we are connected. */ - struct GST_ValidationIteratorContext *vic; + struct GST_AtsSuggestionContext *asc; /** * Performance data for the peer. @@ -339,10 +339,10 @@ disconnect_neighbour (struct NeighbourMapEntry *n) mq); GNUNET_free (mq); } - if (NULL != n->vic) + if (NULL != n->asc) { - GST_validation_get_addresses_cancel (n->vic); - n->vic = NULL; + GST_ats_suggest_address_cancel (n->asc); + n->asc = NULL; } GNUNET_array_grow (n->ats, n->ats_count, @@ -400,35 +400,31 @@ GST_neighbours_stop () * @param cls the 'struct NeighbourMapEntry' of the target * @param public_key public key for the peer, never NULL * @param target identity of the target peer - * @param valid_until is ZERO if we never validated the address, - * otherwise a time up to when we consider it (or was) valid - * @param validation_block is FOREVER if the address is for an unsupported plugin (from PEERINFO) - * is ZERO if the address is considered valid (no validation needed) - * otherwise a time in the future if we're currently denying re-validation * @param plugin_name name of the plugin * @param plugin_address binary address * @param plugin_address_len length of address + * @param ats performance data for the address (as far as known) + * @param ats_count number of performance records in 'ats' */ static void try_connect_using_address (void *cls, const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, const struct GNUNET_PeerIdentity *target, - struct GNUNET_TIME_Absolute valid_until, - struct GNUNET_TIME_Absolute validation_block, const char *plugin_name, const void *plugin_address, - size_t plugin_address_len) + size_t plugin_address_len, + const struct GNUNET_TRANSPORT_ATS_Information *ats, + uint32_t ats_count) { struct NeighbourMapEntry *n = cls; + n->asc = NULL; if (n->public_key_valid == GNUNET_NO) { n->public_key = *public_key; n->public_key_valid = GNUNET_YES; } - if (GNUNET_TIME_absolute_get_remaining (valid_until).rel_value == 0) - return; /* address is not valid right now */ - /* FIXME: do ATS here! */ + /* FIXME: do connect! */ } @@ -488,12 +484,12 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target) n, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); } - if (n->vic != NULL) + if (n->asc != NULL) return; /* already trying */ - n->vic = GST_validation_get_addresses (target, - GNUNET_NO, - &try_connect_using_address, - n); + n->asc = GST_ats_suggest_address (GST_ats, + target, + &try_connect_using_address, + n); } diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 13d48bce2..1a619a901 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c @@ -27,6 +27,7 @@ #include "gnunet-service-transport_validation.h" #include "gnunet-service-transport_plugins.h" #include "gnunet-service-transport_hello.h" +#include "gnunet-service-transport_ats-new.h" #include "gnunet-service-transport.h" #include "gnunet_hello_lib.h" #include "gnunet_peerinfo_service.h" @@ -248,28 +249,6 @@ struct CheckHelloValidatedContext }; -/** - * Opaque handle to stop incremental validation address callbacks. - */ -struct GST_ValidationIteratorContext -{ - /** - * Function to call on each address. - */ - GST_ValidationAddressCallback cb; - - /** - * Closure for 'cb'. - */ - void *cb_cls; - - /** - * Which peer are we monitoring? - */ - struct GNUNET_PeerIdentity target; -}; - - /** * Head of linked list of HELLOs awaiting validation. */ @@ -287,11 +266,6 @@ static struct CheckHelloValidatedContext *chvc_tail; */ static struct GNUNET_CONTAINER_MultiHashMap *validation_map; -/** - * Map of PeerIdentities to 'struct GST_ValidationIteratorContext's. - */ -static struct GNUNET_CONTAINER_MultiHashMap *notify_map; - /** * Context for peerinfo iteration. */ @@ -408,34 +382,6 @@ find_validation_entry (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pub } -/** - * Notify validation watcher that an entry is now valid - * - * @param cls 'struct ValidationEntry' that is now valid - * @param key peer identity (unused) - * @param value a 'GST_ValidationIteratorContext' to notify - * @return GNUNET_YES (continue to iterate) - */ -static int -notify_valid (void *cls, - const GNUNET_HashCode *key, - void *value) -{ - struct ValidationEntry *ve = cls; - struct GST_ValidationIteratorContext *vic = value; - - vic->cb (vic->cb_cls, - &ve->public_key, - &vic->target, - ve->valid_until, - ve->validation_block, - ve->transport_name, - ve->addr, - ve->addrlen); - return GNUNET_OK; -} - - /** * Iterator which adds the given address to the set of validated * addresses. @@ -472,10 +418,14 @@ add_valid_address (void *cls, ve = find_validation_entry (&public_key, &pid, tname, addr, addrlen); ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until, expiration); - GNUNET_CONTAINER_multihashmap_get_multiple (notify_map, - &pid.hashPubKey, - ¬ify_valid, - ve); + GST_ats_address_update (GST_ats, + &public_key, + &pid, + tname, + NULL, + addr, + addrlen, + NULL, 0); return GNUNET_OK; } @@ -512,7 +462,6 @@ void GST_validation_start () { validation_map = GNUNET_CONTAINER_multihashmap_create (VALIDATION_MAP_SIZE); - notify_map = GNUNET_CONTAINER_multihashmap_create (VALIDATION_MAP_SIZE); pnc = GNUNET_PEERINFO_notify (GST_cfg, &process_peerinfo_hello, NULL); @@ -558,9 +507,6 @@ GST_validation_stop () NULL); GNUNET_CONTAINER_multihashmap_destroy (validation_map); validation_map = NULL; - GNUNET_assert (GNUNET_CONTAINER_multihashmap_size (notify_map) == 0); - GNUNET_CONTAINER_multihashmap_destroy (notify_map); - notify_map = NULL; while (NULL != (chvc = chvc_head)) { GNUNET_CONTAINER_DLL_remove (chvc_head, @@ -801,10 +747,9 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, gettext_noop ("# PONGs multicast to all available addresses"), 1, GNUNET_NO); - (void) GST_validation_get_addresses (sender, - GNUNET_YES, - &multicast_pong, - pong); + GST_validation_get_addresses (sender, + &multicast_pong, + pong); GNUNET_free (pong); } @@ -1092,6 +1037,14 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, /* validity achieved, remember it! */ ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION); + GST_ats_address_update (GST_ats, + &ve->public_key, + &ve->pid, + ve->transport_name, + NULL, + ve->addr, + ve->addrlen, + NULL, 0); /* FIXME: compute and add latency here... */ /* build HELLO to store in PEERINFO */ hello = GNUNET_HELLO_create (&ve->public_key, @@ -1145,6 +1098,24 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello) } +/** + * Closure for 'iterate_addresses' + */ +struct IteratorContext +{ + /** + * Function to call on each address. + */ + GST_ValidationAddressCallback cb; + + /** + * Closure for 'cb'. + */ + void *cb_cls; + +}; + + /** * Call the callback in the closure for each validation entry. * @@ -1158,17 +1129,17 @@ iterate_addresses (void *cls, const GNUNET_HashCode *key, void *value) { - struct GST_ValidationIteratorContext *vic = cls; + struct IteratorContext *ic = cls; struct ValidationEntry *ve = value; - vic->cb (vic->cb_cls, - &ve->public_key, - &ve->pid, - ve->valid_until, - ve->validation_block, - ve->transport_name, - ve->addr, - ve->addrlen); + ic->cb (ic->cb_cls, + &ve->public_key, + &ve->pid, + ve->valid_until, + ve->validation_block, + ve->transport_name, + ve->addr, + ve->addrlen); return GNUNET_OK; } @@ -1185,48 +1156,19 @@ iterate_addresses (void *cls, * @param cb_cls closure for 'cb' * @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES */ -struct GST_ValidationIteratorContext * +void GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, - int snapshot_only, GST_ValidationAddressCallback cb, void *cb_cls) { - struct GST_ValidationIteratorContext *vic; + struct IteratorContext ic; - vic = GNUNET_malloc (sizeof (struct GST_ValidationIteratorContext)); - vic->cb = cb; - vic->cb_cls = cb_cls; - vic->target = *target; + ic.cb = cb; + ic.cb_cls = cb_cls; GNUNET_CONTAINER_multihashmap_get_multiple (validation_map, &target->hashPubKey, &iterate_addresses, - vic); - if (GNUNET_YES == snapshot_only) - { - GNUNET_free (vic); - return NULL; - } - GNUNET_CONTAINER_multihashmap_put (notify_map, - &target->hashPubKey, - vic, - GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); - return vic; -} - - -/** - * Cancel an active validation address iteration. - * - * @param ctx the context of the operation that is cancelled - */ -void -GST_validation_get_addresses_cancel (struct GST_ValidationIteratorContext *ctx) -{ - GNUNET_assert (GNUNET_OK == - GNUNET_CONTAINER_multihashmap_remove (notify_map, - &ctx->target.hashPubKey, - ctx)); - GNUNET_free (ctx); + &ic); } diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h index 77c5164f9..5ab2e9163 100644 --- a/src/transport/gnunet-service-transport_validation.h +++ b/src/transport/gnunet-service-transport_validation.h @@ -94,12 +94,6 @@ void GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello); -/** - * Opaque handle to stop incremental validation address callbacks. - */ -struct GST_ValidationIteratorContext; - - /** * Function called for each address (or address status change) that * the validation module is aware of (for the given target). @@ -128,32 +122,18 @@ typedef void (*GST_ValidationAddressCallback)(void *cls, /** * Call the given function for each address for the given target. - * Can either give a snapshot (synchronous API) or be continuous. * * @param target peer information is requested for - * @param snapshot_only GNUNET_YES to iterate over addresses once, GNUNET_NO to - * continue to give information about addresses as it evolves * @param cb function to call; will not be called after this function returns * if snapshot_only is GNUNET_YES * @param cb_cls closure for 'cb' * @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES */ -struct GST_ValidationIteratorContext * +void GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, - int snapshot_only, GST_ValidationAddressCallback cb, void *cb_cls); -/** - * Cancel an active validation address iteration. - * - * @param ctx the context of the operation that is cancelled - */ -void -GST_validation_get_addresses_cancel (struct GST_ValidationIteratorContext *ctx); - - - #endif /* end of file gnunet-service-transport_validation.h */ -- 2.25.1