aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-service-namestore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/gnunet-service-namestore.c')
-rw-r--r--src/namestore/gnunet-service-namestore.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 2cce92635..869be75d5 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -347,14 +347,14 @@ struct LookupBlockContext
347 347
348 348
349/** 349/**
350 * A #GNUNET_NAMESTORE_BlockCallback for name lookups in #handle_lookup_block 350 * A #GNUNET_GNSRECORD_BlockCallback for name lookups in #handle_lookup_block
351 * 351 *
352 * @param cls a `struct LookupNameContext *` with information about the request 352 * @param cls a `struct LookupNameContext *` with information about the request
353 * @param block the block 353 * @param block the block
354 */ 354 */
355static void 355static void
356handle_lookup_block_it (void *cls, 356handle_lookup_block_it (void *cls,
357 const struct GNUNET_NAMESTORE_Block *block) 357 const struct GNUNET_GNSRECORD_Block *block)
358{ 358{
359 struct LookupBlockContext *lnc = cls; 359 struct LookupBlockContext *lnc = cls;
360 struct LookupBlockResponseMessage *r; 360 struct LookupBlockResponseMessage *r;
@@ -455,7 +455,7 @@ handle_block_cache (void *cls,
455 struct NamestoreClient *nc; 455 struct NamestoreClient *nc;
456 const struct BlockCacheMessage *rp_msg; 456 const struct BlockCacheMessage *rp_msg;
457 struct BlockCacheResponseMessage rpr_msg; 457 struct BlockCacheResponseMessage rpr_msg;
458 struct GNUNET_NAMESTORE_Block *block; 458 struct GNUNET_GNSRECORD_Block *block;
459 size_t esize; 459 size_t esize;
460 int res; 460 int res;
461 461
@@ -468,7 +468,7 @@ handle_block_cache (void *cls,
468 } 468 }
469 rp_msg = (const struct BlockCacheMessage *) message; 469 rp_msg = (const struct BlockCacheMessage *) message;
470 esize = ntohs (rp_msg->gns_header.header.size) - sizeof (struct BlockCacheMessage); 470 esize = ntohs (rp_msg->gns_header.header.size) - sizeof (struct BlockCacheMessage);
471 block = GNUNET_malloc (sizeof (struct GNUNET_NAMESTORE_Block) + esize); 471 block = GNUNET_malloc (sizeof (struct GNUNET_GNSRECORD_Block) + esize);
472 block->signature = rp_msg->signature; 472 block->signature = rp_msg->signature;
473 block->derived_key = rp_msg->derived_key; 473 block->derived_key = rp_msg->derived_key;
474 block->purpose.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + 474 block->purpose.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
@@ -515,7 +515,7 @@ send_lookup_response (struct GNUNET_SERVER_NotificationContext *nc,
515 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, 515 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
516 const char *name, 516 const char *name,
517 unsigned int rd_count, 517 unsigned int rd_count,
518 const struct GNUNET_NAMESTORE_RecordData *rd) 518 const struct GNUNET_GNSRECORD_Data *rd)
519{ 519{
520 struct RecordResultMessage *zir_msg; 520 struct RecordResultMessage *zir_msg;
521 size_t name_len; 521 size_t name_len;
@@ -525,7 +525,7 @@ send_lookup_response (struct GNUNET_SERVER_NotificationContext *nc,
525 char *rd_ser; 525 char *rd_ser;
526 526
527 name_len = strlen (name) + 1; 527 name_len = strlen (name) + 1;
528 rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); 528 rd_ser_len = GNUNET_GNSRECORD_records_get_size (rd_count, rd);
529 msg_size = sizeof (struct RecordResultMessage) + name_len + rd_ser_len; 529 msg_size = sizeof (struct RecordResultMessage) + name_len + rd_ser_len;
530 530
531 zir_msg = GNUNET_malloc (msg_size); 531 zir_msg = GNUNET_malloc (msg_size);
@@ -539,7 +539,7 @@ send_lookup_response (struct GNUNET_SERVER_NotificationContext *nc,
539 name_tmp = (char *) &zir_msg[1]; 539 name_tmp = (char *) &zir_msg[1];
540 memcpy (name_tmp, name, name_len); 540 memcpy (name_tmp, name, name_len);
541 rd_ser = &name_tmp[name_len]; 541 rd_ser = &name_tmp[name_len];
542 GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_ser); 542 GNUNET_GNSRECORD_records_serialize (rd_count, rd, rd_ser_len, rd_ser);
543 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 543 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
544 "Sending `%s' message with %u records and size %u\n", 544 "Sending `%s' message with %u records and size %u\n",
545 "RECORD_RESULT", 545 "RECORD_RESULT",
@@ -566,18 +566,18 @@ static void
566refresh_block (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, 566refresh_block (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
567 const char *name, 567 const char *name,
568 unsigned int rd_count, 568 unsigned int rd_count,
569 const struct GNUNET_NAMESTORE_RecordData *rd) 569 const struct GNUNET_GNSRECORD_Data *rd)
570{ 570{
571 struct GNUNET_NAMESTORE_Block *block; 571 struct GNUNET_GNSRECORD_Block *block;
572 572
573 if (0 == rd_count) 573 if (0 == rd_count)
574 block = GNUNET_NAMESTORE_block_create (zone_key, 574 block = GNUNET_GNSRECORD_block_create (zone_key,
575 GNUNET_TIME_UNIT_ZERO_ABS, 575 GNUNET_TIME_UNIT_ZERO_ABS,
576 name, 576 name,
577 rd, rd_count); 577 rd, rd_count);
578 else 578 else
579 block = GNUNET_NAMESTORE_block_create (zone_key, 579 block = GNUNET_GNSRECORD_block_create (zone_key,
580 GNUNET_NAMESTORE_record_get_expiration_time (rd_count, 580 GNUNET_GNSRECORD_record_get_expiration_time (rd_count,
581 rd), 581 rd),
582 name, 582 name,
583 rd, rd_count); 583 rd, rd_count);
@@ -659,10 +659,10 @@ handle_record_store (void *cls,
659 return; 659 return;
660 } 660 }
661 { 661 {
662 struct GNUNET_NAMESTORE_RecordData rd[rd_count]; 662 struct GNUNET_GNSRECORD_Data rd[rd_count];
663 663
664 if (GNUNET_OK != 664 if (GNUNET_OK !=
665 GNUNET_NAMESTORE_records_deserialize (rd_ser_len, rd_ser, rd_count, rd)) 665 GNUNET_GNSRECORD_records_deserialize (rd_ser_len, rd_ser, rd_count, rd))
666 { 666 {
667 GNUNET_break (0); 667 GNUNET_break (0);
668 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 668 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
@@ -672,7 +672,7 @@ handle_record_store (void *cls,
672 /* Extracting and converting private key */ 672 /* Extracting and converting private key */
673 GNUNET_CRYPTO_ecdsa_key_get_public (&rp_msg->private_key, 673 GNUNET_CRYPTO_ecdsa_key_get_public (&rp_msg->private_key,
674 &pubkey); 674 &pubkey);
675 conv_name = GNUNET_NAMESTORE_normalize_string (name_tmp); 675 conv_name = GNUNET_GNSRECORD_string_to_lowercase (name_tmp);
676 if (NULL == conv_name) 676 if (NULL == conv_name)
677 { 677 {
678 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 678 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -684,7 +684,7 @@ handle_record_store (void *cls,
684 "Creating %u records for name `%s' in zone `%s'\n", 684 "Creating %u records for name `%s' in zone `%s'\n",
685 (unsigned int) rd_count, 685 (unsigned int) rd_count,
686 conv_name, 686 conv_name,
687 GNUNET_NAMESTORE_z2s (&pubkey)); 687 GNUNET_GNSRECORD_z2s (&pubkey));
688 688
689 if ( (0 == rd_count) && 689 if ( (0 == rd_count) &&
690 (GNUNET_NO == 690 (GNUNET_NO ==
@@ -777,7 +777,7 @@ handle_zone_to_name_it (void *cls,
777 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, 777 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
778 const char *name, 778 const char *name,
779 unsigned int rd_count, 779 unsigned int rd_count,
780 const struct GNUNET_NAMESTORE_RecordData *rd) 780 const struct GNUNET_GNSRECORD_Data *rd)
781{ 781{
782 struct ZoneToNameCtx *ztn_ctx = cls; 782 struct ZoneToNameCtx *ztn_ctx = cls;
783 struct ZoneToNameResponseMessage *ztnr_msg; 783 struct ZoneToNameResponseMessage *ztnr_msg;
@@ -793,7 +793,7 @@ handle_zone_to_name_it (void *cls,
793 name); 793 name);
794 res = GNUNET_YES; 794 res = GNUNET_YES;
795 name_len = (NULL == name) ? 0 : strlen (name) + 1; 795 name_len = (NULL == name) ? 0 : strlen (name) + 1;
796 rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); 796 rd_ser_len = GNUNET_GNSRECORD_records_get_size (rd_count, rd);
797 msg_size = sizeof (struct ZoneToNameResponseMessage) + name_len + rd_ser_len; 797 msg_size = sizeof (struct ZoneToNameResponseMessage) + name_len + rd_ser_len;
798 if (msg_size >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 798 if (msg_size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
799 { 799 {
@@ -814,7 +814,7 @@ handle_zone_to_name_it (void *cls,
814 if (NULL != name) 814 if (NULL != name)
815 memcpy (name_tmp, name, name_len); 815 memcpy (name_tmp, name, name_len);
816 rd_tmp = &name_tmp[name_len]; 816 rd_tmp = &name_tmp[name_len];
817 GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_tmp); 817 GNUNET_GNSRECORD_records_serialize (rd_count, rd, rd_ser_len, rd_tmp);
818 ztn_ctx->success = GNUNET_OK; 818 ztn_ctx->success = GNUNET_OK;
819 GNUNET_SERVER_notification_context_unicast (snc, ztn_ctx->nc->client, 819 GNUNET_SERVER_notification_context_unicast (snc, ztn_ctx->nc->client,
820 &ztnr_msg->gns_header.header, 820 &ztnr_msg->gns_header.header,
@@ -939,7 +939,7 @@ zone_iteraterate_proc (void *cls,
939 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, 939 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
940 const char *name, 940 const char *name,
941 unsigned int rd_count, 941 unsigned int rd_count,
942 const struct GNUNET_NAMESTORE_RecordData *rd) 942 const struct GNUNET_GNSRECORD_Data *rd)
943{ 943{
944 struct ZoneIterationProcResult *proc = cls; 944 struct ZoneIterationProcResult *proc = cls;
945 unsigned int i; 945 unsigned int i;
@@ -969,8 +969,8 @@ zone_iteraterate_proc (void *cls,
969 rd); 969 rd);
970 do_refresh_block = GNUNET_NO; 970 do_refresh_block = GNUNET_NO;
971 for (i=0;i<rd_count;i++) 971 for (i=0;i<rd_count;i++)
972 if( (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) && 972 if( (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) &&
973 (0 == (rd[i].flags & GNUNET_NAMESTORE_RF_PENDING)) ) 973 (0 == (rd[i].flags & GNUNET_GNSRECORD_RF_PENDING)) )
974 { 974 {
975 do_refresh_block = GNUNET_YES; 975 do_refresh_block = GNUNET_YES;
976 break; 976 break;
@@ -1201,7 +1201,7 @@ monitor_iterate_cb (void *cls,
1201 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, 1201 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
1202 const char *name, 1202 const char *name,
1203 unsigned int rd_count, 1203 unsigned int rd_count,
1204 const struct GNUNET_NAMESTORE_RecordData *rd) 1204 const struct GNUNET_GNSRECORD_Data *rd)
1205{ 1205{
1206 struct ZoneMonitor *zm = cls; 1206 struct ZoneMonitor *zm = cls;
1207 1207