[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r21608 - in gnunet/src: ats core dns dv gns hostlist includ
From: |
gnunet |
Subject: |
[GNUnet-SVN] r21608 - in gnunet/src: ats core dns dv gns hostlist include integration-tests mesh namestore nse testing transport util |
Date: |
Sun, 27 May 2012 23:46:41 +0200 |
Author: grothoff
Date: 2012-05-27 23:46:41 +0200 (Sun, 27 May 2012)
New Revision: 21608
Modified:
gnunet/src/ats/gnunet-service-ats_addresses.c
gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
gnunet/src/ats/test_ats_api_update_address.c
gnunet/src/core/core_api_is_connected.c
gnunet/src/core/core_api_iterate_peers.c
gnunet/src/dns/plugin_block_dns.c
gnunet/src/dv/gnunet-service-dv.c
gnunet/src/gns/gnunet-service-gns_resolver.c
gnunet/src/gns/plugin_block_gns.c
gnunet/src/gns/test_gns_dht_delegated_lookup.c
gnunet/src/gns/test_gns_max_queries.c
gnunet/src/gns/test_gns_pseu_shorten.c
gnunet/src/gns/test_gns_simple_delegated_lookup.c
gnunet/src/gns/test_gns_simple_get_authority.c
gnunet/src/gns/test_gns_simple_lookup.c
gnunet/src/gns/test_gns_simple_mx_lookup.c
gnunet/src/gns/test_gns_simple_shorten.c
gnunet/src/gns/test_gns_simple_zkey_lookup.c
gnunet/src/hostlist/hostlist-client.c
gnunet/src/include/gnunet_time_lib.h
gnunet/src/integration-tests/connection_watchdog.c
gnunet/src/mesh/gnunet-service-mesh.c
gnunet/src/mesh/test_mesh_2dtorus.c
gnunet/src/mesh/test_mesh_small.c
gnunet/src/namestore/gnunet-namestore.c
gnunet/src/namestore/gnunet-service-namestore.c
gnunet/src/namestore/namestore_api.c
gnunet/src/namestore/test_namestore_api.c
gnunet/src/namestore/test_namestore_api_create.c
gnunet/src/namestore/test_namestore_api_create_update.c
gnunet/src/namestore/test_namestore_api_lookup.c
gnunet/src/namestore/test_namestore_api_lookup_specific_type.c
gnunet/src/namestore/test_namestore_api_put.c
gnunet/src/namestore/test_namestore_api_remove.c
gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
gnunet/src/namestore/test_namestore_api_zone_iteration.c
gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
gnunet/src/namestore/test_namestore_record_serialization.c
gnunet/src/nse/gnunet-nse-profiler.c
gnunet/src/nse/nse_profiler_test.conf
gnunet/src/testing/test_testing_2dtorus.c
gnunet/src/testing/testing_group.c
gnunet/src/transport/plugin_transport_http.c
gnunet/src/transport/plugin_transport_http_server.c
gnunet/src/transport/plugin_transport_udp.c
gnunet/src/util/test_time.c
gnunet/src/util/time.c
Log:
renaming GNUNET_TIME_relative_get_forever and GNUNET_TIME_absolute_get_forever
methods, adding underscore, to make it clear that the respective #defines
should be used instead; replacing use of direct function calls with respective
macros where applicable; adding additional
GNUNET_TIME_relative_get_xxx-functions to avoid calls to
GNUNET_TIME_relative_multiply, which turn out to have gotten
performance-relevant
Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -170,11 +170,6 @@
memcpy (&aa[1], plugin_addr, plugin_addr_len);
aa->plugin = GNUNET_strdup (plugin_name);
aa->session_id = session_id;
- aa->mlp_information = NULL;
- aa->blocked_until = GNUNET_TIME_absolute_get_zero();
- aa->block_interval = GNUNET_TIME_relative_get_zero();
- aa->next = NULL;
- aa->prev = NULL;
return aa;
}
@@ -751,8 +746,8 @@
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Resetting interval for peer `%s' address %p from %llu to 0\n",
GNUNET_i2s (&aa->peer), aa, aa->block_interval);
- aa->blocked_until = GNUNET_TIME_absolute_get_zero();
- aa->block_interval = GNUNET_TIME_relative_get_zero();
+ aa->blocked_until = GNUNET_TIME_UNIT_ZERO_ABS;
+ aa->block_interval = GNUNET_TIME_UNIT_ZERO;
return GNUNET_OK;
}
Modified: gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_mlp.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/ats/gnunet-service-ats_addresses_mlp.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -1021,8 +1021,8 @@
ctx->lp_result = GNUNET_SYSERR;
ctx->mlp_result = GNUNET_SYSERR;
- ctx->lp_duration = GNUNET_TIME_relative_get_forever();
- ctx->mlp_duration = GNUNET_TIME_relative_get_forever();
+ ctx->lp_duration = GNUNET_TIME_UNIT_FOREVER_REL;
+ ctx->mlp_duration = GNUNET_TIME_UNIT_FOREVER_REL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Solve LP problem\n");
#if WRITE_MLP
@@ -1369,7 +1369,7 @@
#endif
mlp->control_param_mlp.tm_lim = max_duration.rel_value;
- mlp->last_execution = GNUNET_TIME_absolute_get_forever();
+ mlp->last_execution = GNUNET_TIME_UNIT_FOREVER_ABS;
mlp->co_D = D;
mlp->co_R = R;
Modified: gnunet/src/ats/test_ats_api_update_address.c
===================================================================
--- gnunet/src/ats/test_ats_api_update_address.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/ats/test_ats_api_update_address.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -38,7 +38,7 @@
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
-#define VALID GNUNET_TIME_absolute_get_forever ()
+#define VALID GNUNET_TIME_UNIT_FOREVER_ABS
static struct GNUNET_ATS_SchedulingHandle *ats;
Modified: gnunet/src/core/core_api_is_connected.c
===================================================================
--- gnunet/src/core/core_api_is_connected.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/core/core_api_is_connected.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -204,7 +204,7 @@
GNUNET_CLIENT_notify_transmit_ready (client,
sizeof (struct GNUNET_MessageHeader) +
sizeof (struct GNUNET_PeerIdentity),
- GNUNET_TIME_relative_get_forever (),
+ GNUNET_TIME_UNIT_FOREVER_REL,
GNUNET_YES,
&transmit_is_connected_request, cth);
GNUNET_assert (NULL != cth->th);
return cth;
Modified: gnunet/src/core/core_api_iterate_peers.c
===================================================================
--- gnunet/src/core/core_api_iterate_peers.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/core/core_api_iterate_peers.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -192,11 +192,11 @@
request_context->th =
GNUNET_CLIENT_notify_transmit_ready (client,
sizeof (struct
GNUNET_MessageHeader),
- GNUNET_TIME_relative_get_forever (),
+ GNUNET_TIME_UNIT_FOREVER_REL,
GNUNET_YES, &transmit_request,
NULL);
GNUNET_CLIENT_receive (client, &receive_info, request_context,
- GNUNET_TIME_relative_get_forever ());
+ GNUNET_TIME_UNIT_FOREVER_REL);
return GNUNET_OK;
}
Modified: gnunet/src/dns/plugin_block_dns.c
===================================================================
--- gnunet/src/dns/plugin_block_dns.c 2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/dns/plugin_block_dns.c 2012-05-27 21:46:41 UTC (rev 21608)
@@ -85,7 +85,7 @@
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
}
- if (GNUNET_TIME_relative_get_zero ().rel_value ==
+ if (0 ==
GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh
(rec->expiration_time)).rel_value)
{
Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c 2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/dv/gnunet-service-dv.c 2012-05-27 21:46:41 UTC (rev 21608)
@@ -1334,7 +1334,7 @@
{
send_message (&msg_ctx->dest, &msg_ctx->sender, NULL, msg_ctx->message,
msg_ctx->message_size, default_dv_priority, msg_ctx->uid,
- GNUNET_TIME_relative_get_forever ());
+ GNUNET_TIME_UNIT_FOREVER_REL);
GNUNET_free (msg_ctx->message);
GNUNET_free (msg_ctx);
}
@@ -1629,7 +1629,7 @@
send_message (destination, original_sender, NULL, packed_message,
packed_message_size, default_dv_priority,
ntohl (incoming->uid),
- GNUNET_TIME_relative_get_forever ());
+ GNUNET_TIME_UNIT_FOREVER_REL);
}
if (ret != GNUNET_SYSERR)
return GNUNET_OK;
@@ -1764,7 +1764,7 @@
sizeof (p2p_dv_MESSAGE_NeighborInfo));
pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1];
pending_message->importance = default_dv_priority;
- pending_message->timeout = GNUNET_TIME_relative_get_forever ();
+ pending_message->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
memcpy (&pending_message->recipient, &to->identity,
sizeof (struct GNUNET_PeerIdentity));
pending_message->msg_size = sizeof (p2p_dv_MESSAGE_NeighborInfo);
@@ -1784,7 +1784,7 @@
GNUNET_SCHEDULER_add_now (try_core_send, NULL);
/*if (core_transmit_handle == NULL)
- * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI,
GNUNET_YES, default_dv_priority, GNUNET_TIME_relative_get_forever(),
&to->identity, sizeof(p2p_dv_MESSAGE_NeighborInfo), &core_transmit_notify,
NULL); */
+ * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI,
GNUNET_YES, default_dv_priority, GNUNET_TIME_UNIT_FOREVER_REL, &to->identity,
sizeof(p2p_dv_MESSAGE_NeighborInfo), &core_transmit_notify, NULL); */
}
@@ -2193,7 +2193,7 @@
sizeof (p2p_dv_MESSAGE_Disconnect));
pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1];
pending_message->importance = default_dv_priority;
- pending_message->timeout = GNUNET_TIME_relative_get_forever ();
+ pending_message->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
memcpy (&pending_message->recipient, ¬ify->identity,
sizeof (struct GNUNET_PeerIdentity));
pending_message->msg_size = sizeof (p2p_dv_MESSAGE_Disconnect);
@@ -2207,7 +2207,7 @@
GNUNET_SCHEDULER_add_now (try_core_send, NULL);
/*if (core_transmit_handle == NULL)
- * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI,
GNUNET_YES, default_dv_priority, GNUNET_TIME_relative_get_forever(),
¬ify->identity, sizeof(p2p_dv_MESSAGE_Disconnect), &core_transmit_notify,
NULL); */
+ * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI,
GNUNET_YES, default_dv_priority, GNUNET_TIME_UNIT_FOREVER_REL,
¬ify->identity, sizeof(p2p_dv_MESSAGE_Disconnect), &core_transmit_notify,
NULL); */
return GNUNET_YES;
}
Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -132,7 +132,7 @@
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
"GNS_AUTO_PSEU: Name %s not taken in NS! Adding\n",
gph->new_name);
- new_pkey.expiration = GNUNET_TIME_absolute_get_forever ();
+ new_pkey.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
new_pkey.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
new_pkey.data = &gph->new_zone;
new_pkey.record_type = GNUNET_GNS_RECORD_PKEY;
Modified: gnunet/src/gns/plugin_block_gns.c
===================================================================
--- gnunet/src/gns/plugin_block_gns.c 2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/gns/plugin_block_gns.c 2012-05-27 21:46:41 UTC (rev 21608)
@@ -135,7 +135,7 @@
{
struct GNUNET_NAMESTORE_RecordData rd[rd_count];
unsigned int i;
- struct GNUNET_TIME_Absolute exp = GNUNET_TIME_absolute_get_forever();
+ struct GNUNET_TIME_Absolute exp = GNUNET_TIME_UNIT_FOREVER_ABS;
if (GNUNET_SYSERR == GNUNET_NAMESTORE_records_deserialize (rd_len,
rd_data,
Modified: gnunet/src/gns/test_gns_dht_delegated_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_dht_delegated_lookup.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/gns/test_gns_dht_delegated_lookup.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -211,13 +211,13 @@
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
rd.data_size = sizeof(struct in_addr);
rd.data = web;
rd.record_type = GNUNET_DNSPARSER_TYPE_A;
- sig = GNUNET_NAMESTORE_create_signature(bob_key,
GNUNET_TIME_absolute_get_forever(), TEST_RECORD_NAME,
+ sig = GNUNET_NAMESTORE_create_signature(bob_key,
GNUNET_TIME_UNIT_FOREVER_ABS, TEST_RECORD_NAME,
&rd, 1);
rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd);
nrb = GNUNET_malloc(rd_payload_length + strlen(TEST_RECORD_NAME) + 1
@@ -315,7 +315,7 @@
GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
struct GNUNET_NAMESTORE_RecordData rd;
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &bob_hash;
rd.record_type = GNUNET_GNS_RECORD_PKEY;
Modified: gnunet/src/gns/test_gns_max_queries.c
===================================================================
--- gnunet/src/gns/test_gns_max_queries.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/gns/test_gns_max_queries.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -269,7 +269,7 @@
struct GNUNET_NAMESTORE_RecordData rd;
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
rd.data_size = sizeof(struct in_addr);
rd.data = web;
Modified: gnunet/src/gns/test_gns_pseu_shorten.c
===================================================================
--- gnunet/src/gns/test_gns_pseu_shorten.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/gns/test_gns_pseu_shorten.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -272,13 +272,13 @@
struct GNUNET_CRYPTO_RsaSignature *sig;
struct GNUNET_NAMESTORE_RecordData rd;
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
rd.data_size = strlen(TEST_PSEU_ALICE)+1;
rd.data = TEST_PSEU_ALICE;
rd.record_type = GNUNET_GNS_RECORD_PSEU;
sig = GNUNET_NAMESTORE_create_signature(alice_key,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
"+",
&rd, 1);
rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd);
@@ -352,14 +352,14 @@
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
rd.data_size = sizeof(struct in_addr);
rd.data = web;
rd.record_type = GNUNET_DNSPARSER_TYPE_A;
sig = GNUNET_NAMESTORE_create_signature(alice_key,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_RECORD_NAME,
&rd, 1);
rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd);
@@ -430,13 +430,13 @@
struct GNUNET_CRYPTO_RsaSignature *sig;
struct GNUNET_NAMESTORE_RecordData rd;
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &alice_hash;
rd.record_type = GNUNET_GNS_RECORD_PKEY;
sig = GNUNET_NAMESTORE_create_signature(bob_key,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_AUTHORITY_ALICE,
&rd,
1);
@@ -547,7 +547,7 @@
GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash);
struct GNUNET_NAMESTORE_RecordData rd;
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &bob_hash;
rd.record_type = GNUNET_GNS_RECORD_PKEY;
Modified: gnunet/src/gns/test_gns_simple_delegated_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_simple_delegated_lookup.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/gns/test_gns_simple_delegated_lookup.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -238,7 +238,7 @@
struct GNUNET_NAMESTORE_RecordData rd;
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -258,7 +258,7 @@
rd.data = web;
rd.record_type = GNUNET_DNSPARSER_TYPE_A;
sig = GNUNET_NAMESTORE_create_signature(bob_key,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_RECORD_NAME,
&rd, 1);
Modified: gnunet/src/gns/test_gns_simple_get_authority.c
===================================================================
--- gnunet/src/gns/test_gns_simple_get_authority.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/gns/test_gns_simple_get_authority.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -236,7 +236,7 @@
struct GNUNET_NAMESTORE_RecordData rd;
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -256,13 +256,13 @@
/* put alice into bobs zone */
GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash);
rd.data = &alice_hash;
- sig = GNUNET_NAMESTORE_create_signature(bob_key,
GNUNET_TIME_absolute_get_forever(), TEST_AUTHORITY_ALICE,
+ sig = GNUNET_NAMESTORE_create_signature(bob_key,
GNUNET_TIME_UNIT_FOREVER_ABS, TEST_AUTHORITY_ALICE,
&rd, 1);
GNUNET_NAMESTORE_record_put (namestore_handle,
&bob_pkey,
TEST_AUTHORITY_ALICE,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
1,
&rd,
sig,
@@ -274,13 +274,13 @@
rd.data_size = sizeof(struct in_addr);
rd.data = web;
rd.record_type = GNUNET_DNSPARSER_TYPE_A;
- sig =
GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_absolute_get_forever(),
TEST_RECORD_NAME,
+ sig =
GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_RECORD_NAME,
&rd, 1);
GNUNET_NAMESTORE_record_put (namestore_handle,
&alice_pkey,
TEST_RECORD_NAME,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
1,
&rd,
sig,
@@ -292,13 +292,13 @@
rd.record_type = GNUNET_GNS_RECORD_PSEU;
GNUNET_free(sig);
- sig =
GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_absolute_get_forever(),
"",
+ sig =
GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_UNIT_FOREVER_ABS, "",
&rd, 1);
GNUNET_NAMESTORE_record_put (namestore_handle,
&alice_pkey,
"",
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
1,
&rd,
sig,
Modified: gnunet/src/gns/test_gns_simple_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_simple_lookup.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/gns/test_gns_simple_lookup.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -220,7 +220,7 @@
struct GNUNET_NAMESTORE_RecordData rd;
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
rd.data_size = sizeof(struct in_addr);
rd.data = web;
Modified: gnunet/src/gns/test_gns_simple_mx_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_simple_mx_lookup.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/gns/test_gns_simple_mx_lookup.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -257,7 +257,7 @@
struct in_addr *mail = GNUNET_malloc(sizeof(struct in_addr));
char *mx_record;
uint16_t mx_preference = 1;
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
GNUNET_assert(1 == inet_pton (AF_INET, ip, mail));
GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -277,7 +277,7 @@
rd.data = mail;
rd.record_type = GNUNET_DNSPARSER_TYPE_A;
sig = GNUNET_NAMESTORE_create_signature(bob_key,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_RECORD_NAME,
&rd, 1);
@@ -298,7 +298,7 @@
rd.data = mx_record;
rd.record_type = GNUNET_GNS_RECORD_MX;
sig = GNUNET_NAMESTORE_create_signature(bob_key,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
"+",
&rd, 1);
GNUNET_NAMESTORE_record_put (namestore_handle,
Modified: gnunet/src/gns/test_gns_simple_shorten.c
===================================================================
--- gnunet/src/gns/test_gns_simple_shorten.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/gns/test_gns_simple_shorten.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -236,7 +236,7 @@
struct GNUNET_NAMESTORE_RecordData rd;
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -257,14 +257,14 @@
GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash);
rd.data = &alice_hash;
sig = GNUNET_NAMESTORE_create_signature(bob_key,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_AUTHORITY_ALICE,
&rd, 1);
GNUNET_NAMESTORE_record_put (namestore_handle,
&bob_pkey,
TEST_AUTHORITY_ALICE,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
1,
&rd,
sig,
@@ -277,14 +277,14 @@
rd.data = web;
rd.record_type = GNUNET_DNSPARSER_TYPE_A;
sig = GNUNET_NAMESTORE_create_signature(alice_key,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_RECORD_NAME,
&rd, 1);
GNUNET_NAMESTORE_record_put (namestore_handle,
&alice_pkey,
TEST_RECORD_NAME,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
1,
&rd,
sig,
Modified: gnunet/src/gns/test_gns_simple_zkey_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_simple_zkey_lookup.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/gns/test_gns_simple_zkey_lookup.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -241,7 +241,7 @@
struct GNUNET_NAMESTORE_RecordData rd;
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
- rd.expiration = GNUNET_TIME_absolute_get_forever ();
+ rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -261,7 +261,7 @@
rd.data = web;
rd.record_type = GNUNET_DNSPARSER_TYPE_A;
sig = GNUNET_NAMESTORE_create_signature(bob_key,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_RECORD_NAME,
&rd, 1);
Modified: gnunet/src/hostlist/hostlist-client.c
===================================================================
--- gnunet/src/hostlist/hostlist-client.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/hostlist/hostlist-client.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -1194,7 +1194,6 @@
hostlist->hostlist_uri = (const char *) &hostlist[1];
memcpy (&hostlist[1], uri, uri_size);
hostlist->time_creation = GNUNET_TIME_absolute_get ();
- hostlist->time_last_usage = GNUNET_TIME_absolute_get_zero ();
hostlist->quality = HOSTLIST_INITIAL;
hostlist_to_test = hostlist;
Modified: gnunet/src/include/gnunet_time_lib.h
===================================================================
--- gnunet/src/include/gnunet_time_lib.h 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/include/gnunet_time_lib.h 2012-05-27 21:46:41 UTC (rev
21608)
@@ -90,32 +90,32 @@
/**
* Relative time zero.
*/
-#define GNUNET_TIME_UNIT_ZERO GNUNET_TIME_relative_get_zero()
+#define GNUNET_TIME_UNIT_ZERO GNUNET_TIME_relative_get_zero_()
/**
* Absolute time zero.
*/
-#define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero()
+#define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero_()
/**
* One millisecond, our basic time unit.
*/
-#define GNUNET_TIME_UNIT_MILLISECONDS GNUNET_TIME_relative_get_unit()
+#define GNUNET_TIME_UNIT_MILLISECONDS GNUNET_TIME_relative_get_unit_()
/**
* One second.
*/
-#define GNUNET_TIME_UNIT_SECONDS
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 1000)
+#define GNUNET_TIME_UNIT_SECONDS GNUNET_TIME_relative_get_second_()
/**
* One minute.
*/
-#define GNUNET_TIME_UNIT_MINUTES
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60)
+#define GNUNET_TIME_UNIT_MINUTES GNUNET_TIME_relative_get_minute_()
/**
* One hour.
*/
-#define GNUNET_TIME_UNIT_HOURS
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 60)
+#define GNUNET_TIME_UNIT_HOURS GNUNET_TIME_relative_get_hour_()
/**
* One day.
@@ -141,44 +141,71 @@
* Constant used to specify "forever". This constant
* will be treated specially in all time operations.
*/
-#define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever ()
+#define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever_ ()
/**
* Constant used to specify "forever". This constant
* will be treated specially in all time operations.
*/
-#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever ()
+#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ ()
+
/**
* Return relative time of 0ms.
*/
struct GNUNET_TIME_Relative
-GNUNET_TIME_relative_get_zero (void);
+GNUNET_TIME_relative_get_zero_ (void);
+
/**
* Return absolute time of 0ms.
*/
struct GNUNET_TIME_Absolute
-GNUNET_TIME_absolute_get_zero (void);
+GNUNET_TIME_absolute_get_zero_ (void);
+
/**
* Return relative time of 1ms.
*/
struct GNUNET_TIME_Relative
-GNUNET_TIME_relative_get_unit (void);
+GNUNET_TIME_relative_get_unit_ (void);
+
/**
+ * Return relative time of 1s.
+ */
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_get_second_ (void);
+
+
+/**
+ * Return relative time of 1 minute.
+ */
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_get_minute_ (void);
+
+
+/**
+ * Return relative time of 1 hour.
+ */
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_get_hour_ (void);
+
+
+/**
* Return "forever".
*/
struct GNUNET_TIME_Relative
-GNUNET_TIME_relative_get_forever (void);
+GNUNET_TIME_relative_get_forever_ (void);
+
/**
* Return "forever".
*/
struct GNUNET_TIME_Absolute
-GNUNET_TIME_absolute_get_forever (void);
+GNUNET_TIME_absolute_get_forever_ (void);
+
/**
* Get the current time.
*
@@ -187,6 +214,7 @@
struct GNUNET_TIME_Absolute
GNUNET_TIME_absolute_get (void);
+
/**
* Convert relative time to an absolute time in the
* future.
@@ -197,6 +225,7 @@
struct GNUNET_TIME_Absolute
GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel);
+
/**
* Return the minimum of two relative time values.
*
@@ -209,6 +238,7 @@
struct GNUNET_TIME_Relative t2);
+
/**
* Return the maximum of two relative time values.
*
@@ -220,6 +250,7 @@
GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1,
struct GNUNET_TIME_Relative t2);
+
/**
* Return the minimum of two absolute time values.
*
@@ -231,6 +262,7 @@
GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1,
struct GNUNET_TIME_Absolute t2);
+
/**
* Return the maximum of two absolute time values.
*
@@ -242,6 +274,7 @@
GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1,
struct GNUNET_TIME_Absolute t2);
+
/**
* Given a timestamp in the future, how much time
* remains until then?
@@ -281,6 +314,7 @@
GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start,
struct GNUNET_TIME_Absolute end);
+
/**
* Get the duration of an operation as the
* difference of the current time and the given start time "hence".
@@ -317,6 +351,7 @@
GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start,
struct GNUNET_TIME_Relative duration);
+
/**
* Multiply relative time by a given factor.
*
@@ -328,6 +363,7 @@
GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
unsigned int factor);
+
/**
* Divide relative time by a given factor.
*
@@ -339,6 +375,7 @@
GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
unsigned int factor);
+
/**
* Add relative times together.
*
@@ -350,6 +387,7 @@
GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1,
struct GNUNET_TIME_Relative a2);
+
/**
* Subtract relative timestamp from the other.
*
@@ -371,6 +409,7 @@
struct GNUNET_TIME_RelativeNBO
GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a);
+
/**
* Convert relative time from network byte order.
*
@@ -380,6 +419,7 @@
struct GNUNET_TIME_Relative
GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a);
+
/**
* Convert relative time to network byte order.
*
@@ -389,6 +429,7 @@
struct GNUNET_TIME_AbsoluteNBO
GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a);
+
/**
* Convert relative time from network byte order.
*
@@ -398,6 +439,7 @@
struct GNUNET_TIME_Absolute
GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a);
+
/**
* Convert a relative time to a string.
* NOT reentrant!
@@ -409,6 +451,7 @@
const char *
GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time);
+
/**
* Set the timestamp offset for this instance.
*
@@ -417,6 +460,7 @@
void
GNUNET_TIME_set_offset (long long offset);
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
Modified: gnunet/src/integration-tests/connection_watchdog.c
===================================================================
--- gnunet/src/integration-tests/connection_watchdog.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/integration-tests/connection_watchdog.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -461,14 +461,14 @@
if ((GNUNET_YES == pc->transport_connected) && (NULL == pc->th_ping))
pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, &pc->id,
sizeof (struct PING), UINT_MAX,
- GNUNET_TIME_relative_get_forever(), &send_transport_ping_cb, pc);
+ GNUNET_TIME_UNIT_FOREVER_REL, &send_transport_ping_cb, pc);
else
GNUNET_break(0);
if ((GNUNET_YES == pc->core_connected) && (NULL == pc->ch_ping))
pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch,
GNUNET_NO, UINT_MAX,
-
GNUNET_TIME_relative_get_forever(),
+
GNUNET_TIME_UNIT_FOREVER_REL,
&pc->id,
sizeof (struct PING),
send_core_ping_cb, pc);
@@ -580,7 +580,7 @@
if (GNUNET_YES == ping)
{
if (NULL == pc->th_ping)
- pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, peer,
sizeof (struct PING), UINT_MAX, GNUNET_TIME_relative_get_forever(),
&send_transport_ping_cb, pc);
+ pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, peer,
sizeof (struct PING), UINT_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
&send_transport_ping_cb, pc);
else
GNUNET_break(0);
}
@@ -605,7 +605,7 @@
if (NULL == pc->ch_ping)
pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch,
GNUNET_NO, UINT_MAX,
-
GNUNET_TIME_relative_get_forever(),
+
GNUNET_TIME_UNIT_FOREVER_REL,
peer,
sizeof (struct PING),
send_core_ping_cb, pc);
@@ -842,7 +842,7 @@
if (NULL == pc->th_pong)
pc->th_pong = GNUNET_TRANSPORT_notify_transmit_ready(th,
peer, sizeof (struct PONG),
- UINT_MAX, GNUNET_TIME_relative_get_forever(),
+ UINT_MAX,
GNUNET_TIME_UNIT_FOREVER_REL,
&send_transport_pong_cb, pc);
else
GNUNET_break (0);
@@ -893,7 +893,7 @@
if (NULL == pc->ch_pong)
pc->ch_pong = GNUNET_CORE_notify_transmit_ready(ch,
GNUNET_NO, UINT_MAX,
-
GNUNET_TIME_relative_get_forever(),
+
GNUNET_TIME_UNIT_FOREVER_REL,
peer,
sizeof (struct PONG),
send_core_pong_cb, pc);
Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/mesh/gnunet-service-mesh.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -694,7 +694,7 @@
GNUNET_BLOCK_TYPE_TEST, /* Block type */
sizeof (my_full_id), /* Size of the data */
(char *) &my_full_id, /* Data itself */
- GNUNET_TIME_absolute_get_forever (), /* Data expiration */
+ GNUNET_TIME_UNIT_FOREVER_ABS, /* Data expiration */
GNUNET_TIME_UNIT_FOREVER_REL, /* Retry time */
NULL, /* Continuation */
NULL); /* Continuation closure */
Modified: gnunet/src/mesh/test_mesh_2dtorus.c
===================================================================
--- gnunet/src/mesh/test_mesh_2dtorus.c 2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/mesh/test_mesh_2dtorus.c 2012-05-27 21:46:41 UTC (rev 21608)
@@ -316,7 +316,7 @@
hosts);
GNUNET_assert (pg != NULL);
shutdown_handle =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (),
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&shutdown_task, NULL);
}
Modified: gnunet/src/mesh/test_mesh_small.c
===================================================================
--- gnunet/src/mesh/test_mesh_small.c 2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/mesh/test_mesh_small.c 2012-05-27 21:46:41 UTC (rev 21608)
@@ -901,7 +901,7 @@
hosts);
GNUNET_assert (pg != NULL);
shutdown_handle =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (),
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&shutdown_task, NULL);
}
Modified: gnunet/src/namestore/gnunet-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-namestore.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/namestore/gnunet-namestore.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -356,7 +356,7 @@
{
if (0 == strcmp (expirationstring, "never"))
{
- etime = GNUNET_TIME_relative_get_forever();
+ etime = GNUNET_TIME_UNIT_FOREVER_REL;
}
else if (GNUNET_OK !=
GNUNET_STRINGS_fancy_time_to_relative (expirationstring,
Modified: gnunet/src/namestore/gnunet-service-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-service-namestore.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/namestore/gnunet-service-namestore.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -226,15 +226,13 @@
struct GNUNET_TIME_Absolute
get_block_expiration_time (unsigned int rd_count, const struct
GNUNET_NAMESTORE_RecordData *rd)
{
- int c;
- struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get_forever();
+ unsigned int c;
+ struct GNUNET_TIME_Absolute expire = GNUNET_TIME_UNIT_FOREVER_ABS;
+
if (NULL == rd)
- return GNUNET_TIME_absolute_get_zero();
- for (c = 0; c < rd_count; c++)
- {
- if (rd[c].expiration.abs_value < expire.abs_value)
- expire = rd[c].expiration;
- }
+ return GNUNET_TIME_UNIT_ZERO_ABS;
+ for (c = 0; c < rd_count; c++)
+ expire = GNUNET_TIME_absolute_min (rd[c].expiration, expire);
return expire;
}
@@ -1611,7 +1609,7 @@
zir_msg.gns_header.header.type = htons
(GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE);
zir_msg.gns_header.header.size = htons (sizeof (struct
ZoneIterationResponseMessage));
zir_msg.gns_header.r_id = htonl(zi->request_id);
- zir_msg.expire =
GNUNET_TIME_absolute_hton(GNUNET_TIME_absolute_get_zero());
+ zir_msg.expire = GNUNET_TIME_absolute_hton(GNUNET_TIME_UNIT_ZERO_ABS);
zir_msg.name_len = htons (0);
zir_msg.reserved = htons (0);
zir_msg.rd_count = htons (0);
Modified: gnunet/src/namestore/namestore_api.c
===================================================================
--- gnunet/src/namestore/namestore_api.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/namestore/namestore_api.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -463,13 +463,13 @@
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "An error occured during zone to name
operation\n");
if (qe->proc != NULL)
- qe->proc (qe->proc_cls, NULL, GNUNET_TIME_absolute_get_zero(), NULL, 0,
NULL, NULL);
+ qe->proc (qe->proc_cls, NULL, GNUNET_TIME_UNIT_ZERO_ABS, NULL, 0, NULL,
NULL);
}
else if (res == GNUNET_NO)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Namestore has no result for zone
to name mapping \n");
if (qe->proc != NULL)
- qe->proc (qe->proc_cls, NULL, GNUNET_TIME_absolute_get_zero(), NULL,
0, NULL, NULL);
+ qe->proc (qe->proc_cls, NULL, GNUNET_TIME_UNIT_ZERO_ABS, NULL, 0,
NULL, NULL);
}
else if (res == GNUNET_YES)
{
@@ -606,7 +606,7 @@
GNUNET_CONTAINER_DLL_remove(ze->h->z_head, ze->h->z_tail, ze);
if (ze->proc != NULL)
- ze->proc(ze->proc_cls, NULL, GNUNET_TIME_absolute_get_zero (), NULL , 0,
NULL, NULL);
+ ze->proc(ze->proc_cls, NULL, GNUNET_TIME_UNIT_ZERO_ABS, NULL , 0, NULL,
NULL);
GNUNET_free (ze);
return;
@@ -1197,7 +1197,7 @@
msg->rd_count = htons (1);
msg->rd_len = htons (rd_ser_len);
msg->pkey_len = htons (key_len);
- msg->expire = GNUNET_TIME_absolute_hton(GNUNET_TIME_absolute_get_forever());
+ msg->expire = GNUNET_TIME_absolute_hton(GNUNET_TIME_UNIT_FOREVER_ABS);
memcpy (pkey_tmp, pkey_enc, key_len);
memcpy (name_tmp, name, name_len);
memcpy (rd_tmp, rd_ser, rd_ser_len);
Modified: gnunet/src/namestore/test_namestore_api.c
===================================================================
--- gnunet/src/namestore/test_namestore_api.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/namestore/test_namestore_api.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -197,7 +197,7 @@
GNUNET_break (NULL != nsh);
GNUNET_NAMESTORE_record_put (nsh, &pubkey, name,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
1, &rd, &signature, put_cont, name);
GNUNET_free ((void *)rd.data);
Modified: gnunet/src/namestore/test_namestore_api_create.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_create.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/namestore/test_namestore_api_create.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -301,7 +301,7 @@
/* create a second record */
s_second_record = GNUNET_malloc(sizeof (struct
GNUNET_NAMESTORE_RecordData) + TEST_CREATE_RECORD_DATALEN);
- s_second_record->expiration = GNUNET_TIME_absolute_get_forever();
+ s_second_record->expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
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];
Modified: gnunet/src/namestore/test_namestore_api_create_update.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_create_update.c 2012-05-27
21:11:29 UTC (rev 21607)
+++ gnunet/src/namestore/test_namestore_api_create_update.c 2012-05-27
21:46:41 UTC (rev 21608)
@@ -294,7 +294,7 @@
/* create a second record */
s_second_record = GNUNET_malloc(sizeof (struct
GNUNET_NAMESTORE_RecordData) + TEST_CREATE_RECORD_DATALEN);
- s_second_record->expiration = GNUNET_TIME_absolute_get_forever();
+ s_second_record->expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
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];
@@ -406,11 +406,11 @@
for (c = 0; c < count; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get_zero();
- 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 = GNUNET_TIME_UNIT_ZERO_ABS;
+ 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;
Modified: gnunet/src/namestore/test_namestore_api_lookup.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_lookup.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/namestore/test_namestore_api_lookup.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -284,7 +284,7 @@
GNUNET_break (s_name != NULL);
GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS
RECORDS, s_rd, s_signature, put_cont, s_name);
Modified: gnunet/src/namestore/test_namestore_api_lookup_specific_type.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_lookup_specific_type.c
2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/namestore/test_namestore_api_lookup_specific_type.c
2012-05-27 21:46:41 UTC (rev 21608)
@@ -279,11 +279,11 @@
for (c = 0; c < RECORDS-1; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get_zero();
- 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_UNIT_ZERO_ABS;
+ 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();
@@ -358,7 +358,7 @@
GNUNET_break (s_name != NULL);
GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
RECORDS, s_rd, s_signature, put_cont, s_name);
Modified: gnunet/src/namestore/test_namestore_api_put.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_put.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/namestore/test_namestore_api_put.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -203,7 +203,7 @@
GNUNET_break (s_name != NULL);
GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
RECORDS, s_rd, signature, put_cont, s_name);
GNUNET_free (signature);
Modified: gnunet/src/namestore/test_namestore_api_remove.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_remove.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/namestore/test_namestore_api_remove.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -251,11 +251,11 @@
for (c = 1; c < RECORDS; c++)
{
- rd[c].expiration = GNUNET_TIME_absolute_get_zero();
- 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 = GNUNET_TIME_UNIT_ZERO_ABS;
+ 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;
@@ -325,7 +325,7 @@
GNUNET_break (s_name != NULL);
GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
RECORDS, s_rd, s_signature, put_cont, s_name);
Modified: gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
2012-05-27 21:46:41 UTC (rev 21608)
@@ -259,7 +259,7 @@
GNUNET_break (s_name != NULL);
GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
- GNUNET_TIME_absolute_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
RECORDS, s_rd, s_signature, put_cont, s_name);
Modified: gnunet/src/namestore/test_namestore_api_zone_iteration.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration.c 2012-05-27
21:11:29 UTC (rev 21607)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration.c 2012-05-27
21:46:41 UTC (rev 21608)
@@ -452,7 +452,7 @@
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);
- GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3,
GNUNET_TIME_absolute_get_forever(), 1, s_rd_3, sig_3, &put_cont, NULL);
+ GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3,
GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
}
static int
Modified: gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
2012-05-27 21:46:41 UTC (rev 21608)
@@ -414,7 +414,7 @@
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);
- GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3,
GNUNET_TIME_absolute_get_forever(), 1, s_rd_3, sig_3, &put_cont, NULL);
+ GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3,
GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
}
static int
Modified: gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
2012-05-27 21:46:41 UTC (rev 21608)
@@ -464,7 +464,7 @@
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);
- GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3,
GNUNET_TIME_absolute_get_forever(), 1, s_rd_3, sig_3, &put_cont, NULL);
+ GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3,
GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
}
static int
Modified: gnunet/src/namestore/test_namestore_record_serialization.c
===================================================================
--- gnunet/src/namestore/test_namestore_record_serialization.c 2012-05-27
21:11:29 UTC (rev 21607)
+++ gnunet/src/namestore/test_namestore_record_serialization.c 2012-05-27
21:46:41 UTC (rev 21608)
@@ -78,7 +78,7 @@
GNUNET_break (0);
res = 1;
}
- if (GNUNET_TIME_absolute_get_difference(src[c].expiration,
dst[c].expiration).rel_value != GNUNET_TIME_relative_get_zero().rel_value)
+ if (0 != GNUNET_TIME_absolute_get_difference(src[c].expiration,
dst[c].expiration).rel_value)
{
GNUNET_break (0);
res = 1;
Modified: gnunet/src/nse/gnunet-nse-profiler.c
===================================================================
--- gnunet/src/nse/gnunet-nse-profiler.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/nse/gnunet-nse-profiler.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -896,7 +896,7 @@
&connect_cb, &my_cb, NULL, hosts);
GNUNET_assert (pg != NULL);
shutdown_handle =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (),
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&shutdown_task, NULL);
}
Modified: gnunet/src/nse/nse_profiler_test.conf
===================================================================
--- gnunet/src/nse/nse_profiler_test.conf 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/nse/nse_profiler_test.conf 2012-05-27 21:46:41 UTC (rev
21608)
@@ -104,7 +104,7 @@
AUTOSTART = NO
[testing]
-NUM_PEERS = 4000
+NUM_PEERS = 2000
WEAKRANDOM = YES
TOPOLOGY = NONE
#CONNECT_TOPOLOGY = SMALL_WORLD_RING
@@ -122,7 +122,7 @@
MAX_CONCURRENT_SSH = 20
USE_PROGRESSBARS = YES
PEERGROUP_TIMEOUT = 1000 s
-TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers_initial
+TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers_initial
MAX_OUTSTANDING_CONNECTIONS = 100
#SINGLE_PEERINFO_PER_HOST = YES
#NUM_PEERINFO_PER_HOST = 10
@@ -132,20 +132,20 @@
#SKEW_VARIANCE = 30000
[nse-profiler]
-OUTPUT_FILE = nse_output_4000_peers.dat
-TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers
-DATA_OUTPUT_FILE = nse_stats_4000_peers
+OUTPUT_FILE = nse_output_2000_peers.dat
+TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers
+DATA_OUTPUT_FILE = nse_stats_2000_peers
ROUND0 = 1000
-#ROUND1 = 4000
-ROUND2 = 4000
-ROUND3 = 4000
-ROUND4 = 4000
-ROUND5 = 4000
-ROUND6 = 4000
-ROUND7 = 4000
-ROUND8 = 4000
-ROUND9 = 4000
-ROUND10 = 4000
+#ROUND1 = 2000
+ROUND2 = 2000
+ROUND3 = 2000
+ROUND4 = 2000
+ROUND5 = 2000
+ROUND6 = 2000
+ROUND7 = 2000
+ROUND8 = 2000
+ROUND9 = 2000
+ROUND10 = 2000
ROUND11 = 1000
ROUND12 = 1000
ROUND13 = 1000
Modified: gnunet/src/testing/test_testing_2dtorus.c
===================================================================
--- gnunet/src/testing/test_testing_2dtorus.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/testing/test_testing_2dtorus.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -317,7 +317,7 @@
hosts);
GNUNET_assert (pg != NULL);
shutdown_handle =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (),
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&shutdown_task, NULL);
}
Modified: gnunet/src/testing/testing_group.c
===================================================================
--- gnunet/src/testing/testing_group.c 2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/testing/testing_group.c 2012-05-27 21:46:41 UTC (rev 21608)
@@ -4968,7 +4968,7 @@
core_context->stats_get_handle =
GNUNET_STATISTICS_get (core_context->stats_handle, NULL, NULL,
- GNUNET_TIME_relative_get_forever (),
+ GNUNET_TIME_UNIT_FOREVER_REL,
&internal_stats_cont, &internal_stats_callback,
core_context);
if (core_context->stats_get_handle == NULL)
Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/transport/plugin_transport_http.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -620,8 +620,6 @@
s->addr = GNUNET_malloc (addrlen);
memcpy (s->addr, addr, addrlen);
s->addrlen = addrlen;
- s->next = NULL;
- s->next_receive = GNUNET_TIME_absolute_get_zero ();
s->ats_address_network_type = htonl (GNUNET_ATS_NET_UNSPECIFIED);
start_session_timeout(s);
return s;
Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2012-05-27 21:11:29 UTC
(rev 21607)
+++ gnunet/src/transport/plugin_transport_http_server.c 2012-05-27 21:46:41 UTC
(rev 21608)
@@ -542,7 +542,7 @@
s->ats_address_network_type = ats.value;
s->inbound = GNUNET_YES;
- s->next_receive = GNUNET_TIME_absolute_get_zero ();
+ s->next_receive = GNUNET_TIME_UNIT_ZERO_ABS;
s->tag = tag;
if (0 == strcmp (MHD_HTTP_METHOD_PUT, method))
s->server_recv = s;
Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2012-05-27 21:11:29 UTC (rev
21607)
+++ gnunet/src/transport/plugin_transport_udp.c 2012-05-27 21:46:41 UTC (rev
21608)
@@ -846,16 +846,11 @@
GNUNET_break_op (0);
return NULL;
}
-
s->addrlen = len;
s->target = *target;
s->sock_addr = (const struct sockaddr *) &s[1];
- s->flow_delay_for_other_peer = GNUNET_TIME_relative_get_zero();
- s->flow_delay_from_other_peer = GNUNET_TIME_absolute_get_zero();
s->last_expected_delay = GNUNET_TIME_UNIT_SECONDS;
-
start_session_timeout(s);
-
return s;
}
@@ -1521,14 +1516,10 @@
sockaddr_in6)),
delay);
udpw = GNUNET_malloc (sizeof (struct UDPMessageWrapper) + msize);
- udpw->cont = NULL;
- udpw->cont_cls = NULL;
- udpw->frag_ctx = NULL;
udpw->msg_size = msize;
udpw->session = s;
- udpw->timeout = GNUNET_TIME_absolute_get_forever();
+ udpw->timeout = GNUNET_TIME_UNIT_FOREVER_ABS;
udpw->udp = (char *)&udpw[1];
-
udp_ack = (struct UDP_ACK_Message *) udpw->udp;
udp_ack->header.size = htons ((uint16_t) msize);
udp_ack->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_ACK);
Modified: gnunet/src/util/test_time.c
===================================================================
--- gnunet/src/util/test_time.c 2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/util/test_time.c 2012-05-27 21:46:41 UTC (rev 21608)
@@ -43,9 +43,9 @@
struct GNUNET_TIME_RelativeNBO reln;
unsigned int i;
- forever = GNUNET_TIME_absolute_get_forever ();
- relForever = GNUNET_TIME_relative_get_forever ();
- relUnit = GNUNET_TIME_relative_get_unit ();
+ forever = GNUNET_TIME_UNIT_FOREVER_ABS;
+ relForever = GNUNET_TIME_UNIT_FOREVER_REL;
+ relUnit = GNUNET_TIME_UNIT_MILLISECONDS;
zero.abs_value = 0;
last = now = GNUNET_TIME_absolute_get ();
@@ -62,7 +62,7 @@
GNUNET_assert (rel.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value);
/*check zero */
rel.rel_value = (UINT64_MAX) - 1024;
- GNUNET_assert (GNUNET_TIME_relative_get_zero ().rel_value ==
+ GNUNET_assert (GNUNET_TIME_UNIT_ZERO.rel_value ==
GNUNET_TIME_relative_multiply (rel, 0).rel_value);
/* test infinity-check for relative to absolute */
@@ -77,7 +77,7 @@
GNUNET_TIME_relative_to_absolute (rel).abs_value);
/*check forever */
rel.rel_value = UINT64_MAX;
- GNUNET_assert (GNUNET_TIME_absolute_get_forever ().abs_value ==
+ GNUNET_assert (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value ==
GNUNET_TIME_relative_to_absolute (rel).abs_value);
/* check overflow for r2a */
rel.rel_value = (UINT64_MAX) - 1024;
@@ -125,8 +125,8 @@
rel = GNUNET_TIME_absolute_get_remaining (future);
GNUNET_assert (rel.rel_value > 0);
GNUNET_assert (rel.rel_value <= 1000000);
- forever = GNUNET_TIME_absolute_get_forever ();
- GNUNET_assert (GNUNET_TIME_relative_get_forever ().rel_value ==
+ forever = GNUNET_TIME_UNIT_FOREVER_ABS;
+ GNUNET_assert (GNUNET_TIME_UNIT_FOREVER_REL.rel_value ==
GNUNET_TIME_absolute_get_remaining (forever).rel_value);
/* check endianess */
@@ -175,13 +175,13 @@
/* check Return absolute time of 0ms */
- zero = GNUNET_TIME_absolute_get_zero ();
+ zero = GNUNET_TIME_UNIT_ZERO_ABS;
/* check GNUNET_TIME_calculate_eta */
last.abs_value = GNUNET_TIME_absolute_get ().abs_value - 1024;
- forever = GNUNET_TIME_absolute_get_forever ();
+ forever = GNUNET_TIME_UNIT_FOREVER_ABS;
forever.abs_value = forever.abs_value - 1024;
- GNUNET_assert (GNUNET_TIME_absolute_get_zero ().abs_value ==
+ GNUNET_assert (GNUNET_TIME_UNIT_ZERO_ABS.abs_value ==
GNUNET_TIME_calculate_eta (forever, 50000, 100000).rel_value);
/* check zero */
GNUNET_log_skip (1, GNUNET_NO);
@@ -199,11 +199,11 @@
GNUNET_assert (1024 ==
GNUNET_TIME_relative_subtract (relForever, rel).rel_value);
/*check zero */
- GNUNET_assert (GNUNET_TIME_relative_get_zero ().rel_value ==
+ GNUNET_assert (GNUNET_TIME_UNIT_ZERO.rel_value ==
GNUNET_TIME_relative_subtract (rel, relForever).rel_value);
/*check forever */
rel.rel_value = UINT64_MAX;
- GNUNET_assert (GNUNET_TIME_relative_get_forever ().rel_value ==
+ GNUNET_assert (GNUNET_TIME_UNIT_FOREVER_REL.rel_value ==
GNUNET_TIME_relative_subtract (rel, relForever).rel_value);
/*check GNUNET_TIME_relative_min */
Modified: gnunet/src/util/time.c
===================================================================
--- gnunet/src/util/time.c 2012-05-27 21:11:29 UTC (rev 21607)
+++ gnunet/src/util/time.c 2012-05-27 21:46:41 UTC (rev 21608)
@@ -68,7 +68,7 @@
* Return relative time of 0ms.
*/
struct GNUNET_TIME_Relative
-GNUNET_TIME_relative_get_zero ()
+GNUNET_TIME_relative_get_zero_ ()
{
static struct GNUNET_TIME_Relative zero;
@@ -80,28 +80,63 @@
* Return absolute time of 0ms.
*/
struct GNUNET_TIME_Absolute
-GNUNET_TIME_absolute_get_zero ()
+GNUNET_TIME_absolute_get_zero_ ()
{
static struct GNUNET_TIME_Absolute zero;
return zero;
}
+
/**
* Return relative time of 1ms.
*/
struct GNUNET_TIME_Relative
-GNUNET_TIME_relative_get_unit ()
+GNUNET_TIME_relative_get_unit_ ()
{
static struct GNUNET_TIME_Relative one = { 1 };
return one;
}
+
/**
+ * Return relative time of 1s.
+ */
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_get_second_ ()
+{
+ static struct GNUNET_TIME_Relative one = { 1000 };
+ return one;
+}
+
+
+/**
+ * Return relative time of 1 minute.
+ */
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_get_minute_ ()
+{
+ static struct GNUNET_TIME_Relative one = { 60 * 1000 };
+ return one;
+}
+
+
+/**
+ * Return relative time of 1 hour.
+ */
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_get_hour_ ()
+{
+ static struct GNUNET_TIME_Relative one = { 60 * 60 * 1000 };
+ return one;
+}
+
+
+/**
* Return "forever".
*/
struct GNUNET_TIME_Relative
-GNUNET_TIME_relative_get_forever ()
+GNUNET_TIME_relative_get_forever_ ()
{
static struct GNUNET_TIME_Relative forever = { UINT64_MAX };
return forever;
@@ -111,7 +146,7 @@
* Return "forever".
*/
struct GNUNET_TIME_Absolute
-GNUNET_TIME_absolute_get_forever ()
+GNUNET_TIME_absolute_get_forever_ ()
{
static struct GNUNET_TIME_Absolute forever = { UINT64_MAX };
return forever;
@@ -129,13 +164,13 @@
struct GNUNET_TIME_Absolute ret;
if (rel.rel_value == UINT64_MAX)
- return GNUNET_TIME_absolute_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_ABS;
struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
if (rel.rel_value + now.abs_value < rel.rel_value)
{
GNUNET_break (0); /* overflow... */
- return GNUNET_TIME_absolute_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_ABS;
}
ret.abs_value = rel.rel_value + now.abs_value;
return ret;
@@ -215,11 +250,11 @@
struct GNUNET_TIME_Relative ret;
if (future.abs_value == UINT64_MAX)
- return GNUNET_TIME_relative_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_REL;
struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
if (now.abs_value > future.abs_value)
- return GNUNET_TIME_relative_get_zero ();
+ return GNUNET_TIME_UNIT_ZERO;
ret.rel_value = future.abs_value - now.abs_value;
return ret;
}
@@ -238,9 +273,9 @@
struct GNUNET_TIME_Relative ret;
if (end.abs_value == UINT64_MAX)
- return GNUNET_TIME_relative_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_REL;
if (end.abs_value < start.abs_value)
- return GNUNET_TIME_relative_get_zero ();
+ return GNUNET_TIME_UNIT_ZERO;
ret.rel_value = end.abs_value - start.abs_value;
return ret;
}
@@ -260,7 +295,7 @@
now = GNUNET_TIME_absolute_get ();
GNUNET_assert (whence.abs_value != UINT64_MAX);
if (whence.abs_value > now.abs_value)
- return GNUNET_TIME_relative_get_zero ();
+ return GNUNET_TIME_UNIT_ZERO;
ret.rel_value = now.abs_value - whence.abs_value;
return ret;
}
@@ -279,11 +314,11 @@
struct GNUNET_TIME_Absolute ret;
if ((start.abs_value == UINT64_MAX) || (duration.rel_value == UINT64_MAX))
- return GNUNET_TIME_absolute_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_ABS;
if (start.abs_value + duration.rel_value < start.abs_value)
{
GNUNET_break (0);
- return GNUNET_TIME_absolute_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_ABS;
}
ret.abs_value = start.abs_value + duration.rel_value;
return ret;
@@ -325,12 +360,12 @@
struct GNUNET_TIME_Relative ret;
if (factor == 0)
- return GNUNET_TIME_relative_get_zero ();
+ return GNUNET_TIME_UNIT_ZERO;
ret.rel_value = rel.rel_value * (unsigned long long) factor;
if (ret.rel_value / factor != rel.rel_value)
{
GNUNET_break (0);
- return GNUNET_TIME_relative_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_REL;
}
return ret;
}
@@ -401,11 +436,11 @@
struct GNUNET_TIME_Relative ret;
if ((a1.rel_value == UINT64_MAX) || (a2.rel_value == UINT64_MAX))
- return GNUNET_TIME_relative_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_REL;
if (a1.rel_value + a2.rel_value < a1.rel_value)
{
GNUNET_break (0);
- return GNUNET_TIME_relative_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_REL;
}
ret.rel_value = a1.rel_value + a2.rel_value;
return ret;
@@ -426,9 +461,9 @@
struct GNUNET_TIME_Relative ret;
if (a2.rel_value >= a1.rel_value)
- return GNUNET_TIME_relative_get_zero ();
+ return GNUNET_TIME_UNIT_ZERO;
if (a1.rel_value == UINT64_MAX)
- return GNUNET_TIME_relative_get_forever ();
+ return GNUNET_TIME_UNIT_FOREVER_REL;
ret.rel_value = a1.rel_value - a2.rel_value;
return ret;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r21608 - in gnunet/src: ats core dns dv gns hostlist include integration-tests mesh namestore nse testing transport util,
gnunet <=