- * @param cls the closure
- * @param name name of the authority
- */
-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 (array of 'rd_count' records)
- */
-typedef void (*ResolutionResultProcessor) (void *cls,
- struct ResolverHandle *rh,
- uint32_t rd_count,
- const struct GNUNET_NAMESTORE_RecordData *rd);
-
-
-/**
- * Resolution status indicator
- */
-enum ResolutionStatus
-{
- /**
- * the name to lookup exists
- */
- RSL_RECORD_EXISTS = 1,
-
- /**
- * the name in the record expired
- */
- RSL_RECORD_EXPIRED = 2,
-
- /**
- * resolution timed out
- */
- RSL_TIMED_OUT = 4,
-
- /**
- * Found VPN delegation
- */
- RSL_DELEGATE_VPN = 8,
-
- /**
- * Found NS delegation
- */
- RSL_DELEGATE_NS = 16,
-
- /**
- * Found PKEY delegation
- */
- RSL_DELEGATE_PKEY = 32,
-
- /**
- * Found CNAME record
- */
- RSL_CNAME_FOUND = 64,
-
- /**
- * Found PKEY has been revoked
- */
- RSL_PKEY_REVOKED = 128
-};
-
-/**
- * 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
-{
-
- /**
- * DLL
- */
- struct ResolverHandle *next;
-
- /**
- * DLL
- */
- struct ResolverHandle *prev;
-
- /**
- * Last record data found
- */
- struct GNUNET_NAMESTORE_RecordData rd;
-
- /**
- * Number of last record data found
- */
- unsigned int rd_count;
-
- /**
- * The name to resolve
- */
- char name[GNUNET_DNSPARSER_MAX_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[GNUNET_DNSPARSER_MAX_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[GNUNET_DNSPARSER_MAX_NAME_LENGTH];
-
- /**
- * the authoritative dns zone
- */
- char dns_zone[GNUNET_DNSPARSER_MAX_NAME_LENGTH];
-
- /**
- * the address of the DNS server FIXME not needed?
- */
- struct sockaddr_in dns_addr;
-
- /**
- * handle to the local stub resolver request
- */
- struct GNUNET_RESOLVER_RequestHandle *dns_resolver_handle;
-
- /**
- * 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_EccPrivateKey *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;
-
- /**
- * Pending Namestore task
- */
- struct GNUNET_NAMESTORE_QueueEntry *namestore_task;
-
-};
-
-
-/**
- * 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[GNUNET_DNSPARSER_MAX_NAME_LENGTH];
-
- /**
- * Method to call on record resolution result
- */
- RecordLookupProcessor proc;
-
- /**
- * closure to pass to proc
- */
- void* proc_cls;
-
-};
-
-
-/**
- * Handle to a shorten context
- */
-struct NameShortenHandle
-{
- /**
- * Method to call on shorten result
- */
- ShortenResultProcessor proc;
-
- /**
- * closure to pass to proc
- */
- void* proc_cls;
-
- /**
- * result of shorten
- */
- char result[GNUNET_DNSPARSER_MAX_NAME_LENGTH];
-
- /**
- * root zone
- */
- struct GNUNET_CRYPTO_ShortHashCode *root_zone;
-
- /**
- * private zone
- */
- struct GNUNET_CRYPTO_ShortHashCode *private_zone;
-
- /**
- * name of private zone
- */
- char private_zone_name[GNUNET_DNSPARSER_MAX_LABEL_LENGTH];
-
- /**
- * shorten zone
- */
- struct GNUNET_CRYPTO_ShortHashCode *shorten_zone;
-
- /**
- * name of shorten zone
- */
- char shorten_zone_name[GNUNET_DNSPARSER_MAX_LABEL_LENGTH];
-
-};
-
-
-/**
- * Handle to a get authority context