![]() |
GNUnet
0.11.x
|
GNUnet GNS service. More...
#include "gns.h"
#include "gnunet_dht_service.h"
#include "gnunet_gns_service.h"
#include "gnunet_namecache_service.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | GNS_ResultProcessor) (void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
Function called with results for a GNS resolution. More... | |
Functions | |
void | GNS_resolver_init (struct GNUNET_NAMECACHE_Handle *nc, struct GNUNET_DHT_Handle *dht, const struct GNUNET_CONFIGURATION_Handle *c, unsigned long long max_bg_queries) |
Initialize the resolver subsystem. More... | |
void | GNS_resolver_done (void) |
Cleanup resolver: Terminate pending lookups. More... | |
struct GNS_ResolverHandle * | GNS_resolver_lookup (const struct GNUNET_IDENTITY_PublicKey *zone, uint32_t record_type, const char *name, enum GNUNET_GNS_LocalOptions options, uint16_t recursion_depth_limit, GNS_ResultProcessor proc, void *proc_cls) |
Lookup of a record in a specific zone calls RecordLookupProcessor on result or timeout. More... | |
void | GNS_resolver_lookup_cancel (struct GNS_ResolverHandle *rh) |
Cancel active resolution (i.e. More... | |
GNUnet GNS service.
Definition in file gnunet-service-gns_resolver.h.
typedef void(* GNS_ResultProcessor) (void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
Function called with results for a GNS resolution.
cls | closure |
rd_count | number of records in rd |
rd | records returned for the lookup |
Definition at line 69 of file gnunet-service-gns_resolver.h.
void GNS_resolver_init | ( | struct GNUNET_NAMECACHE_Handle * | nc, |
struct GNUNET_DHT_Handle * | dht, | ||
const struct GNUNET_CONFIGURATION_Handle * | c, | ||
unsigned long long | max_bg_queries | ||
) |
Initialize the resolver subsystem.
MUST be called before GNS_resolver_lookup.
nc | the namecache handle |
dht | handle to the dht |
c | configuration handle |
max_bg_queries | maximum amount of background queries |
Initialize the resolver subsystem.
nc | the namecache handle |
dht | the dht handle |
c | configuration handle |
max_bg_queries | maximum number of parallel background queries in dht |
Definition at line 3019 of file gnunet-service-gns_resolver.c.
References dht, disable_cache, GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_CONTAINER_heap_create(), GNUNET_CONTAINER_HEAP_ORDER_MIN, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_VPN_connect(), GNUNET_YES, max_allowed_background_queries, and nc.
Referenced by run().
void GNS_resolver_done | ( | void | ) |
Cleanup resolver: Terminate pending lookups.
Cleanup resolver: Terminate pending lookups.
Definition at line 3044 of file gnunet-service-gns_resolver.c.
References GNS_resolver_lookup_cancel(), GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_heap_destroy(), GNUNET_free, GNUNET_NAMECACHE_cancel(), GNUNET_VPN_disconnect(), CacheOps::namecache_qe_cache, GNS_ResolverHandle::proc, GNS_ResolverHandle::proc_cls, and Gns2DnsPending::rh.
Referenced by shutdown_task().
struct GNS_ResolverHandle* GNS_resolver_lookup | ( | const struct GNUNET_IDENTITY_PublicKey * | zone, |
uint32_t | record_type, | ||
const char * | name, | ||
enum GNUNET_GNS_LocalOptions | options, | ||
uint16_t | recursion_depth_limit, | ||
GNS_ResultProcessor | proc, | ||
void * | proc_cls | ||
) |
Lookup of a record in a specific zone calls RecordLookupProcessor on result or timeout.
zone | the zone to perform the lookup in |
record_type | the record type to look up |
name | the name to look up |
options | options set to control local lookup |
recursion_depth_limit | how many zones to traverse at most |
proc | the processor to call |
proc_cls | the closure to pass to proc |
Lookup of a record in a specific zone calls RecordLookupProcessor on result or timeout.
zone | the zone to perform the lookup in |
record_type | the record type to look up |
name | the name to look up |
options | local options to control local lookup |
recursion_depth_limit | how many zones to traverse at most |
proc | the processor to call on result |
proc_cls | the closure to pass to proc |
Definition at line 2865 of file gnunet-service-gns_resolver.c.
References GNS_ResolverHandle::authority_zone, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, GNS_ResolverHandle::loop_threshold, GNS_ResolverHandle::name, GNS_ResolverHandle::name_resolution_pos, options, GNS_ResolverHandle::options, GNS_ResolverHandle::proc, GNS_ResolverHandle::proc_cls, GNS_ResolverHandle::record_type, Gns2DnsPending::rh, start_resolver_lookup(), GNS_ResolverHandle::task_id, and zone.
Referenced by handle_dns_request(), and handle_lookup().
void GNS_resolver_lookup_cancel | ( | struct GNS_ResolverHandle * | rh | ) |
Cancel active resolution (i.e.
client disconnected).
rh | resolution to abort |
Definition at line 2902 of file gnunet-service-gns_resolver.c.
References Gns2DnsPending::ac, GNS_ResolverHandle::ac_head, GNS_ResolverHandle::ac_tail, AuthorityChain::authority_info, GNS_ResolverHandle::dht_heap_node, AuthorityChain::dns_authority, GNS_ResolverHandle::dns_request, GNS_ResolverHandle::dns_result_head, GNS_ResolverHandle::dns_result_tail, Gns2DnsPending::dns_rh, GNS_ResolverHandle::get_handle, AuthorityChain::gns_authority, GNS_resolver_lookup_cancel_(), GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_heap_remove_node(), GNUNET_DHT_get_stop(), GNUNET_DNSSTUB_resolve_cancel(), GNUNET_DNSSTUB_stop(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NAMECACHE_cancel(), GNUNET_NO, GNUNET_RESOLVER_request_cancel(), GNUNET_REVOCATION_query_cancel(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_VPN_cancel_request(), AuthorityChain::label, GNS_ResolverHandle::leho, GNS_ResolverHandle::name, GNS_ResolverHandle::namecache_qe, VpnContext::rd_data, GNS_ResolverHandle::rev_check, Gns2DnsPending::rh, GNS_ResolverHandle::std_resolve, GNS_ResolverHandle::task_id, GNS_ResolverHandle::vpn_ctx, and VpnContext::vpn_request.
Referenced by client_disconnect_cb(), GNS_interceptor_done(), GNS_resolver_done(), GNS_resolver_lookup_cancel_(), and transmit_lookup_dns_result().