-getting rid of duplication of record type values / enum GNUNET_GNS_RecordType
authorChristian Grothoff <christian@grothoff.org>
Tue, 13 Aug 2013 17:10:07 +0000 (17:10 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 13 Aug 2013 17:10:07 +0000 (17:10 +0000)
27 files changed:
src/gns/gns.h
src/gns/gns_api.c
src/gns/gnunet-dns2gns.c
src/gns/gnunet-gns-helper-service-w32.c
src/gns/gnunet-gns-proxy.c
src/gns/gnunet-gns.c
src/gns/gnunet-service-gns.c
src/gns/gnunet-service-gns_interceptor.c
src/gns/gnunet-service-gns_resolver.c
src/gns/gnunet-service-gns_resolver.h
src/gns/test_gns_cname_lookup.c
src/gns/test_gns_dht_delegated_lookup.c
src/gns/test_gns_dht_three_peers.c
src/gns/test_gns_max_queries.c
src/gns/test_gns_ns_lookup.c
src/gns/test_gns_proxy.c
src/gns/test_gns_pseu_shorten.c
src/gns/test_gns_revocation.c
src/gns/test_gns_simple_delegated_lookup.c
src/gns/test_gns_simple_get_authority.c
src/gns/test_gns_simple_lookup.c
src/gns/test_gns_simple_mx_lookup.c
src/gns/test_gns_simple_shorten.c
src/gns/test_gns_simple_srv_lookup.c
src/gns/test_gns_simple_zkey_lookup.c
src/include/gnunet_gns_service.h
src/pt/test_gns_vpn.c

index a4830bda4b6e504ed7aa10fd47128bba1780cb0a..a7697be1deace8460c00c41f6cba38b348fdf640 100644 (file)
@@ -83,7 +83,7 @@ struct GNUNET_GNS_ClientLookupMessage
   /**
    * the type of record to look up
    */
-  /* enum GNUNET_GNS_RecordType */ uint32_t type;
+  /* int */ uint32_t type;
   
   /**
    * The key for shorten, if 'have_key' is set 
index e672c5687f4eef6cb0d69944383c3950eda37d13..64f5144c664759c78cf21631ac0abd3d05641db9 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2010, 2012 Christian Grothoff (and other contributing authors)
+     (C) 2009-2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -821,7 +821,7 @@ struct GNUNET_GNS_LookupRequest*
 GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle,
                        const char *name,
                        struct GNUNET_CRYPTO_ShortHashCode *zone,
-                       enum GNUNET_GNS_RecordType type,
+                       int type,
                        int only_cached,
                        struct GNUNET_CRYPTO_EccPrivateKey *shorten_key,
                        GNUNET_GNS_LookupResultProcessor proc,
@@ -900,7 +900,7 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle,
 struct GNUNET_GNS_LookupRequest *
 GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
                    const char *name,
-                   enum GNUNET_GNS_RecordType type,
+                   int type,
                    int only_cached,
                    struct GNUNET_CRYPTO_EccPrivateKey *shorten_key,
                    GNUNET_GNS_LookupResultProcessor proc,
index c1fdc2dc86eacb7670a6a9bc3ea256d7dcc8e4d0..8cef98489f595dbf045e65ae908aec7e6fb24162 100644 (file)
@@ -356,7 +356,7 @@ handle_request (struct GNUNET_NETWORK_Handle *lsock,
   char *dot;
   char *nname;
   size_t name_len;
-  enum GNUNET_GNS_RecordType type;
+  int type;
   int use_gns;
   struct GNUNET_CRYPTO_ShortHashCode zone;
 
index f0bf6577c89858bf604e91cc73cbb9e1db926160..187ee41ae602022f2a52fabb7daa539d25ba25d0 100644 (file)
@@ -282,13 +282,13 @@ process_ip_lookup_result (void* cls,
   {
     switch (rd[i].record_type)
     {
-    case GNUNET_GNS_RECORD_A:
+    case GNUNET_DNSPARSER_TYPE_A:
       if (rd[i].data_size != sizeof (struct in_addr))
         continue;
       size += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in) * 2;
       csanum++;
       break;
-    case GNUNET_GNS_RECORD_AAAA:
+    case GNUNET_DNSPARSER_TYPE_AAAA:
       if (rd[i].data_size != sizeof (struct in6_addr))
         continue;
       size += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in6) * 2;
@@ -305,13 +305,13 @@ process_ip_lookup_result (void* cls,
     blobsize += sizeof (void *); /* For addresses */
     for (i = 0; i < rd_count; i++)
     {
-      if ((rq->af == AF_INET || rq->af == AF_UNSPEC) && rd[i].record_type == GNUNET_GNS_RECORD_A)
+      if ((rq->af == AF_INET || rq->af == AF_UNSPEC) && rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
         blobsize += sizeof (void *);
         blobsize += sizeof (struct in_addr);
         blobaddrcount++;
       }
-      else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_GNS_RECORD_AAAA)
+      else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_DNSPARSER_TYPE_AAAA)
       {
         blobsize += sizeof (void *);
         blobsize += sizeof (struct in6_addr);
@@ -367,7 +367,7 @@ process_ip_lookup_result (void* cls,
   {
     switch (rd[i].record_type)
     {
-    case GNUNET_GNS_RECORD_A:
+    case GNUNET_DNSPARSER_TYPE_A:
       if (rd[i].data_size != sizeof (struct in_addr))
         continue;
       qs->lpcsaBuffer[j].iSocketType = SOCK_STREAM;
@@ -389,7 +389,7 @@ process_ip_lookup_result (void* cls,
       size_recalc += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in) * 2;
       j++;
       break;
-    case GNUNET_GNS_RECORD_AAAA:
+    case GNUNET_DNSPARSER_TYPE_AAAA:
       if (rd[i].data_size != sizeof (struct in6_addr))
         continue;
       qs->lpcsaBuffer[j].iSocketType = SOCK_STREAM;
@@ -460,7 +460,7 @@ process_ip_lookup_result (void* cls,
     for (i = 0; i < rd_count; i++)
     {
       if ((rq->af == AF_INET || rq->af == AF_UNSPEC) &&
-          rd[i].record_type == GNUNET_GNS_RECORD_A)
+          rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
         he->h_addr_list[j] = (char *) ptr;
         ptr += sizeof (struct in_addr);
@@ -471,7 +471,7 @@ process_ip_lookup_result (void* cls,
         memcpy (he->h_addr_list[j], rd[i].data, sizeof (struct in_addr));
         j++;
       }
-      else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_GNS_RECORD_AAAA)
+      else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_DNSPARSER_TYPE_AAAA)
       {
         he->h_addr_list[j] = (char *) ptr;
         ptr += sizeof (struct in6_addr);
@@ -512,25 +512,25 @@ get_ip_from_hostname (struct GNUNET_SERVER_Client *client,
   uint32_t rtype;
 
   if (IsEqualGUID (&SVCID_DNS_TYPE_A, &sc))
-    rtype = GNUNET_GNS_RECORD_A;
+    rtype = GNUNET_DNSPARSER_TYPE_A;
   else if (IsEqualGUID (&SVCID_DNS_TYPE_NS, &sc))
-    rtype = GNUNET_GNS_RECORD_NS;
+    rtype = GNUNET_DNSPARSER_TYPE_NS;
   else if (IsEqualGUID (&SVCID_DNS_TYPE_CNAME, &sc))
-    rtype = GNUNET_GNS_RECORD_CNAME;
+    rtype = GNUNET_DNSPARSER_TYPE_CNAME;
   else if (IsEqualGUID (&SVCID_DNS_TYPE_SOA, &sc))
-    rtype = GNUNET_GNS_RECORD_SOA;
+    rtype = GNUNET_DNSPARSER_TYPE_SOA;
   else if (IsEqualGUID (&SVCID_DNS_TYPE_PTR, &sc))
-    rtype = GNUNET_GNS_RECORD_PTR;
+    rtype = GNUNET_DNSPARSER_TYPE_PTR;
   else if (IsEqualGUID (&SVCID_DNS_TYPE_MX, &sc))
-    rtype = GNUNET_GNS_RECORD_MX;
+    rtype = GNUNET_DNSPARSER_TYPE_MX;
   else if (IsEqualGUID (&SVCID_DNS_TYPE_TEXT, &sc))
-    rtype = GNUNET_GNS_RECORD_TXT;
+    rtype = GNUNET_DNSPARSER_TYPE_TXT;
   else if (IsEqualGUID (&SVCID_DNS_TYPE_AAAA, &sc))
-    rtype = GNUNET_GNS_RECORD_AAAA;
+    rtype = GNUNET_DNSPARSER_TYPE_AAAA;
   else if (IsEqualGUID (&SVCID_DNS_TYPE_SRV, &sc))
-    rtype = GNUNET_GNS_RECORD_SRV;
+    rtype = GNUNET_DNSPARSER_TYPE_SRV;
   else if (IsEqualGUID (&SVCID_INET_HOSTADDRBYNAME, &sc))
-    rtype = GNUNET_GNS_RECORD_A;
+    rtype = GNUNET_DNSPARSER_TYPE_A;
   else
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
index 46b16c323c71ed73629ed8d3285480403cb695af..719ab6212a5c1c71496da3a99a45b7b3e94d9c07 100644 (file)
@@ -1751,7 +1751,7 @@ process_leho_lookup (void *cls,
 
   for (i=0; i<rd_count; i++)
   {
-    if (rd[i].record_type != GNUNET_GNS_RECORD_LEHO)
+    if (rd[i].record_type != GNUNET_NAMESTORE_TYPE_LEHO)
       continue;
 
     memcpy (ctask->leho, rd[i].data, rd[i].data_size);
@@ -1849,7 +1849,7 @@ process_get_authority (void *cls,
   GNUNET_GNS_lookup_zone (gns_handle,
                           ctask->host,
                           local_gns_zone,
-                          GNUNET_GNS_RECORD_LEHO,
+                          GNUNET_NAMESTORE_TYPE_LEHO,
                           GNUNET_YES, //Only cached for performance
                           shorten_zonekey,
                           &process_leho_lookup,
index fa0a99590f086d79c23a9e15f7615d4e12f50708..d3b61d5102afb17ff1615ed5c119f420caae69c2 100644 (file)
@@ -62,7 +62,7 @@ static int raw;
 /**
  * Requested record type.
  */
-static enum GNUNET_GNS_RecordType rtype;
+static int rtype;
 
 /**
  * Handle to lookup request 
@@ -291,7 +291,7 @@ run (void *cls, char *const *args, const char *cfgfile,
   if (NULL != lookup_type)
     rtype = GNUNET_NAMESTORE_typename_to_number (lookup_type);
   else
-    rtype = GNUNET_GNS_RECORD_A;
+    rtype = GNUNET_DNSPARSER_TYPE_A;
 
   if ( (NULL != shorten_name) && 
        (NULL != shorten_zone) && 
index 1bd6d33d1bb216a160d169c5e7697d9314a6cb95..e1fc507fb148183682717c7b3515194e1c1e1877 100644 (file)
@@ -110,7 +110,7 @@ struct ClientShortenHandle
   /**
    * request type
    */
-  enum GNUNET_GNS_RecordType type;
+  int type;
 
   /** 
    * name to shorten
@@ -192,7 +192,7 @@ struct ClientLookupHandle
   /**
    * request type
    */
-  enum GNUNET_GNS_RecordType type;
+  int type;
 };
 
 
@@ -1129,7 +1129,7 @@ handle_lookup (void *cls,
     return;
   }
 
-  if ((GNUNET_GNS_RECORD_A == clh->type) &&
+  if ((GNUNET_DNSPARSER_TYPE_A == clh->type) &&
       (GNUNET_OK != v4_enabled))
   {
     GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
@@ -1139,7 +1139,7 @@ handle_lookup (void *cls,
     return;
   }
   
-  if ((GNUNET_GNS_RECORD_AAAA == clh->type) &&
+  if ((GNUNET_DNSPARSER_TYPE_AAAA == clh->type) &&
       (GNUNET_OK != v6_enabled))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
index 8f55b82848c98edb47900e1bb1b44a541bc3bb43..8f1f1fb0b074681a7b382d0d6644f441536b4aca 100644 (file)
@@ -123,16 +123,16 @@ reply_to_dns (void* cls, uint32_t rd_count,
       answer_records[i].type = rd[i].record_type;
       switch(rd[i].record_type)
       {
-       case GNUNET_GNS_RECORD_NS:
-       case GNUNET_GNS_RECORD_CNAME:
-       case GNUNET_GNS_RECORD_PTR:
+       case GNUNET_DNSPARSER_TYPE_NS:
+       case GNUNET_DNSPARSER_TYPE_CNAME:
+       case GNUNET_DNSPARSER_TYPE_PTR:
          answer_records[i].data.hostname = (char*)rd[i].data;
          break;
-       case GNUNET_GNS_RECORD_SOA:
+       case GNUNET_DNSPARSER_TYPE_SOA:
          answer_records[i].data.soa =
            (struct GNUNET_DNSPARSER_SoaRecord *)rd[i].data;
          break;
-       case GNUNET_GNS_RECORD_MX:
+       case GNUNET_DNSPARSER_TYPE_MX:
          answer_records[i].data.mx =
            (struct GNUNET_DNSPARSER_MxRecord *)rd[i].data;
          break;
@@ -150,16 +150,16 @@ reply_to_dns (void* cls, uint32_t rd_count,
       additional_records[i].type = rd[i].record_type;
       switch(rd[i].record_type)
       {
-       case GNUNET_GNS_RECORD_NS:
-       case GNUNET_GNS_RECORD_CNAME:
-       case GNUNET_GNS_RECORD_PTR:
+       case GNUNET_DNSPARSER_TYPE_NS:
+       case GNUNET_DNSPARSER_TYPE_CNAME:
+       case GNUNET_DNSPARSER_TYPE_PTR:
          additional_records[i].data.hostname = (char*)rd[i].data;
          break;
-       case GNUNET_GNS_RECORD_SOA:
+       case GNUNET_DNSPARSER_TYPE_SOA:
          additional_records[i].data.soa =
            (struct GNUNET_DNSPARSER_SoaRecord *)rd[i].data;
          break;
-       case GNUNET_GNS_RECORD_MX:
+       case GNUNET_DNSPARSER_TYPE_MX:
          additional_records[i].data.mx =
            (struct GNUNET_DNSPARSER_MxRecord *)rd[i].data;
          break;
index bd9daf56e59a618f7dada4f04f10ee8d63e8029c..b01200d8e72f7abc051904b87b84acbdbcf348d8 100644 (file)
@@ -296,7 +296,7 @@ process_pseu_lookup_ns (void* cls,
   new_pkey.expiration_time = UINT64_MAX;
   new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode);
   new_pkey.data = &gph->auth->zone;
-  new_pkey.record_type = GNUNET_GNS_RECORD_PKEY;
+  new_pkey.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   new_pkey.flags = GNUNET_NAMESTORE_RF_AUTHORITY
                  | GNUNET_NAMESTORE_RF_PRIVATE
                  | GNUNET_NAMESTORE_RF_PENDING;
@@ -436,7 +436,7 @@ process_auth_discovery_dht_result (void* cls,
       for (i=0; i < num_records; i++)
       {
         if ((strcmp (name, GNUNET_GNS_MASTERZONE_STR) == 0) &&
-            (rd[i].record_type == GNUNET_GNS_RECORD_PSEU))
+            (rd[i].record_type == GNUNET_NAMESTORE_TYPE_PSEU))
         {
           /* found pseu */
           process_pseu_result (gph, (char*)rd[i].data);
@@ -489,7 +489,7 @@ process_auth_discovery_ns_result (void* cls,
     gph->timeout = GNUNET_SCHEDULER_add_delayed (DHT_LOOKUP_TIMEOUT,
                                                 &handle_auth_discovery_timeout, gph);
 
-    xquery = htonl (GNUNET_GNS_RECORD_PSEU);
+    xquery = htonl (GNUNET_NAMESTORE_TYPE_PSEU);
     
     GNUNET_assert (gph->get_handle == NULL);
 
@@ -510,7 +510,7 @@ process_auth_discovery_ns_result (void* cls,
     if (0 != (strcmp (name, GNUNET_GNS_TLD_PLUS)))
       continue;
 
-    if (rd[i].record_type != GNUNET_GNS_RECORD_PSEU)
+    if (rd[i].record_type != GNUNET_NAMESTORE_TYPE_PSEU)
       continue;
 
     /* found pseu */
@@ -552,7 +552,7 @@ process_zone_to_name_discover (void *cls,
     gph->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle,
                                     &gph->auth->zone,
                                     GNUNET_GNS_MASTERZONE_STR,
-                                    GNUNET_GNS_RECORD_PSEU,
+                                    GNUNET_NAMESTORE_TYPE_PSEU,
                                     &process_auth_discovery_ns_result,
                                     gph);
     return;
@@ -1264,7 +1264,7 @@ process_record_result_vpn (void* cls, int af, const void *address)
     GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                "GNS_PHASE_REC-%llu: Answer is IPv4!\n",
                rh->id);
-    if (GNUNET_GNS_RECORD_A != rlh->record_type)
+    if (GNUNET_DNSPARSER_TYPE_A != rlh->record_type)
     {
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_REC-%llu: Requested record is not IPv4!\n",
@@ -1272,7 +1272,7 @@ process_record_result_vpn (void* cls, int af, const void *address)
       rh->proc (rh->proc_cls, rh, 0, NULL);
       return;
     }
-    rd.record_type = GNUNET_GNS_RECORD_A;
+    rd.record_type = GNUNET_DNSPARSER_TYPE_A;
     rd.expiration_time = UINT64_MAX; /* FIXME: should probably pick something shorter... */
     rd.data = address;
     rd.data_size = sizeof (struct in_addr);
@@ -1285,7 +1285,7 @@ process_record_result_vpn (void* cls, int af, const void *address)
     GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                "GNS_PHASE_REC-%llu: Answer is IPv6!\n",
                rh->id);
-    if (GNUNET_GNS_RECORD_AAAA != rlh->record_type)
+    if (GNUNET_DNSPARSER_TYPE_AAAA != rlh->record_type)
     {
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_REC-%llu: Requested record is not IPv6!\n",
@@ -1293,7 +1293,7 @@ process_record_result_vpn (void* cls, int af, const void *address)
       rh->proc (rh->proc_cls, rh, 0, NULL);
       return;
     }
-    rd.record_type = GNUNET_GNS_RECORD_AAAA;
+    rd.record_type = GNUNET_DNSPARSER_TYPE_AAAA;
     rd.expiration_time = UINT64_MAX; /* FIXME: should probably pick something shorter... */
     rd.data = address;
     rd.data_size = sizeof (struct in6_addr);
@@ -1383,14 +1383,14 @@ handle_dns_resolver (void *cls,
   if (sizeof (struct sockaddr_in) == addrlen)
   {
     sai = (struct sockaddr_in*) addr;
-    rd.record_type = GNUNET_GNS_RECORD_A;
+    rd.record_type = GNUNET_DNSPARSER_TYPE_A;
     rd.data_size = sizeof (struct in_addr);
     rd.data = &sai->sin_addr;
   }
   else if (sizeof (struct sockaddr_in6) == addrlen)
   {
     sai6 = (struct sockaddr_in6*) addr;
-    rd.record_type = GNUNET_GNS_RECORD_AAAA;
+    rd.record_type = GNUNET_DNSPARSER_TYPE_AAAA;
     rd.data_size = sizeof (struct in6_addr);
     rd.data = &sai6->sin6_addr;
   }
@@ -1418,8 +1418,8 @@ resolve_dns_name (struct ResolverHandle *rh)
   struct RecordLookupHandle *rlh = rh->proc_cls;
   int af;
 
-  if ((GNUNET_GNS_RECORD_A != rlh->record_type) &&
-      (GNUNET_GNS_RECORD_AAAA != rlh->record_type))
+  if ((GNUNET_DNSPARSER_TYPE_A != rlh->record_type) &&
+      (GNUNET_DNSPARSER_TYPE_AAAA != rlh->record_type))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Can only resolve A/AAAA via stub... abort\n");
@@ -1427,7 +1427,7 @@ resolve_dns_name (struct ResolverHandle *rh)
     return;
   }
 
-  if (GNUNET_GNS_RECORD_A == rlh->record_type)
+  if (GNUNET_DNSPARSER_TYPE_A == rlh->record_type)
     af = AF_INET;
   else
     af = AF_INET6;
@@ -1501,7 +1501,7 @@ read_dns_response (void *cls,
                packet->answers[i].type,
                rlh->record_type);
     /* http://tools.ietf.org/html/rfc1034#section-3.6.2 */
-    if (GNUNET_GNS_RECORD_CNAME == packet->answers[i].type)
+    if (GNUNET_DNSPARSER_TYPE_CNAME == packet->answers[i].type)
     {
       struct GNUNET_DNSPARSER_Query query;
       struct GNUNET_DNSPARSER_Packet npacket;
@@ -1591,7 +1591,7 @@ read_dns_response (void *cls,
 
   for (i = 0; i < packet->num_authority_records; i++)
   {    
-    if (packet->authority_records[i].type == GNUNET_GNS_RECORD_NS)
+    if (packet->authority_records[i].type == GNUNET_DNSPARSER_TYPE_NS)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Found NS delegation!\n");
@@ -1606,7 +1606,7 @@ read_dns_response (void *cls,
     if (GNUNET_NO == found_delegation)
       break;
 
-    if ((packet->additional_records[i].type == GNUNET_GNS_RECORD_A) &&
+    if ((packet->additional_records[i].type == GNUNET_DNSPARSER_TYPE_A) &&
         (0 == strcmp (packet->additional_records[i].name, delegation_name)))
     {
       GNUNET_assert (sizeof (struct in_addr) ==
@@ -1709,7 +1709,7 @@ resolve_record_dns (struct ResolverHandle *rh,
   for (i = 0; i < rd_count; i++)
   {
     /* Synthesize dns name */
-    if (GNUNET_GNS_RECORD_NS == rd[i].record_type)
+    if (GNUNET_DNSPARSER_TYPE_NS == rd[i].record_type)
     {
       strcpy (rh->dns_zone, (char*)rd[i].data);
       if (0 == strcmp (rh->name, ""))
@@ -1718,7 +1718,7 @@ resolve_record_dns (struct ResolverHandle *rh,
         sprintf (rh->dns_name, "%s.%s", rh->name, (char*)rd[i].data);
     }
     /* The glue */
-    if (GNUNET_GNS_RECORD_A == rd[i].record_type)
+    if (GNUNET_DNSPARSER_TYPE_A == rd[i].record_type)
       /* need to use memcpy as .data may be unaligned */
       memcpy (&dnsip, rd[i].data, sizeof (dnsip));
   }
@@ -1841,7 +1841,7 @@ resolve_record_vpn (struct ResolverHandle *rh,
               (char*)&vpn[1],
               GNUNET_h2s (&serv_desc));
   rh->proc = &handle_record_vpn;
-  if (GNUNET_GNS_RECORD_A == rlh->record_type)
+  if (GNUNET_DNSPARSER_TYPE_A == rlh->record_type)
     af = AF_INET;
   else
     af = AF_INET6;
@@ -2049,7 +2049,7 @@ process_pkey_revocation_result_ns (void *cls,
   
   for (i = 0; i < rd_count; i++)
   {
-    if (GNUNET_GNS_RECORD_REV == rd[i].record_type)
+    if (GNUNET_NAMESTORE_TYPE_REV == rd[i].record_type)
     {
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_DELEGATE_REV-%llu: Zone has been revoked.\n",
@@ -2071,11 +2071,11 @@ process_pkey_revocation_result_ns (void *cls,
     {
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
         "GNS_PHASE_DELEGATE_REV-%llu: Starting background lookup for %s type %d\n",
-        rh->id, "+.gads", GNUNET_GNS_RECORD_REV);
+        rh->id, "+.gads", GNUNET_NAMESTORE_TYPE_REV);
 
       gns_resolver_lookup_record(rh->authority,
                                  rh->private_local_zone,
-                                 GNUNET_GNS_RECORD_REV,
+                                 GNUNET_NAMESTORE_TYPE_REV,
                                  GNUNET_GNS_TLD,
                                  NULL,
                                  GNUNET_TIME_UNIT_FOREVER_REL,
@@ -2213,7 +2213,7 @@ process_delegation_result_dht (void* cls,
                  rh->id, name, rh->authority_name);
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_DELEGATE_DHT-%llu: Got type: %d (wanted %d)\n",
-                 rh->id, rd[i].record_type, GNUNET_GNS_RECORD_PKEY);
+                 rh->id, rd[i].record_type, GNUNET_NAMESTORE_TYPE_PKEY);
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_DELEGATE_DHT-%llu: Got data length: %d\n",
                  rh->id, rd[i].data_size);
@@ -2221,9 +2221,9 @@ process_delegation_result_dht (void* cls,
                  "GNS_PHASE_DELEGATE_DHT-%llu: Got flag %d\n",
                  rh->id, rd[i].flags);
       
-      if ((GNUNET_GNS_RECORD_VPN == rd[i].record_type) ||
-          (GNUNET_GNS_RECORD_NS == rd[i].record_type) ||
-          (GNUNET_GNS_RECORD_CNAME == rd[i].record_type))
+      if ((GNUNET_NAMESTORE_TYPE_VPN == rd[i].record_type) ||
+          (GNUNET_DNSPARSER_TYPE_NS == rd[i].record_type) ||
+          (GNUNET_DNSPARSER_TYPE_CNAME == rd[i].record_type))
       {
         /**
          * This is a VPN,NS,CNAME entry. Let namestore handle this after caching
@@ -2238,7 +2238,7 @@ process_delegation_result_dht (void* cls,
       }
 
       if ((0 == strcmp(name, rh->authority_name)) &&
-          (GNUNET_GNS_RECORD_PKEY == rd[i].record_type))
+          (GNUNET_NAMESTORE_TYPE_PKEY == rd[i].record_type))
       {
         GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                    "GNS_PHASE_DELEGATE_DHT-%llu: Authority found in DHT\n",
@@ -2339,7 +2339,7 @@ process_delegation_result_dht (void* cls,
     rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle,
                                     &rh->authority,
                                     GNUNET_GNS_MASTERZONE_STR,
-                                    GNUNET_GNS_RECORD_REV,
+                                    GNUNET_NAMESTORE_TYPE_REV,
                                     &process_pkey_revocation_result_ns,
                                     rh);
 
@@ -2460,12 +2460,12 @@ finish_lookup (struct ResolverHandle *rh,
   for (i = 0; i < rd_count; i++)
   {
     
-    if ((GNUNET_GNS_RECORD_NS != rd[i].record_type) &&
-        (GNUNET_GNS_RECORD_PTR != rd[i].record_type) &&
-        (GNUNET_GNS_RECORD_CNAME != rd[i].record_type) &&
-        (GNUNET_GNS_RECORD_MX != rd[i].record_type) &&
-        (GNUNET_GNS_RECORD_SOA != rd[i].record_type) &&
-        (GNUNET_GNS_RECORD_SRV != rd[i].record_type))
+    if ((GNUNET_DNSPARSER_TYPE_NS != rd[i].record_type) &&
+        (GNUNET_DNSPARSER_TYPE_PTR != rd[i].record_type) &&
+        (GNUNET_DNSPARSER_TYPE_CNAME != rd[i].record_type) &&
+        (GNUNET_DNSPARSER_TYPE_MX != rd[i].record_type) &&
+        (GNUNET_DNSPARSER_TYPE_SOA != rd[i].record_type) &&
+        (GNUNET_DNSPARSER_TYPE_SRV != rd[i].record_type))
     {
       p_rd[i].data = rd[i].data;
       continue;
@@ -2485,7 +2485,7 @@ finish_lookup (struct ResolverHandle *rh,
       repl_string = rlh->name+strlen(rh->name)+1;
 
     offset = 0;
-    if (GNUNET_GNS_RECORD_MX == rd[i].record_type)
+    if (GNUNET_DNSPARSER_TYPE_MX == rd[i].record_type)
     {
       memcpy (new_mx_data, (char*)rd[i].data, sizeof(uint16_t));
       offset = sizeof (uint16_t);
@@ -2497,7 +2497,7 @@ finish_lookup (struct ResolverHandle *rh,
       p_rd[i].data = new_mx_data;
       p_rd[i].data_size = offset;
     }
-    else if (GNUNET_GNS_RECORD_SRV == rd[i].record_type)
+    else if (GNUNET_DNSPARSER_TYPE_SRV == rd[i].record_type)
     {
       /*
        * Prio, weight and port
@@ -2513,7 +2513,7 @@ finish_lookup (struct ResolverHandle *rh,
       p_rd[i].data = new_srv_data;
       p_rd[i].data_size = sizeof (struct srv_data) + strlen ((char*)&new_srv[1]) + 1;
     }
-    else if (GNUNET_GNS_RECORD_SOA == rd[i].record_type)
+    else if (GNUNET_DNSPARSER_TYPE_SOA == rd[i].record_type)
     {
       /* expand mname and rname */
       old_soa = (struct soa_data*)rd[i].data;
@@ -2708,7 +2708,7 @@ handle_delegation_dht(void* cls, struct ResolverHandle *rh,
   
   if (0 == strcmp(rh->name, ""))
   {
-    if (GNUNET_GNS_RECORD_PKEY == rlh->record_type)
+    if (GNUNET_NAMESTORE_TYPE_PKEY == rlh->record_type)
     {
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_DELEGATE_DHT-%llu: Resolved queried PKEY via DHT.\n",
@@ -2798,7 +2798,7 @@ resolve_delegation_dht (struct ResolverHandle *rh)
              rh->authority_name,
              GNUNET_short_h2s (&rh->authority),
              rh->id);
-  xquery = htonl (GNUNET_GNS_RECORD_PKEY);
+  xquery = htonl (GNUNET_NAMESTORE_TYPE_PKEY);
   GNUNET_assert (rh->get_handle == NULL);
   rh->get_handle = GNUNET_DHT_get_start (dht_handle,
                                         GNUNET_BLOCK_TYPE_GNS_NAMERECORD,
@@ -2869,7 +2869,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh,
               rh->id);
     if (rh->status & RSL_CNAME_FOUND)
     {
-      if (GNUNET_GNS_RECORD_CNAME == rlh->record_type)
+      if (GNUNET_DNSPARSER_TYPE_CNAME == rlh->record_type)
       {
         GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                   "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried CNAME in NS.\n",
@@ -2915,7 +2915,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh,
     }
     else if (rh->status & RSL_DELEGATE_VPN)
     {
-      if (GNUNET_GNS_RECORD_VPN == rlh->record_type)
+      if (GNUNET_NAMESTORE_TYPE_VPN == rlh->record_type)
       {
         GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried VPNRR in NS.\n",
@@ -2933,7 +2933,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh,
     }
     else if (rh->status & RSL_DELEGATE_NS)
     {
-      if (GNUNET_GNS_RECORD_NS == rlh->record_type)
+      if (GNUNET_DNSPARSER_TYPE_NS == rlh->record_type)
       {
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                    "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n",
@@ -2959,7 +2959,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh,
         finish_lookup (rh, rlh, 0, NULL);
         return;
       }
-      else if (GNUNET_GNS_RECORD_PKEY == rlh->record_type)
+      else if (GNUNET_NAMESTORE_TYPE_PKEY == rlh->record_type)
       {
         GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                    "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried PKEY in NS.\n",
@@ -2979,7 +2979,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh,
   
   if (rh->status & RSL_DELEGATE_NS)
   {
-    if (GNUNET_GNS_RECORD_NS == rlh->record_type)
+    if (GNUNET_DNSPARSER_TYPE_NS == rlh->record_type)
     {
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n",
@@ -3157,7 +3157,7 @@ process_delegation_result_ns (void* cls,
   {
     switch (rd[i].record_type)
     {
-    case GNUNET_GNS_RECORD_CNAME:
+    case GNUNET_DNSPARSER_TYPE_CNAME:
       /* Like in regular DNS this should mean that there is no other
        * record for this name.  */
 
@@ -3169,14 +3169,14 @@ process_delegation_result_ns (void* cls,
       rh->status |= RSL_CNAME_FOUND;
       rh->proc (rh->proc_cls, rh, rd_count, rd);
       return;
-    case GNUNET_GNS_RECORD_VPN:
+    case GNUNET_NAMESTORE_TYPE_VPN:
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_DELEGATE_NS-%llu: VPN found.\n",
                  rh->id);
       rh->status |= RSL_DELEGATE_VPN;
       rh->proc (rh->proc_cls, rh, rd_count, rd);
       return;
-    case GNUNET_GNS_RECORD_NS:
+    case GNUNET_DNSPARSER_TYPE_NS:
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_DELEGATE_NS-%llu: NS `%.*s' found.\n",
                  rh->id,
@@ -3185,7 +3185,7 @@ process_delegation_result_ns (void* cls,
       rh->status |= RSL_DELEGATE_NS;
       rh->proc (rh->proc_cls, rh, rd_count, rd);
       return;
-    case GNUNET_GNS_RECORD_PKEY:
+    case GNUNET_NAMESTORE_TYPE_PKEY:
       rh->status |= RSL_DELEGATE_PKEY;
       if ((ignore_pending_records != 0) &&
          (rd[i].flags & GNUNET_NAMESTORE_RF_PENDING))
@@ -3234,7 +3234,7 @@ process_delegation_result_ns (void* cls,
       rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle,
                                                           &rh->authority,
                                                           GNUNET_GNS_MASTERZONE_STR,
-                                                          GNUNET_GNS_RECORD_REV,
+                                                          GNUNET_NAMESTORE_TYPE_REV,
                                                           &process_pkey_revocation_result_ns,
                                                           rh);
       return;
@@ -3300,7 +3300,7 @@ resolve_delegation_ns (struct ResolverHandle *rh)
   rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle,
                                                       &rh->authority,
                                                       rh->authority_name,
-                                                      GNUNET_GNS_RECORD_ANY,
+                                                      GNUNET_DNSPARSER_TYPE_ANY,
                                                       &process_delegation_result_ns,
                                                       rh);
 }
index 1d236b427ff7ebcaf7879178db55b91476dbef4f..1b10297c237e5613de77ee7d48793828a7e68930 100644 (file)
@@ -356,7 +356,7 @@ struct RecordLookupHandle
   /**
    * the record type to look up 
    */
-  enum GNUNET_GNS_RecordType record_type;
+  int record_type;
 
   /**
    * the name to look up 
index 3255830016a005456edf6e5bce633d1543cf25be..58f0e1c9e5c1a48654bb96ad3ea8a8191dce0bd4 100644 (file)
@@ -132,7 +132,7 @@ on_lookup_result_cname (void *cls,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_CNAME)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_CNAME)
       {
         GNUNET_log (GNUNET_ERROR_TYPE_INFO, "CNAME: %s\n", rd[i].data);
         if (0 == strcmp(rd[i].data, TEST_RECORD_CNAME_SERVER))
@@ -173,7 +173,7 @@ on_lookup_result_dns (void *cls,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
        memcpy(&a, rd[i].data, sizeof(a));
        addr = inet_ntoa(a);
@@ -191,7 +191,7 @@ on_lookup_result_dns (void *cls,
       }
     }
   }
-  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_PLUS, GNUNET_GNS_RECORD_CNAME,
+  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_PLUS, GNUNET_DNSPARSER_TYPE_CNAME,
                      GNUNET_YES,
                      NULL,
                      &on_lookup_result_cname, TEST_DOMAIN_PLUS);
@@ -221,7 +221,7 @@ on_lookup_result_zkey (void *cls, uint32_t rd_count,
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                "type: %d\n", rd[i].record_type);
-    if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+    if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
     {
       memcpy (&a, rd[i].data, sizeof(a));
       addr = inet_ntoa(a);
@@ -241,7 +241,7 @@ on_lookup_result_zkey (void *cls, uint32_t rd_count,
                  "No resolution!\n");
     }
   }  
-  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_DNS, GNUNET_GNS_RECORD_A,
+  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_DNS, GNUNET_DNSPARSER_TYPE_A,
                     GNUNET_YES,
                     NULL,
                     &on_lookup_result_dns, TEST_DOMAIN_DNS);
@@ -269,7 +269,7 @@ on_lookup_result_plus (void *cls, uint32_t rd_count,
   for (i=0; i<rd_count; i++)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-    if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+    if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
     {
       memcpy(&a, rd[i].data, sizeof(a));
       addr = inet_ntoa(a);
@@ -286,7 +286,7 @@ on_lookup_result_plus (void *cls, uint32_t rd_count,
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No resolution!\n");
     }
   }
-  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_ZKEY, GNUNET_GNS_RECORD_A,
+  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_ZKEY, GNUNET_DNSPARSER_TYPE_A,
                     GNUNET_YES,
                     NULL,
                     &on_lookup_result_zkey, TEST_DOMAIN_ZKEY);
@@ -322,7 +322,7 @@ commence_testing (void *cls, int32_t success, const char *emsg)
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_PLUS, GNUNET_GNS_RECORD_A,
+  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_PLUS, GNUNET_DNSPARSER_TYPE_A,
                     GNUNET_YES,
                     NULL,
                     &on_lookup_result_plus, TEST_DOMAIN_PLUS);
@@ -387,7 +387,7 @@ do_check (void *cls,
 
   rd.data_size = strlen (TEST_RECORD_CNAME_PLUS);
   rd.data = TEST_RECORD_CNAME_PLUS;
-  rd.record_type = GNUNET_GNS_RECORD_CNAME;
+  rd.record_type = GNUNET_DNSPARSER_TYPE_CNAME;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
                                            alice_key,
@@ -398,7 +398,7 @@ do_check (void *cls,
 
   rd.data_size = strlen (TEST_RECORD_CNAME_ZKEY);
   rd.data = TEST_RECORD_CNAME_ZKEY;
-  rd.record_type = GNUNET_GNS_RECORD_CNAME;
+  rd.record_type = GNUNET_DNSPARSER_TYPE_CNAME;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
                                            alice_key,
@@ -409,7 +409,7 @@ do_check (void *cls,
 
   rd.data_size = strlen (TEST_RECORD_CNAME_DNS);
   rd.data = TEST_RECORD_CNAME_DNS;
-  rd.record_type = GNUNET_GNS_RECORD_CNAME;
+  rd.record_type = GNUNET_DNSPARSER_TYPE_CNAME;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
                                            alice_key,
index fbaacfdfa1d9c7a2522b13050eb95d2062bb73f0..104c6e01dea0ff586c73fdab78c35991e3d7afed 100644 (file)
@@ -156,7 +156,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
         memcpy(&a, rd[i].data, sizeof(a));
         addr = inet_ntoa(a);
@@ -198,7 +198,7 @@ commence_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     return;
   }
 
-  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
+  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A,
                     GNUNET_NO,
                     NULL,
                     &on_lookup_result, TEST_DOMAIN);
@@ -343,7 +343,7 @@ do_check (void *cls,
   rd.expiration_time = UINT64_MAX;
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
index 11f78db4b422f171aa1db22b07ff4c5e595401e0..968889b0da42437fdcf9556312598d461352520c 100644 (file)
@@ -261,7 +261,7 @@ commence_testing(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   {
     fprintf (stderr, "\n");
     wait_task = GNUNET_SCHEDULER_NO_TASK;
-    lookup_handle = GNUNET_GNS_lookup(gh, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
+    lookup_handle = GNUNET_GNS_lookup(gh, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A,
                       GNUNET_NO,
                       NULL,
                       &on_lookup_result, TEST_DOMAIN);
@@ -353,7 +353,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg)
   GNUNET_assert(1 == inet_pton (AF_INET, TEST_IP, web));
   rd.data_size = sizeof(struct in_addr);
   rd.data = web;
-  rd.record_type = GNUNET_GNS_RECORD_A;
+  rd.record_type = GNUNET_DNSPARSER_TYPE_A;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (nh[0], key, "www", 
@@ -362,7 +362,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg)
 
   rd.data_size = strlen(TEST_DAVE_PSEU);
   rd.data = TEST_DAVE_PSEU;
-  rd.record_type = GNUNET_GNS_RECORD_PSEU;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PSEU;
 
 
   GNUNET_NAMESTORE_record_put_by_authority (nh[0], key, 
@@ -421,7 +421,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg)
   rd.expiration_time = UINT64_MAX;
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &dave_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (nh[1], key, "buddy",
@@ -473,7 +473,7 @@ setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg)
   rd.expiration_time = UINT64_MAX;
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (nh[2], key, "bob", 
index cc993e3478ccd638d626d697ff54892177d7a301..c63495ca31bb475c253f90bf749b1296e87d6646 100644 (file)
@@ -182,7 +182,7 @@ on_lookup_result (void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
         memcpy(&a, rd[i].data, sizeof(a));
         addr = inet_ntoa(a);
@@ -231,13 +231,13 @@ commence_testing (void *cls, int32_t success, const char *emsg)
     GNUNET_snprintf(lookup_name,
                     GNUNET_DNSPARSER_MAX_NAME_LENGTH,
                     "www.doesnotexist-%d.bob.gads", i);
-    lr = GNUNET_GNS_lookup (gns_handle, lookup_name, GNUNET_GNS_RECORD_A,
+    lr = GNUNET_GNS_lookup (gns_handle, lookup_name, GNUNET_DNSPARSER_TYPE_A,
                            GNUNET_NO,
                            NULL,
                            &on_lookup_result_dummy, &requests[num_requests]);
     requests[num_requests++] = lr;
   }
-  lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
+  lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A,
                          GNUNET_NO,
                          NULL,
                          &on_lookup_result, TEST_DOMAIN);
@@ -320,7 +320,7 @@ do_check (void *cls,
   GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
                                            alice_key,
index 0673243b6b6406b6089df09f6d2c83254c6f14ef..77398b3de821fa8d24ed2a100867b6e6ea49ef9c 100644 (file)
@@ -267,7 +267,7 @@ on_lookup_result_alt2 (void *cls, uint32_t rd_count,
   ok = 1;
   for (i=0; i<rd_count; i++)
   {
-    if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+    if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
     {
       memcpy(&a, rd[i].data, sizeof(a));
       addr = inet_ntoa(a);
@@ -335,7 +335,7 @@ on_lookup_result_alt (void *cls, uint32_t rd_count,
   ok = 1;
   for (i=0; i<rd_count; i++)
   {
-    if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+    if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
     {
       memcpy (&a, rd[i].data, sizeof(a));
       addr = inet_ntoa (a);
@@ -366,7 +366,7 @@ on_lookup_result_alt (void *cls, uint32_t rd_count,
              "Starting lookup for `%s'\n",
              TEST_DOMAIN_ALT2);
   lr = GNUNET_GNS_lookup (gns_handle, 
-                         TEST_DOMAIN_ALT2, GNUNET_GNS_RECORD_A,
+                         TEST_DOMAIN_ALT2, GNUNET_DNSPARSER_TYPE_A,
                          GNUNET_YES,
                          NULL,
                          &on_lookup_result_alt2, NULL);
@@ -407,7 +407,7 @@ on_lookup_result (void *cls, uint32_t rd_count,
   ok = 1;
   for (i=0; i<rd_count; i++)
   {
-    if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+    if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
     {
       memcpy (&a, rd[i].data, sizeof(a));
       addr = inet_ntoa(a);
@@ -438,7 +438,7 @@ on_lookup_result (void *cls, uint32_t rd_count,
              "Starting lookup for `%s'\n",
              TEST_DOMAIN_ALT);
 
-  lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_ALT, GNUNET_GNS_RECORD_A,
+  lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_ALT, GNUNET_DNSPARSER_TYPE_A,
                          GNUNET_YES,
                          NULL,
                          &on_lookup_result_alt, NULL);
@@ -462,7 +462,7 @@ start_lookup ()
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
              "Records ready, starting lookup for `%s'\n",
              TEST_DOMAIN);
-  lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
+  lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A,
                          GNUNET_YES,
                          NULL,
                          &on_lookup_result, NULL);
@@ -606,7 +606,7 @@ do_check (void *cls,
   rd[1].expiration_time = UINT64_MAX;
   rd[1].data_size = strlen (TEST_RECORD_NS);
   rd[1].data = TEST_RECORD_NS;
-  rd[1].record_type = GNUNET_GNS_RECORD_NS;
+  rd[1].record_type = GNUNET_DNSPARSER_TYPE_NS;
   rd[1].flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   qe = GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
index 050e2d258baad531169cc01c063f8748999449a5..d9c660c86b676a376c94ed2cdb2304343a225a29 100644 (file)
@@ -423,11 +423,11 @@ run (void *cls,
 
   host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile);
   rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
-  GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_GNS_RECORD_A,
+  GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_DNSPARSER_TYPE_A,
                                                                "127.0.0.1",
                                                                (void**)&rd.data,
                                                                &rd.data_size));
-  rd.record_type = GNUNET_GNS_RECORD_A;
+  rd.record_type = GNUNET_DNSPARSER_TYPE_A;
 
   GNUNET_NAMESTORE_record_create (namestore,
                                   host_key,
index ba7cd24929bb0624c311c0d0cb6cfa8f688ebe27..c6724ab05d94477f429a5d01273b118869e0919e 100644 (file)
@@ -200,7 +200,7 @@ on_lookup_result (void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
         memcpy(&a, rd[i].data, sizeof(a));
         addr = inet_ntoa(a);
@@ -247,7 +247,7 @@ commence_testing (void *cls, int success)
   }
   GNUNET_GNS_lookup_zone (gns_handle, TEST_DOMAIN,
                           &our_zone,
-                          GNUNET_GNS_RECORD_A,
+                          GNUNET_DNSPARSER_TYPE_A,
                           GNUNET_NO,
                           short_key,
                           &on_lookup_result, TEST_DOMAIN);
@@ -272,7 +272,7 @@ put_pseu_dht (void *cls, int success)
   rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
   rd.data_size = strlen(TEST_PSEU_ALICE)+1;
   rd.data = TEST_PSEU_ALICE;
-  rd.record_type = GNUNET_GNS_RECORD_PSEU;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PSEU;
   rd.flags = 0;
 
   sig = GNUNET_NAMESTORE_create_signature(alice_key,
@@ -447,7 +447,7 @@ put_pkey_dht (void *cls, int32_t success, const char *emsg)
   rd.expiration_time = UINT64_MAX;
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &alice_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
   
   sig = GNUNET_NAMESTORE_create_signature (bob_key,
@@ -518,7 +518,7 @@ fin_init_zone (void *cls, int32_t success, const char *emsg)
   rd.expiration_time = UINT64_MAX;
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
   
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
@@ -539,7 +539,7 @@ cont_init_zone (void *cls, int32_t success, const char *emsg)
   rd.expiration_time = UINT64_MAX;
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &short_zone;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
@@ -640,7 +640,7 @@ do_check (void *cls,
   rd.expiration_time = UINT64_MAX;
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &priv_zone;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
index e66655203e6d4011729f65f3835229d9f5c01bfe..85da4a09a4391b701a73d94c4ac98dbcdc6ec503 100644 (file)
@@ -130,7 +130,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
         memcpy(&a, rd[i].data, sizeof(a));
         addr = inet_ntoa(a);
@@ -168,7 +168,7 @@ commence_testing (void *cls, int32_t success, const char *emsg)
     return;
   }
 
-  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
+  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A,
                     GNUNET_NO,
                     NULL,
                     &on_lookup_result, TEST_DOMAIN);
@@ -225,7 +225,7 @@ do_check (void *cls,
 
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
@@ -253,7 +253,7 @@ do_check (void *cls,
                                NULL,
                                NULL);
   rd.data_size = 0;
-  rd.record_type = GNUNET_GNS_RECORD_REV;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_REV;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
                                            bob_key,
index 8b5f8bc38e344ea5d59ef926c811f2a75d960fd9..522b74d29b3bbbcd0e40a3bf3f194036a82f2f41 100644 (file)
@@ -138,7 +138,7 @@ on_lookup_result (void *cls, uint32_t rd_count,
   for (i=0; i<rd_count; i++)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-    if (rd[i].record_type != GNUNET_GNS_RECORD_A)
+    if (rd[i].record_type != GNUNET_DNSPARSER_TYPE_A)
       continue;
     memcpy (&a, rd[i].data, sizeof (a));
     addr = inet_ntoa (a);
@@ -177,7 +177,7 @@ commence_testing (void *cls, int32_t success, const char *emsg)
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
+  GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A,
                     GNUNET_NO,
                     NULL,
                     &on_lookup_result, TEST_DOMAIN);
@@ -232,7 +232,7 @@ do_check (void *cls,
   GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash);
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
                                            alice_key,
index 7a3e8af93227862b85362f177da718df684ca838..b874558579f587dfd11fa0ed52a906a8e575d806 100644 (file)
@@ -231,7 +231,7 @@ void do_check (void *cls,
 
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   /* put bob into our zone */
@@ -280,7 +280,7 @@ void do_check (void *cls,
 
   rd.data_size = strlen(TEST_ALICE_PSEU);
   rd.data = TEST_ALICE_PSEU;
-  rd.record_type = GNUNET_GNS_RECORD_PSEU;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PSEU;
   GNUNET_free(sig);
 
   sig = GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_UNIT_FOREVER_ABS,  "",
index fceb8f0528d1357308bb76e31439fb8b4996e3b1..471e6843a8c1d3b145e0c7d2b488202b700572c9 100644 (file)
@@ -153,7 +153,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
         memcpy (&a, rd[i].data, sizeof(a));
         addr = inet_ntoa(a);
@@ -209,7 +209,7 @@ commence_testing (void *cls,
     end_badly_now ();
     return;
   }
-  lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
+  lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A,
                          GNUNET_YES,
                          NULL,
                          &on_lookup_result, TEST_DOMAIN);
index b078edc4fabe60c8928ada25a8a4f45b060cb1d6..a6839e54946dc649e178adfbbd907205eab5ba6b 100644 (file)
@@ -131,7 +131,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_MX)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_MX)
       {
         mx = (char*)rd[i].data+sizeof(uint16_t);
         mx_preference = *(uint16_t*)rd[i].data;
@@ -168,7 +168,7 @@ commence_testing (void *cls, int32_t success, const char *emsg)
     end_badly_now();
     return;
   }
-  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_MX,
+  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_MX,
                     GNUNET_NO,
                     NULL,
                     &on_lookup_result, TEST_DOMAIN);
@@ -228,7 +228,7 @@ do_check (void *cls,
 
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
@@ -262,7 +262,7 @@ do_check (void *cls,
   memcpy(mx_record, &mx_preference, sizeof(uint16_t));
   strcpy(mx_record+sizeof(uint16_t), TEST_MX_NAME);
   rd.data = mx_record;
-  rd.record_type = GNUNET_GNS_RECORD_MX;
+  rd.record_type = GNUNET_DNSPARSER_TYPE_MX;
   sig = GNUNET_NAMESTORE_create_signature(bob_key,
                                           GNUNET_TIME_UNIT_FOREVER_ABS,
                                           GNUNET_GNS_MASTERZONE_STR,
index 679a74dc810fa8b7513d18fef13a064dc6ce32b4..ab81292542761cd54cc243152764c14b3bbed5b1 100644 (file)
@@ -256,7 +256,7 @@ void do_check (void *cls,
 
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
   
   /* put bob into our zone */
@@ -308,7 +308,7 @@ void do_check (void *cls,
   
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &alice_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   GNUNET_free(sig);
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
index 601d01af9500d0f47c306218488aaaadfc8a05ab..498b7e13175ce6f34ff0c72b4c9c0a10581234f7 100644 (file)
@@ -130,7 +130,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_SRV)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_SRV)
       {
         srv_data = (uint16_t*)rd[i].data;
         srv = (char*)&srv_data[3];
@@ -170,7 +170,7 @@ commence_testing (void *cls, int32_t success, const char *emsg)
     return;
   }
 
-  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_SRV,
+  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_SRV,
                     GNUNET_NO,
                     NULL,
                     &on_lookup_result, TEST_DOMAIN);
@@ -234,7 +234,7 @@ do_check (void *cls,
 
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
@@ -269,7 +269,7 @@ do_check (void *cls,
   srv_data->weight = srv_weight;
   strcpy((char*)&srv_data[1], TEST_SRV_NAME);
   rd.data = srv_data;
-  rd.record_type = GNUNET_GNS_RECORD_SRV;
+  rd.record_type = GNUNET_DNSPARSER_TYPE_SRV;
   sig = GNUNET_NAMESTORE_create_signature(bob_key,
                                           GNUNET_TIME_UNIT_FOREVER_ABS,
                                           TEST_RECORD_NAME_SRV,
index c0e3afc8d485f8894cf13d5795f4675800d9daea..806655d3c33ecbc2cf54652b079c0136ca122025 100644 (file)
@@ -132,7 +132,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
         memcpy(&a, rd[i].data, sizeof(a));
         addr = inet_ntoa(a);
@@ -187,7 +187,7 @@ commence_testing (void *cls, int32_t success, const char *emsg)
   pos++;
   strcpy(pos, GNUNET_GNS_TLD_ZKEY);
 
-  GNUNET_GNS_lookup(gns_handle, name, GNUNET_GNS_RECORD_A,
+  GNUNET_GNS_lookup(gns_handle, name, GNUNET_DNSPARSER_TYPE_A,
                     GNUNET_NO,
                     NULL,
                     &on_lookup_result, NULL);
@@ -243,7 +243,7 @@ do_check (void *cls,
 
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
index 47d02ac7c2698d42271f81be987ef016f91485e4..d9aad6d773a7f533aeb963b32beb3724b7e24518 100644 (file)
@@ -1,6 +1,6 @@
 /*
       This file is part of GNUnet
-      (C) 2012 Christian Grothoff (and other contributing authors)
+      (C) 2012-2013 Christian Grothoff (and other contributing authors)
 
       GNUnet is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License as published
@@ -55,100 +55,6 @@ struct GNUNET_GNS_Handle;
  */
 struct GNUNET_GNS_LookupRequest;
 
-/**
- * Handle to control a shorten operation.
- */
-struct GNUNET_GNS_ShortenRequest;
-
-/**
- * Handle to control a get authority operation
- */
-struct GNUNET_GNS_GetAuthRequest;
-
-/**
- * Record types
- * Based on GNUNET_DNSPARSER_TYPEs (standard DNS)
- */
-enum GNUNET_GNS_RecordType
-{
-  /**
-   * A 'struct in_addr'
-   */
-  GNUNET_GNS_RECORD_A          = GNUNET_DNSPARSER_TYPE_A,
-
-  /**
-   * A 'char *'
-   */
-  GNUNET_GNS_RECORD_NS         = GNUNET_DNSPARSER_TYPE_NS,
-
-  /**
-   * A 'char *'
-   */
-  GNUNET_GNS_RECORD_CNAME      = GNUNET_DNSPARSER_TYPE_CNAME,
-
-  /**
-   * A 'struct soa_data'
-   */
-  GNUNET_GNS_RECORD_SOA        = GNUNET_DNSPARSER_TYPE_SOA,
-
-  /**
-   * A 'struct srv_data'
-   */
-  GNUNET_GNS_RECORD_SRV        = GNUNET_DNSPARSER_TYPE_SRV,
-
-  /**
-   * A 'char *'
-   */
-  GNUNET_GNS_RECORD_PTR        = GNUNET_DNSPARSER_TYPE_PTR,
-
-  /**
-   * A 'uint16_t' and a 'char *'
-   */
-  GNUNET_GNS_RECORD_MX         = GNUNET_DNSPARSER_TYPE_MX,
-
-  /**
-   * A 'char *'
-   */
-  GNUNET_GNS_RECORD_TXT        = GNUNET_DNSPARSER_TYPE_TXT,
-
-  /**
-   * A 'struct in6_addr'
-   */
-  GNUNET_GNS_RECORD_AAAA       = GNUNET_DNSPARSER_TYPE_AAAA,
-
-  /* GNS specific */
-  /**
-   * A 'struct GNUNET_CRYPTO_ShortHashCode'
-   */
-  GNUNET_GNS_RECORD_PKEY = GNUNET_NAMESTORE_TYPE_PKEY,
-
-  /**
-   * A 'char *'
-   */
-  GNUNET_GNS_RECORD_PSEU = GNUNET_NAMESTORE_TYPE_PSEU,
-  GNUNET_GNS_RECORD_ANY  = GNUNET_NAMESTORE_TYPE_ANY,
-
-  /**
-   * A 'char *'
-   */
-  GNUNET_GNS_RECORD_LEHO = GNUNET_NAMESTORE_TYPE_LEHO,
-
-  /**
-   * A 'struct vpn_data'
-   */
-  GNUNET_GNS_RECORD_VPN  = GNUNET_NAMESTORE_TYPE_VPN,
-
-  /**
-   * Revocation, no data.
-   */
-  GNUNET_GNS_RECORD_REV  = GNUNET_NAMESTORE_TYPE_REV,
-
-  /**
-   * Social place.
-   */
-  GNUNET_GNS_RECORD_PLACE  = GNUNET_NAMESTORE_TYPE_PLACE
-};
-
 
 /**
  * Initialize the connection with the GNS service.
@@ -169,14 +75,11 @@ void
 GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle);
 
 
-/* *************** Standard API: lookup ******************* */
-
 /**
- * Iterator called on obtained result for a GNS
- * lookup
+ * Iterator called on obtained result for a GNS lookup.
  *
  * @param cls closure
- * @param rd_count number of records
+ * @param rd_count number of records in @a rd
  * @param rd the records in reply
  */
 typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls,
@@ -184,14 +87,13 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls,
                                                  const struct GNUNET_NAMESTORE_RecordData *rd);
 
 
-
 /**
  * Perform an asynchronous lookup operation on the GNS.
  *
  * @param handle handle to the GNS service
  * @param name the name to look up
  * @param zone zone to look in
- * @param type the record type to look for
+ * @param type the GNS record type to look for
  * @param only_cached #GNUNET_NO to only check locally (not in the DHT)
  * @param shorten_zone_key the private key of the shorten zone (can be NULL);
  *                    specify to enable automatic shortening (given a PSEU
@@ -206,7 +108,7 @@ struct GNUNET_GNS_LookupRequest*
 GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
                   const char *name,
                   const struct GNUNET_CRYPTO_EccPublicKey *zone,
-                  enum GNUNET_GNS_RecordType type,
+                  int type,
                   int only_cached,
                   struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key,
                   GNUNET_GNS_LookupResultProcessor proc,
@@ -222,45 +124,6 @@ void
 GNUNET_GNS_cancel_lookup_request (struct GNUNET_GNS_LookupRequest *lr);
 
 
-
-/* *************** Standard API: get authority ******************* */
-
-
-/**
- * Processor called on for a name shortening result
- * called only once
- *
- * @param cls closure
- * @param auth_name the name of the auhtority or NULL
- */
-typedef void (*GNUNET_GNS_GetAuthResultProcessor) (void *cls,
-                                                  const char* short_name);
-
-
-/**
- * Perform an authority lookup for a given name.
- *
- * @param handle handle to the GNS service
- * @param name the name to look up authority for
- * @param proc function to call on result
- * @param proc_cls closure for processor
- * @return handle to the operation
- */
-struct GNUNET_GNS_GetAuthRequest*
-GNUNET_GNS_get_authority (struct GNUNET_GNS_Handle *handle,
-                         const char *name,
-                         GNUNET_GNS_GetAuthResultProcessor proc,
-                         void *proc_cls);
-
-
-/**
- * Cancel pending get auth request
- *
- * @param gar the lookup request to cancel
- */
-void
-GNUNET_GNS_cancel_get_auth_request (struct GNUNET_GNS_GetAuthRequest *gar);
-
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
 #endif
index 5c31bd779ebef286eec20548d422ff1c085f368c..0be066317b599f9c5a73d6cd7c6aafd6855cd280 100644 (file)
@@ -395,11 +395,11 @@ run (void *cls,
   host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile);
   rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
   GNUNET_asprintf (&rd_string, "6 %s %s", (char*)&peername, "www.gads.");
-  GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_GNS_RECORD_VPN,
+  GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_NAMESTORE_TYPE_VPN,
                                                                rd_string,
                                                                (void**)&rd.data,
                                                                &rd.data_size));
-  rd.record_type = GNUNET_GNS_RECORD_VPN;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_VPN;
 
   GNUNET_NAMESTORE_records_store (namestore,
                                  host_key,