diff options
Diffstat (limited to 'src/namestore')
20 files changed, 68 insertions, 63 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index 50a8601f8..d0f68b78e 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c | |||
@@ -345,12 +345,12 @@ display_record (void *cls, | |||
345 | } | 345 | } |
346 | if (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) | 346 | if (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) |
347 | { | 347 | { |
348 | rex.rel_value = rd[i].expiration_time; | 348 | rex.rel_value_us = rd[i].expiration_time; |
349 | etime = GNUNET_STRINGS_relative_time_to_string (rex, GNUNET_YES); | 349 | etime = GNUNET_STRINGS_relative_time_to_string (rex, GNUNET_YES); |
350 | } | 350 | } |
351 | else | 351 | else |
352 | { | 352 | { |
353 | aex.abs_value = rd[i].expiration_time; | 353 | aex.abs_value_us = rd[i].expiration_time; |
354 | etime = GNUNET_STRINGS_absolute_time_to_string (aex); | 354 | etime = GNUNET_STRINGS_absolute_time_to_string (aex); |
355 | } | 355 | } |
356 | FPRINTF (stdout, "\t%s: %s (%s %s)\n", typestring, s, | 356 | FPRINTF (stdout, "\t%s: %s (%s %s)\n", typestring, s, |
@@ -418,12 +418,12 @@ get_existing_record (void *cls, | |||
418 | rde->record_type = type; | 418 | rde->record_type = type; |
419 | if (GNUNET_YES == etime_is_rel) | 419 | if (GNUNET_YES == etime_is_rel) |
420 | { | 420 | { |
421 | rde->expiration_time = etime_rel.rel_value; | 421 | rde->expiration_time = etime_rel.rel_value_us; |
422 | rde->flags |= GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION; | 422 | rde->flags |= GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION; |
423 | } | 423 | } |
424 | else if (GNUNET_NO == etime_is_rel) | 424 | else if (GNUNET_NO == etime_is_rel) |
425 | { | 425 | { |
426 | rde->expiration_time = etime_abs.abs_value; | 426 | rde->expiration_time = etime_abs.abs_value_us; |
427 | } | 427 | } |
428 | if (1 != nonauthority) | 428 | if (1 != nonauthority) |
429 | rde->flags |= GNUNET_NAMESTORE_RF_AUTHORITY; | 429 | rde->flags |= GNUNET_NAMESTORE_RF_AUTHORITY; |
@@ -658,13 +658,13 @@ testservice_task (void *cls, | |||
658 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; | 658 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
659 | if (GNUNET_YES == etime_is_rel) | 659 | if (GNUNET_YES == etime_is_rel) |
660 | { | 660 | { |
661 | rd.expiration_time = etime_rel.rel_value; | 661 | rd.expiration_time = etime_rel.rel_value_us; |
662 | rd.flags |= GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION; | 662 | rd.flags |= GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION; |
663 | } | 663 | } |
664 | else if (GNUNET_NO == etime_is_rel) | 664 | else if (GNUNET_NO == etime_is_rel) |
665 | rd.expiration_time = etime_abs.abs_value; | 665 | rd.expiration_time = etime_abs.abs_value_us; |
666 | else | 666 | else |
667 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; | 667 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; |
668 | if (1 != nonauthority) | 668 | if (1 != nonauthority) |
669 | rd.flags |= GNUNET_NAMESTORE_RF_AUTHORITY; | 669 | rd.flags |= GNUNET_NAMESTORE_RF_AUTHORITY; |
670 | add_qe_uri = GNUNET_NAMESTORE_record_put_by_authority (ns, | 670 | add_qe_uri = GNUNET_NAMESTORE_record_put_by_authority (ns, |
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index a4e463642..749552dca 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -442,12 +442,12 @@ get_block_expiration_time (unsigned int rd_count, const struct GNUNET_NAMESTORE_ | |||
442 | { | 442 | { |
443 | if (0 != (rd[c].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) | 443 | if (0 != (rd[c].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) |
444 | { | 444 | { |
445 | rt.rel_value = rd[c].expiration_time; | 445 | rt.rel_value_us = rd[c].expiration_time; |
446 | at = GNUNET_TIME_relative_to_absolute (rt); | 446 | at = GNUNET_TIME_relative_to_absolute (rt); |
447 | } | 447 | } |
448 | else | 448 | else |
449 | { | 449 | { |
450 | at.abs_value = rd[c].expiration_time; | 450 | at.abs_value_us = rd[c].expiration_time; |
451 | } | 451 | } |
452 | expire = GNUNET_TIME_absolute_min (at, expire); | 452 | expire = GNUNET_TIME_absolute_min (at, expire); |
453 | } | 453 | } |
@@ -742,16 +742,16 @@ handle_lookup_name_it (void *cls, | |||
742 | { | 742 | { |
743 | GNUNET_break (GNUNET_YES == authoritative); | 743 | GNUNET_break (GNUNET_YES == authoritative); |
744 | rd_modified = GNUNET_YES; | 744 | rd_modified = GNUNET_YES; |
745 | re.rel_value = rd[c].expiration_time; | 745 | re.rel_value_us = rd[c].expiration_time; |
746 | e = GNUNET_TIME_relative_to_absolute (re); | 746 | e = GNUNET_TIME_relative_to_absolute (re); |
747 | } | 747 | } |
748 | else | 748 | else |
749 | { | 749 | { |
750 | e.abs_value = rd[c].expiration_time; | 750 | e.abs_value_us = rd[c].expiration_time; |
751 | } | 751 | } |
752 | /* found matching record, copy and convert flags to public format */ | 752 | /* found matching record, copy and convert flags to public format */ |
753 | rd_selected[copied_elements] = rd[c]; /* shallow copy! */ | 753 | rd_selected[copied_elements] = rd[c]; /* shallow copy! */ |
754 | rd_selected[copied_elements].expiration_time = e.abs_value; | 754 | rd_selected[copied_elements].expiration_time = e.abs_value_us; |
755 | if (0 != (rd_selected[copied_elements].flags & | 755 | if (0 != (rd_selected[copied_elements].flags & |
756 | (GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION | GNUNET_NAMESTORE_RF_AUTHORITY))) | 756 | (GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION | GNUNET_NAMESTORE_RF_AUTHORITY))) |
757 | { | 757 | { |
@@ -1609,8 +1609,8 @@ zone_iteraterate_proc (void *cls, | |||
1609 | (0 != (rd[c].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) ) | 1609 | (0 != (rd[c].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) ) |
1610 | { | 1610 | { |
1611 | /* should convert relative-to-absolute expiration time */ | 1611 | /* should convert relative-to-absolute expiration time */ |
1612 | rt.rel_value = rd[c].expiration_time; | 1612 | rt.rel_value_us = rd[c].expiration_time; |
1613 | rd_filtered[c].expiration_time = GNUNET_TIME_relative_to_absolute (rt).abs_value; | 1613 | rd_filtered[c].expiration_time = GNUNET_TIME_relative_to_absolute (rt).abs_value_us; |
1614 | rd_filtered[c].flags &= ~ GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION; | 1614 | rd_filtered[c].flags &= ~ GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION; |
1615 | } | 1615 | } |
1616 | /* we NEVER keep the 'authority' flag */ | 1616 | /* we NEVER keep the 'authority' flag */ |
@@ -1637,10 +1637,10 @@ zone_iteraterate_proc (void *cls, | |||
1637 | 1637 | ||
1638 | 1638 | ||
1639 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1639 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1640 | "Creating signature for `%s' in zone `%s' with %u records and expiration %llu\n", | 1640 | "Creating signature for `%s' in zone `%s' with %u records and expiration %s\n", |
1641 | name, GNUNET_NAMESTORE_short_h2s(&zone_hash), | 1641 | name, GNUNET_NAMESTORE_short_h2s(&zone_hash), |
1642 | rd_count_filtered, | 1642 | rd_count_filtered, |
1643 | (unsigned long long) expire.abs_value); | 1643 | GNUNET_STRINGS_absolute_time_to_string (expire)); |
1644 | /* TODO 1) AB: New publishing | 1644 | /* TODO 1) AB: New publishing |
1645 | * - Create HDKF(Q,i) | 1645 | * - Create HDKF(Q,i) |
1646 | * - Encrypt record block R with HKDF: HDKF(Q,i) == E(R) | 1646 | * - Encrypt record block R with HKDF: HDKF(Q,i) == E(R) |
@@ -1671,9 +1671,9 @@ zone_iteraterate_proc (void *cls, | |||
1671 | if (NULL != signature) | 1671 | if (NULL != signature) |
1672 | { | 1672 | { |
1673 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1673 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1674 | "Using provided signature for `%s' in zone `%s' with %u records and expiration %llu\n", | 1674 | "Using provided signature for `%s' in zone `%s' with %u records and expiration %s\n", |
1675 | name, GNUNET_NAMESTORE_short_h2s (&zone_hash), rd_count_filtered, | 1675 | name, GNUNET_NAMESTORE_short_h2s (&zone_hash), rd_count_filtered, |
1676 | (unsigned long long) expire.abs_value); | 1676 | GNUNET_STRINGS_absolute_time_to_string (expire)); |
1677 | return; | 1677 | return; |
1678 | } | 1678 | } |
1679 | } | 1679 | } |
diff --git a/src/namestore/namestore_api_common.c b/src/namestore/namestore_api_common.c index d8fede7d2..7098e6131 100644 --- a/src/namestore/namestore_api_common.c +++ b/src/namestore/namestore_api_common.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 |
@@ -747,8 +747,8 @@ GNUNET_NAMESTORE_is_expired (const struct GNUNET_NAMESTORE_RecordData *rd) | |||
747 | 747 | ||
748 | if (0 != (rd->flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) | 748 | if (0 != (rd->flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) |
749 | return GNUNET_NO; | 749 | return GNUNET_NO; |
750 | at.abs_value = rd->expiration_time; | 750 | at.abs_value_us = rd->expiration_time; |
751 | return (0 == GNUNET_TIME_absolute_get_remaining (at).rel_value) ? GNUNET_YES : GNUNET_NO; | 751 | return (0 == GNUNET_TIME_absolute_get_remaining (at).rel_value_us) ? GNUNET_YES : GNUNET_NO; |
752 | } | 752 | } |
753 | 753 | ||
754 | 754 | ||
diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c index 64bfa631c..b62c306f3 100644 --- a/src/namestore/plugin_namestore_postgres.c +++ b/src/namestore/plugin_namestore_postgres.c | |||
@@ -311,7 +311,7 @@ namestore_postgres_put_records (void *cls, | |||
311 | } | 311 | } |
312 | { | 312 | { |
313 | char data[data_size]; | 313 | char data[data_size]; |
314 | uint64_t expire_be = GNUNET_htonll (expire.abs_value); | 314 | uint64_t expire_be = GNUNET_htonll (expire.abs_value_us); |
315 | uint64_t rvalue_be = GNUNET_htonll (rvalue); | 315 | uint64_t rvalue_be = GNUNET_htonll (rvalue); |
316 | uint32_t rd_count_be = htonl ((uint32_t) rd_count); | 316 | uint32_t rd_count_be = htonl ((uint32_t) rd_count); |
317 | const char *paramValues[] = { | 317 | const char *paramValues[] = { |
@@ -421,7 +421,7 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
421 | record_count = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2)); | 421 | record_count = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2)); |
422 | data_size = PQgetlength (res, 0, 3); | 422 | data_size = PQgetlength (res, 0, 3); |
423 | data = PQgetvalue (res, 0, 3); | 423 | data = PQgetvalue (res, 0, 3); |
424 | expiration.abs_value = | 424 | expiration.abs_value_us = |
425 | GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 4)); | 425 | GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 4)); |
426 | sig = (const struct GNUNET_CRYPTO_EccSignature*) PQgetvalue (res, 0, 5); | 426 | sig = (const struct GNUNET_CRYPTO_EccSignature*) PQgetvalue (res, 0, 5); |
427 | if (record_count > 64 * 1024) | 427 | if (record_count > 64 * 1024) |
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index 6ee3de495..a7cc03434 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c | |||
@@ -501,7 +501,7 @@ namestore_sqlite_put_records (void *cls, | |||
501 | (SQLITE_OK != sqlite3_bind_text (plugin->put_records, 2, name, -1, SQLITE_STATIC)) || | 501 | (SQLITE_OK != sqlite3_bind_text (plugin->put_records, 2, name, -1, SQLITE_STATIC)) || |
502 | (SQLITE_OK != sqlite3_bind_int (plugin->put_records, 3, rd_count)) || | 502 | (SQLITE_OK != sqlite3_bind_int (plugin->put_records, 3, rd_count)) || |
503 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 4, data, data_size, SQLITE_STATIC)) || | 503 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 4, data, data_size, SQLITE_STATIC)) || |
504 | (SQLITE_OK != sqlite3_bind_int64 (plugin->put_records, 5, expire.abs_value)) || | 504 | (SQLITE_OK != sqlite3_bind_int64 (plugin->put_records, 5, expire.abs_value_us)) || |
505 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 6, signature, sizeof (struct GNUNET_CRYPTO_EccSignature), SQLITE_STATIC)) || | 505 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 6, signature, sizeof (struct GNUNET_CRYPTO_EccSignature), SQLITE_STATIC)) || |
506 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 7, &zone_delegation, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || | 506 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 7, &zone_delegation, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || |
507 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 8, &zone, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || | 507 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 8, &zone, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || |
@@ -575,7 +575,7 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
575 | record_count = sqlite3_column_int (stmt, 2); | 575 | record_count = sqlite3_column_int (stmt, 2); |
576 | data_size = sqlite3_column_bytes (stmt, 3); | 576 | data_size = sqlite3_column_bytes (stmt, 3); |
577 | data = sqlite3_column_blob (stmt, 3); | 577 | data = sqlite3_column_blob (stmt, 3); |
578 | expiration.abs_value = (uint64_t) sqlite3_column_int64 (stmt, 4); | 578 | expiration.abs_value_us = (uint64_t) sqlite3_column_int64 (stmt, 4); |
579 | sig = sqlite3_column_blob (stmt, 5); | 579 | sig = sqlite3_column_blob (stmt, 5); |
580 | 580 | ||
581 | if ( (sizeof (struct GNUNET_CRYPTO_EccPublicKey) != sqlite3_column_bytes (stmt, 0)) || | 581 | if ( (sizeof (struct GNUNET_CRYPTO_EccPublicKey) != sqlite3_column_bytes (stmt, 0)) || |
diff --git a/src/namestore/test_namestore_api.c b/src/namestore/test_namestore_api.c index 3397b35f1..3d921f132 100644 --- a/src/namestore/test_namestore_api.c +++ b/src/namestore/test_namestore_api.c | |||
@@ -153,7 +153,7 @@ run (void *cls, | |||
153 | GNUNET_CRYPTO_ecc_key_get_public (privkey, &pubkey); | 153 | GNUNET_CRYPTO_ecc_key_get_public (privkey, &pubkey); |
154 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (pubkey), &zone); | 154 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (pubkey), &zone); |
155 | memset (&signature, '\0', sizeof (signature)); | 155 | memset (&signature, '\0', sizeof (signature)); |
156 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value; | 156 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us; |
157 | rd.record_type = TEST_RECORD_TYPE; | 157 | rd.record_type = TEST_RECORD_TYPE; |
158 | rd.data_size = TEST_RECORD_DATALEN; | 158 | rd.data_size = TEST_RECORD_DATALEN; |
159 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); | 159 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); |
diff --git a/src/namestore/test_namestore_api_create.c b/src/namestore/test_namestore_api_create.c index 4eac96df6..667bf0827 100644 --- a/src/namestore/test_namestore_api_create.c +++ b/src/namestore/test_namestore_api_create.c | |||
@@ -316,7 +316,7 @@ create_record (unsigned int count) | |||
316 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 316 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
317 | for (c = 0; c < count; c++) | 317 | for (c = 0; c < count; c++) |
318 | { | 318 | { |
319 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 319 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
320 | rd[c].record_type = TEST_RECORD_TYPE; | 320 | rd[c].record_type = TEST_RECORD_TYPE; |
321 | rd[c].data_size = TEST_RECORD_DATALEN; | 321 | rd[c].data_size = TEST_RECORD_DATALEN; |
322 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 322 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
diff --git a/src/namestore/test_namestore_api_create_update.c b/src/namestore/test_namestore_api_create_update.c index f1e66963f..90d36ccb6 100644 --- a/src/namestore/test_namestore_api_create_update.c +++ b/src/namestore/test_namestore_api_create_update.c | |||
@@ -146,7 +146,7 @@ create_identical_cont (void *cls, int32_t success, const char *emsg) | |||
146 | if (success == GNUNET_OK) | 146 | if (success == GNUNET_OK) |
147 | { | 147 | { |
148 | res = 0; | 148 | res = 0; |
149 | s_first_record->expiration_time = GNUNET_TIME_absolute_get ().abs_value; | 149 | s_first_record->expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; |
150 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name, | 150 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name, |
151 | 1, s_first_record, | 151 | 1, s_first_record, |
152 | &create_updated_cont, s_name); | 152 | &create_updated_cont, s_name); |
@@ -239,7 +239,7 @@ run (void *cls, | |||
239 | char rd_ser[rd_ser_len]; | 239 | char rd_ser[rd_ser_len]; |
240 | GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser); | 240 | GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser); |
241 | 241 | ||
242 | et.abs_value = s_first_record->expiration_time; | 242 | et.abs_value_us = s_first_record->expiration_time; |
243 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1); | 243 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1); |
244 | 244 | ||
245 | /* create random zone hash */ | 245 | /* create random zone hash */ |
diff --git a/src/namestore/test_namestore_api_lookup.c b/src/namestore/test_namestore_api_lookup.c index d8f6fe056..24ef4c74e 100644 --- a/src/namestore/test_namestore_api_lookup.c +++ b/src/namestore/test_namestore_api_lookup.c | |||
@@ -200,7 +200,7 @@ create_record (unsigned int count) | |||
200 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 200 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
201 | for (c = 0; c < count; c++) | 201 | for (c = 0; c < count; c++) |
202 | { | 202 | { |
203 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 203 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
204 | rd[c].record_type = TEST_RECORD_TYPE; | 204 | rd[c].record_type = TEST_RECORD_TYPE; |
205 | rd[c].data_size = TEST_RECORD_DATALEN; | 205 | rd[c].data_size = TEST_RECORD_DATALEN; |
206 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 206 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -237,7 +237,7 @@ run (void *cls, | |||
237 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 237 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
238 | 238 | ||
239 | /* sign */ | 239 | /* sign */ |
240 | et.abs_value = s_rd[0].expiration_time; | 240 | et.abs_value_us = s_rd[0].expiration_time; |
241 | s_signature = GNUNET_NAMESTORE_create_signature (privkey, et, s_name, | 241 | s_signature = GNUNET_NAMESTORE_create_signature (privkey, et, s_name, |
242 | s_rd, RECORDS); | 242 | s_rd, RECORDS); |
243 | 243 | ||
diff --git a/src/namestore/test_namestore_api_lookup_specific_type.c b/src/namestore/test_namestore_api_lookup_specific_type.c index 28632c83f..1d084dbc1 100644 --- a/src/namestore/test_namestore_api_lookup_specific_type.c +++ b/src/namestore/test_namestore_api_lookup_specific_type.c | |||
@@ -250,13 +250,13 @@ create_record (unsigned int count) | |||
250 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 250 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
251 | for (c = 0; c < count-1; c++) | 251 | for (c = 0; c < count-1; c++) |
252 | { | 252 | { |
253 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 253 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
254 | rd[c].record_type = 1; | 254 | rd[c].record_type = 1; |
255 | rd[c].data_size = TEST_RECORD_DATALEN; | 255 | rd[c].data_size = TEST_RECORD_DATALEN; |
256 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 256 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
257 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 257 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
258 | } | 258 | } |
259 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 259 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
260 | rd[c].record_type = TEST_RECORD_LOOKUP_TYPE_EXISTING; | 260 | rd[c].record_type = TEST_RECORD_LOOKUP_TYPE_EXISTING; |
261 | rd[c].data_size = TEST_RECORD_DATALEN; | 261 | rd[c].data_size = TEST_RECORD_DATALEN; |
262 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 262 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -296,7 +296,7 @@ run (void *cls, | |||
296 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 296 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
297 | 297 | ||
298 | /* sign */ | 298 | /* sign */ |
299 | et.abs_value = s_rd[RECORDS - 1].expiration_time; | 299 | et.abs_value_us = s_rd[RECORDS - 1].expiration_time; |
300 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | 300 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); |
301 | 301 | ||
302 | /* create random zone hash */ | 302 | /* create random zone hash */ |
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c index c103952fa..f60116a79 100644 --- a/src/namestore/test_namestore_api_monitoring.c +++ b/src/namestore/test_namestore_api_monitoring.c | |||
@@ -219,7 +219,7 @@ create_record (unsigned int count) | |||
219 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 219 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
220 | for (c = 0; c < count; c++) | 220 | for (c = 0; c < count; c++) |
221 | { | 221 | { |
222 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 222 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
223 | rd[c].record_type = 1111; | 223 | rd[c].record_type = 1111; |
224 | rd[c].data_size = 50; | 224 | rd[c].data_size = 50; |
225 | rd[c].data = GNUNET_malloc(50); | 225 | rd[c].data = GNUNET_malloc(50); |
@@ -282,7 +282,7 @@ run (void *cls, | |||
282 | 282 | ||
283 | GNUNET_asprintf(&s_name_1, "dummy1"); | 283 | GNUNET_asprintf(&s_name_1, "dummy1"); |
284 | s_rd_1 = create_record(1); | 284 | s_rd_1 = create_record(1); |
285 | et.abs_value = s_rd_1->expiration_time; | 285 | et.abs_value_us = s_rd_1->expiration_time; |
286 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); | 286 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); |
287 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_1, | 287 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_1, |
288 | 1, s_rd_1, | 288 | 1, s_rd_1, |
@@ -293,7 +293,7 @@ run (void *cls, | |||
293 | GNUNET_asprintf(&s_name_2, "dummy2"); | 293 | GNUNET_asprintf(&s_name_2, "dummy2"); |
294 | s_rd_2 = create_record(1); | 294 | s_rd_2 = create_record(1); |
295 | 295 | ||
296 | et.abs_value = s_rd_2->expiration_time; | 296 | et.abs_value_us = s_rd_2->expiration_time; |
297 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); | 297 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); |
298 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_2, | 298 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_2, |
299 | 1, s_rd_2, | 299 | 1, s_rd_2, |
@@ -303,7 +303,7 @@ run (void *cls, | |||
303 | /* name in different zone */ | 303 | /* name in different zone */ |
304 | GNUNET_asprintf(&s_name_3, "dummy3"); | 304 | GNUNET_asprintf(&s_name_3, "dummy3"); |
305 | s_rd_3 = create_record(1); | 305 | s_rd_3 = create_record(1); |
306 | et.abs_value = s_rd_3->expiration_time; | 306 | et.abs_value_us = s_rd_3->expiration_time; |
307 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1); | 307 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1); |
308 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, | 308 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, |
309 | GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, | 309 | GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, |
diff --git a/src/namestore/test_namestore_api_put.c b/src/namestore/test_namestore_api_put.c index ff99b60f9..ccbe8eefe 100644 --- a/src/namestore/test_namestore_api_put.c +++ b/src/namestore/test_namestore_api_put.c | |||
@@ -121,7 +121,7 @@ create_record (unsigned int count) | |||
121 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 121 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
122 | for (c = 0; c < count; c++) | 122 | for (c = 0; c < count; c++) |
123 | { | 123 | { |
124 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; | 124 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value_us; |
125 | rd[c].record_type = TEST_RECORD_TYPE; | 125 | rd[c].record_type = TEST_RECORD_TYPE; |
126 | rd[c].data_size = TEST_RECORD_DATALEN; | 126 | rd[c].data_size = TEST_RECORD_DATALEN; |
127 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 127 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -157,7 +157,7 @@ run (void *cls, | |||
157 | /* create record */ | 157 | /* create record */ |
158 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); | 158 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); |
159 | s_rd = create_record (RECORDS); | 159 | s_rd = create_record (RECORDS); |
160 | et.abs_value = s_rd[0].expiration_time; | 160 | et.abs_value_us = s_rd[0].expiration_time; |
161 | signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | 161 | signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); |
162 | GNUNET_break (s_rd != NULL); | 162 | GNUNET_break (s_rd != NULL); |
163 | GNUNET_break (s_name != NULL); | 163 | GNUNET_break (s_name != NULL); |
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index f278b30db..19721f5a1 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -203,14 +203,14 @@ create_record (unsigned int count) | |||
203 | struct GNUNET_NAMESTORE_RecordData * rd; | 203 | struct GNUNET_NAMESTORE_RecordData * rd; |
204 | 204 | ||
205 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 205 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
206 | rd[0].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 206 | rd[0].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
207 | rd[0].record_type = 0; | 207 | rd[0].record_type = 0; |
208 | rd[0].data_size = TEST_REMOVE_RECORD_DATALEN; | 208 | rd[0].data_size = TEST_REMOVE_RECORD_DATALEN; |
209 | rd[0].data = GNUNET_malloc(TEST_REMOVE_RECORD_DATALEN); | 209 | rd[0].data = GNUNET_malloc(TEST_REMOVE_RECORD_DATALEN); |
210 | memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 210 | memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
211 | for (c = 1; c < count; c++) | 211 | for (c = 1; c < count; c++) |
212 | { | 212 | { |
213 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 213 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
214 | rd[c].record_type = TEST_RECORD_TYPE; | 214 | rd[c].record_type = TEST_RECORD_TYPE; |
215 | rd[c].data_size = TEST_RECORD_DATALEN; | 215 | rd[c].data_size = TEST_RECORD_DATALEN; |
216 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 216 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -250,7 +250,7 @@ run (void *cls, | |||
250 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 250 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
251 | 251 | ||
252 | /* sign */ | 252 | /* sign */ |
253 | et.abs_value = s_rd[0].expiration_time; | 253 | et.abs_value_us = s_rd[0].expiration_time; |
254 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | 254 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); |
255 | 255 | ||
256 | /* create random zone hash */ | 256 | /* create random zone hash */ |
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c index a85bc8c05..6247ff346 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c | |||
@@ -158,7 +158,7 @@ create_record (unsigned int count) | |||
158 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 158 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
159 | for (c = 0; c < count; c++) | 159 | for (c = 0; c < count; c++) |
160 | { | 160 | { |
161 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; | 161 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value_us; |
162 | rd[c].record_type = TEST_RECORD_TYPE; | 162 | rd[c].record_type = TEST_RECORD_TYPE; |
163 | rd[c].data_size = TEST_RECORD_DATALEN; | 163 | rd[c].data_size = TEST_RECORD_DATALEN; |
164 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 164 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -198,7 +198,7 @@ run (void *cls, | |||
198 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 198 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
199 | 199 | ||
200 | /* sign */ | 200 | /* sign */ |
201 | et.abs_value = s_rd[0].expiration_time; | 201 | et.abs_value_us = s_rd[0].expiration_time; |
202 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | 202 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); |
203 | 203 | ||
204 | /* create random zone hash */ | 204 | /* create random zone hash */ |
diff --git a/src/namestore/test_namestore_api_sign_verify.c b/src/namestore/test_namestore_api_sign_verify.c index e2913991c..41b9407e4 100644 --- a/src/namestore/test_namestore_api_sign_verify.c +++ b/src/namestore/test_namestore_api_sign_verify.c | |||
@@ -62,7 +62,7 @@ create_record (int count) | |||
62 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 62 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
63 | for (c = 0; c < count; c++) | 63 | for (c = 0; c < count; c++) |
64 | { | 64 | { |
65 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; | 65 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value_us; |
66 | rd[c].record_type = TEST_RECORD_TYPE; | 66 | rd[c].record_type = TEST_RECORD_TYPE; |
67 | rd[c].data_size = TEST_RECORD_DATALEN; | 67 | rd[c].data_size = TEST_RECORD_DATALEN; |
68 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 68 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index 63e4adf40..036944e9a 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c | |||
@@ -195,7 +195,9 @@ zone_proc (void *cls, | |||
195 | else | 195 | else |
196 | res = 1; | 196 | res = 1; |
197 | 197 | ||
198 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received last result, iteration done after receing %u results\n",returned_records ); | 198 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
199 | "Received last result, iteration done after receing %u results\n", | ||
200 | returned_records ); | ||
199 | GNUNET_SCHEDULER_add_now (&end, NULL); | 201 | GNUNET_SCHEDULER_add_now (&end, NULL); |
200 | } | 202 | } |
201 | else | 203 | else |
@@ -205,7 +207,10 @@ zone_proc (void *cls, | |||
205 | { | 207 | { |
206 | struct GNUNET_HashCode zone_key_hash; | 208 | struct GNUNET_HashCode zone_key_hash; |
207 | GNUNET_CRYPTO_hash (zone_key, sizeof (struct GNUNET_CRYPTO_EccPublicKey), &zone_key_hash); | 209 | GNUNET_CRYPTO_hash (zone_key, sizeof (struct GNUNET_CRYPTO_EccPublicKey), &zone_key_hash); |
208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Verifying signature for `%s' in zone `%s' with %u records and expiration %llu failed\n", name, GNUNET_h2s(&zone_key_hash), rd_count, expire.abs_value); | 210 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
211 | "Verifying signature for `%s' in zone `%s' with %u records and expiration %s failed\n", | ||
212 | name, GNUNET_h2s(&zone_key_hash), rd_count, | ||
213 | GNUNET_STRINGS_absolute_time_to_string (expire)); | ||
209 | 214 | ||
210 | failed = GNUNET_YES; | 215 | failed = GNUNET_YES; |
211 | GNUNET_break (0); | 216 | GNUNET_break (0); |
@@ -337,7 +342,7 @@ create_record (unsigned int count) | |||
337 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 342 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
338 | for (c = 0; c < count; c++) | 343 | for (c = 0; c < count; c++) |
339 | { | 344 | { |
340 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 345 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
341 | rd[c].record_type = 1111; | 346 | rd[c].record_type = 1111; |
342 | rd[c].data_size = 50; | 347 | rd[c].data_size = 50; |
343 | rd[c].data = GNUNET_malloc(50); | 348 | rd[c].data = GNUNET_malloc(50); |
@@ -392,7 +397,7 @@ empty_zone_proc (void *cls, | |||
392 | 397 | ||
393 | GNUNET_asprintf(&s_name_1, "dummy1"); | 398 | GNUNET_asprintf(&s_name_1, "dummy1"); |
394 | s_rd_1 = create_record(1); | 399 | s_rd_1 = create_record(1); |
395 | et.abs_value = s_rd_1->expiration_time; | 400 | et.abs_value_us = s_rd_1->expiration_time; |
396 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); | 401 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); |
397 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_1, | 402 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_1, |
398 | 1, s_rd_1, | 403 | 1, s_rd_1, |
@@ -403,7 +408,7 @@ empty_zone_proc (void *cls, | |||
403 | GNUNET_asprintf(&s_name_2, "dummy2"); | 408 | GNUNET_asprintf(&s_name_2, "dummy2"); |
404 | s_rd_2 = create_record(1); | 409 | s_rd_2 = create_record(1); |
405 | 410 | ||
406 | et.abs_value = s_rd_2->expiration_time; | 411 | et.abs_value_us = s_rd_2->expiration_time; |
407 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); | 412 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); |
408 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_2, | 413 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_2, |
409 | 1, s_rd_2, | 414 | 1, s_rd_2, |
@@ -413,7 +418,7 @@ empty_zone_proc (void *cls, | |||
413 | /* name in different zone */ | 418 | /* name in different zone */ |
414 | GNUNET_asprintf(&s_name_3, "dummy3"); | 419 | GNUNET_asprintf(&s_name_3, "dummy3"); |
415 | s_rd_3 = create_record(1); | 420 | s_rd_3 = create_record(1); |
416 | et.abs_value = s_rd_3->expiration_time; | 421 | et.abs_value_us = s_rd_3->expiration_time; |
417 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1); | 422 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1); |
418 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); | 423 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); |
419 | } | 424 | } |
diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c index 020c8358f..d0db013b7 100644 --- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c +++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c | |||
@@ -302,7 +302,7 @@ create_record (unsigned int count) | |||
302 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 302 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
303 | for (c = 0; c < count; c++) | 303 | for (c = 0; c < count; c++) |
304 | { | 304 | { |
305 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 305 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
306 | rd[c].record_type = 1111; | 306 | rd[c].record_type = 1111; |
307 | rd[c].data_size = 50; | 307 | rd[c].data_size = 50; |
308 | rd[c].data = GNUNET_malloc(50); | 308 | rd[c].data = GNUNET_malloc(50); |
@@ -344,7 +344,7 @@ run (void *cls, | |||
344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n"); | 344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n"); |
345 | GNUNET_asprintf(&s_name_1, "dummy1"); | 345 | GNUNET_asprintf(&s_name_1, "dummy1"); |
346 | s_rd_1 = create_record(1); | 346 | s_rd_1 = create_record(1); |
347 | et.abs_value = s_rd_1[0].expiration_time; | 347 | et.abs_value_us = s_rd_1[0].expiration_time; |
348 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); | 348 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); |
349 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_1, | 349 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_1, |
350 | 1, s_rd_1, | 350 | 1, s_rd_1, |
@@ -353,7 +353,7 @@ run (void *cls, | |||
353 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 2 \n"); | 353 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 2 \n"); |
354 | GNUNET_asprintf(&s_name_2, "dummy2"); | 354 | GNUNET_asprintf(&s_name_2, "dummy2"); |
355 | s_rd_2 = create_record(1); | 355 | s_rd_2 = create_record(1); |
356 | et.abs_value = s_rd_2[0].expiration_time; | 356 | et.abs_value_us = s_rd_2[0].expiration_time; |
357 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); | 357 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); |
358 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_2, | 358 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_2, |
359 | 1, s_rd_2, | 359 | 1, s_rd_2, |
@@ -363,7 +363,7 @@ run (void *cls, | |||
363 | /* name in different zone */ | 363 | /* name in different zone */ |
364 | GNUNET_asprintf(&s_name_3, "dummy3"); | 364 | GNUNET_asprintf(&s_name_3, "dummy3"); |
365 | s_rd_3 = create_record(1); | 365 | s_rd_3 = create_record(1); |
366 | et.abs_value = s_rd_3[0].expiration_time; | 366 | et.abs_value_us = s_rd_3[0].expiration_time; |
367 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_3, s_rd_3, 1); | 367 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_3, s_rd_3, 1); |
368 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, | 368 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, |
369 | GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); | 369 | GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); |
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c index 5d44555d1..abd7c2564 100644 --- a/src/namestore/test_namestore_api_zone_iteration_stop.c +++ b/src/namestore/test_namestore_api_zone_iteration_stop.c | |||
@@ -361,7 +361,7 @@ create_record (unsigned int count) | |||
361 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 361 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
362 | for (c = 0; c < count; c++) | 362 | for (c = 0; c < count; c++) |
363 | { | 363 | { |
364 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value; | 364 | rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; |
365 | rd[c].record_type = 1111; | 365 | rd[c].record_type = 1111; |
366 | rd[c].data_size = 50; | 366 | rd[c].data_size = 50; |
367 | rd[c].data = GNUNET_malloc(50); | 367 | rd[c].data = GNUNET_malloc(50); |
@@ -405,7 +405,7 @@ run (void *cls, | |||
405 | 405 | ||
406 | GNUNET_asprintf(&s_name_1, "dummy1"); | 406 | GNUNET_asprintf(&s_name_1, "dummy1"); |
407 | s_rd_1 = create_record(1); | 407 | s_rd_1 = create_record(1); |
408 | et.abs_value = s_rd_1[0].expiration_time; | 408 | et.abs_value_us = s_rd_1[0].expiration_time; |
409 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); | 409 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); |
410 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_1, | 410 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_1, |
411 | 1, s_rd_1, &put_cont, NULL); | 411 | 1, s_rd_1, &put_cont, NULL); |
@@ -415,7 +415,7 @@ run (void *cls, | |||
415 | GNUNET_asprintf(&s_name_2, "dummy2"); | 415 | GNUNET_asprintf(&s_name_2, "dummy2"); |
416 | s_rd_2 = create_record(1); | 416 | s_rd_2 = create_record(1); |
417 | 417 | ||
418 | et.abs_value = s_rd_2[0].expiration_time; | 418 | et.abs_value_us = s_rd_2[0].expiration_time; |
419 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); | 419 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); |
420 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_2, | 420 | GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, s_name_2, |
421 | 1, s_rd_2, &put_cont, NULL); | 421 | 1, s_rd_2, &put_cont, NULL); |
@@ -424,7 +424,7 @@ run (void *cls, | |||
424 | /* name in different zone */ | 424 | /* name in different zone */ |
425 | GNUNET_asprintf(&s_name_3, "dummy3"); | 425 | GNUNET_asprintf(&s_name_3, "dummy3"); |
426 | s_rd_3 = create_record(1); | 426 | s_rd_3 = create_record(1); |
427 | et.abs_value = s_rd_3[0].expiration_time; | 427 | et.abs_value_us = s_rd_3[0].expiration_time; |
428 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1); | 428 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1); |
429 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); | 429 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); |
430 | } | 430 | } |
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c index e1fefec09..ea242c49e 100644 --- a/src/namestore/test_namestore_api_zone_to_name.c +++ b/src/namestore/test_namestore_api_zone_to_name.c | |||
@@ -187,7 +187,7 @@ run (void *cls, | |||
187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_NAMESTORE_short_h2s (&s_zone_value)); | 187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_NAMESTORE_short_h2s (&s_zone_value)); |
188 | 188 | ||
189 | struct GNUNET_NAMESTORE_RecordData rd; | 189 | struct GNUNET_NAMESTORE_RecordData rd; |
190 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value; | 190 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us; |
191 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; | 191 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
192 | rd.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode); | 192 | rd.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode); |
193 | rd.data = GNUNET_malloc(sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 193 | rd.data = GNUNET_malloc(sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
@@ -196,7 +196,7 @@ run (void *cls, | |||
196 | GNUNET_break (NULL != nsh); | 196 | GNUNET_break (NULL != nsh); |
197 | 197 | ||
198 | expire = GNUNET_TIME_absolute_get (); | 198 | expire = GNUNET_TIME_absolute_get (); |
199 | et.abs_value = rd.expiration_time; | 199 | et.abs_value_us = rd.expiration_time; |
200 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, &rd, 1); | 200 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, &rd, 1); |
201 | GNUNET_NAMESTORE_record_put(nsh, &pubkey, s_name, expire, 1, &rd, s_signature, put_cont, NULL); | 201 | GNUNET_NAMESTORE_record_put(nsh, &pubkey, s_name, expire, 1, &rd, s_signature, put_cont, NULL); |
202 | 202 | ||
diff --git a/src/namestore/test_plugin_namestore.c b/src/namestore/test_plugin_namestore.c index 35c9e920f..4b5a75b5e 100644 --- a/src/namestore/test_plugin_namestore.c +++ b/src/namestore/test_plugin_namestore.c | |||
@@ -154,7 +154,7 @@ put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) | |||
154 | { | 154 | { |
155 | rd[i].data = "Hello World"; | 155 | rd[i].data = "Hello World"; |
156 | rd[i].data_size = id % 10; | 156 | rd[i].data_size = id % 10; |
157 | rd[i].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES).abs_value; | 157 | rd[i].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES).abs_value_us; |
158 | rd[i].record_type = 1 + (id % 13); | 158 | rd[i].record_type = 1 + (id % 13); |
159 | rd[i].flags = (id % 7); | 159 | rd[i].flags = (id % 7); |
160 | } | 160 | } |