diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-13 17:10:07 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-13 17:10:07 +0000 |
commit | bfbbb1e8700093783da55c84221fc688eee4c9a0 (patch) | |
tree | 83693440965fff521bc21af1debf963b95d77471 | |
parent | ee32003b7e606767f9b89715cb956d863fe067d9 (diff) | |
download | gnunet-bfbbb1e8700093783da55c84221fc688eee4c9a0.tar.gz gnunet-bfbbb1e8700093783da55c84221fc688eee4c9a0.zip |
-getting rid of duplication of record type values / enum GNUNET_GNS_RecordType
27 files changed, 163 insertions, 300 deletions
diff --git a/src/gns/gns.h b/src/gns/gns.h index a4830bda4..a7697be1d 100644 --- a/src/gns/gns.h +++ b/src/gns/gns.h | |||
@@ -83,7 +83,7 @@ struct GNUNET_GNS_ClientLookupMessage | |||
83 | /** | 83 | /** |
84 | * the type of record to look up | 84 | * the type of record to look up |
85 | */ | 85 | */ |
86 | /* enum GNUNET_GNS_RecordType */ uint32_t type; | 86 | /* int */ uint32_t type; |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * The key for shorten, if 'have_key' is set | 89 | * The key for shorten, if 'have_key' is set |
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index e672c5687..64f5144c6 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2009, 2010, 2012 Christian Grothoff (and other contributing authors) | 3 | (C) 2009-2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -821,7 +821,7 @@ struct GNUNET_GNS_LookupRequest* | |||
821 | GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, | 821 | GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, |
822 | const char *name, | 822 | const char *name, |
823 | struct GNUNET_CRYPTO_ShortHashCode *zone, | 823 | struct GNUNET_CRYPTO_ShortHashCode *zone, |
824 | enum GNUNET_GNS_RecordType type, | 824 | int type, |
825 | int only_cached, | 825 | int only_cached, |
826 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, | 826 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, |
827 | GNUNET_GNS_LookupResultProcessor proc, | 827 | GNUNET_GNS_LookupResultProcessor proc, |
@@ -900,7 +900,7 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, | |||
900 | struct GNUNET_GNS_LookupRequest * | 900 | struct GNUNET_GNS_LookupRequest * |
901 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | 901 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, |
902 | const char *name, | 902 | const char *name, |
903 | enum GNUNET_GNS_RecordType type, | 903 | int type, |
904 | int only_cached, | 904 | int only_cached, |
905 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, | 905 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, |
906 | GNUNET_GNS_LookupResultProcessor proc, | 906 | GNUNET_GNS_LookupResultProcessor proc, |
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index c1fdc2dc8..8cef98489 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c | |||
@@ -356,7 +356,7 @@ handle_request (struct GNUNET_NETWORK_Handle *lsock, | |||
356 | char *dot; | 356 | char *dot; |
357 | char *nname; | 357 | char *nname; |
358 | size_t name_len; | 358 | size_t name_len; |
359 | enum GNUNET_GNS_RecordType type; | 359 | int type; |
360 | int use_gns; | 360 | int use_gns; |
361 | struct GNUNET_CRYPTO_ShortHashCode zone; | 361 | struct GNUNET_CRYPTO_ShortHashCode zone; |
362 | 362 | ||
diff --git a/src/gns/gnunet-gns-helper-service-w32.c b/src/gns/gnunet-gns-helper-service-w32.c index f0bf6577c..187ee41ae 100644 --- a/src/gns/gnunet-gns-helper-service-w32.c +++ b/src/gns/gnunet-gns-helper-service-w32.c | |||
@@ -282,13 +282,13 @@ process_ip_lookup_result (void* cls, | |||
282 | { | 282 | { |
283 | switch (rd[i].record_type) | 283 | switch (rd[i].record_type) |
284 | { | 284 | { |
285 | case GNUNET_GNS_RECORD_A: | 285 | case GNUNET_DNSPARSER_TYPE_A: |
286 | if (rd[i].data_size != sizeof (struct in_addr)) | 286 | if (rd[i].data_size != sizeof (struct in_addr)) |
287 | continue; | 287 | continue; |
288 | size += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in) * 2; | 288 | size += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in) * 2; |
289 | csanum++; | 289 | csanum++; |
290 | break; | 290 | break; |
291 | case GNUNET_GNS_RECORD_AAAA: | 291 | case GNUNET_DNSPARSER_TYPE_AAAA: |
292 | if (rd[i].data_size != sizeof (struct in6_addr)) | 292 | if (rd[i].data_size != sizeof (struct in6_addr)) |
293 | continue; | 293 | continue; |
294 | size += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in6) * 2; | 294 | size += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in6) * 2; |
@@ -305,13 +305,13 @@ process_ip_lookup_result (void* cls, | |||
305 | blobsize += sizeof (void *); /* For addresses */ | 305 | blobsize += sizeof (void *); /* For addresses */ |
306 | for (i = 0; i < rd_count; i++) | 306 | for (i = 0; i < rd_count; i++) |
307 | { | 307 | { |
308 | if ((rq->af == AF_INET || rq->af == AF_UNSPEC) && rd[i].record_type == GNUNET_GNS_RECORD_A) | 308 | if ((rq->af == AF_INET || rq->af == AF_UNSPEC) && rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
309 | { | 309 | { |
310 | blobsize += sizeof (void *); | 310 | blobsize += sizeof (void *); |
311 | blobsize += sizeof (struct in_addr); | 311 | blobsize += sizeof (struct in_addr); |
312 | blobaddrcount++; | 312 | blobaddrcount++; |
313 | } | 313 | } |
314 | else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_GNS_RECORD_AAAA) | 314 | else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_DNSPARSER_TYPE_AAAA) |
315 | { | 315 | { |
316 | blobsize += sizeof (void *); | 316 | blobsize += sizeof (void *); |
317 | blobsize += sizeof (struct in6_addr); | 317 | blobsize += sizeof (struct in6_addr); |
@@ -367,7 +367,7 @@ process_ip_lookup_result (void* cls, | |||
367 | { | 367 | { |
368 | switch (rd[i].record_type) | 368 | switch (rd[i].record_type) |
369 | { | 369 | { |
370 | case GNUNET_GNS_RECORD_A: | 370 | case GNUNET_DNSPARSER_TYPE_A: |
371 | if (rd[i].data_size != sizeof (struct in_addr)) | 371 | if (rd[i].data_size != sizeof (struct in_addr)) |
372 | continue; | 372 | continue; |
373 | qs->lpcsaBuffer[j].iSocketType = SOCK_STREAM; | 373 | qs->lpcsaBuffer[j].iSocketType = SOCK_STREAM; |
@@ -389,7 +389,7 @@ process_ip_lookup_result (void* cls, | |||
389 | size_recalc += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in) * 2; | 389 | size_recalc += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in) * 2; |
390 | j++; | 390 | j++; |
391 | break; | 391 | break; |
392 | case GNUNET_GNS_RECORD_AAAA: | 392 | case GNUNET_DNSPARSER_TYPE_AAAA: |
393 | if (rd[i].data_size != sizeof (struct in6_addr)) | 393 | if (rd[i].data_size != sizeof (struct in6_addr)) |
394 | continue; | 394 | continue; |
395 | qs->lpcsaBuffer[j].iSocketType = SOCK_STREAM; | 395 | qs->lpcsaBuffer[j].iSocketType = SOCK_STREAM; |
@@ -460,7 +460,7 @@ process_ip_lookup_result (void* cls, | |||
460 | for (i = 0; i < rd_count; i++) | 460 | for (i = 0; i < rd_count; i++) |
461 | { | 461 | { |
462 | if ((rq->af == AF_INET || rq->af == AF_UNSPEC) && | 462 | if ((rq->af == AF_INET || rq->af == AF_UNSPEC) && |
463 | rd[i].record_type == GNUNET_GNS_RECORD_A) | 463 | rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
464 | { | 464 | { |
465 | he->h_addr_list[j] = (char *) ptr; | 465 | he->h_addr_list[j] = (char *) ptr; |
466 | ptr += sizeof (struct in_addr); | 466 | ptr += sizeof (struct in_addr); |
@@ -471,7 +471,7 @@ process_ip_lookup_result (void* cls, | |||
471 | memcpy (he->h_addr_list[j], rd[i].data, sizeof (struct in_addr)); | 471 | memcpy (he->h_addr_list[j], rd[i].data, sizeof (struct in_addr)); |
472 | j++; | 472 | j++; |
473 | } | 473 | } |
474 | else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_GNS_RECORD_AAAA) | 474 | else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_DNSPARSER_TYPE_AAAA) |
475 | { | 475 | { |
476 | he->h_addr_list[j] = (char *) ptr; | 476 | he->h_addr_list[j] = (char *) ptr; |
477 | ptr += sizeof (struct in6_addr); | 477 | ptr += sizeof (struct in6_addr); |
@@ -512,25 +512,25 @@ get_ip_from_hostname (struct GNUNET_SERVER_Client *client, | |||
512 | uint32_t rtype; | 512 | uint32_t rtype; |
513 | 513 | ||
514 | if (IsEqualGUID (&SVCID_DNS_TYPE_A, &sc)) | 514 | if (IsEqualGUID (&SVCID_DNS_TYPE_A, &sc)) |
515 | rtype = GNUNET_GNS_RECORD_A; | 515 | rtype = GNUNET_DNSPARSER_TYPE_A; |
516 | else if (IsEqualGUID (&SVCID_DNS_TYPE_NS, &sc)) | 516 | else if (IsEqualGUID (&SVCID_DNS_TYPE_NS, &sc)) |
517 | rtype = GNUNET_GNS_RECORD_NS; | 517 | rtype = GNUNET_DNSPARSER_TYPE_NS; |
518 | else if (IsEqualGUID (&SVCID_DNS_TYPE_CNAME, &sc)) | 518 | else if (IsEqualGUID (&SVCID_DNS_TYPE_CNAME, &sc)) |
519 | rtype = GNUNET_GNS_RECORD_CNAME; | 519 | rtype = GNUNET_DNSPARSER_TYPE_CNAME; |
520 | else if (IsEqualGUID (&SVCID_DNS_TYPE_SOA, &sc)) | 520 | else if (IsEqualGUID (&SVCID_DNS_TYPE_SOA, &sc)) |
521 | rtype = GNUNET_GNS_RECORD_SOA; | 521 | rtype = GNUNET_DNSPARSER_TYPE_SOA; |
522 | else if (IsEqualGUID (&SVCID_DNS_TYPE_PTR, &sc)) | 522 | else if (IsEqualGUID (&SVCID_DNS_TYPE_PTR, &sc)) |
523 | rtype = GNUNET_GNS_RECORD_PTR; | 523 | rtype = GNUNET_DNSPARSER_TYPE_PTR; |
524 | else if (IsEqualGUID (&SVCID_DNS_TYPE_MX, &sc)) | 524 | else if (IsEqualGUID (&SVCID_DNS_TYPE_MX, &sc)) |
525 | rtype = GNUNET_GNS_RECORD_MX; | 525 | rtype = GNUNET_DNSPARSER_TYPE_MX; |
526 | else if (IsEqualGUID (&SVCID_DNS_TYPE_TEXT, &sc)) | 526 | else if (IsEqualGUID (&SVCID_DNS_TYPE_TEXT, &sc)) |
527 | rtype = GNUNET_GNS_RECORD_TXT; | 527 | rtype = GNUNET_DNSPARSER_TYPE_TXT; |
528 | else if (IsEqualGUID (&SVCID_DNS_TYPE_AAAA, &sc)) | 528 | else if (IsEqualGUID (&SVCID_DNS_TYPE_AAAA, &sc)) |
529 | rtype = GNUNET_GNS_RECORD_AAAA; | 529 | rtype = GNUNET_DNSPARSER_TYPE_AAAA; |
530 | else if (IsEqualGUID (&SVCID_DNS_TYPE_SRV, &sc)) | 530 | else if (IsEqualGUID (&SVCID_DNS_TYPE_SRV, &sc)) |
531 | rtype = GNUNET_GNS_RECORD_SRV; | 531 | rtype = GNUNET_DNSPARSER_TYPE_SRV; |
532 | else if (IsEqualGUID (&SVCID_INET_HOSTADDRBYNAME, &sc)) | 532 | else if (IsEqualGUID (&SVCID_INET_HOSTADDRBYNAME, &sc)) |
533 | rtype = GNUNET_GNS_RECORD_A; | 533 | rtype = GNUNET_DNSPARSER_TYPE_A; |
534 | else | 534 | else |
535 | { | 535 | { |
536 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 536 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 46b16c323..719ab6212 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c | |||
@@ -1751,7 +1751,7 @@ process_leho_lookup (void *cls, | |||
1751 | 1751 | ||
1752 | for (i=0; i<rd_count; i++) | 1752 | for (i=0; i<rd_count; i++) |
1753 | { | 1753 | { |
1754 | if (rd[i].record_type != GNUNET_GNS_RECORD_LEHO) | 1754 | if (rd[i].record_type != GNUNET_NAMESTORE_TYPE_LEHO) |
1755 | continue; | 1755 | continue; |
1756 | 1756 | ||
1757 | memcpy (ctask->leho, rd[i].data, rd[i].data_size); | 1757 | memcpy (ctask->leho, rd[i].data, rd[i].data_size); |
@@ -1849,7 +1849,7 @@ process_get_authority (void *cls, | |||
1849 | GNUNET_GNS_lookup_zone (gns_handle, | 1849 | GNUNET_GNS_lookup_zone (gns_handle, |
1850 | ctask->host, | 1850 | ctask->host, |
1851 | local_gns_zone, | 1851 | local_gns_zone, |
1852 | GNUNET_GNS_RECORD_LEHO, | 1852 | GNUNET_NAMESTORE_TYPE_LEHO, |
1853 | GNUNET_YES, //Only cached for performance | 1853 | GNUNET_YES, //Only cached for performance |
1854 | shorten_zonekey, | 1854 | shorten_zonekey, |
1855 | &process_leho_lookup, | 1855 | &process_leho_lookup, |
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index fa0a99590..d3b61d510 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c | |||
@@ -62,7 +62,7 @@ static int raw; | |||
62 | /** | 62 | /** |
63 | * Requested record type. | 63 | * Requested record type. |
64 | */ | 64 | */ |
65 | static enum GNUNET_GNS_RecordType rtype; | 65 | static int rtype; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * Handle to lookup request | 68 | * Handle to lookup request |
@@ -291,7 +291,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
291 | if (NULL != lookup_type) | 291 | if (NULL != lookup_type) |
292 | rtype = GNUNET_NAMESTORE_typename_to_number (lookup_type); | 292 | rtype = GNUNET_NAMESTORE_typename_to_number (lookup_type); |
293 | else | 293 | else |
294 | rtype = GNUNET_GNS_RECORD_A; | 294 | rtype = GNUNET_DNSPARSER_TYPE_A; |
295 | 295 | ||
296 | if ( (NULL != shorten_name) && | 296 | if ( (NULL != shorten_name) && |
297 | (NULL != shorten_zone) && | 297 | (NULL != shorten_zone) && |
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 1bd6d33d1..e1fc507fb 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c | |||
@@ -110,7 +110,7 @@ struct ClientShortenHandle | |||
110 | /** | 110 | /** |
111 | * request type | 111 | * request type |
112 | */ | 112 | */ |
113 | enum GNUNET_GNS_RecordType type; | 113 | int type; |
114 | 114 | ||
115 | /** | 115 | /** |
116 | * name to shorten | 116 | * name to shorten |
@@ -192,7 +192,7 @@ struct ClientLookupHandle | |||
192 | /** | 192 | /** |
193 | * request type | 193 | * request type |
194 | */ | 194 | */ |
195 | enum GNUNET_GNS_RecordType type; | 195 | int type; |
196 | }; | 196 | }; |
197 | 197 | ||
198 | 198 | ||
@@ -1129,7 +1129,7 @@ handle_lookup (void *cls, | |||
1129 | return; | 1129 | return; |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | if ((GNUNET_GNS_RECORD_A == clh->type) && | 1132 | if ((GNUNET_DNSPARSER_TYPE_A == clh->type) && |
1133 | (GNUNET_OK != v4_enabled)) | 1133 | (GNUNET_OK != v4_enabled)) |
1134 | { | 1134 | { |
1135 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1135 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
@@ -1139,7 +1139,7 @@ handle_lookup (void *cls, | |||
1139 | return; | 1139 | return; |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | if ((GNUNET_GNS_RECORD_AAAA == clh->type) && | 1142 | if ((GNUNET_DNSPARSER_TYPE_AAAA == clh->type) && |
1143 | (GNUNET_OK != v6_enabled)) | 1143 | (GNUNET_OK != v6_enabled)) |
1144 | { | 1144 | { |
1145 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1145 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c index 8f55b8284..8f1f1fb0b 100644 --- a/src/gns/gnunet-service-gns_interceptor.c +++ b/src/gns/gnunet-service-gns_interceptor.c | |||
@@ -123,16 +123,16 @@ reply_to_dns (void* cls, uint32_t rd_count, | |||
123 | answer_records[i].type = rd[i].record_type; | 123 | answer_records[i].type = rd[i].record_type; |
124 | switch(rd[i].record_type) | 124 | switch(rd[i].record_type) |
125 | { | 125 | { |
126 | case GNUNET_GNS_RECORD_NS: | 126 | case GNUNET_DNSPARSER_TYPE_NS: |
127 | case GNUNET_GNS_RECORD_CNAME: | 127 | case GNUNET_DNSPARSER_TYPE_CNAME: |
128 | case GNUNET_GNS_RECORD_PTR: | 128 | case GNUNET_DNSPARSER_TYPE_PTR: |
129 | answer_records[i].data.hostname = (char*)rd[i].data; | 129 | answer_records[i].data.hostname = (char*)rd[i].data; |
130 | break; | 130 | break; |
131 | case GNUNET_GNS_RECORD_SOA: | 131 | case GNUNET_DNSPARSER_TYPE_SOA: |
132 | answer_records[i].data.soa = | 132 | answer_records[i].data.soa = |
133 | (struct GNUNET_DNSPARSER_SoaRecord *)rd[i].data; | 133 | (struct GNUNET_DNSPARSER_SoaRecord *)rd[i].data; |
134 | break; | 134 | break; |
135 | case GNUNET_GNS_RECORD_MX: | 135 | case GNUNET_DNSPARSER_TYPE_MX: |
136 | answer_records[i].data.mx = | 136 | answer_records[i].data.mx = |
137 | (struct GNUNET_DNSPARSER_MxRecord *)rd[i].data; | 137 | (struct GNUNET_DNSPARSER_MxRecord *)rd[i].data; |
138 | break; | 138 | break; |
@@ -150,16 +150,16 @@ reply_to_dns (void* cls, uint32_t rd_count, | |||
150 | additional_records[i].type = rd[i].record_type; | 150 | additional_records[i].type = rd[i].record_type; |
151 | switch(rd[i].record_type) | 151 | switch(rd[i].record_type) |
152 | { | 152 | { |
153 | case GNUNET_GNS_RECORD_NS: | 153 | case GNUNET_DNSPARSER_TYPE_NS: |
154 | case GNUNET_GNS_RECORD_CNAME: | 154 | case GNUNET_DNSPARSER_TYPE_CNAME: |
155 | case GNUNET_GNS_RECORD_PTR: | 155 | case GNUNET_DNSPARSER_TYPE_PTR: |
156 | additional_records[i].data.hostname = (char*)rd[i].data; | 156 | additional_records[i].data.hostname = (char*)rd[i].data; |
157 | break; | 157 | break; |
158 | case GNUNET_GNS_RECORD_SOA: | 158 | case GNUNET_DNSPARSER_TYPE_SOA: |
159 | additional_records[i].data.soa = | 159 | additional_records[i].data.soa = |
160 | (struct GNUNET_DNSPARSER_SoaRecord *)rd[i].data; | 160 | (struct GNUNET_DNSPARSER_SoaRecord *)rd[i].data; |
161 | break; | 161 | break; |
162 | case GNUNET_GNS_RECORD_MX: | 162 | case GNUNET_DNSPARSER_TYPE_MX: |
163 | additional_records[i].data.mx = | 163 | additional_records[i].data.mx = |
164 | (struct GNUNET_DNSPARSER_MxRecord *)rd[i].data; | 164 | (struct GNUNET_DNSPARSER_MxRecord *)rd[i].data; |
165 | break; | 165 | break; |
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index bd9daf56e..b01200d8e 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -296,7 +296,7 @@ process_pseu_lookup_ns (void* cls, | |||
296 | new_pkey.expiration_time = UINT64_MAX; | 296 | new_pkey.expiration_time = UINT64_MAX; |
297 | new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode); | 297 | new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode); |
298 | new_pkey.data = &gph->auth->zone; | 298 | new_pkey.data = &gph->auth->zone; |
299 | new_pkey.record_type = GNUNET_GNS_RECORD_PKEY; | 299 | new_pkey.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
300 | new_pkey.flags = GNUNET_NAMESTORE_RF_AUTHORITY | 300 | new_pkey.flags = GNUNET_NAMESTORE_RF_AUTHORITY |
301 | | GNUNET_NAMESTORE_RF_PRIVATE | 301 | | GNUNET_NAMESTORE_RF_PRIVATE |
302 | | GNUNET_NAMESTORE_RF_PENDING; | 302 | | GNUNET_NAMESTORE_RF_PENDING; |
@@ -436,7 +436,7 @@ process_auth_discovery_dht_result (void* cls, | |||
436 | for (i=0; i < num_records; i++) | 436 | for (i=0; i < num_records; i++) |
437 | { | 437 | { |
438 | if ((strcmp (name, GNUNET_GNS_MASTERZONE_STR) == 0) && | 438 | if ((strcmp (name, GNUNET_GNS_MASTERZONE_STR) == 0) && |
439 | (rd[i].record_type == GNUNET_GNS_RECORD_PSEU)) | 439 | (rd[i].record_type == GNUNET_NAMESTORE_TYPE_PSEU)) |
440 | { | 440 | { |
441 | /* found pseu */ | 441 | /* found pseu */ |
442 | process_pseu_result (gph, (char*)rd[i].data); | 442 | process_pseu_result (gph, (char*)rd[i].data); |
@@ -489,7 +489,7 @@ process_auth_discovery_ns_result (void* cls, | |||
489 | gph->timeout = GNUNET_SCHEDULER_add_delayed (DHT_LOOKUP_TIMEOUT, | 489 | gph->timeout = GNUNET_SCHEDULER_add_delayed (DHT_LOOKUP_TIMEOUT, |
490 | &handle_auth_discovery_timeout, gph); | 490 | &handle_auth_discovery_timeout, gph); |
491 | 491 | ||
492 | xquery = htonl (GNUNET_GNS_RECORD_PSEU); | 492 | xquery = htonl (GNUNET_NAMESTORE_TYPE_PSEU); |
493 | 493 | ||
494 | GNUNET_assert (gph->get_handle == NULL); | 494 | GNUNET_assert (gph->get_handle == NULL); |
495 | 495 | ||
@@ -510,7 +510,7 @@ process_auth_discovery_ns_result (void* cls, | |||
510 | if (0 != (strcmp (name, GNUNET_GNS_TLD_PLUS))) | 510 | if (0 != (strcmp (name, GNUNET_GNS_TLD_PLUS))) |
511 | continue; | 511 | continue; |
512 | 512 | ||
513 | if (rd[i].record_type != GNUNET_GNS_RECORD_PSEU) | 513 | if (rd[i].record_type != GNUNET_NAMESTORE_TYPE_PSEU) |
514 | continue; | 514 | continue; |
515 | 515 | ||
516 | /* found pseu */ | 516 | /* found pseu */ |
@@ -552,7 +552,7 @@ process_zone_to_name_discover (void *cls, | |||
552 | gph->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, | 552 | gph->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, |
553 | &gph->auth->zone, | 553 | &gph->auth->zone, |
554 | GNUNET_GNS_MASTERZONE_STR, | 554 | GNUNET_GNS_MASTERZONE_STR, |
555 | GNUNET_GNS_RECORD_PSEU, | 555 | GNUNET_NAMESTORE_TYPE_PSEU, |
556 | &process_auth_discovery_ns_result, | 556 | &process_auth_discovery_ns_result, |
557 | gph); | 557 | gph); |
558 | return; | 558 | return; |
@@ -1264,7 +1264,7 @@ process_record_result_vpn (void* cls, int af, const void *address) | |||
1264 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1264 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
1265 | "GNS_PHASE_REC-%llu: Answer is IPv4!\n", | 1265 | "GNS_PHASE_REC-%llu: Answer is IPv4!\n", |
1266 | rh->id); | 1266 | rh->id); |
1267 | if (GNUNET_GNS_RECORD_A != rlh->record_type) | 1267 | if (GNUNET_DNSPARSER_TYPE_A != rlh->record_type) |
1268 | { | 1268 | { |
1269 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1269 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
1270 | "GNS_PHASE_REC-%llu: Requested record is not IPv4!\n", | 1270 | "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) | |||
1272 | rh->proc (rh->proc_cls, rh, 0, NULL); | 1272 | rh->proc (rh->proc_cls, rh, 0, NULL); |
1273 | return; | 1273 | return; |
1274 | } | 1274 | } |
1275 | rd.record_type = GNUNET_GNS_RECORD_A; | 1275 | rd.record_type = GNUNET_DNSPARSER_TYPE_A; |
1276 | rd.expiration_time = UINT64_MAX; /* FIXME: should probably pick something shorter... */ | 1276 | rd.expiration_time = UINT64_MAX; /* FIXME: should probably pick something shorter... */ |
1277 | rd.data = address; | 1277 | rd.data = address; |
1278 | rd.data_size = sizeof (struct in_addr); | 1278 | rd.data_size = sizeof (struct in_addr); |
@@ -1285,7 +1285,7 @@ process_record_result_vpn (void* cls, int af, const void *address) | |||
1285 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1285 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
1286 | "GNS_PHASE_REC-%llu: Answer is IPv6!\n", | 1286 | "GNS_PHASE_REC-%llu: Answer is IPv6!\n", |
1287 | rh->id); | 1287 | rh->id); |
1288 | if (GNUNET_GNS_RECORD_AAAA != rlh->record_type) | 1288 | if (GNUNET_DNSPARSER_TYPE_AAAA != rlh->record_type) |
1289 | { | 1289 | { |
1290 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1290 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
1291 | "GNS_PHASE_REC-%llu: Requested record is not IPv6!\n", | 1291 | "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) | |||
1293 | rh->proc (rh->proc_cls, rh, 0, NULL); | 1293 | rh->proc (rh->proc_cls, rh, 0, NULL); |
1294 | return; | 1294 | return; |
1295 | } | 1295 | } |
1296 | rd.record_type = GNUNET_GNS_RECORD_AAAA; | 1296 | rd.record_type = GNUNET_DNSPARSER_TYPE_AAAA; |
1297 | rd.expiration_time = UINT64_MAX; /* FIXME: should probably pick something shorter... */ | 1297 | rd.expiration_time = UINT64_MAX; /* FIXME: should probably pick something shorter... */ |
1298 | rd.data = address; | 1298 | rd.data = address; |
1299 | rd.data_size = sizeof (struct in6_addr); | 1299 | rd.data_size = sizeof (struct in6_addr); |
@@ -1383,14 +1383,14 @@ handle_dns_resolver (void *cls, | |||
1383 | if (sizeof (struct sockaddr_in) == addrlen) | 1383 | if (sizeof (struct sockaddr_in) == addrlen) |
1384 | { | 1384 | { |
1385 | sai = (struct sockaddr_in*) addr; | 1385 | sai = (struct sockaddr_in*) addr; |
1386 | rd.record_type = GNUNET_GNS_RECORD_A; | 1386 | rd.record_type = GNUNET_DNSPARSER_TYPE_A; |
1387 | rd.data_size = sizeof (struct in_addr); | 1387 | rd.data_size = sizeof (struct in_addr); |
1388 | rd.data = &sai->sin_addr; | 1388 | rd.data = &sai->sin_addr; |
1389 | } | 1389 | } |
1390 | else if (sizeof (struct sockaddr_in6) == addrlen) | 1390 | else if (sizeof (struct sockaddr_in6) == addrlen) |
1391 | { | 1391 | { |
1392 | sai6 = (struct sockaddr_in6*) addr; | 1392 | sai6 = (struct sockaddr_in6*) addr; |
1393 | rd.record_type = GNUNET_GNS_RECORD_AAAA; | 1393 | rd.record_type = GNUNET_DNSPARSER_TYPE_AAAA; |
1394 | rd.data_size = sizeof (struct in6_addr); | 1394 | rd.data_size = sizeof (struct in6_addr); |
1395 | rd.data = &sai6->sin6_addr; | 1395 | rd.data = &sai6->sin6_addr; |
1396 | } | 1396 | } |
@@ -1418,8 +1418,8 @@ resolve_dns_name (struct ResolverHandle *rh) | |||
1418 | struct RecordLookupHandle *rlh = rh->proc_cls; | 1418 | struct RecordLookupHandle *rlh = rh->proc_cls; |
1419 | int af; | 1419 | int af; |
1420 | 1420 | ||
1421 | if ((GNUNET_GNS_RECORD_A != rlh->record_type) && | 1421 | if ((GNUNET_DNSPARSER_TYPE_A != rlh->record_type) && |
1422 | (GNUNET_GNS_RECORD_AAAA != rlh->record_type)) | 1422 | (GNUNET_DNSPARSER_TYPE_AAAA != rlh->record_type)) |
1423 | { | 1423 | { |
1424 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1424 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1425 | "Can only resolve A/AAAA via stub... abort\n"); | 1425 | "Can only resolve A/AAAA via stub... abort\n"); |
@@ -1427,7 +1427,7 @@ resolve_dns_name (struct ResolverHandle *rh) | |||
1427 | return; | 1427 | return; |
1428 | } | 1428 | } |
1429 | 1429 | ||
1430 | if (GNUNET_GNS_RECORD_A == rlh->record_type) | 1430 | if (GNUNET_DNSPARSER_TYPE_A == rlh->record_type) |
1431 | af = AF_INET; | 1431 | af = AF_INET; |
1432 | else | 1432 | else |
1433 | af = AF_INET6; | 1433 | af = AF_INET6; |
@@ -1501,7 +1501,7 @@ read_dns_response (void *cls, | |||
1501 | packet->answers[i].type, | 1501 | packet->answers[i].type, |
1502 | rlh->record_type); | 1502 | rlh->record_type); |
1503 | /* http://tools.ietf.org/html/rfc1034#section-3.6.2 */ | 1503 | /* http://tools.ietf.org/html/rfc1034#section-3.6.2 */ |
1504 | if (GNUNET_GNS_RECORD_CNAME == packet->answers[i].type) | 1504 | if (GNUNET_DNSPARSER_TYPE_CNAME == packet->answers[i].type) |
1505 | { | 1505 | { |
1506 | struct GNUNET_DNSPARSER_Query query; | 1506 | struct GNUNET_DNSPARSER_Query query; |
1507 | struct GNUNET_DNSPARSER_Packet npacket; | 1507 | struct GNUNET_DNSPARSER_Packet npacket; |
@@ -1591,7 +1591,7 @@ read_dns_response (void *cls, | |||
1591 | 1591 | ||
1592 | for (i = 0; i < packet->num_authority_records; i++) | 1592 | for (i = 0; i < packet->num_authority_records; i++) |
1593 | { | 1593 | { |
1594 | if (packet->authority_records[i].type == GNUNET_GNS_RECORD_NS) | 1594 | if (packet->authority_records[i].type == GNUNET_DNSPARSER_TYPE_NS) |
1595 | { | 1595 | { |
1596 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1596 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1597 | "Found NS delegation!\n"); | 1597 | "Found NS delegation!\n"); |
@@ -1606,7 +1606,7 @@ read_dns_response (void *cls, | |||
1606 | if (GNUNET_NO == found_delegation) | 1606 | if (GNUNET_NO == found_delegation) |
1607 | break; | 1607 | break; |
1608 | 1608 | ||
1609 | if ((packet->additional_records[i].type == GNUNET_GNS_RECORD_A) && | 1609 | if ((packet->additional_records[i].type == GNUNET_DNSPARSER_TYPE_A) && |
1610 | (0 == strcmp (packet->additional_records[i].name, delegation_name))) | 1610 | (0 == strcmp (packet->additional_records[i].name, delegation_name))) |
1611 | { | 1611 | { |
1612 | GNUNET_assert (sizeof (struct in_addr) == | 1612 | GNUNET_assert (sizeof (struct in_addr) == |
@@ -1709,7 +1709,7 @@ resolve_record_dns (struct ResolverHandle *rh, | |||
1709 | for (i = 0; i < rd_count; i++) | 1709 | for (i = 0; i < rd_count; i++) |
1710 | { | 1710 | { |
1711 | /* Synthesize dns name */ | 1711 | /* Synthesize dns name */ |
1712 | if (GNUNET_GNS_RECORD_NS == rd[i].record_type) | 1712 | if (GNUNET_DNSPARSER_TYPE_NS == rd[i].record_type) |
1713 | { | 1713 | { |
1714 | strcpy (rh->dns_zone, (char*)rd[i].data); | 1714 | strcpy (rh->dns_zone, (char*)rd[i].data); |
1715 | if (0 == strcmp (rh->name, "")) | 1715 | if (0 == strcmp (rh->name, "")) |
@@ -1718,7 +1718,7 @@ resolve_record_dns (struct ResolverHandle *rh, | |||
1718 | sprintf (rh->dns_name, "%s.%s", rh->name, (char*)rd[i].data); | 1718 | sprintf (rh->dns_name, "%s.%s", rh->name, (char*)rd[i].data); |
1719 | } | 1719 | } |
1720 | /* The glue */ | 1720 | /* The glue */ |
1721 | if (GNUNET_GNS_RECORD_A == rd[i].record_type) | 1721 | if (GNUNET_DNSPARSER_TYPE_A == rd[i].record_type) |
1722 | /* need to use memcpy as .data may be unaligned */ | 1722 | /* need to use memcpy as .data may be unaligned */ |
1723 | memcpy (&dnsip, rd[i].data, sizeof (dnsip)); | 1723 | memcpy (&dnsip, rd[i].data, sizeof (dnsip)); |
1724 | } | 1724 | } |
@@ -1841,7 +1841,7 @@ resolve_record_vpn (struct ResolverHandle *rh, | |||
1841 | (char*)&vpn[1], | 1841 | (char*)&vpn[1], |
1842 | GNUNET_h2s (&serv_desc)); | 1842 | GNUNET_h2s (&serv_desc)); |
1843 | rh->proc = &handle_record_vpn; | 1843 | rh->proc = &handle_record_vpn; |
1844 | if (GNUNET_GNS_RECORD_A == rlh->record_type) | 1844 | if (GNUNET_DNSPARSER_TYPE_A == rlh->record_type) |
1845 | af = AF_INET; | 1845 | af = AF_INET; |
1846 | else | 1846 | else |
1847 | af = AF_INET6; | 1847 | af = AF_INET6; |
@@ -2049,7 +2049,7 @@ process_pkey_revocation_result_ns (void *cls, | |||
2049 | 2049 | ||
2050 | for (i = 0; i < rd_count; i++) | 2050 | for (i = 0; i < rd_count; i++) |
2051 | { | 2051 | { |
2052 | if (GNUNET_GNS_RECORD_REV == rd[i].record_type) | 2052 | if (GNUNET_NAMESTORE_TYPE_REV == rd[i].record_type) |
2053 | { | 2053 | { |
2054 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2054 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2055 | "GNS_PHASE_DELEGATE_REV-%llu: Zone has been revoked.\n", | 2055 | "GNS_PHASE_DELEGATE_REV-%llu: Zone has been revoked.\n", |
@@ -2071,11 +2071,11 @@ process_pkey_revocation_result_ns (void *cls, | |||
2071 | { | 2071 | { |
2072 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2072 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2073 | "GNS_PHASE_DELEGATE_REV-%llu: Starting background lookup for %s type %d\n", | 2073 | "GNS_PHASE_DELEGATE_REV-%llu: Starting background lookup for %s type %d\n", |
2074 | rh->id, "+.gads", GNUNET_GNS_RECORD_REV); | 2074 | rh->id, "+.gads", GNUNET_NAMESTORE_TYPE_REV); |
2075 | 2075 | ||
2076 | gns_resolver_lookup_record(rh->authority, | 2076 | gns_resolver_lookup_record(rh->authority, |
2077 | rh->private_local_zone, | 2077 | rh->private_local_zone, |
2078 | GNUNET_GNS_RECORD_REV, | 2078 | GNUNET_NAMESTORE_TYPE_REV, |
2079 | GNUNET_GNS_TLD, | 2079 | GNUNET_GNS_TLD, |
2080 | NULL, | 2080 | NULL, |
2081 | GNUNET_TIME_UNIT_FOREVER_REL, | 2081 | GNUNET_TIME_UNIT_FOREVER_REL, |
@@ -2213,7 +2213,7 @@ process_delegation_result_dht (void* cls, | |||
2213 | rh->id, name, rh->authority_name); | 2213 | rh->id, name, rh->authority_name); |
2214 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2214 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2215 | "GNS_PHASE_DELEGATE_DHT-%llu: Got type: %d (wanted %d)\n", | 2215 | "GNS_PHASE_DELEGATE_DHT-%llu: Got type: %d (wanted %d)\n", |
2216 | rh->id, rd[i].record_type, GNUNET_GNS_RECORD_PKEY); | 2216 | rh->id, rd[i].record_type, GNUNET_NAMESTORE_TYPE_PKEY); |
2217 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2217 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2218 | "GNS_PHASE_DELEGATE_DHT-%llu: Got data length: %d\n", | 2218 | "GNS_PHASE_DELEGATE_DHT-%llu: Got data length: %d\n", |
2219 | rh->id, rd[i].data_size); | 2219 | rh->id, rd[i].data_size); |
@@ -2221,9 +2221,9 @@ process_delegation_result_dht (void* cls, | |||
2221 | "GNS_PHASE_DELEGATE_DHT-%llu: Got flag %d\n", | 2221 | "GNS_PHASE_DELEGATE_DHT-%llu: Got flag %d\n", |
2222 | rh->id, rd[i].flags); | 2222 | rh->id, rd[i].flags); |
2223 | 2223 | ||
2224 | if ((GNUNET_GNS_RECORD_VPN == rd[i].record_type) || | 2224 | if ((GNUNET_NAMESTORE_TYPE_VPN == rd[i].record_type) || |
2225 | (GNUNET_GNS_RECORD_NS == rd[i].record_type) || | 2225 | (GNUNET_DNSPARSER_TYPE_NS == rd[i].record_type) || |
2226 | (GNUNET_GNS_RECORD_CNAME == rd[i].record_type)) | 2226 | (GNUNET_DNSPARSER_TYPE_CNAME == rd[i].record_type)) |
2227 | { | 2227 | { |
2228 | /** | 2228 | /** |
2229 | * This is a VPN,NS,CNAME entry. Let namestore handle this after caching | 2229 | * This is a VPN,NS,CNAME entry. Let namestore handle this after caching |
@@ -2238,7 +2238,7 @@ process_delegation_result_dht (void* cls, | |||
2238 | } | 2238 | } |
2239 | 2239 | ||
2240 | if ((0 == strcmp(name, rh->authority_name)) && | 2240 | if ((0 == strcmp(name, rh->authority_name)) && |
2241 | (GNUNET_GNS_RECORD_PKEY == rd[i].record_type)) | 2241 | (GNUNET_NAMESTORE_TYPE_PKEY == rd[i].record_type)) |
2242 | { | 2242 | { |
2243 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2243 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2244 | "GNS_PHASE_DELEGATE_DHT-%llu: Authority found in DHT\n", | 2244 | "GNS_PHASE_DELEGATE_DHT-%llu: Authority found in DHT\n", |
@@ -2339,7 +2339,7 @@ process_delegation_result_dht (void* cls, | |||
2339 | rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, | 2339 | rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, |
2340 | &rh->authority, | 2340 | &rh->authority, |
2341 | GNUNET_GNS_MASTERZONE_STR, | 2341 | GNUNET_GNS_MASTERZONE_STR, |
2342 | GNUNET_GNS_RECORD_REV, | 2342 | GNUNET_NAMESTORE_TYPE_REV, |
2343 | &process_pkey_revocation_result_ns, | 2343 | &process_pkey_revocation_result_ns, |
2344 | rh); | 2344 | rh); |
2345 | 2345 | ||
@@ -2460,12 +2460,12 @@ finish_lookup (struct ResolverHandle *rh, | |||
2460 | for (i = 0; i < rd_count; i++) | 2460 | for (i = 0; i < rd_count; i++) |
2461 | { | 2461 | { |
2462 | 2462 | ||
2463 | if ((GNUNET_GNS_RECORD_NS != rd[i].record_type) && | 2463 | if ((GNUNET_DNSPARSER_TYPE_NS != rd[i].record_type) && |
2464 | (GNUNET_GNS_RECORD_PTR != rd[i].record_type) && | 2464 | (GNUNET_DNSPARSER_TYPE_PTR != rd[i].record_type) && |
2465 | (GNUNET_GNS_RECORD_CNAME != rd[i].record_type) && | 2465 | (GNUNET_DNSPARSER_TYPE_CNAME != rd[i].record_type) && |
2466 | (GNUNET_GNS_RECORD_MX != rd[i].record_type) && | 2466 | (GNUNET_DNSPARSER_TYPE_MX != rd[i].record_type) && |
2467 | (GNUNET_GNS_RECORD_SOA != rd[i].record_type) && | 2467 | (GNUNET_DNSPARSER_TYPE_SOA != rd[i].record_type) && |
2468 | (GNUNET_GNS_RECORD_SRV != rd[i].record_type)) | 2468 | (GNUNET_DNSPARSER_TYPE_SRV != rd[i].record_type)) |
2469 | { | 2469 | { |
2470 | p_rd[i].data = rd[i].data; | 2470 | p_rd[i].data = rd[i].data; |
2471 | continue; | 2471 | continue; |
@@ -2485,7 +2485,7 @@ finish_lookup (struct ResolverHandle *rh, | |||
2485 | repl_string = rlh->name+strlen(rh->name)+1; | 2485 | repl_string = rlh->name+strlen(rh->name)+1; |
2486 | 2486 | ||
2487 | offset = 0; | 2487 | offset = 0; |
2488 | if (GNUNET_GNS_RECORD_MX == rd[i].record_type) | 2488 | if (GNUNET_DNSPARSER_TYPE_MX == rd[i].record_type) |
2489 | { | 2489 | { |
2490 | memcpy (new_mx_data, (char*)rd[i].data, sizeof(uint16_t)); | 2490 | memcpy (new_mx_data, (char*)rd[i].data, sizeof(uint16_t)); |
2491 | offset = sizeof (uint16_t); | 2491 | offset = sizeof (uint16_t); |
@@ -2497,7 +2497,7 @@ finish_lookup (struct ResolverHandle *rh, | |||
2497 | p_rd[i].data = new_mx_data; | 2497 | p_rd[i].data = new_mx_data; |
2498 | p_rd[i].data_size = offset; | 2498 | p_rd[i].data_size = offset; |
2499 | } | 2499 | } |
2500 | else if (GNUNET_GNS_RECORD_SRV == rd[i].record_type) | 2500 | else if (GNUNET_DNSPARSER_TYPE_SRV == rd[i].record_type) |
2501 | { | 2501 | { |
2502 | /* | 2502 | /* |
2503 | * Prio, weight and port | 2503 | * Prio, weight and port |
@@ -2513,7 +2513,7 @@ finish_lookup (struct ResolverHandle *rh, | |||
2513 | p_rd[i].data = new_srv_data; | 2513 | p_rd[i].data = new_srv_data; |
2514 | p_rd[i].data_size = sizeof (struct srv_data) + strlen ((char*)&new_srv[1]) + 1; | 2514 | p_rd[i].data_size = sizeof (struct srv_data) + strlen ((char*)&new_srv[1]) + 1; |
2515 | } | 2515 | } |
2516 | else if (GNUNET_GNS_RECORD_SOA == rd[i].record_type) | 2516 | else if (GNUNET_DNSPARSER_TYPE_SOA == rd[i].record_type) |
2517 | { | 2517 | { |
2518 | /* expand mname and rname */ | 2518 | /* expand mname and rname */ |
2519 | old_soa = (struct soa_data*)rd[i].data; | 2519 | old_soa = (struct soa_data*)rd[i].data; |
@@ -2708,7 +2708,7 @@ handle_delegation_dht(void* cls, struct ResolverHandle *rh, | |||
2708 | 2708 | ||
2709 | if (0 == strcmp(rh->name, "")) | 2709 | if (0 == strcmp(rh->name, "")) |
2710 | { | 2710 | { |
2711 | if (GNUNET_GNS_RECORD_PKEY == rlh->record_type) | 2711 | if (GNUNET_NAMESTORE_TYPE_PKEY == rlh->record_type) |
2712 | { | 2712 | { |
2713 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2713 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2714 | "GNS_PHASE_DELEGATE_DHT-%llu: Resolved queried PKEY via DHT.\n", | 2714 | "GNS_PHASE_DELEGATE_DHT-%llu: Resolved queried PKEY via DHT.\n", |
@@ -2798,7 +2798,7 @@ resolve_delegation_dht (struct ResolverHandle *rh) | |||
2798 | rh->authority_name, | 2798 | rh->authority_name, |
2799 | GNUNET_short_h2s (&rh->authority), | 2799 | GNUNET_short_h2s (&rh->authority), |
2800 | rh->id); | 2800 | rh->id); |
2801 | xquery = htonl (GNUNET_GNS_RECORD_PKEY); | 2801 | xquery = htonl (GNUNET_NAMESTORE_TYPE_PKEY); |
2802 | GNUNET_assert (rh->get_handle == NULL); | 2802 | GNUNET_assert (rh->get_handle == NULL); |
2803 | rh->get_handle = GNUNET_DHT_get_start (dht_handle, | 2803 | rh->get_handle = GNUNET_DHT_get_start (dht_handle, |
2804 | GNUNET_BLOCK_TYPE_GNS_NAMERECORD, | 2804 | GNUNET_BLOCK_TYPE_GNS_NAMERECORD, |
@@ -2869,7 +2869,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh, | |||
2869 | rh->id); | 2869 | rh->id); |
2870 | if (rh->status & RSL_CNAME_FOUND) | 2870 | if (rh->status & RSL_CNAME_FOUND) |
2871 | { | 2871 | { |
2872 | if (GNUNET_GNS_RECORD_CNAME == rlh->record_type) | 2872 | if (GNUNET_DNSPARSER_TYPE_CNAME == rlh->record_type) |
2873 | { | 2873 | { |
2874 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2874 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2875 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried CNAME in NS.\n", | 2875 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried CNAME in NS.\n", |
@@ -2915,7 +2915,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh, | |||
2915 | } | 2915 | } |
2916 | else if (rh->status & RSL_DELEGATE_VPN) | 2916 | else if (rh->status & RSL_DELEGATE_VPN) |
2917 | { | 2917 | { |
2918 | if (GNUNET_GNS_RECORD_VPN == rlh->record_type) | 2918 | if (GNUNET_NAMESTORE_TYPE_VPN == rlh->record_type) |
2919 | { | 2919 | { |
2920 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2920 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2921 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried VPNRR in NS.\n", | 2921 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried VPNRR in NS.\n", |
@@ -2933,7 +2933,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh, | |||
2933 | } | 2933 | } |
2934 | else if (rh->status & RSL_DELEGATE_NS) | 2934 | else if (rh->status & RSL_DELEGATE_NS) |
2935 | { | 2935 | { |
2936 | if (GNUNET_GNS_RECORD_NS == rlh->record_type) | 2936 | if (GNUNET_DNSPARSER_TYPE_NS == rlh->record_type) |
2937 | { | 2937 | { |
2938 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2938 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2939 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n", | 2939 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n", |
@@ -2959,7 +2959,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh, | |||
2959 | finish_lookup (rh, rlh, 0, NULL); | 2959 | finish_lookup (rh, rlh, 0, NULL); |
2960 | return; | 2960 | return; |
2961 | } | 2961 | } |
2962 | else if (GNUNET_GNS_RECORD_PKEY == rlh->record_type) | 2962 | else if (GNUNET_NAMESTORE_TYPE_PKEY == rlh->record_type) |
2963 | { | 2963 | { |
2964 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2964 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2965 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried PKEY in NS.\n", | 2965 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried PKEY in NS.\n", |
@@ -2979,7 +2979,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh, | |||
2979 | 2979 | ||
2980 | if (rh->status & RSL_DELEGATE_NS) | 2980 | if (rh->status & RSL_DELEGATE_NS) |
2981 | { | 2981 | { |
2982 | if (GNUNET_GNS_RECORD_NS == rlh->record_type) | 2982 | if (GNUNET_DNSPARSER_TYPE_NS == rlh->record_type) |
2983 | { | 2983 | { |
2984 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2984 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2985 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n", | 2985 | "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n", |
@@ -3157,7 +3157,7 @@ process_delegation_result_ns (void* cls, | |||
3157 | { | 3157 | { |
3158 | switch (rd[i].record_type) | 3158 | switch (rd[i].record_type) |
3159 | { | 3159 | { |
3160 | case GNUNET_GNS_RECORD_CNAME: | 3160 | case GNUNET_DNSPARSER_TYPE_CNAME: |
3161 | /* Like in regular DNS this should mean that there is no other | 3161 | /* Like in regular DNS this should mean that there is no other |
3162 | * record for this name. */ | 3162 | * record for this name. */ |
3163 | 3163 | ||
@@ -3169,14 +3169,14 @@ process_delegation_result_ns (void* cls, | |||
3169 | rh->status |= RSL_CNAME_FOUND; | 3169 | rh->status |= RSL_CNAME_FOUND; |
3170 | rh->proc (rh->proc_cls, rh, rd_count, rd); | 3170 | rh->proc (rh->proc_cls, rh, rd_count, rd); |
3171 | return; | 3171 | return; |
3172 | case GNUNET_GNS_RECORD_VPN: | 3172 | case GNUNET_NAMESTORE_TYPE_VPN: |
3173 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3173 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3174 | "GNS_PHASE_DELEGATE_NS-%llu: VPN found.\n", | 3174 | "GNS_PHASE_DELEGATE_NS-%llu: VPN found.\n", |
3175 | rh->id); | 3175 | rh->id); |
3176 | rh->status |= RSL_DELEGATE_VPN; | 3176 | rh->status |= RSL_DELEGATE_VPN; |
3177 | rh->proc (rh->proc_cls, rh, rd_count, rd); | 3177 | rh->proc (rh->proc_cls, rh, rd_count, rd); |
3178 | return; | 3178 | return; |
3179 | case GNUNET_GNS_RECORD_NS: | 3179 | case GNUNET_DNSPARSER_TYPE_NS: |
3180 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3180 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3181 | "GNS_PHASE_DELEGATE_NS-%llu: NS `%.*s' found.\n", | 3181 | "GNS_PHASE_DELEGATE_NS-%llu: NS `%.*s' found.\n", |
3182 | rh->id, | 3182 | rh->id, |
@@ -3185,7 +3185,7 @@ process_delegation_result_ns (void* cls, | |||
3185 | rh->status |= RSL_DELEGATE_NS; | 3185 | rh->status |= RSL_DELEGATE_NS; |
3186 | rh->proc (rh->proc_cls, rh, rd_count, rd); | 3186 | rh->proc (rh->proc_cls, rh, rd_count, rd); |
3187 | return; | 3187 | return; |
3188 | case GNUNET_GNS_RECORD_PKEY: | 3188 | case GNUNET_NAMESTORE_TYPE_PKEY: |
3189 | rh->status |= RSL_DELEGATE_PKEY; | 3189 | rh->status |= RSL_DELEGATE_PKEY; |
3190 | if ((ignore_pending_records != 0) && | 3190 | if ((ignore_pending_records != 0) && |
3191 | (rd[i].flags & GNUNET_NAMESTORE_RF_PENDING)) | 3191 | (rd[i].flags & GNUNET_NAMESTORE_RF_PENDING)) |
@@ -3234,7 +3234,7 @@ process_delegation_result_ns (void* cls, | |||
3234 | rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, | 3234 | rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, |
3235 | &rh->authority, | 3235 | &rh->authority, |
3236 | GNUNET_GNS_MASTERZONE_STR, | 3236 | GNUNET_GNS_MASTERZONE_STR, |
3237 | GNUNET_GNS_RECORD_REV, | 3237 | GNUNET_NAMESTORE_TYPE_REV, |
3238 | &process_pkey_revocation_result_ns, | 3238 | &process_pkey_revocation_result_ns, |
3239 | rh); | 3239 | rh); |
3240 | return; | 3240 | return; |
@@ -3300,7 +3300,7 @@ resolve_delegation_ns (struct ResolverHandle *rh) | |||
3300 | rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, | 3300 | rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, |
3301 | &rh->authority, | 3301 | &rh->authority, |
3302 | rh->authority_name, | 3302 | rh->authority_name, |
3303 | GNUNET_GNS_RECORD_ANY, | 3303 | GNUNET_DNSPARSER_TYPE_ANY, |
3304 | &process_delegation_result_ns, | 3304 | &process_delegation_result_ns, |
3305 | rh); | 3305 | rh); |
3306 | } | 3306 | } |
diff --git a/src/gns/gnunet-service-gns_resolver.h b/src/gns/gnunet-service-gns_resolver.h index 1d236b427..1b10297c2 100644 --- a/src/gns/gnunet-service-gns_resolver.h +++ b/src/gns/gnunet-service-gns_resolver.h | |||
@@ -356,7 +356,7 @@ struct RecordLookupHandle | |||
356 | /** | 356 | /** |
357 | * the record type to look up | 357 | * the record type to look up |
358 | */ | 358 | */ |
359 | enum GNUNET_GNS_RecordType record_type; | 359 | int record_type; |
360 | 360 | ||
361 | /** | 361 | /** |
362 | * the name to look up | 362 | * the name to look up |
diff --git a/src/gns/test_gns_cname_lookup.c b/src/gns/test_gns_cname_lookup.c index 325583001..58f0e1c9e 100644 --- a/src/gns/test_gns_cname_lookup.c +++ b/src/gns/test_gns_cname_lookup.c | |||
@@ -132,7 +132,7 @@ on_lookup_result_cname (void *cls, | |||
132 | for (i=0; i<rd_count; i++) | 132 | for (i=0; i<rd_count; i++) |
133 | { | 133 | { |
134 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 134 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
135 | if (rd[i].record_type == GNUNET_GNS_RECORD_CNAME) | 135 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_CNAME) |
136 | { | 136 | { |
137 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "CNAME: %s\n", rd[i].data); | 137 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "CNAME: %s\n", rd[i].data); |
138 | if (0 == strcmp(rd[i].data, TEST_RECORD_CNAME_SERVER)) | 138 | if (0 == strcmp(rd[i].data, TEST_RECORD_CNAME_SERVER)) |
@@ -173,7 +173,7 @@ on_lookup_result_dns (void *cls, | |||
173 | for (i=0; i<rd_count; i++) | 173 | for (i=0; i<rd_count; i++) |
174 | { | 174 | { |
175 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 175 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
176 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 176 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
177 | { | 177 | { |
178 | memcpy(&a, rd[i].data, sizeof(a)); | 178 | memcpy(&a, rd[i].data, sizeof(a)); |
179 | addr = inet_ntoa(a); | 179 | addr = inet_ntoa(a); |
@@ -191,7 +191,7 @@ on_lookup_result_dns (void *cls, | |||
191 | } | 191 | } |
192 | } | 192 | } |
193 | } | 193 | } |
194 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_PLUS, GNUNET_GNS_RECORD_CNAME, | 194 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_PLUS, GNUNET_DNSPARSER_TYPE_CNAME, |
195 | GNUNET_YES, | 195 | GNUNET_YES, |
196 | NULL, | 196 | NULL, |
197 | &on_lookup_result_cname, TEST_DOMAIN_PLUS); | 197 | &on_lookup_result_cname, TEST_DOMAIN_PLUS); |
@@ -221,7 +221,7 @@ on_lookup_result_zkey (void *cls, uint32_t rd_count, | |||
221 | { | 221 | { |
222 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 222 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
223 | "type: %d\n", rd[i].record_type); | 223 | "type: %d\n", rd[i].record_type); |
224 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 224 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
225 | { | 225 | { |
226 | memcpy (&a, rd[i].data, sizeof(a)); | 226 | memcpy (&a, rd[i].data, sizeof(a)); |
227 | addr = inet_ntoa(a); | 227 | addr = inet_ntoa(a); |
@@ -241,7 +241,7 @@ on_lookup_result_zkey (void *cls, uint32_t rd_count, | |||
241 | "No resolution!\n"); | 241 | "No resolution!\n"); |
242 | } | 242 | } |
243 | } | 243 | } |
244 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_DNS, GNUNET_GNS_RECORD_A, | 244 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_DNS, GNUNET_DNSPARSER_TYPE_A, |
245 | GNUNET_YES, | 245 | GNUNET_YES, |
246 | NULL, | 246 | NULL, |
247 | &on_lookup_result_dns, TEST_DOMAIN_DNS); | 247 | &on_lookup_result_dns, TEST_DOMAIN_DNS); |
@@ -269,7 +269,7 @@ on_lookup_result_plus (void *cls, uint32_t rd_count, | |||
269 | for (i=0; i<rd_count; i++) | 269 | for (i=0; i<rd_count; i++) |
270 | { | 270 | { |
271 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 271 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
272 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 272 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
273 | { | 273 | { |
274 | memcpy(&a, rd[i].data, sizeof(a)); | 274 | memcpy(&a, rd[i].data, sizeof(a)); |
275 | addr = inet_ntoa(a); | 275 | addr = inet_ntoa(a); |
@@ -286,7 +286,7 @@ on_lookup_result_plus (void *cls, uint32_t rd_count, | |||
286 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No resolution!\n"); | 286 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No resolution!\n"); |
287 | } | 287 | } |
288 | } | 288 | } |
289 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_ZKEY, GNUNET_GNS_RECORD_A, | 289 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_ZKEY, GNUNET_DNSPARSER_TYPE_A, |
290 | GNUNET_YES, | 290 | GNUNET_YES, |
291 | NULL, | 291 | NULL, |
292 | &on_lookup_result_zkey, TEST_DOMAIN_ZKEY); | 292 | &on_lookup_result_zkey, TEST_DOMAIN_ZKEY); |
@@ -322,7 +322,7 @@ commence_testing (void *cls, int32_t success, const char *emsg) | |||
322 | GNUNET_SCHEDULER_shutdown (); | 322 | GNUNET_SCHEDULER_shutdown (); |
323 | return; | 323 | return; |
324 | } | 324 | } |
325 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_PLUS, GNUNET_GNS_RECORD_A, | 325 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_PLUS, GNUNET_DNSPARSER_TYPE_A, |
326 | GNUNET_YES, | 326 | GNUNET_YES, |
327 | NULL, | 327 | NULL, |
328 | &on_lookup_result_plus, TEST_DOMAIN_PLUS); | 328 | &on_lookup_result_plus, TEST_DOMAIN_PLUS); |
@@ -387,7 +387,7 @@ do_check (void *cls, | |||
387 | 387 | ||
388 | rd.data_size = strlen (TEST_RECORD_CNAME_PLUS); | 388 | rd.data_size = strlen (TEST_RECORD_CNAME_PLUS); |
389 | rd.data = TEST_RECORD_CNAME_PLUS; | 389 | rd.data = TEST_RECORD_CNAME_PLUS; |
390 | rd.record_type = GNUNET_GNS_RECORD_CNAME; | 390 | rd.record_type = GNUNET_DNSPARSER_TYPE_CNAME; |
391 | 391 | ||
392 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 392 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
393 | alice_key, | 393 | alice_key, |
@@ -398,7 +398,7 @@ do_check (void *cls, | |||
398 | 398 | ||
399 | rd.data_size = strlen (TEST_RECORD_CNAME_ZKEY); | 399 | rd.data_size = strlen (TEST_RECORD_CNAME_ZKEY); |
400 | rd.data = TEST_RECORD_CNAME_ZKEY; | 400 | rd.data = TEST_RECORD_CNAME_ZKEY; |
401 | rd.record_type = GNUNET_GNS_RECORD_CNAME; | 401 | rd.record_type = GNUNET_DNSPARSER_TYPE_CNAME; |
402 | 402 | ||
403 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 403 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
404 | alice_key, | 404 | alice_key, |
@@ -409,7 +409,7 @@ do_check (void *cls, | |||
409 | 409 | ||
410 | rd.data_size = strlen (TEST_RECORD_CNAME_DNS); | 410 | rd.data_size = strlen (TEST_RECORD_CNAME_DNS); |
411 | rd.data = TEST_RECORD_CNAME_DNS; | 411 | rd.data = TEST_RECORD_CNAME_DNS; |
412 | rd.record_type = GNUNET_GNS_RECORD_CNAME; | 412 | rd.record_type = GNUNET_DNSPARSER_TYPE_CNAME; |
413 | 413 | ||
414 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 414 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
415 | alice_key, | 415 | alice_key, |
diff --git a/src/gns/test_gns_dht_delegated_lookup.c b/src/gns/test_gns_dht_delegated_lookup.c index fbaacfdfa..104c6e01d 100644 --- a/src/gns/test_gns_dht_delegated_lookup.c +++ b/src/gns/test_gns_dht_delegated_lookup.c | |||
@@ -156,7 +156,7 @@ on_lookup_result(void *cls, uint32_t rd_count, | |||
156 | for (i=0; i<rd_count; i++) | 156 | for (i=0; i<rd_count; i++) |
157 | { | 157 | { |
158 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 158 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
159 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 159 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
160 | { | 160 | { |
161 | memcpy(&a, rd[i].data, sizeof(a)); | 161 | memcpy(&a, rd[i].data, sizeof(a)); |
162 | addr = inet_ntoa(a); | 162 | addr = inet_ntoa(a); |
@@ -198,7 +198,7 @@ commence_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
198 | return; | 198 | return; |
199 | } | 199 | } |
200 | 200 | ||
201 | GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A, | 201 | GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A, |
202 | GNUNET_NO, | 202 | GNUNET_NO, |
203 | NULL, | 203 | NULL, |
204 | &on_lookup_result, TEST_DOMAIN); | 204 | &on_lookup_result, TEST_DOMAIN); |
@@ -343,7 +343,7 @@ do_check (void *cls, | |||
343 | rd.expiration_time = UINT64_MAX; | 343 | rd.expiration_time = UINT64_MAX; |
344 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 344 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
345 | rd.data = &bob_hash; | 345 | rd.data = &bob_hash; |
346 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 346 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
347 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 347 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
348 | 348 | ||
349 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 349 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
diff --git a/src/gns/test_gns_dht_three_peers.c b/src/gns/test_gns_dht_three_peers.c index 11f78db4b..968889b0d 100644 --- a/src/gns/test_gns_dht_three_peers.c +++ b/src/gns/test_gns_dht_three_peers.c | |||
@@ -261,7 +261,7 @@ commence_testing(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
261 | { | 261 | { |
262 | fprintf (stderr, "\n"); | 262 | fprintf (stderr, "\n"); |
263 | wait_task = GNUNET_SCHEDULER_NO_TASK; | 263 | wait_task = GNUNET_SCHEDULER_NO_TASK; |
264 | lookup_handle = GNUNET_GNS_lookup(gh, TEST_DOMAIN, GNUNET_GNS_RECORD_A, | 264 | lookup_handle = GNUNET_GNS_lookup(gh, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A, |
265 | GNUNET_NO, | 265 | GNUNET_NO, |
266 | NULL, | 266 | NULL, |
267 | &on_lookup_result, TEST_DOMAIN); | 267 | &on_lookup_result, TEST_DOMAIN); |
@@ -353,7 +353,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
353 | GNUNET_assert(1 == inet_pton (AF_INET, TEST_IP, web)); | 353 | GNUNET_assert(1 == inet_pton (AF_INET, TEST_IP, web)); |
354 | rd.data_size = sizeof(struct in_addr); | 354 | rd.data_size = sizeof(struct in_addr); |
355 | rd.data = web; | 355 | rd.data = web; |
356 | rd.record_type = GNUNET_GNS_RECORD_A; | 356 | rd.record_type = GNUNET_DNSPARSER_TYPE_A; |
357 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 357 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
358 | 358 | ||
359 | GNUNET_NAMESTORE_record_put_by_authority (nh[0], key, "www", | 359 | GNUNET_NAMESTORE_record_put_by_authority (nh[0], key, "www", |
@@ -362,7 +362,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
362 | 362 | ||
363 | rd.data_size = strlen(TEST_DAVE_PSEU); | 363 | rd.data_size = strlen(TEST_DAVE_PSEU); |
364 | rd.data = TEST_DAVE_PSEU; | 364 | rd.data = TEST_DAVE_PSEU; |
365 | rd.record_type = GNUNET_GNS_RECORD_PSEU; | 365 | rd.record_type = GNUNET_NAMESTORE_TYPE_PSEU; |
366 | 366 | ||
367 | 367 | ||
368 | GNUNET_NAMESTORE_record_put_by_authority (nh[0], key, | 368 | GNUNET_NAMESTORE_record_put_by_authority (nh[0], key, |
@@ -421,7 +421,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
421 | rd.expiration_time = UINT64_MAX; | 421 | rd.expiration_time = UINT64_MAX; |
422 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 422 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
423 | rd.data = &dave_hash; | 423 | rd.data = &dave_hash; |
424 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 424 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
425 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 425 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
426 | 426 | ||
427 | GNUNET_NAMESTORE_record_put_by_authority (nh[1], key, "buddy", | 427 | GNUNET_NAMESTORE_record_put_by_authority (nh[1], key, "buddy", |
@@ -473,7 +473,7 @@ setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
473 | rd.expiration_time = UINT64_MAX; | 473 | rd.expiration_time = UINT64_MAX; |
474 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 474 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
475 | rd.data = &bob_hash; | 475 | rd.data = &bob_hash; |
476 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 476 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
477 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 477 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
478 | 478 | ||
479 | GNUNET_NAMESTORE_record_put_by_authority (nh[2], key, "bob", | 479 | GNUNET_NAMESTORE_record_put_by_authority (nh[2], key, "bob", |
diff --git a/src/gns/test_gns_max_queries.c b/src/gns/test_gns_max_queries.c index cc993e347..c63495ca3 100644 --- a/src/gns/test_gns_max_queries.c +++ b/src/gns/test_gns_max_queries.c | |||
@@ -182,7 +182,7 @@ on_lookup_result (void *cls, uint32_t rd_count, | |||
182 | for (i=0; i<rd_count; i++) | 182 | for (i=0; i<rd_count; i++) |
183 | { | 183 | { |
184 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 184 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
185 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 185 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
186 | { | 186 | { |
187 | memcpy(&a, rd[i].data, sizeof(a)); | 187 | memcpy(&a, rd[i].data, sizeof(a)); |
188 | addr = inet_ntoa(a); | 188 | addr = inet_ntoa(a); |
@@ -231,13 +231,13 @@ commence_testing (void *cls, int32_t success, const char *emsg) | |||
231 | GNUNET_snprintf(lookup_name, | 231 | GNUNET_snprintf(lookup_name, |
232 | GNUNET_DNSPARSER_MAX_NAME_LENGTH, | 232 | GNUNET_DNSPARSER_MAX_NAME_LENGTH, |
233 | "www.doesnotexist-%d.bob.gads", i); | 233 | "www.doesnotexist-%d.bob.gads", i); |
234 | lr = GNUNET_GNS_lookup (gns_handle, lookup_name, GNUNET_GNS_RECORD_A, | 234 | lr = GNUNET_GNS_lookup (gns_handle, lookup_name, GNUNET_DNSPARSER_TYPE_A, |
235 | GNUNET_NO, | 235 | GNUNET_NO, |
236 | NULL, | 236 | NULL, |
237 | &on_lookup_result_dummy, &requests[num_requests]); | 237 | &on_lookup_result_dummy, &requests[num_requests]); |
238 | requests[num_requests++] = lr; | 238 | requests[num_requests++] = lr; |
239 | } | 239 | } |
240 | lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A, | 240 | lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A, |
241 | GNUNET_NO, | 241 | GNUNET_NO, |
242 | NULL, | 242 | NULL, |
243 | &on_lookup_result, TEST_DOMAIN); | 243 | &on_lookup_result, TEST_DOMAIN); |
@@ -320,7 +320,7 @@ do_check (void *cls, | |||
320 | GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); | 320 | GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); |
321 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 321 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
322 | rd.data = &bob_hash; | 322 | rd.data = &bob_hash; |
323 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 323 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
324 | 324 | ||
325 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 325 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
326 | alice_key, | 326 | alice_key, |
diff --git a/src/gns/test_gns_ns_lookup.c b/src/gns/test_gns_ns_lookup.c index 0673243b6..77398b3de 100644 --- a/src/gns/test_gns_ns_lookup.c +++ b/src/gns/test_gns_ns_lookup.c | |||
@@ -267,7 +267,7 @@ on_lookup_result_alt2 (void *cls, uint32_t rd_count, | |||
267 | ok = 1; | 267 | ok = 1; |
268 | for (i=0; i<rd_count; i++) | 268 | for (i=0; i<rd_count; i++) |
269 | { | 269 | { |
270 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 270 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
271 | { | 271 | { |
272 | memcpy(&a, rd[i].data, sizeof(a)); | 272 | memcpy(&a, rd[i].data, sizeof(a)); |
273 | addr = inet_ntoa(a); | 273 | addr = inet_ntoa(a); |
@@ -335,7 +335,7 @@ on_lookup_result_alt (void *cls, uint32_t rd_count, | |||
335 | ok = 1; | 335 | ok = 1; |
336 | for (i=0; i<rd_count; i++) | 336 | for (i=0; i<rd_count; i++) |
337 | { | 337 | { |
338 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 338 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
339 | { | 339 | { |
340 | memcpy (&a, rd[i].data, sizeof(a)); | 340 | memcpy (&a, rd[i].data, sizeof(a)); |
341 | addr = inet_ntoa (a); | 341 | addr = inet_ntoa (a); |
@@ -366,7 +366,7 @@ on_lookup_result_alt (void *cls, uint32_t rd_count, | |||
366 | "Starting lookup for `%s'\n", | 366 | "Starting lookup for `%s'\n", |
367 | TEST_DOMAIN_ALT2); | 367 | TEST_DOMAIN_ALT2); |
368 | lr = GNUNET_GNS_lookup (gns_handle, | 368 | lr = GNUNET_GNS_lookup (gns_handle, |
369 | TEST_DOMAIN_ALT2, GNUNET_GNS_RECORD_A, | 369 | TEST_DOMAIN_ALT2, GNUNET_DNSPARSER_TYPE_A, |
370 | GNUNET_YES, | 370 | GNUNET_YES, |
371 | NULL, | 371 | NULL, |
372 | &on_lookup_result_alt2, NULL); | 372 | &on_lookup_result_alt2, NULL); |
@@ -407,7 +407,7 @@ on_lookup_result (void *cls, uint32_t rd_count, | |||
407 | ok = 1; | 407 | ok = 1; |
408 | for (i=0; i<rd_count; i++) | 408 | for (i=0; i<rd_count; i++) |
409 | { | 409 | { |
410 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 410 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
411 | { | 411 | { |
412 | memcpy (&a, rd[i].data, sizeof(a)); | 412 | memcpy (&a, rd[i].data, sizeof(a)); |
413 | addr = inet_ntoa(a); | 413 | addr = inet_ntoa(a); |
@@ -438,7 +438,7 @@ on_lookup_result (void *cls, uint32_t rd_count, | |||
438 | "Starting lookup for `%s'\n", | 438 | "Starting lookup for `%s'\n", |
439 | TEST_DOMAIN_ALT); | 439 | TEST_DOMAIN_ALT); |
440 | 440 | ||
441 | lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_ALT, GNUNET_GNS_RECORD_A, | 441 | lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN_ALT, GNUNET_DNSPARSER_TYPE_A, |
442 | GNUNET_YES, | 442 | GNUNET_YES, |
443 | NULL, | 443 | NULL, |
444 | &on_lookup_result_alt, NULL); | 444 | &on_lookup_result_alt, NULL); |
@@ -462,7 +462,7 @@ start_lookup () | |||
462 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 462 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
463 | "Records ready, starting lookup for `%s'\n", | 463 | "Records ready, starting lookup for `%s'\n", |
464 | TEST_DOMAIN); | 464 | TEST_DOMAIN); |
465 | lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A, | 465 | lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A, |
466 | GNUNET_YES, | 466 | GNUNET_YES, |
467 | NULL, | 467 | NULL, |
468 | &on_lookup_result, NULL); | 468 | &on_lookup_result, NULL); |
@@ -606,7 +606,7 @@ do_check (void *cls, | |||
606 | rd[1].expiration_time = UINT64_MAX; | 606 | rd[1].expiration_time = UINT64_MAX; |
607 | rd[1].data_size = strlen (TEST_RECORD_NS); | 607 | rd[1].data_size = strlen (TEST_RECORD_NS); |
608 | rd[1].data = TEST_RECORD_NS; | 608 | rd[1].data = TEST_RECORD_NS; |
609 | rd[1].record_type = GNUNET_GNS_RECORD_NS; | 609 | rd[1].record_type = GNUNET_DNSPARSER_TYPE_NS; |
610 | rd[1].flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 610 | rd[1].flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
611 | 611 | ||
612 | qe = GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 612 | qe = GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c index 050e2d258..d9c660c86 100644 --- a/src/gns/test_gns_proxy.c +++ b/src/gns/test_gns_proxy.c | |||
@@ -423,11 +423,11 @@ run (void *cls, | |||
423 | 423 | ||
424 | host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile); | 424 | host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile); |
425 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; | 425 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; |
426 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_GNS_RECORD_A, | 426 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_DNSPARSER_TYPE_A, |
427 | "127.0.0.1", | 427 | "127.0.0.1", |
428 | (void**)&rd.data, | 428 | (void**)&rd.data, |
429 | &rd.data_size)); | 429 | &rd.data_size)); |
430 | rd.record_type = GNUNET_GNS_RECORD_A; | 430 | rd.record_type = GNUNET_DNSPARSER_TYPE_A; |
431 | 431 | ||
432 | GNUNET_NAMESTORE_record_create (namestore, | 432 | GNUNET_NAMESTORE_record_create (namestore, |
433 | host_key, | 433 | host_key, |
diff --git a/src/gns/test_gns_pseu_shorten.c b/src/gns/test_gns_pseu_shorten.c index ba7cd2492..c6724ab05 100644 --- a/src/gns/test_gns_pseu_shorten.c +++ b/src/gns/test_gns_pseu_shorten.c | |||
@@ -200,7 +200,7 @@ on_lookup_result (void *cls, uint32_t rd_count, | |||
200 | for (i=0; i<rd_count; i++) | 200 | for (i=0; i<rd_count; i++) |
201 | { | 201 | { |
202 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 202 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
203 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 203 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
204 | { | 204 | { |
205 | memcpy(&a, rd[i].data, sizeof(a)); | 205 | memcpy(&a, rd[i].data, sizeof(a)); |
206 | addr = inet_ntoa(a); | 206 | addr = inet_ntoa(a); |
@@ -247,7 +247,7 @@ commence_testing (void *cls, int success) | |||
247 | } | 247 | } |
248 | GNUNET_GNS_lookup_zone (gns_handle, TEST_DOMAIN, | 248 | GNUNET_GNS_lookup_zone (gns_handle, TEST_DOMAIN, |
249 | &our_zone, | 249 | &our_zone, |
250 | GNUNET_GNS_RECORD_A, | 250 | GNUNET_DNSPARSER_TYPE_A, |
251 | GNUNET_NO, | 251 | GNUNET_NO, |
252 | short_key, | 252 | short_key, |
253 | &on_lookup_result, TEST_DOMAIN); | 253 | &on_lookup_result, TEST_DOMAIN); |
@@ -272,7 +272,7 @@ put_pseu_dht (void *cls, int success) | |||
272 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; | 272 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; |
273 | rd.data_size = strlen(TEST_PSEU_ALICE)+1; | 273 | rd.data_size = strlen(TEST_PSEU_ALICE)+1; |
274 | rd.data = TEST_PSEU_ALICE; | 274 | rd.data = TEST_PSEU_ALICE; |
275 | rd.record_type = GNUNET_GNS_RECORD_PSEU; | 275 | rd.record_type = GNUNET_NAMESTORE_TYPE_PSEU; |
276 | rd.flags = 0; | 276 | rd.flags = 0; |
277 | 277 | ||
278 | sig = GNUNET_NAMESTORE_create_signature(alice_key, | 278 | sig = GNUNET_NAMESTORE_create_signature(alice_key, |
@@ -447,7 +447,7 @@ put_pkey_dht (void *cls, int32_t success, const char *emsg) | |||
447 | rd.expiration_time = UINT64_MAX; | 447 | rd.expiration_time = UINT64_MAX; |
448 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 448 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
449 | rd.data = &alice_hash; | 449 | rd.data = &alice_hash; |
450 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 450 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
451 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 451 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
452 | 452 | ||
453 | sig = GNUNET_NAMESTORE_create_signature (bob_key, | 453 | sig = GNUNET_NAMESTORE_create_signature (bob_key, |
@@ -518,7 +518,7 @@ fin_init_zone (void *cls, int32_t success, const char *emsg) | |||
518 | rd.expiration_time = UINT64_MAX; | 518 | rd.expiration_time = UINT64_MAX; |
519 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 519 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
520 | rd.data = &bob_hash; | 520 | rd.data = &bob_hash; |
521 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 521 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
522 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 522 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
523 | 523 | ||
524 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 524 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
@@ -539,7 +539,7 @@ cont_init_zone (void *cls, int32_t success, const char *emsg) | |||
539 | rd.expiration_time = UINT64_MAX; | 539 | rd.expiration_time = UINT64_MAX; |
540 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 540 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
541 | rd.data = &short_zone; | 541 | rd.data = &short_zone; |
542 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 542 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
543 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 543 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
544 | 544 | ||
545 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 545 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
@@ -640,7 +640,7 @@ do_check (void *cls, | |||
640 | rd.expiration_time = UINT64_MAX; | 640 | rd.expiration_time = UINT64_MAX; |
641 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 641 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
642 | rd.data = &priv_zone; | 642 | rd.data = &priv_zone; |
643 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 643 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
644 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 644 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
645 | 645 | ||
646 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 646 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
diff --git a/src/gns/test_gns_revocation.c b/src/gns/test_gns_revocation.c index e66655203..85da4a09a 100644 --- a/src/gns/test_gns_revocation.c +++ b/src/gns/test_gns_revocation.c | |||
@@ -130,7 +130,7 @@ on_lookup_result(void *cls, uint32_t rd_count, | |||
130 | for (i=0; i<rd_count; i++) | 130 | for (i=0; i<rd_count; i++) |
131 | { | 131 | { |
132 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "type: %d\n", rd[i].record_type); | 132 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "type: %d\n", rd[i].record_type); |
133 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 133 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
134 | { | 134 | { |
135 | memcpy(&a, rd[i].data, sizeof(a)); | 135 | memcpy(&a, rd[i].data, sizeof(a)); |
136 | addr = inet_ntoa(a); | 136 | addr = inet_ntoa(a); |
@@ -168,7 +168,7 @@ commence_testing (void *cls, int32_t success, const char *emsg) | |||
168 | return; | 168 | return; |
169 | } | 169 | } |
170 | 170 | ||
171 | GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A, | 171 | GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A, |
172 | GNUNET_NO, | 172 | GNUNET_NO, |
173 | NULL, | 173 | NULL, |
174 | &on_lookup_result, TEST_DOMAIN); | 174 | &on_lookup_result, TEST_DOMAIN); |
@@ -225,7 +225,7 @@ do_check (void *cls, | |||
225 | 225 | ||
226 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 226 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
227 | rd.data = &bob_hash; | 227 | rd.data = &bob_hash; |
228 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 228 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
229 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 229 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
230 | 230 | ||
231 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 231 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
@@ -253,7 +253,7 @@ do_check (void *cls, | |||
253 | NULL, | 253 | NULL, |
254 | NULL); | 254 | NULL); |
255 | rd.data_size = 0; | 255 | rd.data_size = 0; |
256 | rd.record_type = GNUNET_GNS_RECORD_REV; | 256 | rd.record_type = GNUNET_NAMESTORE_TYPE_REV; |
257 | 257 | ||
258 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 258 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
259 | bob_key, | 259 | bob_key, |
diff --git a/src/gns/test_gns_simple_delegated_lookup.c b/src/gns/test_gns_simple_delegated_lookup.c index 8b5f8bc38..522b74d29 100644 --- a/src/gns/test_gns_simple_delegated_lookup.c +++ b/src/gns/test_gns_simple_delegated_lookup.c | |||
@@ -138,7 +138,7 @@ on_lookup_result (void *cls, uint32_t rd_count, | |||
138 | for (i=0; i<rd_count; i++) | 138 | for (i=0; i<rd_count; i++) |
139 | { | 139 | { |
140 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 140 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
141 | if (rd[i].record_type != GNUNET_GNS_RECORD_A) | 141 | if (rd[i].record_type != GNUNET_DNSPARSER_TYPE_A) |
142 | continue; | 142 | continue; |
143 | memcpy (&a, rd[i].data, sizeof (a)); | 143 | memcpy (&a, rd[i].data, sizeof (a)); |
144 | addr = inet_ntoa (a); | 144 | addr = inet_ntoa (a); |
@@ -177,7 +177,7 @@ commence_testing (void *cls, int32_t success, const char *emsg) | |||
177 | GNUNET_SCHEDULER_shutdown (); | 177 | GNUNET_SCHEDULER_shutdown (); |
178 | return; | 178 | return; |
179 | } | 179 | } |
180 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A, | 180 | GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A, |
181 | GNUNET_NO, | 181 | GNUNET_NO, |
182 | NULL, | 182 | NULL, |
183 | &on_lookup_result, TEST_DOMAIN); | 183 | &on_lookup_result, TEST_DOMAIN); |
@@ -232,7 +232,7 @@ do_check (void *cls, | |||
232 | GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); | 232 | GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); |
233 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 233 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
234 | rd.data = &bob_hash; | 234 | rd.data = &bob_hash; |
235 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 235 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
236 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 236 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
237 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 237 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
238 | alice_key, | 238 | alice_key, |
diff --git a/src/gns/test_gns_simple_get_authority.c b/src/gns/test_gns_simple_get_authority.c index 7a3e8af93..b87455857 100644 --- a/src/gns/test_gns_simple_get_authority.c +++ b/src/gns/test_gns_simple_get_authority.c | |||
@@ -231,7 +231,7 @@ void do_check (void *cls, | |||
231 | 231 | ||
232 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 232 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
233 | rd.data = &bob_hash; | 233 | rd.data = &bob_hash; |
234 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 234 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
235 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 235 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
236 | 236 | ||
237 | /* put bob into our zone */ | 237 | /* put bob into our zone */ |
@@ -280,7 +280,7 @@ void do_check (void *cls, | |||
280 | 280 | ||
281 | rd.data_size = strlen(TEST_ALICE_PSEU); | 281 | rd.data_size = strlen(TEST_ALICE_PSEU); |
282 | rd.data = TEST_ALICE_PSEU; | 282 | rd.data = TEST_ALICE_PSEU; |
283 | rd.record_type = GNUNET_GNS_RECORD_PSEU; | 283 | rd.record_type = GNUNET_NAMESTORE_TYPE_PSEU; |
284 | GNUNET_free(sig); | 284 | GNUNET_free(sig); |
285 | 285 | ||
286 | sig = GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_UNIT_FOREVER_ABS, "", | 286 | sig = GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_UNIT_FOREVER_ABS, "", |
diff --git a/src/gns/test_gns_simple_lookup.c b/src/gns/test_gns_simple_lookup.c index fceb8f052..471e6843a 100644 --- a/src/gns/test_gns_simple_lookup.c +++ b/src/gns/test_gns_simple_lookup.c | |||
@@ -153,7 +153,7 @@ on_lookup_result(void *cls, uint32_t rd_count, | |||
153 | for (i=0; i<rd_count; i++) | 153 | for (i=0; i<rd_count; i++) |
154 | { | 154 | { |
155 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 155 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
156 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 156 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
157 | { | 157 | { |
158 | memcpy (&a, rd[i].data, sizeof(a)); | 158 | memcpy (&a, rd[i].data, sizeof(a)); |
159 | addr = inet_ntoa(a); | 159 | addr = inet_ntoa(a); |
@@ -209,7 +209,7 @@ commence_testing (void *cls, | |||
209 | end_badly_now (); | 209 | end_badly_now (); |
210 | return; | 210 | return; |
211 | } | 211 | } |
212 | lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A, | 212 | lr = GNUNET_GNS_lookup (gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A, |
213 | GNUNET_YES, | 213 | GNUNET_YES, |
214 | NULL, | 214 | NULL, |
215 | &on_lookup_result, TEST_DOMAIN); | 215 | &on_lookup_result, TEST_DOMAIN); |
diff --git a/src/gns/test_gns_simple_mx_lookup.c b/src/gns/test_gns_simple_mx_lookup.c index b078edc4f..a6839e549 100644 --- a/src/gns/test_gns_simple_mx_lookup.c +++ b/src/gns/test_gns_simple_mx_lookup.c | |||
@@ -131,7 +131,7 @@ on_lookup_result(void *cls, uint32_t rd_count, | |||
131 | for (i=0; i<rd_count; i++) | 131 | for (i=0; i<rd_count; i++) |
132 | { | 132 | { |
133 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 133 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
134 | if (rd[i].record_type == GNUNET_GNS_RECORD_MX) | 134 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_MX) |
135 | { | 135 | { |
136 | mx = (char*)rd[i].data+sizeof(uint16_t); | 136 | mx = (char*)rd[i].data+sizeof(uint16_t); |
137 | mx_preference = *(uint16_t*)rd[i].data; | 137 | mx_preference = *(uint16_t*)rd[i].data; |
@@ -168,7 +168,7 @@ commence_testing (void *cls, int32_t success, const char *emsg) | |||
168 | end_badly_now(); | 168 | end_badly_now(); |
169 | return; | 169 | return; |
170 | } | 170 | } |
171 | GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_MX, | 171 | GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_MX, |
172 | GNUNET_NO, | 172 | GNUNET_NO, |
173 | NULL, | 173 | NULL, |
174 | &on_lookup_result, TEST_DOMAIN); | 174 | &on_lookup_result, TEST_DOMAIN); |
@@ -228,7 +228,7 @@ do_check (void *cls, | |||
228 | 228 | ||
229 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 229 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
230 | rd.data = &bob_hash; | 230 | rd.data = &bob_hash; |
231 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 231 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
232 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 232 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
233 | 233 | ||
234 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 234 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
@@ -262,7 +262,7 @@ do_check (void *cls, | |||
262 | memcpy(mx_record, &mx_preference, sizeof(uint16_t)); | 262 | memcpy(mx_record, &mx_preference, sizeof(uint16_t)); |
263 | strcpy(mx_record+sizeof(uint16_t), TEST_MX_NAME); | 263 | strcpy(mx_record+sizeof(uint16_t), TEST_MX_NAME); |
264 | rd.data = mx_record; | 264 | rd.data = mx_record; |
265 | rd.record_type = GNUNET_GNS_RECORD_MX; | 265 | rd.record_type = GNUNET_DNSPARSER_TYPE_MX; |
266 | sig = GNUNET_NAMESTORE_create_signature(bob_key, | 266 | sig = GNUNET_NAMESTORE_create_signature(bob_key, |
267 | GNUNET_TIME_UNIT_FOREVER_ABS, | 267 | GNUNET_TIME_UNIT_FOREVER_ABS, |
268 | GNUNET_GNS_MASTERZONE_STR, | 268 | GNUNET_GNS_MASTERZONE_STR, |
diff --git a/src/gns/test_gns_simple_shorten.c b/src/gns/test_gns_simple_shorten.c index 679a74dc8..ab8129254 100644 --- a/src/gns/test_gns_simple_shorten.c +++ b/src/gns/test_gns_simple_shorten.c | |||
@@ -256,7 +256,7 @@ void do_check (void *cls, | |||
256 | 256 | ||
257 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 257 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
258 | rd.data = &bob_hash; | 258 | rd.data = &bob_hash; |
259 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 259 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
260 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 260 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
261 | 261 | ||
262 | /* put bob into our zone */ | 262 | /* put bob into our zone */ |
@@ -308,7 +308,7 @@ void do_check (void *cls, | |||
308 | 308 | ||
309 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 309 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
310 | rd.data = &alice_hash; | 310 | rd.data = &alice_hash; |
311 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 311 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
312 | GNUNET_free(sig); | 312 | GNUNET_free(sig); |
313 | 313 | ||
314 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 314 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
diff --git a/src/gns/test_gns_simple_srv_lookup.c b/src/gns/test_gns_simple_srv_lookup.c index 601d01af9..498b7e131 100644 --- a/src/gns/test_gns_simple_srv_lookup.c +++ b/src/gns/test_gns_simple_srv_lookup.c | |||
@@ -130,7 +130,7 @@ on_lookup_result(void *cls, uint32_t rd_count, | |||
130 | for (i=0; i<rd_count; i++) | 130 | for (i=0; i<rd_count; i++) |
131 | { | 131 | { |
132 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 132 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
133 | if (rd[i].record_type == GNUNET_GNS_RECORD_SRV) | 133 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_SRV) |
134 | { | 134 | { |
135 | srv_data = (uint16_t*)rd[i].data; | 135 | srv_data = (uint16_t*)rd[i].data; |
136 | srv = (char*)&srv_data[3]; | 136 | srv = (char*)&srv_data[3]; |
@@ -170,7 +170,7 @@ commence_testing (void *cls, int32_t success, const char *emsg) | |||
170 | return; | 170 | return; |
171 | } | 171 | } |
172 | 172 | ||
173 | GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_SRV, | 173 | GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_SRV, |
174 | GNUNET_NO, | 174 | GNUNET_NO, |
175 | NULL, | 175 | NULL, |
176 | &on_lookup_result, TEST_DOMAIN); | 176 | &on_lookup_result, TEST_DOMAIN); |
@@ -234,7 +234,7 @@ do_check (void *cls, | |||
234 | 234 | ||
235 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 235 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
236 | rd.data = &bob_hash; | 236 | rd.data = &bob_hash; |
237 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 237 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
238 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 238 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
239 | 239 | ||
240 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 240 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
@@ -269,7 +269,7 @@ do_check (void *cls, | |||
269 | srv_data->weight = srv_weight; | 269 | srv_data->weight = srv_weight; |
270 | strcpy((char*)&srv_data[1], TEST_SRV_NAME); | 270 | strcpy((char*)&srv_data[1], TEST_SRV_NAME); |
271 | rd.data = srv_data; | 271 | rd.data = srv_data; |
272 | rd.record_type = GNUNET_GNS_RECORD_SRV; | 272 | rd.record_type = GNUNET_DNSPARSER_TYPE_SRV; |
273 | sig = GNUNET_NAMESTORE_create_signature(bob_key, | 273 | sig = GNUNET_NAMESTORE_create_signature(bob_key, |
274 | GNUNET_TIME_UNIT_FOREVER_ABS, | 274 | GNUNET_TIME_UNIT_FOREVER_ABS, |
275 | TEST_RECORD_NAME_SRV, | 275 | TEST_RECORD_NAME_SRV, |
diff --git a/src/gns/test_gns_simple_zkey_lookup.c b/src/gns/test_gns_simple_zkey_lookup.c index c0e3afc8d..806655d3c 100644 --- a/src/gns/test_gns_simple_zkey_lookup.c +++ b/src/gns/test_gns_simple_zkey_lookup.c | |||
@@ -132,7 +132,7 @@ on_lookup_result(void *cls, uint32_t rd_count, | |||
132 | for (i=0; i<rd_count; i++) | 132 | for (i=0; i<rd_count; i++) |
133 | { | 133 | { |
134 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); | 134 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type); |
135 | if (rd[i].record_type == GNUNET_GNS_RECORD_A) | 135 | if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A) |
136 | { | 136 | { |
137 | memcpy(&a, rd[i].data, sizeof(a)); | 137 | memcpy(&a, rd[i].data, sizeof(a)); |
138 | addr = inet_ntoa(a); | 138 | addr = inet_ntoa(a); |
@@ -187,7 +187,7 @@ commence_testing (void *cls, int32_t success, const char *emsg) | |||
187 | pos++; | 187 | pos++; |
188 | strcpy(pos, GNUNET_GNS_TLD_ZKEY); | 188 | strcpy(pos, GNUNET_GNS_TLD_ZKEY); |
189 | 189 | ||
190 | GNUNET_GNS_lookup(gns_handle, name, GNUNET_GNS_RECORD_A, | 190 | GNUNET_GNS_lookup(gns_handle, name, GNUNET_DNSPARSER_TYPE_A, |
191 | GNUNET_NO, | 191 | GNUNET_NO, |
192 | NULL, | 192 | NULL, |
193 | &on_lookup_result, NULL); | 193 | &on_lookup_result, NULL); |
@@ -243,7 +243,7 @@ do_check (void *cls, | |||
243 | 243 | ||
244 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); | 244 | rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); |
245 | rd.data = &bob_hash; | 245 | rd.data = &bob_hash; |
246 | rd.record_type = GNUNET_GNS_RECORD_PKEY; | 246 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
247 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 247 | rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
248 | 248 | ||
249 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, | 249 | GNUNET_NAMESTORE_record_put_by_authority (namestore_handle, |
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h index 47d02ac7c..d9aad6d77 100644 --- a/src/include/gnunet_gns_service.h +++ b/src/include/gnunet_gns_service.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2012 Christian Grothoff (and other contributing authors) | 3 | (C) 2012-2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -55,100 +55,6 @@ struct GNUNET_GNS_Handle; | |||
55 | */ | 55 | */ |
56 | struct GNUNET_GNS_LookupRequest; | 56 | struct GNUNET_GNS_LookupRequest; |
57 | 57 | ||
58 | /** | ||
59 | * Handle to control a shorten operation. | ||
60 | */ | ||
61 | struct GNUNET_GNS_ShortenRequest; | ||
62 | |||
63 | /** | ||
64 | * Handle to control a get authority operation | ||
65 | */ | ||
66 | struct GNUNET_GNS_GetAuthRequest; | ||
67 | |||
68 | /** | ||
69 | * Record types | ||
70 | * Based on GNUNET_DNSPARSER_TYPEs (standard DNS) | ||
71 | */ | ||
72 | enum GNUNET_GNS_RecordType | ||
73 | { | ||
74 | /** | ||
75 | * A 'struct in_addr' | ||
76 | */ | ||
77 | GNUNET_GNS_RECORD_A = GNUNET_DNSPARSER_TYPE_A, | ||
78 | |||
79 | /** | ||
80 | * A 'char *' | ||
81 | */ | ||
82 | GNUNET_GNS_RECORD_NS = GNUNET_DNSPARSER_TYPE_NS, | ||
83 | |||
84 | /** | ||
85 | * A 'char *' | ||
86 | */ | ||
87 | GNUNET_GNS_RECORD_CNAME = GNUNET_DNSPARSER_TYPE_CNAME, | ||
88 | |||
89 | /** | ||
90 | * A 'struct soa_data' | ||
91 | */ | ||
92 | GNUNET_GNS_RECORD_SOA = GNUNET_DNSPARSER_TYPE_SOA, | ||
93 | |||
94 | /** | ||
95 | * A 'struct srv_data' | ||
96 | */ | ||
97 | GNUNET_GNS_RECORD_SRV = GNUNET_DNSPARSER_TYPE_SRV, | ||
98 | |||
99 | /** | ||
100 | * A 'char *' | ||
101 | */ | ||
102 | GNUNET_GNS_RECORD_PTR = GNUNET_DNSPARSER_TYPE_PTR, | ||
103 | |||
104 | /** | ||
105 | * A 'uint16_t' and a 'char *' | ||
106 | */ | ||
107 | GNUNET_GNS_RECORD_MX = GNUNET_DNSPARSER_TYPE_MX, | ||
108 | |||
109 | /** | ||
110 | * A 'char *' | ||
111 | */ | ||
112 | GNUNET_GNS_RECORD_TXT = GNUNET_DNSPARSER_TYPE_TXT, | ||
113 | |||
114 | /** | ||
115 | * A 'struct in6_addr' | ||
116 | */ | ||
117 | GNUNET_GNS_RECORD_AAAA = GNUNET_DNSPARSER_TYPE_AAAA, | ||
118 | |||
119 | /* GNS specific */ | ||
120 | /** | ||
121 | * A 'struct GNUNET_CRYPTO_ShortHashCode' | ||
122 | */ | ||
123 | GNUNET_GNS_RECORD_PKEY = GNUNET_NAMESTORE_TYPE_PKEY, | ||
124 | |||
125 | /** | ||
126 | * A 'char *' | ||
127 | */ | ||
128 | GNUNET_GNS_RECORD_PSEU = GNUNET_NAMESTORE_TYPE_PSEU, | ||
129 | GNUNET_GNS_RECORD_ANY = GNUNET_NAMESTORE_TYPE_ANY, | ||
130 | |||
131 | /** | ||
132 | * A 'char *' | ||
133 | */ | ||
134 | GNUNET_GNS_RECORD_LEHO = GNUNET_NAMESTORE_TYPE_LEHO, | ||
135 | |||
136 | /** | ||
137 | * A 'struct vpn_data' | ||
138 | */ | ||
139 | GNUNET_GNS_RECORD_VPN = GNUNET_NAMESTORE_TYPE_VPN, | ||
140 | |||
141 | /** | ||
142 | * Revocation, no data. | ||
143 | */ | ||
144 | GNUNET_GNS_RECORD_REV = GNUNET_NAMESTORE_TYPE_REV, | ||
145 | |||
146 | /** | ||
147 | * Social place. | ||
148 | */ | ||
149 | GNUNET_GNS_RECORD_PLACE = GNUNET_NAMESTORE_TYPE_PLACE | ||
150 | }; | ||
151 | |||
152 | 58 | ||
153 | /** | 59 | /** |
154 | * Initialize the connection with the GNS service. | 60 | * Initialize the connection with the GNS service. |
@@ -169,14 +75,11 @@ void | |||
169 | GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle); | 75 | GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle); |
170 | 76 | ||
171 | 77 | ||
172 | /* *************** Standard API: lookup ******************* */ | ||
173 | |||
174 | /** | 78 | /** |
175 | * Iterator called on obtained result for a GNS | 79 | * Iterator called on obtained result for a GNS lookup. |
176 | * lookup | ||
177 | * | 80 | * |
178 | * @param cls closure | 81 | * @param cls closure |
179 | * @param rd_count number of records | 82 | * @param rd_count number of records in @a rd |
180 | * @param rd the records in reply | 83 | * @param rd the records in reply |
181 | */ | 84 | */ |
182 | typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls, | 85 | typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls, |
@@ -184,14 +87,13 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls, | |||
184 | const struct GNUNET_NAMESTORE_RecordData *rd); | 87 | const struct GNUNET_NAMESTORE_RecordData *rd); |
185 | 88 | ||
186 | 89 | ||
187 | |||
188 | /** | 90 | /** |
189 | * Perform an asynchronous lookup operation on the GNS. | 91 | * Perform an asynchronous lookup operation on the GNS. |
190 | * | 92 | * |
191 | * @param handle handle to the GNS service | 93 | * @param handle handle to the GNS service |
192 | * @param name the name to look up | 94 | * @param name the name to look up |
193 | * @param zone zone to look in | 95 | * @param zone zone to look in |
194 | * @param type the record type to look for | 96 | * @param type the GNS record type to look for |
195 | * @param only_cached #GNUNET_NO to only check locally (not in the DHT) | 97 | * @param only_cached #GNUNET_NO to only check locally (not in the DHT) |
196 | * @param shorten_zone_key the private key of the shorten zone (can be NULL); | 98 | * @param shorten_zone_key the private key of the shorten zone (can be NULL); |
197 | * specify to enable automatic shortening (given a PSEU | 99 | * specify to enable automatic shortening (given a PSEU |
@@ -206,7 +108,7 @@ struct GNUNET_GNS_LookupRequest* | |||
206 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | 108 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, |
207 | const char *name, | 109 | const char *name, |
208 | const struct GNUNET_CRYPTO_EccPublicKey *zone, | 110 | const struct GNUNET_CRYPTO_EccPublicKey *zone, |
209 | enum GNUNET_GNS_RecordType type, | 111 | int type, |
210 | int only_cached, | 112 | int only_cached, |
211 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key, | 113 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key, |
212 | GNUNET_GNS_LookupResultProcessor proc, | 114 | GNUNET_GNS_LookupResultProcessor proc, |
@@ -222,45 +124,6 @@ void | |||
222 | GNUNET_GNS_cancel_lookup_request (struct GNUNET_GNS_LookupRequest *lr); | 124 | GNUNET_GNS_cancel_lookup_request (struct GNUNET_GNS_LookupRequest *lr); |
223 | 125 | ||
224 | 126 | ||
225 | |||
226 | /* *************** Standard API: get authority ******************* */ | ||
227 | |||
228 | |||
229 | /** | ||
230 | * Processor called on for a name shortening result | ||
231 | * called only once | ||
232 | * | ||
233 | * @param cls closure | ||
234 | * @param auth_name the name of the auhtority or NULL | ||
235 | */ | ||
236 | typedef void (*GNUNET_GNS_GetAuthResultProcessor) (void *cls, | ||
237 | const char* short_name); | ||
238 | |||
239 | |||
240 | /** | ||
241 | * Perform an authority lookup for a given name. | ||
242 | * | ||
243 | * @param handle handle to the GNS service | ||
244 | * @param name the name to look up authority for | ||
245 | * @param proc function to call on result | ||
246 | * @param proc_cls closure for processor | ||
247 | * @return handle to the operation | ||
248 | */ | ||
249 | struct GNUNET_GNS_GetAuthRequest* | ||
250 | GNUNET_GNS_get_authority (struct GNUNET_GNS_Handle *handle, | ||
251 | const char *name, | ||
252 | GNUNET_GNS_GetAuthResultProcessor proc, | ||
253 | void *proc_cls); | ||
254 | |||
255 | |||
256 | /** | ||
257 | * Cancel pending get auth request | ||
258 | * | ||
259 | * @param gar the lookup request to cancel | ||
260 | */ | ||
261 | void | ||
262 | GNUNET_GNS_cancel_get_auth_request (struct GNUNET_GNS_GetAuthRequest *gar); | ||
263 | |||
264 | #if 0 /* keep Emacsens' auto-indent happy */ | 127 | #if 0 /* keep Emacsens' auto-indent happy */ |
265 | { | 128 | { |
266 | #endif | 129 | #endif |
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c index 5c31bd779..0be066317 100644 --- a/src/pt/test_gns_vpn.c +++ b/src/pt/test_gns_vpn.c | |||
@@ -395,11 +395,11 @@ run (void *cls, | |||
395 | host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile); | 395 | host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile); |
396 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; | 396 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; |
397 | GNUNET_asprintf (&rd_string, "6 %s %s", (char*)&peername, "www.gads."); | 397 | GNUNET_asprintf (&rd_string, "6 %s %s", (char*)&peername, "www.gads."); |
398 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_GNS_RECORD_VPN, | 398 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_NAMESTORE_TYPE_VPN, |
399 | rd_string, | 399 | rd_string, |
400 | (void**)&rd.data, | 400 | (void**)&rd.data, |
401 | &rd.data_size)); | 401 | &rd.data_size)); |
402 | rd.record_type = GNUNET_GNS_RECORD_VPN; | 402 | rd.record_type = GNUNET_NAMESTORE_TYPE_VPN; |
403 | 403 | ||
404 | GNUNET_NAMESTORE_records_store (namestore, | 404 | GNUNET_NAMESTORE_records_store (namestore, |
405 | host_key, | 405 | host_key, |