- * @param cls the closure
- * @param rd_count number of results
- * @param rd result data
- */
-typedef void (*RecordLookupProcessor) (void *cls,
- uint32_t rd_count,
- const struct GNUNET_NAMESTORE_RecordData *rd);
-
-
-/**
- * processor for a shorten result
- *
- * @param cls the closure
- * @param name shortened name
- */
-typedef void (*ShortenResultProcessor) (void *cls, const char* name);
-
-
-/**
- * processor for an authority result
- *
- * @param cls the closure
- * @param name name
- */
-typedef void (*GetAuthorityResultProcessor) (void *cls, const char* name);
-
-/**
- * processor for a resolution result
- *
- * @param cls the closure
- * @param rh the resolution handle
- * @param rd_count number of results
- * @param rd result data
- */
-typedef void (*ResolutionResultProcessor) (void *cls,
- struct ResolverHandle *rh,
- uint32_t rd_count,
- const struct GNUNET_NAMESTORE_RecordData *rd);
-
-
-/**
- * Resolution status indicator
- * RSL_RECORD_EXISTS: the name to lookup exists
- * RSL_RECORD_EXPIRED: the name in the record expired
- * RSL_TIMED_OUT: resolution timed out
- * RSL_DELEGATE_VPN: Found VPN delegation
- * RSL_DELEGATE_NS: Found NS delegation
- */
-enum ResolutionStatus
-{
- RSL_RECORD_EXISTS = 1,
- RSL_RECORD_EXPIRED = 2,
- RSL_TIMED_OUT = 4,
- RSL_DELEGATE_VPN = 8,
- RSL_DELEGATE_NS = 16
-};
-
-/**
- * Handle to a currenty pending resolution
- * a ResolverHandle is passed to, for example
- * resolve_record_ns to resolve a record in the namestore.
- * On result (positive or negative) the ResolutionResultProcessor
- * is called.
- * If a timeout is set timeout_cont will be called.
- * If no timeout is set (ie timeout forever) then background resolutions
- * might be triggered.
- */
-struct ResolverHandle
-{
- /* The name to resolve */
- char name[MAX_DNS_NAME_LENGTH];
-
- /* has this query been answered? how many matches */
- int answered;
-
- /* Use only cache */
- int only_cached;
-
- /* the authoritative zone to query */
- struct GNUNET_CRYPTO_ShortHashCode authority;
-
- /* the name of the authoritative zone to query */
- char authority_name[MAX_DNS_LABEL_LENGTH];
-
- /* a handle for dht lookups. should be NULL if no lookups are in progress */
- struct GNUNET_DHT_GetHandle *get_handle;
-
- /* timeout set for this lookup task */
- struct GNUNET_TIME_Relative timeout;
-
- /* a handle to a vpn request */
- struct GNUNET_VPN_RedirectionRequest *vpn_handle;
-
- /* a socket for a dns request */
- struct GNUNET_NETWORK_Handle *dns_sock;
-
- /* a synthesized dns name */
- char dns_name[MAX_DNS_NAME_LENGTH];
-
- /* the address of the DNS server FIXME not needed? */
- struct sockaddr_in dns_addr;
-
- /* select task for DNS */
- GNUNET_SCHEDULER_TaskIdentifier dns_read_task;
-
- /* pointer to raw dns query payload FIXME needs to be freed/NULL */
- char *dns_raw_packet;
-
- /* size of the raw dns query */
- size_t dns_raw_packet_size;
-
- /* timeout task for the lookup */
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
-
- /* continuation to call on timeout */
- GNUNET_SCHEDULER_Task timeout_cont;
-
- /* closure for timeout cont */
- void* timeout_cont_cls;
-
- /* called when resolution phase finishes */
- ResolutionResultProcessor proc;
-
- /* closure passed to proc */
- void* proc_cls;
-
- /* DLL to store the authority chain */
- struct AuthorityChain *authority_chain_head;
-
- /* DLL to store the authority chain */
- struct AuthorityChain *authority_chain_tail;
-
- /* status of the resolution result */
- enum ResolutionStatus status;
-
- /* The provate local zone of this request */
- struct GNUNET_CRYPTO_ShortHashCode private_local_zone;
-
- /**
- * private key of an/our authoritative zone
- * can be NULL but automatical PKEY import will not work
- */
- struct GNUNET_CRYPTO_RsaPrivateKey *priv_key;
-
- /**
- * the heap node associated with this lookup, null if timeout is set
- * used for DHT background lookups.
- */
- struct GNUNET_CONTAINER_HeapNode *dht_heap_node;
-
- /**
- * Id for resolution process
- */
- unsigned long long id;
-
-};
-
-
-/**
- * Handle to a record lookup
- */
-struct RecordLookupHandle
-{
- /* the record type to look up */
- enum GNUNET_GNS_RecordType record_type;
-
- /* the name to look up */
- char name[MAX_DNS_NAME_LENGTH];
-
- /* Method to call on record resolution result */
- RecordLookupProcessor proc;
-
- /* closure to pass to proc */
- void* proc_cls;
-
-};
-
-
-/**
- * Handle to a shorten context