-fix for #688590: allow user to specify how to install nsslibs
[oweals/gnunet.git] / src / gns / gnunet-service-gns_resolver.h
index 0e18f13a6902db4b9570c352ff3aefd327468b15..b24fd1274613095a8bc65e498cf50f663f6fc577 100644 (file)
@@ -11,6 +11,7 @@
 #define DHT_GNS_REPLICATION_LEVEL 5
 
 #define GNUNET_GNS_MAX_PARALLEL_LOOKUPS 500
+#define GNUNET_GNS_MAX_NS_TASKS 500
 
 /*
  * DLL to hold the authority chain
@@ -35,10 +36,6 @@ struct AuthorityChain
 /* handle to a resolution process */
 struct ResolverHandle;
 
-/**
- * continuation called when cleanup of resolver finishes
- */
-typedef void (*ResolverCleanupContinuation) (void);
 
 /**
  * processor for a record lookup result
@@ -92,6 +89,7 @@ typedef void (*ResolutionResultProcessor) (void *cls,
  * RSL_DELEGATE_NS: Found NS delegation
  * RSL_DELEGATE_PKEY: Found PKEY delegation
  * RSL_CNAME_FOUND: Found CNAME record
+ * RSL_PKEY_REVOKED: Found PKEY has been revoked
  */
 enum ResolutionStatus
 {
@@ -101,7 +99,8 @@ enum ResolutionStatus
   RSL_DELEGATE_VPN = 8,
   RSL_DELEGATE_NS = 16,
   RSL_DELEGATE_PKEY = 32,
-  RSL_CNAME_FOUND = 64
+  RSL_CNAME_FOUND = 64,
+  RSL_PKEY_REVOKED = 128
 };
 
 /**
@@ -116,6 +115,19 @@ enum ResolutionStatus
  */
 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[MAX_DNS_NAME_LENGTH];
 
@@ -208,6 +220,11 @@ struct ResolverHandle
    */
   unsigned long long id;
 
+  /**
+   * Pending Namestore task
+   */
+  struct GNUNET_NAMESTORE_QueueEntry *namestore_task;
+
 };
 
 
@@ -269,6 +286,9 @@ struct GetNameAuthorityHandle
 {
   /* the name to look up authority for */
   char name[MAX_DNS_NAME_LENGTH];
+
+  /* the result */
+  char result[MAX_DNS_NAME_LENGTH];
   
   /* Method to call on result */
   GetAuthorityResultProcessor proc;
@@ -282,6 +302,12 @@ struct GetNameAuthorityHandle
  */
 struct GetPseuAuthorityHandle
 {
+  /* DLL */
+  struct GetPseuAuthorityHandle *next;
+
+  /* DLL */
+  struct GetPseuAuthorityHandle *prev;
+
   /* the name to store the zone under */
   char name[MAX_DNS_LABEL_LENGTH];
 
@@ -300,8 +326,23 @@ struct GetPseuAuthorityHandle
   /* timeout task for lookup */
   GNUNET_SCHEDULER_TaskIdentifier timeout;
 
-  /* Head of the authority list */
-  struct AuthorityChain *ahead;
+  /* Authority to shorten */
+  struct AuthorityChain *auth;
+
+  /* handle to namestore request */
+  struct GNUNET_NAMESTORE_QueueEntry* namestore_task;
+};
+
+/**
+ * Namestore queue entries in background
+ */
+struct NamestoreBGTask
+{
+  /* node in heap */
+  struct GNUNET_CONTAINER_HeapNode *node;
+
+  /* queue entry */
+  struct GNUNET_NAMESTORE_QueueEntry *qe;
 };
 
 /**
@@ -311,7 +352,7 @@ struct GetPseuAuthorityHandle
  * @param nh handle to the namestore
  * @param dh handle to the dht
  * @param lz the local zone
- * @param cfg configuration handle
+ * @param c configuration handle
  * @param max_bg_queries maximum amount of background queries
  * @param ignore_pending ignore records that still require user confirmation
  *        on lookup
@@ -321,17 +362,15 @@ int
 gns_resolver_init(struct GNUNET_NAMESTORE_Handle *nh,
                   struct GNUNET_DHT_Handle *dh,
                   struct GNUNET_CRYPTO_ShortHashCode lz,
-                  const struct GNUNET_CONFIGURATION_Handle *cfg,
+                  const struct GNUNET_CONFIGURATION_Handle *c,
                   unsigned long long max_bg_queries,
                   int ignore_pending);
 
 /**
  * Cleanup resolver: Terminate pending lookups
- * 
- * @param cont continuation to call when finished
  */
 void
-gns_resolver_cleanup(ResolverCleanupContinuation cont);
+gns_resolver_cleanup(void);
 
 /**
  * Lookup of a record in a specific zone