aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-27 21:46:41 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-27 21:46:41 +0000
commit46a63dc665f31fa7d42639ab6adabbdb1af239c8 (patch)
tree6c3e58a7f57d6d3ee44aa6cd2808b5458d75de4b
parent4848a679018f9e864cd277345191ad8f1000b5ff (diff)
downloadgnunet-46a63dc665f31fa7d42639ab6adabbdb1af239c8.tar.gz
gnunet-46a63dc665f31fa7d42639ab6adabbdb1af239c8.zip
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
-rw-r--r--src/ats/gnunet-service-ats_addresses.c9
-rw-r--r--src/ats/gnunet-service-ats_addresses_mlp.c6
-rw-r--r--src/ats/test_ats_api_update_address.c2
-rw-r--r--src/core/core_api_is_connected.c2
-rw-r--r--src/core/core_api_iterate_peers.c4
-rw-r--r--src/dns/plugin_block_dns.c2
-rw-r--r--src/dv/gnunet-service-dv.c12
-rw-r--r--src/gns/gnunet-service-gns_resolver.c2
-rw-r--r--src/gns/plugin_block_gns.c2
-rw-r--r--src/gns/test_gns_dht_delegated_lookup.c6
-rw-r--r--src/gns/test_gns_max_queries.c2
-rw-r--r--src/gns/test_gns_pseu_shorten.c14
-rw-r--r--src/gns/test_gns_simple_delegated_lookup.c4
-rw-r--r--src/gns/test_gns_simple_get_authority.c14
-rw-r--r--src/gns/test_gns_simple_lookup.c2
-rw-r--r--src/gns/test_gns_simple_mx_lookup.c6
-rw-r--r--src/gns/test_gns_simple_shorten.c10
-rw-r--r--src/gns/test_gns_simple_zkey_lookup.c4
-rw-r--r--src/hostlist/hostlist-client.c1
-rw-r--r--src/include/gnunet_time_lib.h70
-rw-r--r--src/integration-tests/connection_watchdog.c12
-rw-r--r--src/mesh/gnunet-service-mesh.c2
-rw-r--r--src/mesh/test_mesh_2dtorus.c2
-rw-r--r--src/mesh/test_mesh_small.c2
-rw-r--r--src/namestore/gnunet-namestore.c2
-rw-r--r--src/namestore/gnunet-service-namestore.c16
-rw-r--r--src/namestore/namestore_api.c8
-rw-r--r--src/namestore/test_namestore_api.c2
-rw-r--r--src/namestore/test_namestore_api_create.c2
-rw-r--r--src/namestore/test_namestore_api_create_update.c12
-rw-r--r--src/namestore/test_namestore_api_lookup.c2
-rw-r--r--src/namestore/test_namestore_api_lookup_specific_type.c12
-rw-r--r--src/namestore/test_namestore_api_put.c2
-rw-r--r--src/namestore/test_namestore_api_remove.c12
-rw-r--r--src/namestore/test_namestore_api_remove_not_existing_record.c2
-rw-r--r--src/namestore/test_namestore_api_zone_iteration.c2
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_specific_zone.c2
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_stop.c2
-rw-r--r--src/namestore/test_namestore_record_serialization.c2
-rw-r--r--src/nse/gnunet-nse-profiler.c2
-rw-r--r--src/nse/nse_profiler_test.conf30
-rw-r--r--src/testing/test_testing_2dtorus.c2
-rw-r--r--src/testing/testing_group.c2
-rw-r--r--src/transport/plugin_transport_http.c2
-rw-r--r--src/transport/plugin_transport_http_server.c2
-rw-r--r--src/transport/plugin_transport_udp.c11
-rw-r--r--src/util/test_time.c24
-rw-r--r--src/util/time.c75
48 files changed, 241 insertions, 181 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index 7f96edcac..7412cee19 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -170,11 +170,6 @@ create_address (const struct GNUNET_PeerIdentity *peer,
170 memcpy (&aa[1], plugin_addr, plugin_addr_len); 170 memcpy (&aa[1], plugin_addr, plugin_addr_len);
171 aa->plugin = GNUNET_strdup (plugin_name); 171 aa->plugin = GNUNET_strdup (plugin_name);
172 aa->session_id = session_id; 172 aa->session_id = session_id;
173 aa->mlp_information = NULL;
174 aa->blocked_until = GNUNET_TIME_absolute_get_zero();
175 aa->block_interval = GNUNET_TIME_relative_get_zero();
176 aa->next = NULL;
177 aa->prev = NULL;
178 return aa; 173 return aa;
179} 174}
180 175
@@ -751,8 +746,8 @@ reset_address_it (void *cls, const GNUNET_HashCode * key, void *value)
751 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 746 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
752 "Resetting interval for peer `%s' address %p from %llu to 0\n", GNUNET_i2s (&aa->peer), aa, aa->block_interval); 747 "Resetting interval for peer `%s' address %p from %llu to 0\n", GNUNET_i2s (&aa->peer), aa, aa->block_interval);
753 748
754 aa->blocked_until = GNUNET_TIME_absolute_get_zero(); 749 aa->blocked_until = GNUNET_TIME_UNIT_ZERO_ABS;
755 aa->block_interval = GNUNET_TIME_relative_get_zero(); 750 aa->block_interval = GNUNET_TIME_UNIT_ZERO;
756 return GNUNET_OK; 751 return GNUNET_OK;
757} 752}
758 753
diff --git a/src/ats/gnunet-service-ats_addresses_mlp.c b/src/ats/gnunet-service-ats_addresses_mlp.c
index 196ebaba8..8bfa010ca 100644
--- a/src/ats/gnunet-service-ats_addresses_mlp.c
+++ b/src/ats/gnunet-service-ats_addresses_mlp.c
@@ -1021,8 +1021,8 @@ GAS_mlp_solve_problem (struct GAS_MLP_Handle *mlp, struct GAS_MLP_SolutionContex
1021 1021
1022 ctx->lp_result = GNUNET_SYSERR; 1022 ctx->lp_result = GNUNET_SYSERR;
1023 ctx->mlp_result = GNUNET_SYSERR; 1023 ctx->mlp_result = GNUNET_SYSERR;
1024 ctx->lp_duration = GNUNET_TIME_relative_get_forever(); 1024 ctx->lp_duration = GNUNET_TIME_UNIT_FOREVER_REL;
1025 ctx->mlp_duration = GNUNET_TIME_relative_get_forever(); 1025 ctx->mlp_duration = GNUNET_TIME_UNIT_FOREVER_REL;
1026 1026
1027 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Solve LP problem\n"); 1027 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Solve LP problem\n");
1028#if WRITE_MLP 1028#if WRITE_MLP
@@ -1369,7 +1369,7 @@ GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
1369#endif 1369#endif
1370 mlp->control_param_mlp.tm_lim = max_duration.rel_value; 1370 mlp->control_param_mlp.tm_lim = max_duration.rel_value;
1371 1371
1372 mlp->last_execution = GNUNET_TIME_absolute_get_forever(); 1372 mlp->last_execution = GNUNET_TIME_UNIT_FOREVER_ABS;
1373 1373
1374 mlp->co_D = D; 1374 mlp->co_D = D;
1375 mlp->co_R = R; 1375 mlp->co_R = R;
diff --git a/src/ats/test_ats_api_update_address.c b/src/ats/test_ats_api_update_address.c
index 19585903f..12d283aac 100644
--- a/src/ats/test_ats_api_update_address.c
+++ b/src/ats/test_ats_api_update_address.c
@@ -38,7 +38,7 @@
38 38
39#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 39#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
40 40
41#define VALID GNUNET_TIME_absolute_get_forever () 41#define VALID GNUNET_TIME_UNIT_FOREVER_ABS
42 42
43static struct GNUNET_ATS_SchedulingHandle *ats; 43static struct GNUNET_ATS_SchedulingHandle *ats;
44 44
diff --git a/src/core/core_api_is_connected.c b/src/core/core_api_is_connected.c
index 2e56dffc8..2e01b3691 100644
--- a/src/core/core_api_is_connected.c
+++ b/src/core/core_api_is_connected.c
@@ -204,7 +204,7 @@ GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg,
204 GNUNET_CLIENT_notify_transmit_ready (client, 204 GNUNET_CLIENT_notify_transmit_ready (client,
205 sizeof (struct GNUNET_MessageHeader) + 205 sizeof (struct GNUNET_MessageHeader) +
206 sizeof (struct GNUNET_PeerIdentity), 206 sizeof (struct GNUNET_PeerIdentity),
207 GNUNET_TIME_relative_get_forever (), 207 GNUNET_TIME_UNIT_FOREVER_REL,
208 GNUNET_YES, &transmit_is_connected_request, cth); 208 GNUNET_YES, &transmit_is_connected_request, cth);
209 GNUNET_assert (NULL != cth->th); 209 GNUNET_assert (NULL != cth->th);
210 return cth; 210 return cth;
diff --git a/src/core/core_api_iterate_peers.c b/src/core/core_api_iterate_peers.c
index 8e6904480..7db948618 100644
--- a/src/core/core_api_iterate_peers.c
+++ b/src/core/core_api_iterate_peers.c
@@ -192,11 +192,11 @@ GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg,
192 request_context->th = 192 request_context->th =
193 GNUNET_CLIENT_notify_transmit_ready (client, 193 GNUNET_CLIENT_notify_transmit_ready (client,
194 sizeof (struct GNUNET_MessageHeader), 194 sizeof (struct GNUNET_MessageHeader),
195 GNUNET_TIME_relative_get_forever (), 195 GNUNET_TIME_UNIT_FOREVER_REL,
196 GNUNET_YES, &transmit_request, NULL); 196 GNUNET_YES, &transmit_request, NULL);
197 197
198 GNUNET_CLIENT_receive (client, &receive_info, request_context, 198 GNUNET_CLIENT_receive (client, &receive_info, request_context,
199 GNUNET_TIME_relative_get_forever ()); 199 GNUNET_TIME_UNIT_FOREVER_REL);
200 return GNUNET_OK; 200 return GNUNET_OK;
201} 201}
202 202
diff --git a/src/dns/plugin_block_dns.c b/src/dns/plugin_block_dns.c
index 96a4dc04e..da8add50c 100644
--- a/src/dns/plugin_block_dns.c
+++ b/src/dns/plugin_block_dns.c
@@ -85,7 +85,7 @@ block_plugin_dns_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
85 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; 85 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
86 } 86 }
87 87
88 if (GNUNET_TIME_relative_get_zero ().rel_value == 88 if (0 ==
89 GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh 89 GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh
90 (rec->expiration_time)).rel_value) 90 (rec->expiration_time)).rel_value)
91 { 91 {
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index 651b92ac0..ecf574e20 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -1334,7 +1334,7 @@ send_message_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1334 { 1334 {
1335 send_message (&msg_ctx->dest, &msg_ctx->sender, NULL, msg_ctx->message, 1335 send_message (&msg_ctx->dest, &msg_ctx->sender, NULL, msg_ctx->message,
1336 msg_ctx->message_size, default_dv_priority, msg_ctx->uid, 1336 msg_ctx->message_size, default_dv_priority, msg_ctx->uid,
1337 GNUNET_TIME_relative_get_forever ()); 1337 GNUNET_TIME_UNIT_FOREVER_REL);
1338 GNUNET_free (msg_ctx->message); 1338 GNUNET_free (msg_ctx->message);
1339 GNUNET_free (msg_ctx); 1339 GNUNET_free (msg_ctx);
1340 } 1340 }
@@ -1629,7 +1629,7 @@ handle_dv_data_message (void *cls, const struct GNUNET_PeerIdentity *peer,
1629 send_message (destination, original_sender, NULL, packed_message, 1629 send_message (destination, original_sender, NULL, packed_message,
1630 packed_message_size, default_dv_priority, 1630 packed_message_size, default_dv_priority,
1631 ntohl (incoming->uid), 1631 ntohl (incoming->uid),
1632 GNUNET_TIME_relative_get_forever ()); 1632 GNUNET_TIME_UNIT_FOREVER_REL);
1633 } 1633 }
1634 if (ret != GNUNET_SYSERR) 1634 if (ret != GNUNET_SYSERR)
1635 return GNUNET_OK; 1635 return GNUNET_OK;
@@ -1764,7 +1764,7 @@ neighbor_send_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1764 sizeof (p2p_dv_MESSAGE_NeighborInfo)); 1764 sizeof (p2p_dv_MESSAGE_NeighborInfo));
1765 pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1]; 1765 pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1];
1766 pending_message->importance = default_dv_priority; 1766 pending_message->importance = default_dv_priority;
1767 pending_message->timeout = GNUNET_TIME_relative_get_forever (); 1767 pending_message->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
1768 memcpy (&pending_message->recipient, &to->identity, 1768 memcpy (&pending_message->recipient, &to->identity,
1769 sizeof (struct GNUNET_PeerIdentity)); 1769 sizeof (struct GNUNET_PeerIdentity));
1770 pending_message->msg_size = sizeof (p2p_dv_MESSAGE_NeighborInfo); 1770 pending_message->msg_size = sizeof (p2p_dv_MESSAGE_NeighborInfo);
@@ -1784,7 +1784,7 @@ neighbor_send_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1784 1784
1785 GNUNET_SCHEDULER_add_now (try_core_send, NULL); 1785 GNUNET_SCHEDULER_add_now (try_core_send, NULL);
1786 /*if (core_transmit_handle == NULL) 1786 /*if (core_transmit_handle == NULL)
1787 * 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); */ 1787 * 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); */
1788 1788
1789 } 1789 }
1790 1790
@@ -2193,7 +2193,7 @@ schedule_disconnect_messages (void *cls, const GNUNET_HashCode * key,
2193 sizeof (p2p_dv_MESSAGE_Disconnect)); 2193 sizeof (p2p_dv_MESSAGE_Disconnect));
2194 pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1]; 2194 pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1];
2195 pending_message->importance = default_dv_priority; 2195 pending_message->importance = default_dv_priority;
2196 pending_message->timeout = GNUNET_TIME_relative_get_forever (); 2196 pending_message->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
2197 memcpy (&pending_message->recipient, &notify->identity, 2197 memcpy (&pending_message->recipient, &notify->identity,
2198 sizeof (struct GNUNET_PeerIdentity)); 2198 sizeof (struct GNUNET_PeerIdentity));
2199 pending_message->msg_size = sizeof (p2p_dv_MESSAGE_Disconnect); 2199 pending_message->msg_size = sizeof (p2p_dv_MESSAGE_Disconnect);
@@ -2207,7 +2207,7 @@ schedule_disconnect_messages (void *cls, const GNUNET_HashCode * key,
2207 2207
2208 GNUNET_SCHEDULER_add_now (try_core_send, NULL); 2208 GNUNET_SCHEDULER_add_now (try_core_send, NULL);
2209 /*if (core_transmit_handle == NULL) 2209 /*if (core_transmit_handle == NULL)
2210 * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, GNUNET_YES, default_dv_priority, GNUNET_TIME_relative_get_forever(), &notify->identity, sizeof(p2p_dv_MESSAGE_Disconnect), &core_transmit_notify, NULL); */ 2210 * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, GNUNET_YES, default_dv_priority, GNUNET_TIME_UNIT_FOREVER_REL, &notify->identity, sizeof(p2p_dv_MESSAGE_Disconnect), &core_transmit_notify, NULL); */
2211 2211
2212 return GNUNET_YES; 2212 return GNUNET_YES;
2213} 2213}
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 0f65390ee..cf12e4bac 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -132,7 +132,7 @@ process_pseu_lookup_ns(void* cls,
132 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 132 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
133 "GNS_AUTO_PSEU: Name %s not taken in NS! Adding\n", gph->new_name); 133 "GNS_AUTO_PSEU: Name %s not taken in NS! Adding\n", gph->new_name);
134 134
135 new_pkey.expiration = GNUNET_TIME_absolute_get_forever (); 135 new_pkey.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
136 new_pkey.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); 136 new_pkey.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
137 new_pkey.data = &gph->new_zone; 137 new_pkey.data = &gph->new_zone;
138 new_pkey.record_type = GNUNET_GNS_RECORD_PKEY; 138 new_pkey.record_type = GNUNET_GNS_RECORD_PKEY;
diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c
index dc92f6aec..5d986ce98 100644
--- a/src/gns/plugin_block_gns.c
+++ b/src/gns/plugin_block_gns.c
@@ -135,7 +135,7 @@ block_plugin_gns_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
135 { 135 {
136 struct GNUNET_NAMESTORE_RecordData rd[rd_count]; 136 struct GNUNET_NAMESTORE_RecordData rd[rd_count];
137 unsigned int i; 137 unsigned int i;
138 struct GNUNET_TIME_Absolute exp = GNUNET_TIME_absolute_get_forever(); 138 struct GNUNET_TIME_Absolute exp = GNUNET_TIME_UNIT_FOREVER_ABS;
139 139
140 if (GNUNET_SYSERR == GNUNET_NAMESTORE_records_deserialize (rd_len, 140 if (GNUNET_SYSERR == GNUNET_NAMESTORE_records_deserialize (rd_len,
141 rd_data, 141 rd_data,
diff --git a/src/gns/test_gns_dht_delegated_lookup.c b/src/gns/test_gns_dht_delegated_lookup.c
index b27c5ec33..882bb7e5e 100644
--- a/src/gns/test_gns_dht_delegated_lookup.c
+++ b/src/gns/test_gns_dht_delegated_lookup.c
@@ -211,13 +211,13 @@ put_dht(void *cls, int32_t success, const char *emsg)
211 char* ip = TEST_IP; 211 char* ip = TEST_IP;
212 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); 212 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
213 213
214 rd.expiration = GNUNET_TIME_absolute_get_forever (); 214 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
215 GNUNET_assert(1 == inet_pton (AF_INET, ip, web)); 215 GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
216 rd.data_size = sizeof(struct in_addr); 216 rd.data_size = sizeof(struct in_addr);
217 rd.data = web; 217 rd.data = web;
218 rd.record_type = GNUNET_DNSPARSER_TYPE_A; 218 rd.record_type = GNUNET_DNSPARSER_TYPE_A;
219 219
220 sig = GNUNET_NAMESTORE_create_signature(bob_key, GNUNET_TIME_absolute_get_forever(), TEST_RECORD_NAME, 220 sig = GNUNET_NAMESTORE_create_signature(bob_key, GNUNET_TIME_UNIT_FOREVER_ABS, TEST_RECORD_NAME,
221 &rd, 1); 221 &rd, 1);
222 rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd); 222 rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd);
223 nrb = GNUNET_malloc(rd_payload_length + strlen(TEST_RECORD_NAME) + 1 223 nrb = GNUNET_malloc(rd_payload_length + strlen(TEST_RECORD_NAME) + 1
@@ -315,7 +315,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
315 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); 315 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
316 316
317 struct GNUNET_NAMESTORE_RecordData rd; 317 struct GNUNET_NAMESTORE_RecordData rd;
318 rd.expiration = GNUNET_TIME_absolute_get_forever (); 318 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
319 rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); 319 rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
320 rd.data = &bob_hash; 320 rd.data = &bob_hash;
321 rd.record_type = GNUNET_GNS_RECORD_PKEY; 321 rd.record_type = GNUNET_GNS_RECORD_PKEY;
diff --git a/src/gns/test_gns_max_queries.c b/src/gns/test_gns_max_queries.c
index 8bc0bf54e..ad1743c67 100644
--- a/src/gns/test_gns_max_queries.c
+++ b/src/gns/test_gns_max_queries.c
@@ -269,7 +269,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
269 struct GNUNET_NAMESTORE_RecordData rd; 269 struct GNUNET_NAMESTORE_RecordData rd;
270 char* ip = TEST_IP; 270 char* ip = TEST_IP;
271 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); 271 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
272 rd.expiration = GNUNET_TIME_absolute_get_forever (); 272 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
273 GNUNET_assert(1 == inet_pton (AF_INET, ip, web)); 273 GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
274 rd.data_size = sizeof(struct in_addr); 274 rd.data_size = sizeof(struct in_addr);
275 rd.data = web; 275 rd.data = web;
diff --git a/src/gns/test_gns_pseu_shorten.c b/src/gns/test_gns_pseu_shorten.c
index 69301a8eb..3c2d20420 100644
--- a/src/gns/test_gns_pseu_shorten.c
+++ b/src/gns/test_gns_pseu_shorten.c
@@ -272,13 +272,13 @@ put_pseu_dht(void *cls, int success)
272 struct GNUNET_CRYPTO_RsaSignature *sig; 272 struct GNUNET_CRYPTO_RsaSignature *sig;
273 struct GNUNET_NAMESTORE_RecordData rd; 273 struct GNUNET_NAMESTORE_RecordData rd;
274 274
275 rd.expiration = GNUNET_TIME_absolute_get_forever (); 275 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
276 rd.data_size = strlen(TEST_PSEU_ALICE)+1; 276 rd.data_size = strlen(TEST_PSEU_ALICE)+1;
277 rd.data = TEST_PSEU_ALICE; 277 rd.data = TEST_PSEU_ALICE;
278 rd.record_type = GNUNET_GNS_RECORD_PSEU; 278 rd.record_type = GNUNET_GNS_RECORD_PSEU;
279 279
280 sig = GNUNET_NAMESTORE_create_signature(alice_key, 280 sig = GNUNET_NAMESTORE_create_signature(alice_key,
281 GNUNET_TIME_absolute_get_forever(), 281 GNUNET_TIME_UNIT_FOREVER_ABS,
282 "+", 282 "+",
283 &rd, 1); 283 &rd, 1);
284 rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd); 284 rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd);
@@ -352,14 +352,14 @@ put_www_dht(void *cls, int success)
352 char* ip = TEST_IP; 352 char* ip = TEST_IP;
353 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); 353 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
354 354
355 rd.expiration = GNUNET_TIME_absolute_get_forever (); 355 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
356 GNUNET_assert(1 == inet_pton (AF_INET, ip, web)); 356 GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
357 rd.data_size = sizeof(struct in_addr); 357 rd.data_size = sizeof(struct in_addr);
358 rd.data = web; 358 rd.data = web;
359 rd.record_type = GNUNET_DNSPARSER_TYPE_A; 359 rd.record_type = GNUNET_DNSPARSER_TYPE_A;
360 360
361 sig = GNUNET_NAMESTORE_create_signature(alice_key, 361 sig = GNUNET_NAMESTORE_create_signature(alice_key,
362 GNUNET_TIME_absolute_get_forever(), 362 GNUNET_TIME_UNIT_FOREVER_ABS,
363 TEST_RECORD_NAME, 363 TEST_RECORD_NAME,
364 &rd, 1); 364 &rd, 1);
365 rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd); 365 rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd);
@@ -430,13 +430,13 @@ put_pkey_dht(void *cls, int32_t success, const char *emsg)
430 struct GNUNET_CRYPTO_RsaSignature *sig; 430 struct GNUNET_CRYPTO_RsaSignature *sig;
431 struct GNUNET_NAMESTORE_RecordData rd; 431 struct GNUNET_NAMESTORE_RecordData rd;
432 432
433 rd.expiration = GNUNET_TIME_absolute_get_forever (); 433 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
434 rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); 434 rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
435 rd.data = &alice_hash; 435 rd.data = &alice_hash;
436 rd.record_type = GNUNET_GNS_RECORD_PKEY; 436 rd.record_type = GNUNET_GNS_RECORD_PKEY;
437 437
438 sig = GNUNET_NAMESTORE_create_signature(bob_key, 438 sig = GNUNET_NAMESTORE_create_signature(bob_key,
439 GNUNET_TIME_absolute_get_forever(), 439 GNUNET_TIME_UNIT_FOREVER_ABS,
440 TEST_AUTHORITY_ALICE, 440 TEST_AUTHORITY_ALICE,
441 &rd, 441 &rd,
442 1); 442 1);
@@ -547,7 +547,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
547 GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash); 547 GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash);
548 548
549 struct GNUNET_NAMESTORE_RecordData rd; 549 struct GNUNET_NAMESTORE_RecordData rd;
550 rd.expiration = GNUNET_TIME_absolute_get_forever (); 550 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
551 rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode); 551 rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
552 rd.data = &bob_hash; 552 rd.data = &bob_hash;
553 rd.record_type = GNUNET_GNS_RECORD_PKEY; 553 rd.record_type = GNUNET_GNS_RECORD_PKEY;
diff --git a/src/gns/test_gns_simple_delegated_lookup.c b/src/gns/test_gns_simple_delegated_lookup.c
index a91870681..36fb96915 100644
--- a/src/gns/test_gns_simple_delegated_lookup.c
+++ b/src/gns/test_gns_simple_delegated_lookup.c
@@ -238,7 +238,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
238 struct GNUNET_NAMESTORE_RecordData rd; 238 struct GNUNET_NAMESTORE_RecordData rd;
239 char* ip = TEST_IP; 239 char* ip = TEST_IP;
240 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); 240 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
241 rd.expiration = GNUNET_TIME_absolute_get_forever (); 241 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
242 GNUNET_assert(1 == inet_pton (AF_INET, ip, web)); 242 GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
243 243
244 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); 244 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -258,7 +258,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
258 rd.data = web; 258 rd.data = web;
259 rd.record_type = GNUNET_DNSPARSER_TYPE_A; 259 rd.record_type = GNUNET_DNSPARSER_TYPE_A;
260 sig = GNUNET_NAMESTORE_create_signature(bob_key, 260 sig = GNUNET_NAMESTORE_create_signature(bob_key,
261 GNUNET_TIME_absolute_get_forever(), 261 GNUNET_TIME_UNIT_FOREVER_ABS,
262 TEST_RECORD_NAME, 262 TEST_RECORD_NAME,
263 &rd, 1); 263 &rd, 1);
264 264
diff --git a/src/gns/test_gns_simple_get_authority.c b/src/gns/test_gns_simple_get_authority.c
index f274d2cd4..dbecb7dfd 100644
--- a/src/gns/test_gns_simple_get_authority.c
+++ b/src/gns/test_gns_simple_get_authority.c
@@ -236,7 +236,7 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
236 struct GNUNET_NAMESTORE_RecordData rd; 236 struct GNUNET_NAMESTORE_RecordData rd;
237 char* ip = TEST_IP; 237 char* ip = TEST_IP;
238 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); 238 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
239 rd.expiration = GNUNET_TIME_absolute_get_forever (); 239 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
240 GNUNET_assert(1 == inet_pton (AF_INET, ip, web)); 240 GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
241 241
242 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); 242 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -256,13 +256,13 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
256 /* put alice into bobs zone */ 256 /* put alice into bobs zone */
257 GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash); 257 GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash);
258 rd.data = &alice_hash; 258 rd.data = &alice_hash;
259 sig = GNUNET_NAMESTORE_create_signature(bob_key, GNUNET_TIME_absolute_get_forever(), TEST_AUTHORITY_ALICE, 259 sig = GNUNET_NAMESTORE_create_signature(bob_key, GNUNET_TIME_UNIT_FOREVER_ABS, TEST_AUTHORITY_ALICE,
260 &rd, 1); 260 &rd, 1);
261 261
262 GNUNET_NAMESTORE_record_put (namestore_handle, 262 GNUNET_NAMESTORE_record_put (namestore_handle,
263 &bob_pkey, 263 &bob_pkey,
264 TEST_AUTHORITY_ALICE, 264 TEST_AUTHORITY_ALICE,
265 GNUNET_TIME_absolute_get_forever(), 265 GNUNET_TIME_UNIT_FOREVER_ABS,
266 1, 266 1,
267 &rd, 267 &rd,
268 sig, 268 sig,
@@ -274,13 +274,13 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
274 rd.data_size = sizeof(struct in_addr); 274 rd.data_size = sizeof(struct in_addr);
275 rd.data = web; 275 rd.data = web;
276 rd.record_type = GNUNET_DNSPARSER_TYPE_A; 276 rd.record_type = GNUNET_DNSPARSER_TYPE_A;
277 sig = GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_absolute_get_forever(), TEST_RECORD_NAME, 277 sig = GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_UNIT_FOREVER_ABS, TEST_RECORD_NAME,
278 &rd, 1); 278 &rd, 1);
279 279
280 GNUNET_NAMESTORE_record_put (namestore_handle, 280 GNUNET_NAMESTORE_record_put (namestore_handle,
281 &alice_pkey, 281 &alice_pkey,
282 TEST_RECORD_NAME, 282 TEST_RECORD_NAME,
283 GNUNET_TIME_absolute_get_forever(), 283 GNUNET_TIME_UNIT_FOREVER_ABS,
284 1, 284 1,
285 &rd, 285 &rd,
286 sig, 286 sig,
@@ -292,13 +292,13 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
292 rd.record_type = GNUNET_GNS_RECORD_PSEU; 292 rd.record_type = GNUNET_GNS_RECORD_PSEU;
293 GNUNET_free(sig); 293 GNUNET_free(sig);
294 294
295 sig = GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_absolute_get_forever(), "", 295 sig = GNUNET_NAMESTORE_create_signature(alice_key,GNUNET_TIME_UNIT_FOREVER_ABS, "",
296 &rd, 1); 296 &rd, 1);
297 297
298 GNUNET_NAMESTORE_record_put (namestore_handle, 298 GNUNET_NAMESTORE_record_put (namestore_handle,
299 &alice_pkey, 299 &alice_pkey,
300 "", 300 "",
301 GNUNET_TIME_absolute_get_forever(), 301 GNUNET_TIME_UNIT_FOREVER_ABS,
302 1, 302 1,
303 &rd, 303 &rd,
304 sig, 304 sig,
diff --git a/src/gns/test_gns_simple_lookup.c b/src/gns/test_gns_simple_lookup.c
index 12d7a68ac..89a9aefee 100644
--- a/src/gns/test_gns_simple_lookup.c
+++ b/src/gns/test_gns_simple_lookup.c
@@ -220,7 +220,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
220 struct GNUNET_NAMESTORE_RecordData rd; 220 struct GNUNET_NAMESTORE_RecordData rd;
221 char* ip = TEST_IP; 221 char* ip = TEST_IP;
222 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); 222 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
223 rd.expiration = GNUNET_TIME_absolute_get_forever (); 223 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
224 GNUNET_assert(1 == inet_pton (AF_INET, ip, web)); 224 GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
225 rd.data_size = sizeof(struct in_addr); 225 rd.data_size = sizeof(struct in_addr);
226 rd.data = web; 226 rd.data = web;
diff --git a/src/gns/test_gns_simple_mx_lookup.c b/src/gns/test_gns_simple_mx_lookup.c
index ffd97f07b..fdc639a72 100644
--- a/src/gns/test_gns_simple_mx_lookup.c
+++ b/src/gns/test_gns_simple_mx_lookup.c
@@ -257,7 +257,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
257 struct in_addr *mail = GNUNET_malloc(sizeof(struct in_addr)); 257 struct in_addr *mail = GNUNET_malloc(sizeof(struct in_addr));
258 char *mx_record; 258 char *mx_record;
259 uint16_t mx_preference = 1; 259 uint16_t mx_preference = 1;
260 rd.expiration = GNUNET_TIME_absolute_get_forever (); 260 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
261 GNUNET_assert(1 == inet_pton (AF_INET, ip, mail)); 261 GNUNET_assert(1 == inet_pton (AF_INET, ip, mail));
262 262
263 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); 263 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -277,7 +277,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
277 rd.data = mail; 277 rd.data = mail;
278 rd.record_type = GNUNET_DNSPARSER_TYPE_A; 278 rd.record_type = GNUNET_DNSPARSER_TYPE_A;
279 sig = GNUNET_NAMESTORE_create_signature(bob_key, 279 sig = GNUNET_NAMESTORE_create_signature(bob_key,
280 GNUNET_TIME_absolute_get_forever(), 280 GNUNET_TIME_UNIT_FOREVER_ABS,
281 TEST_RECORD_NAME, 281 TEST_RECORD_NAME,
282 &rd, 1); 282 &rd, 1);
283 283
@@ -298,7 +298,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
298 rd.data = mx_record; 298 rd.data = mx_record;
299 rd.record_type = GNUNET_GNS_RECORD_MX; 299 rd.record_type = GNUNET_GNS_RECORD_MX;
300 sig = GNUNET_NAMESTORE_create_signature(bob_key, 300 sig = GNUNET_NAMESTORE_create_signature(bob_key,
301 GNUNET_TIME_absolute_get_forever(), 301 GNUNET_TIME_UNIT_FOREVER_ABS,
302 "+", 302 "+",
303 &rd, 1); 303 &rd, 1);
304 GNUNET_NAMESTORE_record_put (namestore_handle, 304 GNUNET_NAMESTORE_record_put (namestore_handle,
diff --git a/src/gns/test_gns_simple_shorten.c b/src/gns/test_gns_simple_shorten.c
index be6fc27b0..53717932f 100644
--- a/src/gns/test_gns_simple_shorten.c
+++ b/src/gns/test_gns_simple_shorten.c
@@ -236,7 +236,7 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
236 struct GNUNET_NAMESTORE_RecordData rd; 236 struct GNUNET_NAMESTORE_RecordData rd;
237 char* ip = TEST_IP; 237 char* ip = TEST_IP;
238 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); 238 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
239 rd.expiration = GNUNET_TIME_absolute_get_forever (); 239 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
240 GNUNET_assert(1 == inet_pton (AF_INET, ip, web)); 240 GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
241 241
242 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); 242 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -257,14 +257,14 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
257 GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash); 257 GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash);
258 rd.data = &alice_hash; 258 rd.data = &alice_hash;
259 sig = GNUNET_NAMESTORE_create_signature(bob_key, 259 sig = GNUNET_NAMESTORE_create_signature(bob_key,
260 GNUNET_TIME_absolute_get_forever(), 260 GNUNET_TIME_UNIT_FOREVER_ABS,
261 TEST_AUTHORITY_ALICE, 261 TEST_AUTHORITY_ALICE,
262 &rd, 1); 262 &rd, 1);
263 263
264 GNUNET_NAMESTORE_record_put (namestore_handle, 264 GNUNET_NAMESTORE_record_put (namestore_handle,
265 &bob_pkey, 265 &bob_pkey,
266 TEST_AUTHORITY_ALICE, 266 TEST_AUTHORITY_ALICE,
267 GNUNET_TIME_absolute_get_forever(), 267 GNUNET_TIME_UNIT_FOREVER_ABS,
268 1, 268 1,
269 &rd, 269 &rd,
270 sig, 270 sig,
@@ -277,14 +277,14 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
277 rd.data = web; 277 rd.data = web;
278 rd.record_type = GNUNET_DNSPARSER_TYPE_A; 278 rd.record_type = GNUNET_DNSPARSER_TYPE_A;
279 sig = GNUNET_NAMESTORE_create_signature(alice_key, 279 sig = GNUNET_NAMESTORE_create_signature(alice_key,
280 GNUNET_TIME_absolute_get_forever(), 280 GNUNET_TIME_UNIT_FOREVER_ABS,
281 TEST_RECORD_NAME, 281 TEST_RECORD_NAME,
282 &rd, 1); 282 &rd, 1);
283 283
284 GNUNET_NAMESTORE_record_put (namestore_handle, 284 GNUNET_NAMESTORE_record_put (namestore_handle,
285 &alice_pkey, 285 &alice_pkey,
286 TEST_RECORD_NAME, 286 TEST_RECORD_NAME,
287 GNUNET_TIME_absolute_get_forever(), 287 GNUNET_TIME_UNIT_FOREVER_ABS,
288 1, 288 1,
289 &rd, 289 &rd,
290 sig, 290 sig,
diff --git a/src/gns/test_gns_simple_zkey_lookup.c b/src/gns/test_gns_simple_zkey_lookup.c
index 32298cba5..8b9b78bef 100644
--- a/src/gns/test_gns_simple_zkey_lookup.c
+++ b/src/gns/test_gns_simple_zkey_lookup.c
@@ -241,7 +241,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
241 struct GNUNET_NAMESTORE_RecordData rd; 241 struct GNUNET_NAMESTORE_RecordData rd;
242 char* ip = TEST_IP; 242 char* ip = TEST_IP;
243 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); 243 struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
244 rd.expiration = GNUNET_TIME_absolute_get_forever (); 244 rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
245 GNUNET_assert(1 == inet_pton (AF_INET, ip, web)); 245 GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
246 246
247 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); 247 GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -261,7 +261,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
261 rd.data = web; 261 rd.data = web;
262 rd.record_type = GNUNET_DNSPARSER_TYPE_A; 262 rd.record_type = GNUNET_DNSPARSER_TYPE_A;
263 sig = GNUNET_NAMESTORE_create_signature(bob_key, 263 sig = GNUNET_NAMESTORE_create_signature(bob_key,
264 GNUNET_TIME_absolute_get_forever(), 264 GNUNET_TIME_UNIT_FOREVER_ABS,
265 TEST_RECORD_NAME, 265 TEST_RECORD_NAME,
266 &rd, 1); 266 &rd, 1);
267 267
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c
index 9e320e51c..6be37fc78 100644
--- a/src/hostlist/hostlist-client.c
+++ b/src/hostlist/hostlist-client.c
@@ -1194,7 +1194,6 @@ handler_advertisement (void *cls, const struct GNUNET_PeerIdentity *peer,
1194 hostlist->hostlist_uri = (const char *) &hostlist[1]; 1194 hostlist->hostlist_uri = (const char *) &hostlist[1];
1195 memcpy (&hostlist[1], uri, uri_size); 1195 memcpy (&hostlist[1], uri, uri_size);
1196 hostlist->time_creation = GNUNET_TIME_absolute_get (); 1196 hostlist->time_creation = GNUNET_TIME_absolute_get ();
1197 hostlist->time_last_usage = GNUNET_TIME_absolute_get_zero ();
1198 hostlist->quality = HOSTLIST_INITIAL; 1197 hostlist->quality = HOSTLIST_INITIAL;
1199 hostlist_to_test = hostlist; 1198 hostlist_to_test = hostlist;
1200 1199
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h
index 7090c33a1..35d180ce2 100644
--- a/src/include/gnunet_time_lib.h
+++ b/src/include/gnunet_time_lib.h
@@ -90,32 +90,32 @@ GNUNET_NETWORK_STRUCT_END
90/** 90/**
91 * Relative time zero. 91 * Relative time zero.
92 */ 92 */
93#define GNUNET_TIME_UNIT_ZERO GNUNET_TIME_relative_get_zero() 93#define GNUNET_TIME_UNIT_ZERO GNUNET_TIME_relative_get_zero_()
94 94
95/** 95/**
96 * Absolute time zero. 96 * Absolute time zero.
97 */ 97 */
98#define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero() 98#define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero_()
99 99
100/** 100/**
101 * One millisecond, our basic time unit. 101 * One millisecond, our basic time unit.
102 */ 102 */
103#define GNUNET_TIME_UNIT_MILLISECONDS GNUNET_TIME_relative_get_unit() 103#define GNUNET_TIME_UNIT_MILLISECONDS GNUNET_TIME_relative_get_unit_()
104 104
105/** 105/**
106 * One second. 106 * One second.
107 */ 107 */
108#define GNUNET_TIME_UNIT_SECONDS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 1000) 108#define GNUNET_TIME_UNIT_SECONDS GNUNET_TIME_relative_get_second_()
109 109
110/** 110/**
111 * One minute. 111 * One minute.
112 */ 112 */
113#define GNUNET_TIME_UNIT_MINUTES GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60) 113#define GNUNET_TIME_UNIT_MINUTES GNUNET_TIME_relative_get_minute_()
114 114
115/** 115/**
116 * One hour. 116 * One hour.
117 */ 117 */
118#define GNUNET_TIME_UNIT_HOURS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 60) 118#define GNUNET_TIME_UNIT_HOURS GNUNET_TIME_relative_get_hour_()
119 119
120/** 120/**
121 * One day. 121 * One day.
@@ -141,43 +141,70 @@ GNUNET_NETWORK_STRUCT_END
141 * Constant used to specify "forever". This constant 141 * Constant used to specify "forever". This constant
142 * will be treated specially in all time operations. 142 * will be treated specially in all time operations.
143 */ 143 */
144#define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever () 144#define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever_ ()
145 145
146/** 146/**
147 * Constant used to specify "forever". This constant 147 * Constant used to specify "forever". This constant
148 * will be treated specially in all time operations. 148 * will be treated specially in all time operations.
149 */ 149 */
150#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever () 150#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ ()
151
151 152
152/** 153/**
153 * Return relative time of 0ms. 154 * Return relative time of 0ms.
154 */ 155 */
155struct GNUNET_TIME_Relative 156struct GNUNET_TIME_Relative
156GNUNET_TIME_relative_get_zero (void); 157GNUNET_TIME_relative_get_zero_ (void);
158
157 159
158/** 160/**
159 * Return absolute time of 0ms. 161 * Return absolute time of 0ms.
160 */ 162 */
161struct GNUNET_TIME_Absolute 163struct GNUNET_TIME_Absolute
162GNUNET_TIME_absolute_get_zero (void); 164GNUNET_TIME_absolute_get_zero_ (void);
165
163 166
164/** 167/**
165 * Return relative time of 1ms. 168 * Return relative time of 1ms.
166 */ 169 */
167struct GNUNET_TIME_Relative 170struct GNUNET_TIME_Relative
168GNUNET_TIME_relative_get_unit (void); 171GNUNET_TIME_relative_get_unit_ (void);
172
173
174/**
175 * Return relative time of 1s.
176 */
177struct GNUNET_TIME_Relative
178GNUNET_TIME_relative_get_second_ (void);
179
180
181/**
182 * Return relative time of 1 minute.
183 */
184struct GNUNET_TIME_Relative
185GNUNET_TIME_relative_get_minute_ (void);
186
187
188/**
189 * Return relative time of 1 hour.
190 */
191struct GNUNET_TIME_Relative
192GNUNET_TIME_relative_get_hour_ (void);
193
169 194
170/** 195/**
171 * Return "forever". 196 * Return "forever".
172 */ 197 */
173struct GNUNET_TIME_Relative 198struct GNUNET_TIME_Relative
174GNUNET_TIME_relative_get_forever (void); 199GNUNET_TIME_relative_get_forever_ (void);
200
175 201
176/** 202/**
177 * Return "forever". 203 * Return "forever".
178 */ 204 */
179struct GNUNET_TIME_Absolute 205struct GNUNET_TIME_Absolute
180GNUNET_TIME_absolute_get_forever (void); 206GNUNET_TIME_absolute_get_forever_ (void);
207
181 208
182/** 209/**
183 * Get the current time. 210 * Get the current time.
@@ -187,6 +214,7 @@ GNUNET_TIME_absolute_get_forever (void);
187struct GNUNET_TIME_Absolute 214struct GNUNET_TIME_Absolute
188GNUNET_TIME_absolute_get (void); 215GNUNET_TIME_absolute_get (void);
189 216
217
190/** 218/**
191 * Convert relative time to an absolute time in the 219 * Convert relative time to an absolute time in the
192 * future. 220 * future.
@@ -197,6 +225,7 @@ GNUNET_TIME_absolute_get (void);
197struct GNUNET_TIME_Absolute 225struct GNUNET_TIME_Absolute
198GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel); 226GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel);
199 227
228
200/** 229/**
201 * Return the minimum of two relative time values. 230 * Return the minimum of two relative time values.
202 * 231 *
@@ -209,6 +238,7 @@ GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1,
209 struct GNUNET_TIME_Relative t2); 238 struct GNUNET_TIME_Relative t2);
210 239
211 240
241
212/** 242/**
213 * Return the maximum of two relative time values. 243 * Return the maximum of two relative time values.
214 * 244 *
@@ -220,6 +250,7 @@ struct GNUNET_TIME_Relative
220GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1, 250GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1,
221 struct GNUNET_TIME_Relative t2); 251 struct GNUNET_TIME_Relative t2);
222 252
253
223/** 254/**
224 * Return the minimum of two absolute time values. 255 * Return the minimum of two absolute time values.
225 * 256 *
@@ -231,6 +262,7 @@ struct GNUNET_TIME_Absolute
231GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1, 262GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1,
232 struct GNUNET_TIME_Absolute t2); 263 struct GNUNET_TIME_Absolute t2);
233 264
265
234/** 266/**
235 * Return the maximum of two absolute time values. 267 * Return the maximum of two absolute time values.
236 * 268 *
@@ -242,6 +274,7 @@ struct GNUNET_TIME_Absolute
242GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1, 274GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1,
243 struct GNUNET_TIME_Absolute t2); 275 struct GNUNET_TIME_Absolute t2);
244 276
277
245/** 278/**
246 * Given a timestamp in the future, how much time 279 * Given a timestamp in the future, how much time
247 * remains until then? 280 * remains until then?
@@ -281,6 +314,7 @@ struct GNUNET_TIME_Relative
281GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, 314GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start,
282 struct GNUNET_TIME_Absolute end); 315 struct GNUNET_TIME_Absolute end);
283 316
317
284/** 318/**
285 * Get the duration of an operation as the 319 * Get the duration of an operation as the
286 * difference of the current time and the given start time "hence". 320 * difference of the current time and the given start time "hence".
@@ -317,6 +351,7 @@ struct GNUNET_TIME_Absolute
317GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start, 351GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start,
318 struct GNUNET_TIME_Relative duration); 352 struct GNUNET_TIME_Relative duration);
319 353
354
320/** 355/**
321 * Multiply relative time by a given factor. 356 * Multiply relative time by a given factor.
322 * 357 *
@@ -328,6 +363,7 @@ struct GNUNET_TIME_Relative
328GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, 363GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
329 unsigned int factor); 364 unsigned int factor);
330 365
366
331/** 367/**
332 * Divide relative time by a given factor. 368 * Divide relative time by a given factor.
333 * 369 *
@@ -339,6 +375,7 @@ struct GNUNET_TIME_Relative
339GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, 375GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
340 unsigned int factor); 376 unsigned int factor);
341 377
378
342/** 379/**
343 * Add relative times together. 380 * Add relative times together.
344 * 381 *
@@ -350,6 +387,7 @@ struct GNUNET_TIME_Relative
350GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1, 387GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1,
351 struct GNUNET_TIME_Relative a2); 388 struct GNUNET_TIME_Relative a2);
352 389
390
353/** 391/**
354 * Subtract relative timestamp from the other. 392 * Subtract relative timestamp from the other.
355 * 393 *
@@ -371,6 +409,7 @@ GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1,
371struct GNUNET_TIME_RelativeNBO 409struct GNUNET_TIME_RelativeNBO
372GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a); 410GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a);
373 411
412
374/** 413/**
375 * Convert relative time from network byte order. 414 * Convert relative time from network byte order.
376 * 415 *
@@ -380,6 +419,7 @@ GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a);
380struct GNUNET_TIME_Relative 419struct GNUNET_TIME_Relative
381GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a); 420GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a);
382 421
422
383/** 423/**
384 * Convert relative time to network byte order. 424 * Convert relative time to network byte order.
385 * 425 *
@@ -389,6 +429,7 @@ GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a);
389struct GNUNET_TIME_AbsoluteNBO 429struct GNUNET_TIME_AbsoluteNBO
390GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a); 430GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a);
391 431
432
392/** 433/**
393 * Convert relative time from network byte order. 434 * Convert relative time from network byte order.
394 * 435 *
@@ -398,6 +439,7 @@ GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a);
398struct GNUNET_TIME_Absolute 439struct GNUNET_TIME_Absolute
399GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a); 440GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a);
400 441
442
401/** 443/**
402 * Convert a relative time to a string. 444 * Convert a relative time to a string.
403 * NOT reentrant! 445 * NOT reentrant!
@@ -409,6 +451,7 @@ GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a);
409const char * 451const char *
410GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time); 452GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time);
411 453
454
412/** 455/**
413 * Set the timestamp offset for this instance. 456 * Set the timestamp offset for this instance.
414 * 457 *
@@ -417,6 +460,7 @@ GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time);
417void 460void
418GNUNET_TIME_set_offset (long long offset); 461GNUNET_TIME_set_offset (long long offset);
419 462
463
420#if 0 /* keep Emacsens' auto-indent happy */ 464#if 0 /* keep Emacsens' auto-indent happy */
421{ 465{
422#endif 466#endif
diff --git a/src/integration-tests/connection_watchdog.c b/src/integration-tests/connection_watchdog.c
index 592947694..ac19338cf 100644
--- a/src/integration-tests/connection_watchdog.c
+++ b/src/integration-tests/connection_watchdog.c
@@ -461,14 +461,14 @@ int map_ping_it (void *cls,
461 if ((GNUNET_YES == pc->transport_connected) && (NULL == pc->th_ping)) 461 if ((GNUNET_YES == pc->transport_connected) && (NULL == pc->th_ping))
462 pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, &pc->id, 462 pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, &pc->id,
463 sizeof (struct PING), UINT_MAX, 463 sizeof (struct PING), UINT_MAX,
464 GNUNET_TIME_relative_get_forever(), &send_transport_ping_cb, pc); 464 GNUNET_TIME_UNIT_FOREVER_REL, &send_transport_ping_cb, pc);
465 else 465 else
466 GNUNET_break(0); 466 GNUNET_break(0);
467 467
468 if ((GNUNET_YES == pc->core_connected) && (NULL == pc->ch_ping)) 468 if ((GNUNET_YES == pc->core_connected) && (NULL == pc->ch_ping))
469 pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch, 469 pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch,
470 GNUNET_NO, UINT_MAX, 470 GNUNET_NO, UINT_MAX,
471 GNUNET_TIME_relative_get_forever(), 471 GNUNET_TIME_UNIT_FOREVER_REL,
472 &pc->id, 472 &pc->id,
473 sizeof (struct PING), 473 sizeof (struct PING),
474 send_core_ping_cb, pc); 474 send_core_ping_cb, pc);
@@ -580,7 +580,7 @@ map_connect (const struct GNUNET_PeerIdentity *peer, void * source)
580 if (GNUNET_YES == ping) 580 if (GNUNET_YES == ping)
581 { 581 {
582 if (NULL == pc->th_ping) 582 if (NULL == pc->th_ping)
583 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); 583 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);
584 else 584 else
585 GNUNET_break(0); 585 GNUNET_break(0);
586 } 586 }
@@ -605,7 +605,7 @@ map_connect (const struct GNUNET_PeerIdentity *peer, void * source)
605 if (NULL == pc->ch_ping) 605 if (NULL == pc->ch_ping)
606 pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch, 606 pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch,
607 GNUNET_NO, UINT_MAX, 607 GNUNET_NO, UINT_MAX,
608 GNUNET_TIME_relative_get_forever(), 608 GNUNET_TIME_UNIT_FOREVER_REL,
609 peer, 609 peer,
610 sizeof (struct PING), 610 sizeof (struct PING),
611 send_core_ping_cb, pc); 611 send_core_ping_cb, pc);
@@ -842,7 +842,7 @@ transport_notify_receive_cb (void *cls,
842 if (NULL == pc->th_pong) 842 if (NULL == pc->th_pong)
843 pc->th_pong = GNUNET_TRANSPORT_notify_transmit_ready(th, 843 pc->th_pong = GNUNET_TRANSPORT_notify_transmit_ready(th,
844 peer, sizeof (struct PONG), 844 peer, sizeof (struct PONG),
845 UINT_MAX, GNUNET_TIME_relative_get_forever(), 845 UINT_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
846 &send_transport_pong_cb, pc); 846 &send_transport_pong_cb, pc);
847 else 847 else
848 GNUNET_break (0); 848 GNUNET_break (0);
@@ -893,7 +893,7 @@ core_notify_receive_cb (void *cls,
893 if (NULL == pc->ch_pong) 893 if (NULL == pc->ch_pong)
894 pc->ch_pong = GNUNET_CORE_notify_transmit_ready(ch, 894 pc->ch_pong = GNUNET_CORE_notify_transmit_ready(ch,
895 GNUNET_NO, UINT_MAX, 895 GNUNET_NO, UINT_MAX,
896 GNUNET_TIME_relative_get_forever(), 896 GNUNET_TIME_UNIT_FOREVER_REL,
897 peer, 897 peer,
898 sizeof (struct PONG), 898 sizeof (struct PONG),
899 send_core_pong_cb, pc); 899 send_core_pong_cb, pc);
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index d278c2039..36c6115a1 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -694,7 +694,7 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
694 GNUNET_BLOCK_TYPE_TEST, /* Block type */ 694 GNUNET_BLOCK_TYPE_TEST, /* Block type */
695 sizeof (my_full_id), /* Size of the data */ 695 sizeof (my_full_id), /* Size of the data */
696 (char *) &my_full_id, /* Data itself */ 696 (char *) &my_full_id, /* Data itself */
697 GNUNET_TIME_absolute_get_forever (), /* Data expiration */ 697 GNUNET_TIME_UNIT_FOREVER_ABS, /* Data expiration */
698 GNUNET_TIME_UNIT_FOREVER_REL, /* Retry time */ 698 GNUNET_TIME_UNIT_FOREVER_REL, /* Retry time */
699 NULL, /* Continuation */ 699 NULL, /* Continuation */
700 NULL); /* Continuation closure */ 700 NULL); /* Continuation closure */
diff --git a/src/mesh/test_mesh_2dtorus.c b/src/mesh/test_mesh_2dtorus.c
index e447e11c2..c708e8f44 100644
--- a/src/mesh/test_mesh_2dtorus.c
+++ b/src/mesh/test_mesh_2dtorus.c
@@ -316,7 +316,7 @@ run (void *cls, char *const *args, const char *cfgfile,
316 hosts); 316 hosts);
317 GNUNET_assert (pg != NULL); 317 GNUNET_assert (pg != NULL);
318 shutdown_handle = 318 shutdown_handle =
319 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (), 319 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
320 &shutdown_task, NULL); 320 &shutdown_task, NULL);
321} 321}
322 322
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c
index b06e324f7..974b63590 100644
--- a/src/mesh/test_mesh_small.c
+++ b/src/mesh/test_mesh_small.c
@@ -901,7 +901,7 @@ run (void *cls, char *const *args, const char *cfgfile,
901 hosts); 901 hosts);
902 GNUNET_assert (pg != NULL); 902 GNUNET_assert (pg != NULL);
903 shutdown_handle = 903 shutdown_handle =
904 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (), 904 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
905 &shutdown_task, NULL); 905 &shutdown_task, NULL);
906} 906}
907 907
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 6bde4d90e..a0d1de10a 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -356,7 +356,7 @@ run (void *cls, char *const *args, const char *cfgfile,
356 { 356 {
357 if (0 == strcmp (expirationstring, "never")) 357 if (0 == strcmp (expirationstring, "never"))
358 { 358 {
359 etime = GNUNET_TIME_relative_get_forever(); 359 etime = GNUNET_TIME_UNIT_FOREVER_REL;
360 } 360 }
361 else if (GNUNET_OK != 361 else if (GNUNET_OK !=
362 GNUNET_STRINGS_fancy_time_to_relative (expirationstring, 362 GNUNET_STRINGS_fancy_time_to_relative (expirationstring,
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index e9475c9f1..d6c299882 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -226,15 +226,13 @@ int zone_to_disk_it (void *cls,
226struct GNUNET_TIME_Absolute 226struct GNUNET_TIME_Absolute
227get_block_expiration_time (unsigned int rd_count, const struct GNUNET_NAMESTORE_RecordData *rd) 227get_block_expiration_time (unsigned int rd_count, const struct GNUNET_NAMESTORE_RecordData *rd)
228{ 228{
229 int c; 229 unsigned int c;
230 struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get_forever(); 230 struct GNUNET_TIME_Absolute expire = GNUNET_TIME_UNIT_FOREVER_ABS;
231
231 if (NULL == rd) 232 if (NULL == rd)
232 return GNUNET_TIME_absolute_get_zero(); 233 return GNUNET_TIME_UNIT_ZERO_ABS;
233 for (c = 0; c < rd_count; c++) 234 for (c = 0; c < rd_count; c++)
234 { 235 expire = GNUNET_TIME_absolute_min (rd[c].expiration, expire);
235 if (rd[c].expiration.abs_value < expire.abs_value)
236 expire = rd[c].expiration;
237 }
238 return expire; 236 return expire;
239} 237}
240 238
@@ -1611,7 +1609,7 @@ void send_zone_iteration_result (struct ZoneIterationProcResult *proc)
1611 zir_msg.gns_header.header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE); 1609 zir_msg.gns_header.header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE);
1612 zir_msg.gns_header.header.size = htons (sizeof (struct ZoneIterationResponseMessage)); 1610 zir_msg.gns_header.header.size = htons (sizeof (struct ZoneIterationResponseMessage));
1613 zir_msg.gns_header.r_id = htonl(zi->request_id); 1611 zir_msg.gns_header.r_id = htonl(zi->request_id);
1614 zir_msg.expire = GNUNET_TIME_absolute_hton(GNUNET_TIME_absolute_get_zero()); 1612 zir_msg.expire = GNUNET_TIME_absolute_hton(GNUNET_TIME_UNIT_ZERO_ABS);
1615 zir_msg.name_len = htons (0); 1613 zir_msg.name_len = htons (0);
1616 zir_msg.reserved = htons (0); 1614 zir_msg.reserved = htons (0);
1617 zir_msg.rd_count = htons (0); 1615 zir_msg.rd_count = htons (0);
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c
index eadbeb55f..151fb9752 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -463,13 +463,13 @@ handle_zone_to_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe,
463 { 463 {
464 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "An error occured during zone to name operation\n"); 464 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "An error occured during zone to name operation\n");
465 if (qe->proc != NULL) 465 if (qe->proc != NULL)
466 qe->proc (qe->proc_cls, NULL, GNUNET_TIME_absolute_get_zero(), NULL, 0, NULL, NULL); 466 qe->proc (qe->proc_cls, NULL, GNUNET_TIME_UNIT_ZERO_ABS, NULL, 0, NULL, NULL);
467 } 467 }
468 else if (res == GNUNET_NO) 468 else if (res == GNUNET_NO)
469 { 469 {
470 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Namestore has no result for zone to name mapping \n"); 470 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Namestore has no result for zone to name mapping \n");
471 if (qe->proc != NULL) 471 if (qe->proc != NULL)
472 qe->proc (qe->proc_cls, NULL, GNUNET_TIME_absolute_get_zero(), NULL, 0, NULL, NULL); 472 qe->proc (qe->proc_cls, NULL, GNUNET_TIME_UNIT_ZERO_ABS, NULL, 0, NULL, NULL);
473 } 473 }
474 else if (res == GNUNET_YES) 474 else if (res == GNUNET_YES)
475 { 475 {
@@ -606,7 +606,7 @@ handle_zone_iteration_response (struct GNUNET_NAMESTORE_ZoneIterator *ze,
606 GNUNET_CONTAINER_DLL_remove(ze->h->z_head, ze->h->z_tail, ze); 606 GNUNET_CONTAINER_DLL_remove(ze->h->z_head, ze->h->z_tail, ze);
607 607
608 if (ze->proc != NULL) 608 if (ze->proc != NULL)
609 ze->proc(ze->proc_cls, NULL, GNUNET_TIME_absolute_get_zero (), NULL , 0, NULL, NULL); 609 ze->proc(ze->proc_cls, NULL, GNUNET_TIME_UNIT_ZERO_ABS, NULL , 0, NULL, NULL);
610 610
611 GNUNET_free (ze); 611 GNUNET_free (ze);
612 return; 612 return;
@@ -1197,7 +1197,7 @@ GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h,
1197 msg->rd_count = htons (1); 1197 msg->rd_count = htons (1);
1198 msg->rd_len = htons (rd_ser_len); 1198 msg->rd_len = htons (rd_ser_len);
1199 msg->pkey_len = htons (key_len); 1199 msg->pkey_len = htons (key_len);
1200 msg->expire = GNUNET_TIME_absolute_hton(GNUNET_TIME_absolute_get_forever()); 1200 msg->expire = GNUNET_TIME_absolute_hton(GNUNET_TIME_UNIT_FOREVER_ABS);
1201 memcpy (pkey_tmp, pkey_enc, key_len); 1201 memcpy (pkey_tmp, pkey_enc, key_len);
1202 memcpy (name_tmp, name, name_len); 1202 memcpy (name_tmp, name, name_len);
1203 memcpy (rd_tmp, rd_ser, rd_ser_len); 1203 memcpy (rd_tmp, rd_ser, rd_ser_len);
diff --git a/src/namestore/test_namestore_api.c b/src/namestore/test_namestore_api.c
index c28220fb7..039f1b9d7 100644
--- a/src/namestore/test_namestore_api.c
+++ b/src/namestore/test_namestore_api.c
@@ -197,7 +197,7 @@ run (void *cls, char *const *args, const char *cfgfile,
197 GNUNET_break (NULL != nsh); 197 GNUNET_break (NULL != nsh);
198 198
199 GNUNET_NAMESTORE_record_put (nsh, &pubkey, name, 199 GNUNET_NAMESTORE_record_put (nsh, &pubkey, name,
200 GNUNET_TIME_absolute_get_forever(), 200 GNUNET_TIME_UNIT_FOREVER_ABS,
201 1, &rd, &signature, put_cont, name); 201 1, &rd, &signature, put_cont, name);
202 202
203 GNUNET_free ((void *)rd.data); 203 GNUNET_free ((void *)rd.data);
diff --git a/src/namestore/test_namestore_api_create.c b/src/namestore/test_namestore_api_create.c
index 8a2c8a903..131c934cb 100644
--- a/src/namestore/test_namestore_api_create.c
+++ b/src/namestore/test_namestore_api_create.c
@@ -301,7 +301,7 @@ void name_lookup_initial_proc (void *cls,
301 301
302 /* create a second record */ 302 /* create a second record */
303 s_second_record = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_RecordData) + TEST_CREATE_RECORD_DATALEN); 303 s_second_record = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_RecordData) + TEST_CREATE_RECORD_DATALEN);
304 s_second_record->expiration = GNUNET_TIME_absolute_get_forever(); 304 s_second_record->expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
305 s_second_record->record_type = TEST_CREATE_RECORD_TYPE; 305 s_second_record->record_type = TEST_CREATE_RECORD_TYPE;
306 s_second_record->flags = GNUNET_NAMESTORE_RF_AUTHORITY; 306 s_second_record->flags = GNUNET_NAMESTORE_RF_AUTHORITY;
307 s_second_record->data = &s_second_record[1]; 307 s_second_record->data = &s_second_record[1];
diff --git a/src/namestore/test_namestore_api_create_update.c b/src/namestore/test_namestore_api_create_update.c
index d11c894cc..93570e458 100644
--- a/src/namestore/test_namestore_api_create_update.c
+++ b/src/namestore/test_namestore_api_create_update.c
@@ -294,7 +294,7 @@ void name_lookup_initial_proc (void *cls,
294 294
295 /* create a second record */ 295 /* create a second record */
296 s_second_record = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_RecordData) + TEST_CREATE_RECORD_DATALEN); 296 s_second_record = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_RecordData) + TEST_CREATE_RECORD_DATALEN);
297 s_second_record->expiration = GNUNET_TIME_absolute_get_forever(); 297 s_second_record->expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
298 s_second_record->record_type = TEST_CREATE_RECORD_TYPE; 298 s_second_record->record_type = TEST_CREATE_RECORD_TYPE;
299 s_second_record->flags = GNUNET_NAMESTORE_RF_AUTHORITY; 299 s_second_record->flags = GNUNET_NAMESTORE_RF_AUTHORITY;
300 s_second_record->data = &s_second_record[1]; 300 s_second_record->data = &s_second_record[1];
@@ -406,11 +406,11 @@ create_record (int count)
406 406
407 for (c = 0; c < count; c++) 407 for (c = 0; c < count; c++)
408 { 408 {
409 rd[c].expiration = GNUNET_TIME_absolute_get_zero(); 409 rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS;
410 rd[c].record_type = TEST_RECORD_TYPE; 410 rd[c].record_type = TEST_RECORD_TYPE;
411 rd[c].data_size = TEST_RECORD_DATALEN; 411 rd[c].data_size = TEST_RECORD_DATALEN;
412 rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); 412 rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
413 memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); 413 memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
414 } 414 }
415 415
416 return rd; 416 return rd;
diff --git a/src/namestore/test_namestore_api_lookup.c b/src/namestore/test_namestore_api_lookup.c
index 3857ca141..734e5b8fb 100644
--- a/src/namestore/test_namestore_api_lookup.c
+++ b/src/namestore/test_namestore_api_lookup.c
@@ -284,7 +284,7 @@ run (void *cls, char *const *args, const char *cfgfile,
284 GNUNET_break (s_name != NULL); 284 GNUNET_break (s_name != NULL);
285 285
286 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name, 286 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
287 GNUNET_TIME_absolute_get_forever(), 287 GNUNET_TIME_UNIT_FOREVER_ABS
288 RECORDS, s_rd, s_signature, put_cont, s_name); 288 RECORDS, s_rd, s_signature, put_cont, s_name);
289 289
290 290
diff --git a/src/namestore/test_namestore_api_lookup_specific_type.c b/src/namestore/test_namestore_api_lookup_specific_type.c
index 03a6887c6..981e252de 100644
--- a/src/namestore/test_namestore_api_lookup_specific_type.c
+++ b/src/namestore/test_namestore_api_lookup_specific_type.c
@@ -279,11 +279,11 @@ create_record (int count)
279 279
280 for (c = 0; c < RECORDS-1; c++) 280 for (c = 0; c < RECORDS-1; c++)
281 { 281 {
282 rd[c].expiration = GNUNET_TIME_absolute_get_zero(); 282 rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS;
283 rd[c].record_type = 1; 283 rd[c].record_type = 1;
284 rd[c].data_size = TEST_RECORD_DATALEN; 284 rd[c].data_size = TEST_RECORD_DATALEN;
285 rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); 285 rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
286 memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); 286 memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
287 } 287 }
288 288
289 rd[c].expiration = GNUNET_TIME_absolute_get(); 289 rd[c].expiration = GNUNET_TIME_absolute_get();
@@ -358,7 +358,7 @@ run (void *cls, char *const *args, const char *cfgfile,
358 GNUNET_break (s_name != NULL); 358 GNUNET_break (s_name != NULL);
359 359
360 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name, 360 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
361 GNUNET_TIME_absolute_get_forever(), 361 GNUNET_TIME_UNIT_FOREVER_ABS,
362 RECORDS, s_rd, s_signature, put_cont, s_name); 362 RECORDS, s_rd, s_signature, put_cont, s_name);
363 363
364 364
diff --git a/src/namestore/test_namestore_api_put.c b/src/namestore/test_namestore_api_put.c
index cdec716da..9315fd3b5 100644
--- a/src/namestore/test_namestore_api_put.c
+++ b/src/namestore/test_namestore_api_put.c
@@ -203,7 +203,7 @@ run (void *cls, char *const *args, const char *cfgfile,
203 GNUNET_break (s_name != NULL); 203 GNUNET_break (s_name != NULL);
204 204
205 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name, 205 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
206 GNUNET_TIME_absolute_get_forever(), 206 GNUNET_TIME_UNIT_FOREVER_ABS,
207 RECORDS, s_rd, signature, put_cont, s_name); 207 RECORDS, s_rd, signature, put_cont, s_name);
208 208
209 GNUNET_free (signature); 209 GNUNET_free (signature);
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c
index d1b566659..57bb4a822 100644
--- a/src/namestore/test_namestore_api_remove.c
+++ b/src/namestore/test_namestore_api_remove.c
@@ -251,11 +251,11 @@ create_record (int count)
251 251
252 for (c = 1; c < RECORDS; c++) 252 for (c = 1; c < RECORDS; c++)
253 { 253 {
254 rd[c].expiration = GNUNET_TIME_absolute_get_zero(); 254 rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS;
255 rd[c].record_type = TEST_RECORD_TYPE; 255 rd[c].record_type = TEST_RECORD_TYPE;
256 rd[c].data_size = TEST_RECORD_DATALEN; 256 rd[c].data_size = TEST_RECORD_DATALEN;
257 rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); 257 rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
258 memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); 258 memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
259 } 259 }
260 260
261 return rd; 261 return rd;
@@ -325,7 +325,7 @@ run (void *cls, char *const *args, const char *cfgfile,
325 GNUNET_break (s_name != NULL); 325 GNUNET_break (s_name != NULL);
326 326
327 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name, 327 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
328 GNUNET_TIME_absolute_get_forever(), 328 GNUNET_TIME_UNIT_FOREVER_ABS,
329 RECORDS, s_rd, s_signature, put_cont, s_name); 329 RECORDS, s_rd, s_signature, put_cont, s_name);
330 330
331 331
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 68920cb96..8c3227874 100644
--- a/src/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/namestore/test_namestore_api_remove_not_existing_record.c
@@ -259,7 +259,7 @@ run (void *cls, char *const *args, const char *cfgfile,
259 GNUNET_break (s_name != NULL); 259 GNUNET_break (s_name != NULL);
260 260
261 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name, 261 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
262 GNUNET_TIME_absolute_get_forever(), 262 GNUNET_TIME_UNIT_FOREVER_ABS,
263 RECORDS, s_rd, s_signature, put_cont, s_name); 263 RECORDS, s_rd, s_signature, put_cont, s_name);
264 264
265 265
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c
index 6743146e0..066554187 100644
--- a/src/namestore/test_namestore_api_zone_iteration.c
+++ b/src/namestore/test_namestore_api_zone_iteration.c
@@ -452,7 +452,7 @@ run (void *cls, char *const *args, const char *cfgfile,
452 GNUNET_asprintf(&s_name_3, "dummy3"); 452 GNUNET_asprintf(&s_name_3, "dummy3");
453 s_rd_3 = create_record(1); 453 s_rd_3 = create_record(1);
454 sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3->expiration, s_name_3, s_rd_3, 1); 454 sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3->expiration, s_name_3, s_rd_3, 1);
455 GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_absolute_get_forever(), 1, s_rd_3, sig_3, &put_cont, NULL); 455 GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
456} 456}
457 457
458static int 458static int
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 192853e5a..b21c860c8 100644
--- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
+++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
@@ -414,7 +414,7 @@ run (void *cls, char *const *args, const char *cfgfile,
414 GNUNET_asprintf(&s_name_3, "dummy3"); 414 GNUNET_asprintf(&s_name_3, "dummy3");
415 s_rd_3 = create_record(1); 415 s_rd_3 = create_record(1);
416 sig_3 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_3[0].expiration, s_name_3, s_rd_3, 1); 416 sig_3 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_3[0].expiration, s_name_3, s_rd_3, 1);
417 GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_absolute_get_forever(), 1, s_rd_3, sig_3, &put_cont, NULL); 417 GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
418} 418}
419 419
420static int 420static int
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c
index f5f2e3a34..9f62c73b6 100644
--- a/src/namestore/test_namestore_api_zone_iteration_stop.c
+++ b/src/namestore/test_namestore_api_zone_iteration_stop.c
@@ -464,7 +464,7 @@ run (void *cls, char *const *args, const char *cfgfile,
464 GNUNET_asprintf(&s_name_3, "dummy3"); 464 GNUNET_asprintf(&s_name_3, "dummy3");
465 s_rd_3 = create_record(1); 465 s_rd_3 = create_record(1);
466 sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3[0].expiration, s_name_3, s_rd_3, 1); 466 sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3[0].expiration, s_name_3, s_rd_3, 1);
467 GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_absolute_get_forever(), 1, s_rd_3, sig_3, &put_cont, NULL); 467 GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
468} 468}
469 469
470static int 470static int
diff --git a/src/namestore/test_namestore_record_serialization.c b/src/namestore/test_namestore_record_serialization.c
index a045e59a5..5e952539b 100644
--- a/src/namestore/test_namestore_record_serialization.c
+++ b/src/namestore/test_namestore_record_serialization.c
@@ -78,7 +78,7 @@ run (void *cls, char *const *args, const char *cfgfile,
78 GNUNET_break (0); 78 GNUNET_break (0);
79 res = 1; 79 res = 1;
80 } 80 }
81 if (GNUNET_TIME_absolute_get_difference(src[c].expiration, dst[c].expiration).rel_value != GNUNET_TIME_relative_get_zero().rel_value) 81 if (0 != GNUNET_TIME_absolute_get_difference(src[c].expiration, dst[c].expiration).rel_value)
82 { 82 {
83 GNUNET_break (0); 83 GNUNET_break (0);
84 res = 1; 84 res = 1;
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c
index 4748ed370..4a4bea5ed 100644
--- a/src/nse/gnunet-nse-profiler.c
+++ b/src/nse/gnunet-nse-profiler.c
@@ -896,7 +896,7 @@ run (void *cls, char *const *args, const char *cfgfile,
896 &connect_cb, &my_cb, NULL, hosts); 896 &connect_cb, &my_cb, NULL, hosts);
897 GNUNET_assert (pg != NULL); 897 GNUNET_assert (pg != NULL);
898 shutdown_handle = 898 shutdown_handle =
899 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (), 899 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
900 &shutdown_task, NULL); 900 &shutdown_task, NULL);
901} 901}
902 902
diff --git a/src/nse/nse_profiler_test.conf b/src/nse/nse_profiler_test.conf
index 0185ed217..3a3217dbc 100644
--- a/src/nse/nse_profiler_test.conf
+++ b/src/nse/nse_profiler_test.conf
@@ -104,7 +104,7 @@ AUTOSTART = NO
104AUTOSTART = NO 104AUTOSTART = NO
105 105
106[testing] 106[testing]
107NUM_PEERS = 4000 107NUM_PEERS = 2000
108WEAKRANDOM = YES 108WEAKRANDOM = YES
109TOPOLOGY = NONE 109TOPOLOGY = NONE
110#CONNECT_TOPOLOGY = SMALL_WORLD_RING 110#CONNECT_TOPOLOGY = SMALL_WORLD_RING
@@ -122,7 +122,7 @@ HOSTKEYSFILE = hostkeys.dat
122MAX_CONCURRENT_SSH = 20 122MAX_CONCURRENT_SSH = 20
123USE_PROGRESSBARS = YES 123USE_PROGRESSBARS = YES
124PEERGROUP_TIMEOUT = 1000 s 124PEERGROUP_TIMEOUT = 1000 s
125TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers_initial 125TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers_initial
126MAX_OUTSTANDING_CONNECTIONS = 100 126MAX_OUTSTANDING_CONNECTIONS = 100
127#SINGLE_PEERINFO_PER_HOST = YES 127#SINGLE_PEERINFO_PER_HOST = YES
128#NUM_PEERINFO_PER_HOST = 10 128#NUM_PEERINFO_PER_HOST = 10
@@ -132,20 +132,20 @@ DELETE_FILES = NO
132#SKEW_VARIANCE = 30000 132#SKEW_VARIANCE = 30000
133 133
134[nse-profiler] 134[nse-profiler]
135OUTPUT_FILE = nse_output_4000_peers.dat 135OUTPUT_FILE = nse_output_2000_peers.dat
136TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers 136TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers
137DATA_OUTPUT_FILE = nse_stats_4000_peers 137DATA_OUTPUT_FILE = nse_stats_2000_peers
138ROUND0 = 1000 138ROUND0 = 1000
139#ROUND1 = 4000 139#ROUND1 = 2000
140ROUND2 = 4000 140ROUND2 = 2000
141ROUND3 = 4000 141ROUND3 = 2000
142ROUND4 = 4000 142ROUND4 = 2000
143ROUND5 = 4000 143ROUND5 = 2000
144ROUND6 = 4000 144ROUND6 = 2000
145ROUND7 = 4000 145ROUND7 = 2000
146ROUND8 = 4000 146ROUND8 = 2000
147ROUND9 = 4000 147ROUND9 = 2000
148ROUND10 = 4000 148ROUND10 = 2000
149ROUND11 = 1000 149ROUND11 = 1000
150ROUND12 = 1000 150ROUND12 = 1000
151ROUND13 = 1000 151ROUND13 = 1000
diff --git a/src/testing/test_testing_2dtorus.c b/src/testing/test_testing_2dtorus.c
index 7b109bca4..00a66d65c 100644
--- a/src/testing/test_testing_2dtorus.c
+++ b/src/testing/test_testing_2dtorus.c
@@ -317,7 +317,7 @@ run (void *cls, char *const *args, const char *cfgfile,
317 hosts); 317 hosts);
318 GNUNET_assert (pg != NULL); 318 GNUNET_assert (pg != NULL);
319 shutdown_handle = 319 shutdown_handle =
320 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (), 320 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
321 &shutdown_task, NULL); 321 &shutdown_task, NULL);
322} 322}
323 323
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 8c83f988f..245ebd3d9 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -4968,7 +4968,7 @@ schedule_get_statistics (void *cls,
4968 4968
4969 core_context->stats_get_handle = 4969 core_context->stats_get_handle =
4970 GNUNET_STATISTICS_get (core_context->stats_handle, NULL, NULL, 4970 GNUNET_STATISTICS_get (core_context->stats_handle, NULL, NULL,
4971 GNUNET_TIME_relative_get_forever (), 4971 GNUNET_TIME_UNIT_FOREVER_REL,
4972 &internal_stats_cont, &internal_stats_callback, 4972 &internal_stats_cont, &internal_stats_callback,
4973 core_context); 4973 core_context);
4974 if (core_context->stats_get_handle == NULL) 4974 if (core_context->stats_get_handle == NULL)
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c
index 37f7f798d..d55cdb76b 100644
--- a/src/transport/plugin_transport_http.c
+++ b/src/transport/plugin_transport_http.c
@@ -620,8 +620,6 @@ create_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target,
620 s->addr = GNUNET_malloc (addrlen); 620 s->addr = GNUNET_malloc (addrlen);
621 memcpy (s->addr, addr, addrlen); 621 memcpy (s->addr, addr, addrlen);
622 s->addrlen = addrlen; 622 s->addrlen = addrlen;
623 s->next = NULL;
624 s->next_receive = GNUNET_TIME_absolute_get_zero ();
625 s->ats_address_network_type = htonl (GNUNET_ATS_NET_UNSPECIFIED); 623 s->ats_address_network_type = htonl (GNUNET_ATS_NET_UNSPECIFIED);
626 start_session_timeout(s); 624 start_session_timeout(s);
627 return s; 625 return s;
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index bee885453..fce6bd1a3 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -542,7 +542,7 @@ create:
542 s->ats_address_network_type = ats.value; 542 s->ats_address_network_type = ats.value;
543 543
544 s->inbound = GNUNET_YES; 544 s->inbound = GNUNET_YES;
545 s->next_receive = GNUNET_TIME_absolute_get_zero (); 545 s->next_receive = GNUNET_TIME_UNIT_ZERO_ABS;
546 s->tag = tag; 546 s->tag = tag;
547 if (0 == strcmp (MHD_HTTP_METHOD_PUT, method)) 547 if (0 == strcmp (MHD_HTTP_METHOD_PUT, method))
548 s->server_recv = s; 548 s->server_recv = s;
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 45387cfc8..474180db5 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -846,16 +846,11 @@ create_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target,
846 GNUNET_break_op (0); 846 GNUNET_break_op (0);
847 return NULL; 847 return NULL;
848 } 848 }
849
850 s->addrlen = len; 849 s->addrlen = len;
851 s->target = *target; 850 s->target = *target;
852 s->sock_addr = (const struct sockaddr *) &s[1]; 851 s->sock_addr = (const struct sockaddr *) &s[1];
853 s->flow_delay_for_other_peer = GNUNET_TIME_relative_get_zero();
854 s->flow_delay_from_other_peer = GNUNET_TIME_absolute_get_zero();
855 s->last_expected_delay = GNUNET_TIME_UNIT_SECONDS; 852 s->last_expected_delay = GNUNET_TIME_UNIT_SECONDS;
856
857 start_session_timeout(s); 853 start_session_timeout(s);
858
859 return s; 854 return s;
860} 855}
861 856
@@ -1521,14 +1516,10 @@ ack_proc (void *cls, uint32_t id, const struct GNUNET_MessageHeader *msg)
1521 sockaddr_in6)), 1516 sockaddr_in6)),
1522 delay); 1517 delay);
1523 udpw = GNUNET_malloc (sizeof (struct UDPMessageWrapper) + msize); 1518 udpw = GNUNET_malloc (sizeof (struct UDPMessageWrapper) + msize);
1524 udpw->cont = NULL;
1525 udpw->cont_cls = NULL;
1526 udpw->frag_ctx = NULL;
1527 udpw->msg_size = msize; 1519 udpw->msg_size = msize;
1528 udpw->session = s; 1520 udpw->session = s;
1529 udpw->timeout = GNUNET_TIME_absolute_get_forever(); 1521 udpw->timeout = GNUNET_TIME_UNIT_FOREVER_ABS;
1530 udpw->udp = (char *)&udpw[1]; 1522 udpw->udp = (char *)&udpw[1];
1531
1532 udp_ack = (struct UDP_ACK_Message *) udpw->udp; 1523 udp_ack = (struct UDP_ACK_Message *) udpw->udp;
1533 udp_ack->header.size = htons ((uint16_t) msize); 1524 udp_ack->header.size = htons ((uint16_t) msize);
1534 udp_ack->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_ACK); 1525 udp_ack->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_ACK);
diff --git a/src/util/test_time.c b/src/util/test_time.c
index 788884fcc..b4c723344 100644
--- a/src/util/test_time.c
+++ b/src/util/test_time.c
@@ -43,9 +43,9 @@ check ()
43 struct GNUNET_TIME_RelativeNBO reln; 43 struct GNUNET_TIME_RelativeNBO reln;
44 unsigned int i; 44 unsigned int i;
45 45
46 forever = GNUNET_TIME_absolute_get_forever (); 46 forever = GNUNET_TIME_UNIT_FOREVER_ABS;
47 relForever = GNUNET_TIME_relative_get_forever (); 47 relForever = GNUNET_TIME_UNIT_FOREVER_REL;
48 relUnit = GNUNET_TIME_relative_get_unit (); 48 relUnit = GNUNET_TIME_UNIT_MILLISECONDS;
49 zero.abs_value = 0; 49 zero.abs_value = 0;
50 50
51 last = now = GNUNET_TIME_absolute_get (); 51 last = now = GNUNET_TIME_absolute_get ();
@@ -62,7 +62,7 @@ check ()
62 GNUNET_assert (rel.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value); 62 GNUNET_assert (rel.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value);
63 /*check zero */ 63 /*check zero */
64 rel.rel_value = (UINT64_MAX) - 1024; 64 rel.rel_value = (UINT64_MAX) - 1024;
65 GNUNET_assert (GNUNET_TIME_relative_get_zero ().rel_value == 65 GNUNET_assert (GNUNET_TIME_UNIT_ZERO.rel_value ==
66 GNUNET_TIME_relative_multiply (rel, 0).rel_value); 66 GNUNET_TIME_relative_multiply (rel, 0).rel_value);
67 67
68 /* test infinity-check for relative to absolute */ 68 /* test infinity-check for relative to absolute */
@@ -77,7 +77,7 @@ check ()
77 GNUNET_TIME_relative_to_absolute (rel).abs_value); 77 GNUNET_TIME_relative_to_absolute (rel).abs_value);
78 /*check forever */ 78 /*check forever */
79 rel.rel_value = UINT64_MAX; 79 rel.rel_value = UINT64_MAX;
80 GNUNET_assert (GNUNET_TIME_absolute_get_forever ().abs_value == 80 GNUNET_assert (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value ==
81 GNUNET_TIME_relative_to_absolute (rel).abs_value); 81 GNUNET_TIME_relative_to_absolute (rel).abs_value);
82 /* check overflow for r2a */ 82 /* check overflow for r2a */
83 rel.rel_value = (UINT64_MAX) - 1024; 83 rel.rel_value = (UINT64_MAX) - 1024;
@@ -125,8 +125,8 @@ check ()
125 rel = GNUNET_TIME_absolute_get_remaining (future); 125 rel = GNUNET_TIME_absolute_get_remaining (future);
126 GNUNET_assert (rel.rel_value > 0); 126 GNUNET_assert (rel.rel_value > 0);
127 GNUNET_assert (rel.rel_value <= 1000000); 127 GNUNET_assert (rel.rel_value <= 1000000);
128 forever = GNUNET_TIME_absolute_get_forever (); 128 forever = GNUNET_TIME_UNIT_FOREVER_ABS;
129 GNUNET_assert (GNUNET_TIME_relative_get_forever ().rel_value == 129 GNUNET_assert (GNUNET_TIME_UNIT_FOREVER_REL.rel_value ==
130 GNUNET_TIME_absolute_get_remaining (forever).rel_value); 130 GNUNET_TIME_absolute_get_remaining (forever).rel_value);
131 131
132 /* check endianess */ 132 /* check endianess */
@@ -175,13 +175,13 @@ check ()
175 175
176 176
177 /* check Return absolute time of 0ms */ 177 /* check Return absolute time of 0ms */
178 zero = GNUNET_TIME_absolute_get_zero (); 178 zero = GNUNET_TIME_UNIT_ZERO_ABS;
179 179
180 /* check GNUNET_TIME_calculate_eta */ 180 /* check GNUNET_TIME_calculate_eta */
181 last.abs_value = GNUNET_TIME_absolute_get ().abs_value - 1024; 181 last.abs_value = GNUNET_TIME_absolute_get ().abs_value - 1024;
182 forever = GNUNET_TIME_absolute_get_forever (); 182 forever = GNUNET_TIME_UNIT_FOREVER_ABS;
183 forever.abs_value = forever.abs_value - 1024; 183 forever.abs_value = forever.abs_value - 1024;
184 GNUNET_assert (GNUNET_TIME_absolute_get_zero ().abs_value == 184 GNUNET_assert (GNUNET_TIME_UNIT_ZERO_ABS.abs_value ==
185 GNUNET_TIME_calculate_eta (forever, 50000, 100000).rel_value); 185 GNUNET_TIME_calculate_eta (forever, 50000, 100000).rel_value);
186 /* check zero */ 186 /* check zero */
187 GNUNET_log_skip (1, GNUNET_NO); 187 GNUNET_log_skip (1, GNUNET_NO);
@@ -199,11 +199,11 @@ check ()
199 GNUNET_assert (1024 == 199 GNUNET_assert (1024 ==
200 GNUNET_TIME_relative_subtract (relForever, rel).rel_value); 200 GNUNET_TIME_relative_subtract (relForever, rel).rel_value);
201 /*check zero */ 201 /*check zero */
202 GNUNET_assert (GNUNET_TIME_relative_get_zero ().rel_value == 202 GNUNET_assert (GNUNET_TIME_UNIT_ZERO.rel_value ==
203 GNUNET_TIME_relative_subtract (rel, relForever).rel_value); 203 GNUNET_TIME_relative_subtract (rel, relForever).rel_value);
204 /*check forever */ 204 /*check forever */
205 rel.rel_value = UINT64_MAX; 205 rel.rel_value = UINT64_MAX;
206 GNUNET_assert (GNUNET_TIME_relative_get_forever ().rel_value == 206 GNUNET_assert (GNUNET_TIME_UNIT_FOREVER_REL.rel_value ==
207 GNUNET_TIME_relative_subtract (rel, relForever).rel_value); 207 GNUNET_TIME_relative_subtract (rel, relForever).rel_value);
208 208
209 /*check GNUNET_TIME_relative_min */ 209 /*check GNUNET_TIME_relative_min */
diff --git a/src/util/time.c b/src/util/time.c
index 3a6f38041..7467b4497 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -68,7 +68,7 @@ GNUNET_TIME_absolute_get ()
68 * Return relative time of 0ms. 68 * Return relative time of 0ms.
69 */ 69 */
70struct GNUNET_TIME_Relative 70struct GNUNET_TIME_Relative
71GNUNET_TIME_relative_get_zero () 71GNUNET_TIME_relative_get_zero_ ()
72{ 72{
73 static struct GNUNET_TIME_Relative zero; 73 static struct GNUNET_TIME_Relative zero;
74 74
@@ -80,28 +80,63 @@ GNUNET_TIME_relative_get_zero ()
80 * Return absolute time of 0ms. 80 * Return absolute time of 0ms.
81 */ 81 */
82struct GNUNET_TIME_Absolute 82struct GNUNET_TIME_Absolute
83GNUNET_TIME_absolute_get_zero () 83GNUNET_TIME_absolute_get_zero_ ()
84{ 84{
85 static struct GNUNET_TIME_Absolute zero; 85 static struct GNUNET_TIME_Absolute zero;
86 86
87 return zero; 87 return zero;
88} 88}
89 89
90
90/** 91/**
91 * Return relative time of 1ms. 92 * Return relative time of 1ms.
92 */ 93 */
93struct GNUNET_TIME_Relative 94struct GNUNET_TIME_Relative
94GNUNET_TIME_relative_get_unit () 95GNUNET_TIME_relative_get_unit_ ()
95{ 96{
96 static struct GNUNET_TIME_Relative one = { 1 }; 97 static struct GNUNET_TIME_Relative one = { 1 };
97 return one; 98 return one;
98} 99}
99 100
101
102/**
103 * Return relative time of 1s.
104 */
105struct GNUNET_TIME_Relative
106GNUNET_TIME_relative_get_second_ ()
107{
108 static struct GNUNET_TIME_Relative one = { 1000 };
109 return one;
110}
111
112
113/**
114 * Return relative time of 1 minute.
115 */
116struct GNUNET_TIME_Relative
117GNUNET_TIME_relative_get_minute_ ()
118{
119 static struct GNUNET_TIME_Relative one = { 60 * 1000 };
120 return one;
121}
122
123
124/**
125 * Return relative time of 1 hour.
126 */
127struct GNUNET_TIME_Relative
128GNUNET_TIME_relative_get_hour_ ()
129{
130 static struct GNUNET_TIME_Relative one = { 60 * 60 * 1000 };
131 return one;
132}
133
134
100/** 135/**
101 * Return "forever". 136 * Return "forever".
102 */ 137 */
103struct GNUNET_TIME_Relative 138struct GNUNET_TIME_Relative
104GNUNET_TIME_relative_get_forever () 139GNUNET_TIME_relative_get_forever_ ()
105{ 140{
106 static struct GNUNET_TIME_Relative forever = { UINT64_MAX }; 141 static struct GNUNET_TIME_Relative forever = { UINT64_MAX };
107 return forever; 142 return forever;
@@ -111,7 +146,7 @@ GNUNET_TIME_relative_get_forever ()
111 * Return "forever". 146 * Return "forever".
112 */ 147 */
113struct GNUNET_TIME_Absolute 148struct GNUNET_TIME_Absolute
114GNUNET_TIME_absolute_get_forever () 149GNUNET_TIME_absolute_get_forever_ ()
115{ 150{
116 static struct GNUNET_TIME_Absolute forever = { UINT64_MAX }; 151 static struct GNUNET_TIME_Absolute forever = { UINT64_MAX };
117 return forever; 152 return forever;
@@ -129,13 +164,13 @@ GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel)
129 struct GNUNET_TIME_Absolute ret; 164 struct GNUNET_TIME_Absolute ret;
130 165
131 if (rel.rel_value == UINT64_MAX) 166 if (rel.rel_value == UINT64_MAX)
132 return GNUNET_TIME_absolute_get_forever (); 167 return GNUNET_TIME_UNIT_FOREVER_ABS;
133 struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); 168 struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
134 169
135 if (rel.rel_value + now.abs_value < rel.rel_value) 170 if (rel.rel_value + now.abs_value < rel.rel_value)
136 { 171 {
137 GNUNET_break (0); /* overflow... */ 172 GNUNET_break (0); /* overflow... */
138 return GNUNET_TIME_absolute_get_forever (); 173 return GNUNET_TIME_UNIT_FOREVER_ABS;
139 } 174 }
140 ret.abs_value = rel.rel_value + now.abs_value; 175 ret.abs_value = rel.rel_value + now.abs_value;
141 return ret; 176 return ret;
@@ -215,11 +250,11 @@ GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future)
215 struct GNUNET_TIME_Relative ret; 250 struct GNUNET_TIME_Relative ret;
216 251
217 if (future.abs_value == UINT64_MAX) 252 if (future.abs_value == UINT64_MAX)
218 return GNUNET_TIME_relative_get_forever (); 253 return GNUNET_TIME_UNIT_FOREVER_REL;
219 struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); 254 struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
220 255
221 if (now.abs_value > future.abs_value) 256 if (now.abs_value > future.abs_value)
222 return GNUNET_TIME_relative_get_zero (); 257 return GNUNET_TIME_UNIT_ZERO;
223 ret.rel_value = future.abs_value - now.abs_value; 258 ret.rel_value = future.abs_value - now.abs_value;
224 return ret; 259 return ret;
225} 260}
@@ -238,9 +273,9 @@ GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start,
238 struct GNUNET_TIME_Relative ret; 273 struct GNUNET_TIME_Relative ret;
239 274
240 if (end.abs_value == UINT64_MAX) 275 if (end.abs_value == UINT64_MAX)
241 return GNUNET_TIME_relative_get_forever (); 276 return GNUNET_TIME_UNIT_FOREVER_REL;
242 if (end.abs_value < start.abs_value) 277 if (end.abs_value < start.abs_value)
243 return GNUNET_TIME_relative_get_zero (); 278 return GNUNET_TIME_UNIT_ZERO;
244 ret.rel_value = end.abs_value - start.abs_value; 279 ret.rel_value = end.abs_value - start.abs_value;
245 return ret; 280 return ret;
246} 281}
@@ -260,7 +295,7 @@ GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence)
260 now = GNUNET_TIME_absolute_get (); 295 now = GNUNET_TIME_absolute_get ();
261 GNUNET_assert (whence.abs_value != UINT64_MAX); 296 GNUNET_assert (whence.abs_value != UINT64_MAX);
262 if (whence.abs_value > now.abs_value) 297 if (whence.abs_value > now.abs_value)
263 return GNUNET_TIME_relative_get_zero (); 298 return GNUNET_TIME_UNIT_ZERO;
264 ret.rel_value = now.abs_value - whence.abs_value; 299 ret.rel_value = now.abs_value - whence.abs_value;
265 return ret; 300 return ret;
266} 301}
@@ -279,11 +314,11 @@ GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start,
279 struct GNUNET_TIME_Absolute ret; 314 struct GNUNET_TIME_Absolute ret;
280 315
281 if ((start.abs_value == UINT64_MAX) || (duration.rel_value == UINT64_MAX)) 316 if ((start.abs_value == UINT64_MAX) || (duration.rel_value == UINT64_MAX))
282 return GNUNET_TIME_absolute_get_forever (); 317 return GNUNET_TIME_UNIT_FOREVER_ABS;
283 if (start.abs_value + duration.rel_value < start.abs_value) 318 if (start.abs_value + duration.rel_value < start.abs_value)
284 { 319 {
285 GNUNET_break (0); 320 GNUNET_break (0);
286 return GNUNET_TIME_absolute_get_forever (); 321 return GNUNET_TIME_UNIT_FOREVER_ABS;
287 } 322 }
288 ret.abs_value = start.abs_value + duration.rel_value; 323 ret.abs_value = start.abs_value + duration.rel_value;
289 return ret; 324 return ret;
@@ -325,12 +360,12 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
325 struct GNUNET_TIME_Relative ret; 360 struct GNUNET_TIME_Relative ret;
326 361
327 if (factor == 0) 362 if (factor == 0)
328 return GNUNET_TIME_relative_get_zero (); 363 return GNUNET_TIME_UNIT_ZERO;
329 ret.rel_value = rel.rel_value * (unsigned long long) factor; 364 ret.rel_value = rel.rel_value * (unsigned long long) factor;
330 if (ret.rel_value / factor != rel.rel_value) 365 if (ret.rel_value / factor != rel.rel_value)
331 { 366 {
332 GNUNET_break (0); 367 GNUNET_break (0);
333 return GNUNET_TIME_relative_get_forever (); 368 return GNUNET_TIME_UNIT_FOREVER_REL;
334 } 369 }
335 return ret; 370 return ret;
336} 371}
@@ -401,11 +436,11 @@ GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1,
401 struct GNUNET_TIME_Relative ret; 436 struct GNUNET_TIME_Relative ret;
402 437
403 if ((a1.rel_value == UINT64_MAX) || (a2.rel_value == UINT64_MAX)) 438 if ((a1.rel_value == UINT64_MAX) || (a2.rel_value == UINT64_MAX))
404 return GNUNET_TIME_relative_get_forever (); 439 return GNUNET_TIME_UNIT_FOREVER_REL;
405 if (a1.rel_value + a2.rel_value < a1.rel_value) 440 if (a1.rel_value + a2.rel_value < a1.rel_value)
406 { 441 {
407 GNUNET_break (0); 442 GNUNET_break (0);
408 return GNUNET_TIME_relative_get_forever (); 443 return GNUNET_TIME_UNIT_FOREVER_REL;
409 } 444 }
410 ret.rel_value = a1.rel_value + a2.rel_value; 445 ret.rel_value = a1.rel_value + a2.rel_value;
411 return ret; 446 return ret;
@@ -426,9 +461,9 @@ GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1,
426 struct GNUNET_TIME_Relative ret; 461 struct GNUNET_TIME_Relative ret;
427 462
428 if (a2.rel_value >= a1.rel_value) 463 if (a2.rel_value >= a1.rel_value)
429 return GNUNET_TIME_relative_get_zero (); 464 return GNUNET_TIME_UNIT_ZERO;
430 if (a1.rel_value == UINT64_MAX) 465 if (a1.rel_value == UINT64_MAX)
431 return GNUNET_TIME_relative_get_forever (); 466 return GNUNET_TIME_UNIT_FOREVER_REL;
432 ret.rel_value = a1.rel_value - a2.rel_value; 467 ret.rel_value = a1.rel_value - a2.rel_value;
433 return ret; 468 return ret;
434} 469}