diff options
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r-- | src/gns/gnunet-service-gns_resolver.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index ad256430c..e0d395a55 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -504,7 +504,7 @@ translate_dot_plus (struct GNS_ResolverHandle *rh, | |||
504 | "%.*s.%s", | 504 | "%.*s.%s", |
505 | (int) (s_len - 2), | 505 | (int) (s_len - 2), |
506 | name, | 506 | name, |
507 | GNUNET_NAMESTORE_pkey_to_zkey (&rh->ac_tail->authority_info.gns_authority)); | 507 | GNUNET_GNSRECORD_pkey_to_zkey (&rh->ac_tail->authority_info.gns_authority)); |
508 | GNUNET_free (name); | 508 | GNUNET_free (name); |
509 | return ret; | 509 | return ret; |
510 | } | 510 | } |
@@ -598,7 +598,7 @@ transmit_lookup_dns_result (struct GNS_ResolverHandle *rh) | |||
598 | for (pos = rh->dns_result_head; NULL != pos; pos = pos->next) | 598 | for (pos = rh->dns_result_head; NULL != pos; pos = pos->next) |
599 | n++; | 599 | n++; |
600 | { | 600 | { |
601 | struct GNUNET_NAMESTORE_RecordData rd[n]; | 601 | struct GNUNET_GNSRECORD_Data rd[n]; |
602 | 602 | ||
603 | i = 0; | 603 | i = 0; |
604 | for (pos = rh->dns_result_head; NULL != pos; pos = pos->next) | 604 | for (pos = rh->dns_result_head; NULL != pos; pos = pos->next) |
@@ -608,12 +608,12 @@ transmit_lookup_dns_result (struct GNS_ResolverHandle *rh) | |||
608 | rd[i].record_type = pos->record_type; | 608 | rd[i].record_type = pos->record_type; |
609 | if (0 == pos->expiration_time) | 609 | if (0 == pos->expiration_time) |
610 | { | 610 | { |
611 | rd[i].flags = GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION; | 611 | rd[i].flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; |
612 | rd[i].expiration_time = 0; | 612 | rd[i].expiration_time = 0; |
613 | } | 613 | } |
614 | else | 614 | else |
615 | { | 615 | { |
616 | rd[i].flags = GNUNET_NAMESTORE_RF_NONE; | 616 | rd[i].flags = GNUNET_GNSRECORD_RF_NONE; |
617 | rd[i].expiration_time = pos->expiration_time; | 617 | rd[i].expiration_time = pos->expiration_time; |
618 | } | 618 | } |
619 | i++; | 619 | i++; |
@@ -785,7 +785,7 @@ dns_result_parser (void *cls, | |||
785 | /* convert from (parsed) DNS to (binary) GNS format! */ | 785 | /* convert from (parsed) DNS to (binary) GNS format! */ |
786 | rd_count = p->num_answers + p->num_authority_records + p->num_additional_records; | 786 | rd_count = p->num_answers + p->num_authority_records + p->num_additional_records; |
787 | { | 787 | { |
788 | struct GNUNET_NAMESTORE_RecordData rd[rd_count]; | 788 | struct GNUNET_GNSRECORD_Data rd[rd_count]; |
789 | unsigned int skip; | 789 | unsigned int skip; |
790 | char buf[UINT16_MAX]; | 790 | char buf[UINT16_MAX]; |
791 | size_t buf_off; | 791 | size_t buf_off; |
@@ -1064,7 +1064,7 @@ handle_gns_cname_result (struct GNS_ResolverHandle *rh, | |||
1064 | static void | 1064 | static void |
1065 | handle_gns_resolution_result (void *cls, | 1065 | handle_gns_resolution_result (void *cls, |
1066 | unsigned int rd_count, | 1066 | unsigned int rd_count, |
1067 | const struct GNUNET_NAMESTORE_RecordData *rd); | 1067 | const struct GNUNET_GNSRECORD_Data *rd); |
1068 | 1068 | ||
1069 | 1069 | ||
1070 | /** | 1070 | /** |
@@ -1088,13 +1088,13 @@ vpn_allocation_cb (void *cls, | |||
1088 | { | 1088 | { |
1089 | struct VpnContext *vpn_ctx = cls; | 1089 | struct VpnContext *vpn_ctx = cls; |
1090 | struct GNS_ResolverHandle *rh = vpn_ctx->rh; | 1090 | struct GNS_ResolverHandle *rh = vpn_ctx->rh; |
1091 | struct GNUNET_NAMESTORE_RecordData rd[vpn_ctx->rd_count]; | 1091 | struct GNUNET_GNSRECORD_Data rd[vpn_ctx->rd_count]; |
1092 | unsigned int i; | 1092 | unsigned int i; |
1093 | 1093 | ||
1094 | vpn_ctx->vpn_request = NULL; | 1094 | vpn_ctx->vpn_request = NULL; |
1095 | rh->vpn_ctx = NULL; | 1095 | rh->vpn_ctx = NULL; |
1096 | GNUNET_assert (GNUNET_OK == | 1096 | GNUNET_assert (GNUNET_OK == |
1097 | GNUNET_NAMESTORE_records_deserialize (vpn_ctx->rd_data_size, | 1097 | GNUNET_GNSRECORD_records_deserialize (vpn_ctx->rd_data_size, |
1098 | vpn_ctx->rd_data, | 1098 | vpn_ctx->rd_data, |
1099 | vpn_ctx->rd_count, | 1099 | vpn_ctx->rd_count, |
1100 | rd)); | 1100 | rd)); |
@@ -1143,7 +1143,7 @@ vpn_allocation_cb (void *cls, | |||
1143 | static void | 1143 | static void |
1144 | handle_gns_resolution_result (void *cls, | 1144 | handle_gns_resolution_result (void *cls, |
1145 | unsigned int rd_count, | 1145 | unsigned int rd_count, |
1146 | const struct GNUNET_NAMESTORE_RecordData *rd) | 1146 | const struct GNUNET_GNSRECORD_Data *rd) |
1147 | { | 1147 | { |
1148 | struct GNS_ResolverHandle *rh = cls; | 1148 | struct GNS_ResolverHandle *rh = cls; |
1149 | struct AuthorityChain *ac; | 1149 | struct AuthorityChain *ac; |
@@ -1163,13 +1163,13 @@ handle_gns_resolution_result (void *cls, | |||
1163 | size_t scratch_off; | 1163 | size_t scratch_off; |
1164 | size_t scratch_start; | 1164 | size_t scratch_start; |
1165 | size_t off; | 1165 | size_t off; |
1166 | struct GNUNET_NAMESTORE_RecordData rd_new[rd_count]; | 1166 | struct GNUNET_GNSRECORD_Data rd_new[rd_count]; |
1167 | unsigned int rd_off; | 1167 | unsigned int rd_off; |
1168 | 1168 | ||
1169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1170 | "Resolution succeeded for `%s' in zone %s, got %u records\n", | 1170 | "Resolution succeeded for `%s' in zone %s, got %u records\n", |
1171 | rh->ac_tail->label, | 1171 | rh->ac_tail->label, |
1172 | GNUNET_NAMESTORE_z2s (&rh->ac_tail->authority_info.gns_authority), | 1172 | GNUNET_GNSRECORD_z2s (&rh->ac_tail->authority_info.gns_authority), |
1173 | rd_count); | 1173 | rd_count); |
1174 | if (0 == rh->name_resolution_pos) | 1174 | if (0 == rh->name_resolution_pos) |
1175 | { | 1175 | { |
@@ -1230,10 +1230,10 @@ handle_gns_resolution_result (void *cls, | |||
1230 | vpn_ctx = GNUNET_new (struct VpnContext); | 1230 | vpn_ctx = GNUNET_new (struct VpnContext); |
1231 | rh->vpn_ctx = vpn_ctx; | 1231 | rh->vpn_ctx = vpn_ctx; |
1232 | vpn_ctx->rh = rh; | 1232 | vpn_ctx->rh = rh; |
1233 | vpn_ctx->rd_data_size = GNUNET_NAMESTORE_records_get_size (rd_count, | 1233 | vpn_ctx->rd_data_size = GNUNET_GNSRECORD_records_get_size (rd_count, |
1234 | rd); | 1234 | rd); |
1235 | vpn_ctx->rd_data = GNUNET_malloc (vpn_ctx->rd_data_size); | 1235 | vpn_ctx->rd_data = GNUNET_malloc (vpn_ctx->rd_data_size); |
1236 | (void) GNUNET_NAMESTORE_records_serialize (rd_count, | 1236 | (void) GNUNET_GNSRECORD_records_serialize (rd_count, |
1237 | rd, | 1237 | rd, |
1238 | vpn_ctx->rd_data_size, | 1238 | vpn_ctx->rd_data_size, |
1239 | vpn_ctx->rd_data); | 1239 | vpn_ctx->rd_data); |
@@ -1720,7 +1720,7 @@ handle_dht_response (void *cls, | |||
1720 | { | 1720 | { |
1721 | struct GNS_ResolverHandle *rh = cls; | 1721 | struct GNS_ResolverHandle *rh = cls; |
1722 | struct AuthorityChain *ac = rh->ac_tail; | 1722 | struct AuthorityChain *ac = rh->ac_tail; |
1723 | const struct GNUNET_NAMESTORE_Block *block; | 1723 | const struct GNUNET_GNSRECORD_Block *block; |
1724 | struct CacheOps *co; | 1724 | struct CacheOps *co; |
1725 | 1725 | ||
1726 | GNUNET_DHT_get_stop (rh->get_handle); | 1726 | GNUNET_DHT_get_stop (rh->get_handle); |
@@ -1729,7 +1729,7 @@ handle_dht_response (void *cls, | |||
1729 | rh->dht_heap_node = NULL; | 1729 | rh->dht_heap_node = NULL; |
1730 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1730 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1731 | "Handling response from the DHT\n"); | 1731 | "Handling response from the DHT\n"); |
1732 | if (size < sizeof (struct GNUNET_NAMESTORE_Block)) | 1732 | if (size < sizeof (struct GNUNET_GNSRECORD_Block)) |
1733 | { | 1733 | { |
1734 | /* how did this pass DHT block validation!? */ | 1734 | /* how did this pass DHT block validation!? */ |
1735 | GNUNET_break (0); | 1735 | GNUNET_break (0); |
@@ -1750,7 +1750,7 @@ handle_dht_response (void *cls, | |||
1750 | return; | 1750 | return; |
1751 | } | 1751 | } |
1752 | if (GNUNET_OK != | 1752 | if (GNUNET_OK != |
1753 | GNUNET_NAMESTORE_block_decrypt (block, | 1753 | GNUNET_GNSRECORD_block_decrypt (block, |
1754 | &ac->authority_info.gns_authority, | 1754 | &ac->authority_info.gns_authority, |
1755 | ac->label, | 1755 | ac->label, |
1756 | &handle_gns_resolution_result, | 1756 | &handle_gns_resolution_result, |
@@ -1783,7 +1783,7 @@ handle_dht_response (void *cls, | |||
1783 | */ | 1783 | */ |
1784 | static void | 1784 | static void |
1785 | handle_namestore_block_response (void *cls, | 1785 | handle_namestore_block_response (void *cls, |
1786 | const struct GNUNET_NAMESTORE_Block *block) | 1786 | const struct GNUNET_GNSRECORD_Block *block) |
1787 | { | 1787 | { |
1788 | struct GNS_ResolverHandle *rh = cls; | 1788 | struct GNS_ResolverHandle *rh = cls; |
1789 | struct GNS_ResolverHandle *rx; | 1789 | struct GNS_ResolverHandle *rx; |
@@ -1792,7 +1792,7 @@ handle_namestore_block_response (void *cls, | |||
1792 | const struct GNUNET_CRYPTO_EcdsaPublicKey *auth = &ac->authority_info.gns_authority; | 1792 | const struct GNUNET_CRYPTO_EcdsaPublicKey *auth = &ac->authority_info.gns_authority; |
1793 | struct GNUNET_HashCode query; | 1793 | struct GNUNET_HashCode query; |
1794 | 1794 | ||
1795 | GNUNET_NAMESTORE_query_from_public_key (auth, | 1795 | GNUNET_GNSRECORD_query_from_public_key (auth, |
1796 | label, | 1796 | label, |
1797 | &query); | 1797 | &query); |
1798 | GNUNET_assert (NULL != rh->namestore_qe); | 1798 | GNUNET_assert (NULL != rh->namestore_qe); |
@@ -1805,7 +1805,7 @@ handle_namestore_block_response (void *cls, | |||
1805 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1805 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1806 | "Starting DHT lookup for `%s' in zone %s\n", | 1806 | "Starting DHT lookup for `%s' in zone %s\n", |
1807 | ac->label, | 1807 | ac->label, |
1808 | GNUNET_NAMESTORE_z2s (&ac->authority_info.gns_authority)); | 1808 | GNUNET_GNSRECORD_z2s (&ac->authority_info.gns_authority)); |
1809 | GNUNET_assert (NULL == rh->get_handle); | 1809 | GNUNET_assert (NULL == rh->get_handle); |
1810 | rh->get_handle = GNUNET_DHT_get_start (dht_handle, | 1810 | rh->get_handle = GNUNET_DHT_get_start (dht_handle, |
1811 | GNUNET_BLOCK_TYPE_GNS_NAMERECORD, | 1811 | GNUNET_BLOCK_TYPE_GNS_NAMERECORD, |
@@ -1834,7 +1834,7 @@ handle_namestore_block_response (void *cls, | |||
1834 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1834 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1835 | "Resolution failed for `%s' in zone %s (DHT lookup not permitted by configuration)\n", | 1835 | "Resolution failed for `%s' in zone %s (DHT lookup not permitted by configuration)\n", |
1836 | ac->label, | 1836 | ac->label, |
1837 | GNUNET_NAMESTORE_z2s (&ac->authority_info.gns_authority)); | 1837 | GNUNET_GNSRECORD_z2s (&ac->authority_info.gns_authority)); |
1838 | rh->proc (rh->proc_cls, 0, NULL); | 1838 | rh->proc (rh->proc_cls, 0, NULL); |
1839 | GNS_resolver_lookup_cancel (rh); | 1839 | GNS_resolver_lookup_cancel (rh); |
1840 | return; | 1840 | return; |
@@ -1842,7 +1842,7 @@ handle_namestore_block_response (void *cls, | |||
1842 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1842 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1843 | "Decrypting block from the namestore\n"); | 1843 | "Decrypting block from the namestore\n"); |
1844 | if (GNUNET_OK != | 1844 | if (GNUNET_OK != |
1845 | GNUNET_NAMESTORE_block_decrypt (block, | 1845 | GNUNET_GNSRECORD_block_decrypt (block, |
1846 | auth, | 1846 | auth, |
1847 | label, | 1847 | label, |
1848 | &handle_gns_resolution_result, | 1848 | &handle_gns_resolution_result, |
@@ -1870,8 +1870,8 @@ recursive_gns_resolution_namestore (struct GNS_ResolverHandle *rh) | |||
1870 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1870 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1871 | "Starting GNS resolution for `%s' in zone %s\n", | 1871 | "Starting GNS resolution for `%s' in zone %s\n", |
1872 | ac->label, | 1872 | ac->label, |
1873 | GNUNET_NAMESTORE_z2s (&ac->authority_info.gns_authority)); | 1873 | GNUNET_GNSRECORD_z2s (&ac->authority_info.gns_authority)); |
1874 | GNUNET_NAMESTORE_query_from_public_key (&ac->authority_info.gns_authority, | 1874 | GNUNET_GNSRECORD_query_from_public_key (&ac->authority_info.gns_authority, |
1875 | ac->label, | 1875 | ac->label, |
1876 | &query); | 1876 | &query); |
1877 | rh->namestore_qe = GNUNET_NAMESTORE_lookup_block (namestore_handle, | 1877 | rh->namestore_qe = GNUNET_NAMESTORE_lookup_block (namestore_handle, |