aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo-tool/gnunet-peerinfo.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-07-10 10:19:18 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-07-10 10:19:18 +0000
commit241626de97c0b745e64377ca948841f21d2f68d6 (patch)
tree39ebd1d3f454a32411ad66cb3e08f7ca9ca6d981 /src/peerinfo-tool/gnunet-peerinfo.c
parent83c70c11a7d04a593e3f399fc83e9b9d24441e6f (diff)
downloadgnunet-241626de97c0b745e64377ca948841f21d2f68d6.tar.gz
gnunet-241626de97c0b745e64377ca948841f21d2f68d6.zip
including expiration time in output
Diffstat (limited to 'src/peerinfo-tool/gnunet-peerinfo.c')
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c
index 551f2daa4..74ee1726f 100644
--- a/src/peerinfo-tool/gnunet-peerinfo.c
+++ b/src/peerinfo-tool/gnunet-peerinfo.c
@@ -54,6 +54,11 @@ struct AddressRecord
54 struct GNUNET_TRANSPORT_AddressToStringContext *atsc; 54 struct GNUNET_TRANSPORT_AddressToStringContext *atsc;
55 55
56 /** 56 /**
57 * Address expiration time
58 */
59 struct GNUNET_TIME_Absolute expiration;
60
61 /**
57 * Printable address. 62 * Printable address.
58 */ 63 */
59 char *result; 64 char *result;
@@ -233,7 +238,7 @@ dump_pc (struct PrintContext *pc)
233 { 238 {
234 if (NULL != pc->address_list[i].result) 239 if (NULL != pc->address_list[i].result)
235 { 240 {
236 printf ("\t%s\n", pc->address_list[i].result); 241 printf (_("\tExpires: %s \t %s\n"), GNUNET_STRINGS_absolute_time_to_string(pc->address_list[i].expiration), pc->address_list[i].result);
237 GNUNET_free (pc->address_list[i].result); 242 GNUNET_free (pc->address_list[i].result);
238 } 243 }
239 } 244 }
@@ -310,10 +315,10 @@ print_address (void *cls, const struct GNUNET_HELLO_Address *address,
310{ 315{
311 struct PrintContext *pc = cls; 316 struct PrintContext *pc = cls;
312 struct AddressRecord *ar; 317 struct AddressRecord *ar;
313
314 GNUNET_assert (0 < pc->off); 318 GNUNET_assert (0 < pc->off);
315 ar = &pc->address_list[--pc->off]; 319 ar = &pc->address_list[--pc->off];
316 ar->pc = pc; 320 ar->pc = pc;
321 ar->expiration = expiration;
317 ar->atsc = GNUNET_TRANSPORT_address_to_string (cfg, address, no_resolve, 322 ar->atsc = GNUNET_TRANSPORT_address_to_string (cfg, address, no_resolve,
318 GNUNET_TIME_relative_multiply 323 GNUNET_TIME_relative_multiply
319 (GNUNET_TIME_UNIT_SECONDS, 10), 324 (GNUNET_TIME_UNIT_SECONDS, 10),