GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey);
GNUNET_CRYPTO_short_hash (&pubkey, sizeof (pubkey), &zone);
memset (&signature, '\0', sizeof (signature));
- rd.expiration = GNUNET_TIME_absolute_get();
+ rd.expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd.record_type = TEST_RECORD_TYPE;
rd.data_size = TEST_RECORD_DATALEN;
rd.data = GNUNET_malloc(TEST_RECORD_DATALEN);
/* create a second record */
s_second_record = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_RecordData) + TEST_CREATE_RECORD_DATALEN);
- s_second_record->expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
+ s_second_record->expiration_time = UINT64_MAX;
s_second_record->record_type = TEST_CREATE_RECORD_TYPE;
s_second_record->flags = GNUNET_NAMESTORE_RF_AUTHORITY;
s_second_record->data = &s_second_record[1];
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
- rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
+ rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get();
- rd[c].record_type = TEST_RECORD_TYPE;
- rd[c].data_size = TEST_RECORD_DATALEN;
- rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
- memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
+ rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
+ rd[c].record_type = TEST_RECORD_TYPE;
+ rd[c].data_size = TEST_RECORD_DATALEN;
+ rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
+ memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
}
-
return rd;
}
{
size_t rd_ser_len;
char *hostkey_file;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,endbadly, NULL);
/* load privat key */
rd_ser_len = GNUNET_NAMESTORE_records_get_size(1, s_first_record);
char rd_ser[rd_ser_len];
GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser);
-
- s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_first_record->expiration, s_name, s_first_record, 1);
+ et.abs_value = s_first_record->expiration_time;
+ s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1);
/* create random zone hash */
GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
if (success == GNUNET_NO)
{
res = 0;
- s_first_record->expiration = GNUNET_TIME_absolute_get ();
+ s_first_record->expiration_time = GNUNET_TIME_absolute_get ().abs_value;
GNUNET_NAMESTORE_record_create (nsh, privkey, s_name, s_first_record, &create_updated_cont, s_name);
}
else
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
- rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
+ rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS;
+ rd[c].expiration_time = 0;
rd[c].record_type = TEST_RECORD_TYPE;
rd[c].data_size = TEST_RECORD_DATALEN;
rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
}
-
return rd;
}
{
size_t rd_ser_len;
char *hostkey_file;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
char rd_ser[rd_ser_len];
GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser);
- s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_first_record->expiration, s_name, s_first_record, 1);
+ et.abs_value = s_first_record->expiration_time;
+ s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1);
/* create random zone hash */
GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
- rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
- for (c = 0; c < RECORDS; c++)
+ rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
+ for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get();
+ rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd[c].record_type = TEST_RECORD_TYPE;
rd[c].data_size = TEST_RECORD_DATALEN;
rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
}
-
return rd;
}
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
size_t rd_ser_len;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser);
/* sign */
- s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS);
-
+ et.abs_value = s_rd[0].expiration_time;
+ s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS);
+
/* create random zone hash */
GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
nsh = GNUNET_NAMESTORE_connect (cfg);
Boston, MA 02111-1307, USA.
*/
/**
- * @file namestore/test_namestore_api.c
+ * @file namestore/test_namestore_api_lookup_sepecific_type.c
* @brief testcase for namestore_api.c
*/
#include "platform.h"
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
- for (c = 0; c < RECORDS-1; c++)
+ for (c = 0; c < count-1; c++)
{
- rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS;
+ rd[c].expiration_time = 0;
rd[c].record_type = 1;
rd[c].data_size = TEST_RECORD_DATALEN;
rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
}
- rd[c].expiration = GNUNET_TIME_absolute_get();
+ rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd[c].record_type = TEST_RECORD_LOOKUP_TYPE_EXISTING;
rd[c].data_size = TEST_RECORD_DATALEN;
rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
{
size_t rd_ser_len;
char *hostkey_file;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
/* load privat key */
GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser);
/* sign */
- s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[RECORDS -1].expiration, s_name, s_rd, RECORDS);
+ et.abs_value = s_rd[RECORDS - 1].expiration_time;
+ s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS);
/* create random zone hash */
GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
- for (c = 0; c < RECORDS; c++)
+ for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get();
+ rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd[c].record_type = TEST_RECORD_TYPE;
rd[c].data_size = TEST_RECORD_DATALEN;
rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
const char * s_name = "dummy.dummy.gnunet";
int c;
char *hostkey_file;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
/* load privat key */
GNUNET_break (NULL != nsh);
/* create record */
s_rd = create_record (RECORDS);
- signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS);
+ et.abs_value = s_rd[0].expiration_time;
+ signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS);
GNUNET_break (s_rd != NULL);
GNUNET_break (s_name != NULL);
GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
- rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
- rd[0].expiration = GNUNET_TIME_absolute_get();
+ rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
+ rd[0].expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd[0].record_type = 0;
rd[0].data_size = TEST_REMOVE_RECORD_DATALEN;
rd[0].data = GNUNET_malloc(TEST_REMOVE_RECORD_DATALEN);
memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
-
- for (c = 1; c < RECORDS; c++)
+ for (c = 1; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS;
+ rd[c].expiration_time = 0;
rd[c].record_type = TEST_RECORD_TYPE;
rd[c].data_size = TEST_RECORD_DATALEN;
rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
{
size_t rd_ser_len;
char *hostkey_file;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
/* load privat key */
GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser);
/* sign */
- s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS);
+ et.abs_value = s_rd[0].expiration_time;
+ s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS);
/* create random zone hash */
GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
struct GNUNET_NAMESTORE_RecordData rd;
char data[TEST_REMOVE_RECORD_DATALEN];
- rd.expiration = GNUNET_TIME_absolute_get();
+
+ rd.expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd.record_type = TEST_REMOVE_RECORD_TYPE;
rd.data_size = TEST_REMOVE_RECORD_DATALEN;
rd.data = &data;
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
- for (c = 0; c < RECORDS; c++)
+ for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get();
+ rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd[c].record_type = TEST_RECORD_TYPE;
rd[c].data_size = TEST_RECORD_DATALEN;
rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
{
char *hostkey_file;
size_t rd_ser_len;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser);
/* sign */
- s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS);
+ et.abs_value = s_rd[0].expiration_time;
+ s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS);
/* create random zone hash */
GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
static struct GNUNET_NAMESTORE_RecordData *
create_record (int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
- rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
- for (c = 0; c < RECORDS; c++)
+ rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
+ for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get();
- rd[c].record_type = TEST_RECORD_TYPE;
- rd[c].data_size = TEST_RECORD_DATALEN;
- rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
- memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
+ rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
+ rd[c].record_type = TEST_RECORD_TYPE;
+ rd[c].data_size = TEST_RECORD_DATALEN;
+ rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
+ memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
}
-
return rd;
}
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
- rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
+ rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get();
+ rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd[c].record_type = 1111;
rd[c].data_size = 50;
rd[c].data = GNUNET_malloc(50);
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
char *hostkey_file;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL);
GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
GNUNET_asprintf(&s_name_1, "dummy1");
s_rd_1 = create_record(1);
- sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_1->expiration, s_name_1, s_rd_1, 1);
+ et.abs_value = s_rd_1->expiration_time;
+ sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1);
GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL);
GNUNET_asprintf(&s_name_2, "dummy2");
s_rd_2 = create_record(1);
- sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_2->expiration, s_name_2, s_rd_2, 1);
+ et.abs_value = s_rd_2->expiration_time;
+ sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1);
GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n");
/* name in different zone */
GNUNET_asprintf(&s_name_3, "dummy3");
s_rd_3 = create_record(1);
- sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3->expiration, s_name_3, s_rd_3, 1);
+ et.abs_value = s_rd_3->expiration_time;
+ sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1);
GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
}
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
- rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
+ rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get();
+ rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd[c].record_type = 1111;
rd[c].data_size = 50;
rd[c].data = GNUNET_malloc(50);
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
char *hostkey_file;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL);
GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n");
GNUNET_asprintf(&s_name_1, "dummy1");
s_rd_1 = create_record(1);
- sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_1[0].expiration ,s_name_1, s_rd_1, 1);
+ et.abs_value = s_rd_1[0].expiration_time;
+ sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1);
GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 2 \n");
GNUNET_asprintf(&s_name_2, "dummy2");
s_rd_2 = create_record(1);
- sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_2[0].expiration, s_name_2, s_rd_2, 1);
+ et.abs_value = s_rd_2[0].expiration_time;
+ sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1);
GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n");
/* name in different zone */
GNUNET_asprintf(&s_name_3, "dummy3");
s_rd_3 = create_record(1);
- sig_3 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_3[0].expiration, s_name_3, s_rd_3, 1);
+ et.abs_value = s_rd_3[0].expiration_time;
+ sig_3 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_3, s_rd_3, 1);
GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
}
static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
{
- int c;
+ unsigned int c;
struct GNUNET_NAMESTORE_RecordData * rd;
- rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
+ rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get();
+ rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd[c].record_type = 1111;
rd[c].data_size = 50;
rd[c].data = GNUNET_malloc(50);
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
char *hostkey_file;
+ struct GNUNET_TIME_Absolute et;
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL);
GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
GNUNET_asprintf(&s_name_1, "dummy1");
s_rd_1 = create_record(1);
- sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_1[0].expiration, s_name_1, s_rd_1, 1);
+ et.abs_value = s_rd_1[0].expiration_time;
+ sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1);
GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL);
GNUNET_asprintf(&s_name_2, "dummy2");
s_rd_2 = create_record(1);
- sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_2[0].expiration, s_name_2, s_rd_2, 1);
+ et.abs_value = s_rd_2[0].expiration_time;
+ sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1);
GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n");
/* name in different zone */
GNUNET_asprintf(&s_name_3, "dummy3");
s_rd_3 = create_record(1);
- sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3[0].expiration, s_name_3, s_rd_3, 1);
+ et.abs_value = s_rd_3[0].expiration_time;
+ sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1);
GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
}
run (void *cls,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
+ struct GNUNET_TIME_Absolute et;
+
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
GNUNET_asprintf(&s_name, "dummy");
/* load privat key */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_short_h2s (&s_zone_value));
struct GNUNET_NAMESTORE_RecordData rd;
- rd.expiration = GNUNET_TIME_absolute_get();
+ rd.expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
rd.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode);
rd.data = GNUNET_malloc(sizeof (struct GNUNET_CRYPTO_ShortHashCode));
GNUNET_break (NULL != nsh);
expire = GNUNET_TIME_absolute_get ();
- s_signature = GNUNET_NAMESTORE_create_signature(privkey, rd.expiration, s_name, &rd, 1);
+ et.abs_value = rd.expiration_time;
+ s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, &rd, 1);
GNUNET_NAMESTORE_record_put(nsh, &pubkey, s_name, expire, 1, &rd, s_signature, put_cont, NULL);
GNUNET_free ((void *) rd.data);
GNUNET_break (0);
res = 1;
}
- if (0 != GNUNET_TIME_absolute_get_difference(src[c].expiration, dst[c].expiration).rel_value)
+ if (src[c].expiration_time != dst[c].expiration_time)
{
GNUNET_break (0);
res = 1;
{
rd[i].data = "Hello World";
rd[i].data_size = id % 10;
- rd[i].expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
+ rd[i].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES).abs_value;
rd[i].record_type = 1 + (id % 13);
rd[i].flags = (id % 7);
}