21#if !defined (__GNUNET_UTIL_LIB_H_INSIDE__)
22#error "Only <gnunet_util_lib.h> can be included directly."
38#ifndef GNUNET_DNSSTUB_LIB_H
39#define GNUNET_DNSSTUB_LIB_H
89 const struct sockaddr *sa);
static char * dns_ip
IP of DNS server.
static struct GNUNET_FS_Handle * ctx
static struct GNUNET_VPN_RedirectionRequest * request
Opaque redirection request handle.
struct GNUNET_DNSSTUB_Context * GNUNET_DNSSTUB_start(unsigned int num_sockets)
Start a DNS stub resolver.
int GNUNET_DNSSTUB_add_dns_ip(struct GNUNET_DNSSTUB_Context *ctx, const char *dns_ip)
Add nameserver for use by the DNSSTUB.
void(* GNUNET_DNSSTUB_ResultCallback)(void *cls, const struct GNUNET_TUN_DnsHeader *dns, size_t dns_len)
Function called with the result of a DNS resolution.
void GNUNET_DNSSTUB_stop(struct GNUNET_DNSSTUB_Context *ctx)
Cleanup DNSSTUB resolver.
void GNUNET_DNSSTUB_set_retry(struct GNUNET_DNSSTUB_Context *ctx, struct GNUNET_TIME_Relative retry_freq)
How long should we try requests before timing out? Only effective for requests issued after this call...
struct GNUNET_DNSSTUB_RequestSocket * GNUNET_DNSSTUB_resolve(struct GNUNET_DNSSTUB_Context *ctx, const void *request, size_t request_len, GNUNET_DNSSTUB_ResultCallback rc, void *rc_cls)
Perform DNS resolution using our default IP from init.
void GNUNET_DNSSTUB_resolve_cancel(struct GNUNET_DNSSTUB_RequestSocket *rs)
Cancel DNS resolution.
int GNUNET_DNSSTUB_add_dns_sa(struct GNUNET_DNSSTUB_Context *ctx, const struct sockaddr *sa)
Add nameserver for use by the DNSSTUB.
Handle to the stub resolver.
unsigned int num_sockets
Length of sockets array.
struct GNUNET_TIME_Relative retry_freq
How frequently do we retry requests?
UDP socket we are using for sending DNS requests to the Internet.
GNUNET_DNSSTUB_ResultCallback rc
Function to call with result.
size_t request_len
Number of bytes in request.
void * rc_cls
Closure for rc.
Time for relative time used by GNUnet, in microseconds.