diff options
Diffstat (limited to 'src/gnsrecord/gnsrecord.c')
-rw-r--r-- | src/gnsrecord/gnsrecord.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index da098ab66..68e4f23ba 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c | |||
@@ -47,7 +47,7 @@ | |||
47 | * @return NULL on error, otherwise human-readable representation of the value | 47 | * @return NULL on error, otherwise human-readable representation of the value |
48 | */ | 48 | */ |
49 | char * | 49 | char * |
50 | GNUNET_NAMESTORE_value_to_string (uint32_t type, | 50 | GNUNET_GNSRECORD_value_to_string (uint32_t type, |
51 | const void *data, | 51 | const void *data, |
52 | size_t data_size) | 52 | size_t data_size) |
53 | { | 53 | { |
@@ -176,11 +176,11 @@ GNUNET_NAMESTORE_value_to_string (uint32_t type, | |||
176 | if (NULL == inet_ntop (AF_INET6, data, tmp, sizeof (tmp))) | 176 | if (NULL == inet_ntop (AF_INET6, data, tmp, sizeof (tmp))) |
177 | return NULL; | 177 | return NULL; |
178 | return GNUNET_strdup (tmp); | 178 | return GNUNET_strdup (tmp); |
179 | case GNUNET_NAMESTORE_TYPE_PKEY: | 179 | case GNUNET_GNSRECORD_TYPE_PKEY: |
180 | if (data_size != sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) | 180 | if (data_size != sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) |
181 | return NULL; | 181 | return NULL; |
182 | return GNUNET_CRYPTO_ecdsa_public_key_to_string (data); | 182 | return GNUNET_CRYPTO_ecdsa_public_key_to_string (data); |
183 | case GNUNET_NAMESTORE_TYPE_PHONE: | 183 | case GNUNET_GNSRECORD_TYPE_PHONE: |
184 | { | 184 | { |
185 | const struct GNUNET_CONVERSATION_PhoneRecord *pr; | 185 | const struct GNUNET_CONVERSATION_PhoneRecord *pr; |
186 | char *ret; | 186 | char *ret; |
@@ -199,11 +199,11 @@ GNUNET_NAMESTORE_value_to_string (uint32_t type, | |||
199 | GNUNET_free (pkey); | 199 | GNUNET_free (pkey); |
200 | return ret; | 200 | return ret; |
201 | } | 201 | } |
202 | case GNUNET_NAMESTORE_TYPE_PSEU: | 202 | case GNUNET_GNSRECORD_TYPE_PSEU: |
203 | return GNUNET_strndup (data, data_size); | 203 | return GNUNET_strndup (data, data_size); |
204 | case GNUNET_NAMESTORE_TYPE_LEHO: | 204 | case GNUNET_GNSRECORD_TYPE_LEHO: |
205 | return GNUNET_strndup (data, data_size); | 205 | return GNUNET_strndup (data, data_size); |
206 | case GNUNET_NAMESTORE_TYPE_VPN: | 206 | case GNUNET_GNSRECORD_TYPE_VPN: |
207 | { | 207 | { |
208 | const struct GNUNET_TUN_GnsVpnRecord *vpn; | 208 | const struct GNUNET_TUN_GnsVpnRecord *vpn; |
209 | char* vpn_str; | 209 | char* vpn_str; |
@@ -223,7 +223,7 @@ GNUNET_NAMESTORE_value_to_string (uint32_t type, | |||
223 | } | 223 | } |
224 | return vpn_str; | 224 | return vpn_str; |
225 | } | 225 | } |
226 | case GNUNET_NAMESTORE_TYPE_GNS2DNS: | 226 | case GNUNET_GNSRECORD_TYPE_GNS2DNS: |
227 | { | 227 | { |
228 | char *ns; | 228 | char *ns; |
229 | size_t off; | 229 | size_t off; |
@@ -309,7 +309,7 @@ GNUNET_NAMESTORE_value_to_string (uint32_t type, | |||
309 | * @return #GNUNET_OK on success | 309 | * @return #GNUNET_OK on success |
310 | */ | 310 | */ |
311 | int | 311 | int |
312 | GNUNET_NAMESTORE_string_to_value (uint32_t type, | 312 | GNUNET_GNSRECORD_string_to_value (uint32_t type, |
313 | const char *s, | 313 | const char *s, |
314 | void **data, | 314 | void **data, |
315 | size_t *data_size) | 315 | size_t *data_size) |
@@ -509,7 +509,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, | |||
509 | *data_size = sizeof (struct in6_addr); | 509 | *data_size = sizeof (struct in6_addr); |
510 | memcpy (*data, &value_aaaa, sizeof (value_aaaa)); | 510 | memcpy (*data, &value_aaaa, sizeof (value_aaaa)); |
511 | return GNUNET_OK; | 511 | return GNUNET_OK; |
512 | case GNUNET_NAMESTORE_TYPE_PKEY: | 512 | case GNUNET_GNSRECORD_TYPE_PKEY: |
513 | if (GNUNET_OK != | 513 | if (GNUNET_OK != |
514 | GNUNET_CRYPTO_ecdsa_public_key_from_string (s, strlen (s), &pkey)) | 514 | GNUNET_CRYPTO_ecdsa_public_key_from_string (s, strlen (s), &pkey)) |
515 | { | 515 | { |
@@ -522,7 +522,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, | |||
522 | memcpy (*data, &pkey, sizeof (pkey)); | 522 | memcpy (*data, &pkey, sizeof (pkey)); |
523 | *data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey); | 523 | *data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey); |
524 | return GNUNET_OK; | 524 | return GNUNET_OK; |
525 | case GNUNET_NAMESTORE_TYPE_PHONE: | 525 | case GNUNET_GNSRECORD_TYPE_PHONE: |
526 | { | 526 | { |
527 | struct GNUNET_CONVERSATION_PhoneRecord *pr; | 527 | struct GNUNET_CONVERSATION_PhoneRecord *pr; |
528 | unsigned int line; | 528 | unsigned int line; |
@@ -549,15 +549,15 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, | |||
549 | *data_size = sizeof (struct GNUNET_CONVERSATION_PhoneRecord); | 549 | *data_size = sizeof (struct GNUNET_CONVERSATION_PhoneRecord); |
550 | return GNUNET_OK; | 550 | return GNUNET_OK; |
551 | } | 551 | } |
552 | case GNUNET_NAMESTORE_TYPE_PSEU: | 552 | case GNUNET_GNSRECORD_TYPE_PSEU: |
553 | *data = GNUNET_strdup (s); | 553 | *data = GNUNET_strdup (s); |
554 | *data_size = strlen (s); | 554 | *data_size = strlen (s); |
555 | return GNUNET_OK; | 555 | return GNUNET_OK; |
556 | case GNUNET_NAMESTORE_TYPE_LEHO: | 556 | case GNUNET_GNSRECORD_TYPE_LEHO: |
557 | *data = GNUNET_strdup (s); | 557 | *data = GNUNET_strdup (s); |
558 | *data_size = strlen (s); | 558 | *data_size = strlen (s); |
559 | return GNUNET_OK; | 559 | return GNUNET_OK; |
560 | case GNUNET_NAMESTORE_TYPE_VPN: | 560 | case GNUNET_GNSRECORD_TYPE_VPN: |
561 | if (3 != SSCANF (s,"%u %103s %253s", | 561 | if (3 != SSCANF (s,"%u %103s %253s", |
562 | &proto, s_peer, s_serv)) | 562 | &proto, s_peer, s_serv)) |
563 | { | 563 | { |
@@ -579,7 +579,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, | |||
579 | vpn->proto = htons ((uint16_t) proto); | 579 | vpn->proto = htons ((uint16_t) proto); |
580 | strcpy ((char*)&vpn[1], s_serv); | 580 | strcpy ((char*)&vpn[1], s_serv); |
581 | return GNUNET_OK; | 581 | return GNUNET_OK; |
582 | case GNUNET_NAMESTORE_TYPE_GNS2DNS: | 582 | case GNUNET_GNSRECORD_TYPE_GNS2DNS: |
583 | { | 583 | { |
584 | char nsbuf[256]; | 584 | char nsbuf[256]; |
585 | size_t off; | 585 | size_t off; |
@@ -643,12 +643,12 @@ static struct { | |||
643 | { "MX", GNUNET_DNSPARSER_TYPE_MX }, | 643 | { "MX", GNUNET_DNSPARSER_TYPE_MX }, |
644 | { "TXT", GNUNET_DNSPARSER_TYPE_TXT }, | 644 | { "TXT", GNUNET_DNSPARSER_TYPE_TXT }, |
645 | { "AAAA", GNUNET_DNSPARSER_TYPE_AAAA }, | 645 | { "AAAA", GNUNET_DNSPARSER_TYPE_AAAA }, |
646 | { "PKEY", GNUNET_NAMESTORE_TYPE_PKEY }, | 646 | { "PKEY", GNUNET_GNSRECORD_TYPE_PKEY }, |
647 | { "PSEU", GNUNET_NAMESTORE_TYPE_PSEU }, | 647 | { "PSEU", GNUNET_GNSRECORD_TYPE_PSEU }, |
648 | { "LEHO", GNUNET_NAMESTORE_TYPE_LEHO }, | 648 | { "LEHO", GNUNET_GNSRECORD_TYPE_LEHO }, |
649 | { "VPN", GNUNET_NAMESTORE_TYPE_VPN }, | 649 | { "VPN", GNUNET_GNSRECORD_TYPE_VPN }, |
650 | { "GNS2DNS", GNUNET_NAMESTORE_TYPE_GNS2DNS }, | 650 | { "GNS2DNS", GNUNET_GNSRECORD_TYPE_GNS2DNS }, |
651 | { "PHONE", GNUNET_NAMESTORE_TYPE_PHONE }, | 651 | { "PHONE", GNUNET_GNSRECORD_TYPE_PHONE }, |
652 | { "TLSA", GNUNET_DNSPARSER_TYPE_TLSA }, | 652 | { "TLSA", GNUNET_DNSPARSER_TYPE_TLSA }, |
653 | { NULL, UINT32_MAX } | 653 | { NULL, UINT32_MAX } |
654 | }; | 654 | }; |
@@ -661,7 +661,7 @@ static struct { | |||
661 | * @return corresponding number, UINT32_MAX on error | 661 | * @return corresponding number, UINT32_MAX on error |
662 | */ | 662 | */ |
663 | uint32_t | 663 | uint32_t |
664 | GNUNET_NAMESTORE_typename_to_number (const char *dns_typename) | 664 | GNUNET_GNSRECORD_typename_to_number (const char *dns_typename) |
665 | { | 665 | { |
666 | unsigned int i; | 666 | unsigned int i; |
667 | 667 | ||
@@ -680,7 +680,7 @@ GNUNET_NAMESTORE_typename_to_number (const char *dns_typename) | |||
680 | * @return corresponding typestring, NULL on error | 680 | * @return corresponding typestring, NULL on error |
681 | */ | 681 | */ |
682 | const char * | 682 | const char * |
683 | GNUNET_NAMESTORE_number_to_typename (uint32_t type) | 683 | GNUNET_GNSRECORD_number_to_typename (uint32_t type) |
684 | { | 684 | { |
685 | unsigned int i; | 685 | unsigned int i; |
686 | 686 | ||