aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-service-gns_resolver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r--src/gns/gnunet-service-gns_resolver.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index bc6f322ae..5b54cf576 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -1497,7 +1497,7 @@ process_record_result_vpn (void* cls, int af, const void *address)
1497 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 1497 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
1498 "GNS_PHASE_REC-%d: Answer is IPv4!\n", 1498 "GNS_PHASE_REC-%d: Answer is IPv4!\n",
1499 rh->id); 1499 rh->id);
1500 if (rlh->record_type != GNUNET_GNS_RECORD_TYPE_A) 1500 if (rlh->record_type != GNUNET_GNS_RECORD_A)
1501 { 1501 {
1502 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 1502 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
1503 "GNS_PHASE_REC-%d: Requested record is not IPv4!\n", 1503 "GNS_PHASE_REC-%d: Requested record is not IPv4!\n",
@@ -1505,7 +1505,7 @@ process_record_result_vpn (void* cls, int af, const void *address)
1505 rh->proc (rh->proc_cls, rh, 0, NULL); 1505 rh->proc (rh->proc_cls, rh, 0, NULL);
1506 return; 1506 return;
1507 } 1507 }
1508 rd.record_type = GNUNET_GNS_RECORD_TYPE_A; 1508 rd.record_type = GNUNET_GNS_RECORD_A;
1509 rd.expiration_time = UINT64_MAX; /* FIXME: should probably pick something shorter... */ 1509 rd.expiration_time = UINT64_MAX; /* FIXME: should probably pick something shorter... */
1510 rd.data = address; 1510 rd.data = address;
1511 rd.data_size = sizeof (struct in_addr); 1511 rd.data_size = sizeof (struct in_addr);
@@ -1609,7 +1609,7 @@ handle_dns_resolver (void *cls,
1609 if (addrlen == sizeof (struct sockaddr_in)) 1609 if (addrlen == sizeof (struct sockaddr_in))
1610 { 1610 {
1611 sai = (struct sockaddr_in*) addr; 1611 sai = (struct sockaddr_in*) addr;
1612 rd.record_type = GNUNET_GNS_RECORD_TYPE_A; 1612 rd.record_type = GNUNET_GNS_RECORD_A;
1613 rd.data_size = sizeof (struct in_addr); 1613 rd.data_size = sizeof (struct in_addr);
1614 rd.data = &sai->sin_addr; 1614 rd.data = &sai->sin_addr;
1615 } 1615 }
@@ -1639,7 +1639,7 @@ resolve_dns_name (struct ResolverHandle *rh)
1639 struct RecordLookupHandle *rlh = rh->proc_cls; 1639 struct RecordLookupHandle *rlh = rh->proc_cls;
1640 int af; 1640 int af;
1641 1641
1642 if ((rlh->record_type != GNUNET_GNS_RECORD_TYPE_A) && 1642 if ((rlh->record_type != GNUNET_GNS_RECORD_A) &&
1643 (rlh->record_type != GNUNET_GNS_RECORD_AAAA)) 1643 (rlh->record_type != GNUNET_GNS_RECORD_AAAA))
1644 { 1644 {
1645 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1645 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1648,7 +1648,7 @@ resolve_dns_name (struct ResolverHandle *rh)
1648 return; 1648 return;
1649 } 1649 }
1650 1650
1651 if (rlh->record_type == GNUNET_GNS_RECORD_TYPE_A) 1651 if (rlh->record_type == GNUNET_GNS_RECORD_A)
1652 af = AF_INET; 1652 af = AF_INET;
1653 else 1653 else
1654 af = AF_INET6; 1654 af = AF_INET6;
@@ -1727,7 +1727,7 @@ read_dns_response (void *cls,
1727 packet->answers[i].type, 1727 packet->answers[i].type,
1728 rlh->record_type); 1728 rlh->record_type);
1729 /* http://tools.ietf.org/html/rfc1034#section-3.6.2 */ 1729 /* http://tools.ietf.org/html/rfc1034#section-3.6.2 */
1730 if (packet->answers[i].type == GNUNET_GNS_RECORD_TYPE_CNAME) 1730 if (packet->answers[i].type == GNUNET_GNS_RECORD_CNAME)
1731 { 1731 {
1732 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1732 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1733 "CNAME... restarting query with %s\n", 1733 "CNAME... restarting query with %s\n",
@@ -1784,7 +1784,7 @@ read_dns_response (void *cls,
1784 for (i = 0; i < packet->num_authority_records; i++) 1784 for (i = 0; i < packet->num_authority_records; i++)
1785 { 1785 {
1786 1786
1787 if (packet->authority_records[i].type == GNUNET_GNS_RECORD_TYPE_NS) 1787 if (packet->authority_records[i].type == GNUNET_GNS_RECORD_NS)
1788 { 1788 {
1789 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1789 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1790 "Found NS delegation!\n"); 1790 "Found NS delegation!\n");
@@ -1799,7 +1799,7 @@ read_dns_response (void *cls,
1799 if (found_delegation == GNUNET_NO) 1799 if (found_delegation == GNUNET_NO)
1800 break; 1800 break;
1801 1801
1802 if ((packet->additional_records[i].type == GNUNET_GNS_RECORD_TYPE_A) && 1802 if ((packet->additional_records[i].type == GNUNET_GNS_RECORD_A) &&
1803 (0 == strcmp (packet->additional_records[i].name, delegation_name))) 1803 (0 == strcmp (packet->additional_records[i].name, delegation_name)))
1804 { 1804 {
1805 GNUNET_assert (sizeof (struct in_addr) == 1805 GNUNET_assert (sizeof (struct in_addr) ==
@@ -1895,7 +1895,7 @@ resolve_record_dns (struct ResolverHandle *rh,
1895 for (i = 0; i < rd_count; i++) 1895 for (i = 0; i < rd_count; i++)
1896 { 1896 {
1897 /* Synthesize dns name */ 1897 /* Synthesize dns name */
1898 if (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_NS) 1898 if (rd[i].record_type == GNUNET_GNS_RECORD_NS)
1899 { 1899 {
1900 strcpy (rh->dns_zone, (char*)rd[i].data); 1900 strcpy (rh->dns_zone, (char*)rd[i].data);
1901 if (0 == strcmp (rh->name, "")) 1901 if (0 == strcmp (rh->name, ""))
@@ -1904,7 +1904,7 @@ resolve_record_dns (struct ResolverHandle *rh,
1904 sprintf (rh->dns_name, "%s.%s", rh->name, (char*)rd[i].data); 1904 sprintf (rh->dns_name, "%s.%s", rh->name, (char*)rd[i].data);
1905 } 1905 }
1906 /* The glue */ 1906 /* The glue */
1907 if (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_A) 1907 if (rd[i].record_type == GNUNET_GNS_RECORD_A)
1908 dnsip = *((struct in_addr*)rd[i].data); 1908 dnsip = *((struct in_addr*)rd[i].data);
1909 } 1909 }
1910 1910
@@ -2039,7 +2039,7 @@ resolve_record_vpn (struct ResolverHandle *rh,
2039 return; 2039 return;
2040 } 2040 }
2041 2041
2042 if (rlh->record_type == GNUNET_GNS_RECORD_TYPE_A) 2042 if (rlh->record_type == GNUNET_GNS_RECORD_A)
2043 af = AF_INET; 2043 af = AF_INET;
2044 else 2044 else
2045 af = AF_INET6; 2045 af = AF_INET6;
@@ -2405,8 +2405,8 @@ process_delegation_result_dht(void* cls,
2405 rh->id, rd[i].flags); 2405 rh->id, rd[i].flags);
2406 2406
2407 if ((rd[i].record_type == GNUNET_GNS_RECORD_VPN) || 2407 if ((rd[i].record_type == GNUNET_GNS_RECORD_VPN) ||
2408 (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_NS) || 2408 (rd[i].record_type == GNUNET_GNS_RECORD_NS) ||
2409 (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_CNAME)) 2409 (rd[i].record_type == GNUNET_GNS_RECORD_CNAME))
2410 { 2410 {
2411 /** 2411 /**
2412 * This is a VPN,NS,CNAME entry. Let namestore handle this after caching 2412 * This is a VPN,NS,CNAME entry. Let namestore handle this after caching
@@ -2622,12 +2622,12 @@ finish_lookup (struct ResolverHandle *rh,
2622 for (i = 0; i < rd_count; i++) 2622 for (i = 0; i < rd_count; i++)
2623 { 2623 {
2624 2624
2625 if (rd[i].record_type != GNUNET_GNS_RECORD_TYPE_NS && 2625 if (rd[i].record_type != GNUNET_GNS_RECORD_NS &&
2626 rd[i].record_type != GNUNET_GNS_RECORD_TYPE_PTR && 2626 rd[i].record_type != GNUNET_GNS_RECORD_PTR &&
2627 rd[i].record_type != GNUNET_GNS_RECORD_TYPE_CNAME && 2627 rd[i].record_type != GNUNET_GNS_RECORD_CNAME &&
2628 rd[i].record_type != GNUNET_GNS_RECORD_MX && 2628 rd[i].record_type != GNUNET_GNS_RECORD_MX &&
2629 rd[i].record_type != GNUNET_GNS_RECORD_TYPE_SOA && 2629 rd[i].record_type != GNUNET_GNS_RECORD_SOA &&
2630 rd[i].record_type != GNUNET_GNS_RECORD_TYPE_SRV) 2630 rd[i].record_type != GNUNET_GNS_RECORD_SRV)
2631 { 2631 {
2632 p_rd[i].data = rd[i].data; 2632 p_rd[i].data = rd[i].data;
2633 continue; 2633 continue;
@@ -2659,7 +2659,7 @@ finish_lookup (struct ResolverHandle *rh,
2659 p_rd[i].data = new_mx_data; 2659 p_rd[i].data = new_mx_data;
2660 p_rd[i].data_size = offset; 2660 p_rd[i].data_size = offset;
2661 } 2661 }
2662 else if (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_SRV) 2662 else if (rd[i].record_type == GNUNET_GNS_RECORD_SRV)
2663 { 2663 {
2664 /* 2664 /*
2665 * Prio, weight and port 2665 * Prio, weight and port
@@ -2674,7 +2674,7 @@ finish_lookup (struct ResolverHandle *rh,
2674 p_rd[i].data = new_srv_data; 2674 p_rd[i].data = new_srv_data;
2675 p_rd[i].data_size = sizeof (struct srv_data) + strlen ((char*)&new_srv[1]) + 1; 2675 p_rd[i].data_size = sizeof (struct srv_data) + strlen ((char*)&new_srv[1]) + 1;
2676 } 2676 }
2677 else if (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_SOA) 2677 else if (rd[i].record_type == GNUNET_GNS_RECORD_SOA)
2678 { 2678 {
2679 /* expand mname and rname */ 2679 /* expand mname and rname */
2680 old_soa = (struct soa_data*)rd[i].data; 2680 old_soa = (struct soa_data*)rd[i].data;
@@ -3044,7 +3044,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh,
3044 rh->id); 3044 rh->id);
3045 if (rh->status & RSL_CNAME_FOUND) 3045 if (rh->status & RSL_CNAME_FOUND)
3046 { 3046 {
3047 if (rlh->record_type == GNUNET_GNS_RECORD_TYPE_CNAME) 3047 if (rlh->record_type == GNUNET_GNS_RECORD_CNAME)
3048 { 3048 {
3049 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 3049 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
3050 "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried CNAME in NS.\n", 3050 "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried CNAME in NS.\n",
@@ -3108,7 +3108,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh,
3108 } 3108 }
3109 else if (rh->status & RSL_DELEGATE_NS) 3109 else if (rh->status & RSL_DELEGATE_NS)
3110 { 3110 {
3111 if (rlh->record_type == GNUNET_GNS_RECORD_TYPE_NS) 3111 if (rlh->record_type == GNUNET_GNS_RECORD_NS)
3112 { 3112 {
3113 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 3113 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
3114 "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n", 3114 "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n",
@@ -3156,7 +3156,7 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh,
3156 3156
3157 if (rh->status & RSL_DELEGATE_NS) 3157 if (rh->status & RSL_DELEGATE_NS)
3158 { 3158 {
3159 if (rlh->record_type == GNUNET_GNS_RECORD_TYPE_NS) 3159 if (rlh->record_type == GNUNET_GNS_RECORD_NS)
3160 { 3160 {
3161 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 3161 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
3162 "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n", 3162 "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried NSRR in NS.\n",
@@ -3335,7 +3335,7 @@ process_delegation_result_ns (void* cls,
3335 * A CNAME. Like regular DNS this means the is no other record for this 3335 * A CNAME. Like regular DNS this means the is no other record for this
3336 * name. 3336 * name.
3337 */ 3337 */
3338 if (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_CNAME) 3338 if (rd[i].record_type == GNUNET_GNS_RECORD_CNAME)
3339 { 3339 {
3340 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 3340 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
3341 "GNS_PHASE_DELEGATE_NS-%llu: CNAME found.\n", 3341 "GNS_PHASE_DELEGATE_NS-%llu: CNAME found.\n",
@@ -3363,7 +3363,7 @@ process_delegation_result_ns (void* cls,
3363 * Redirect via NS 3363 * Redirect via NS
3364 * FIXME make optional 3364 * FIXME make optional
3365 */ 3365 */
3366 if (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_NS) 3366 if (rd[i].record_type == GNUNET_GNS_RECORD_NS)
3367 { 3367 {
3368 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 3368 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
3369 "GNS_PHASE_DELEGATE_NS-%llu: NS found.\n", 3369 "GNS_PHASE_DELEGATE_NS-%llu: NS found.\n",