aboutsummaryrefslogtreecommitdiff
path: root/src/vpn/gnunet-vpn.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-01-24 10:16:44 +0000
committerChristian Grothoff <christian@grothoff.org>2013-01-24 10:16:44 +0000
commitf1649b1c350008f59a99051c5cfefe8ce998b2f3 (patch)
treef1465066b6fb5bd7080300f8a3eaf5ba129be391 /src/vpn/gnunet-vpn.c
parenteb7e0beb4eeb7897e25b1afbd9575e9111199e43 (diff)
downloadgnunet-f1649b1c350008f59a99051c5cfefe8ce998b2f3.tar.gz
gnunet-f1649b1c350008f59a99051c5cfefe8ce998b2f3.zip
-parse time nicely
Diffstat (limited to 'src/vpn/gnunet-vpn.c')
-rw-r--r--src/vpn/gnunet-vpn.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/vpn/gnunet-vpn.c b/src/vpn/gnunet-vpn.c
index 61d145c6e..6402e1063 100644
--- a/src/vpn/gnunet-vpn.c
+++ b/src/vpn/gnunet-vpn.c
@@ -92,7 +92,7 @@ static int ret;
92/** 92/**
93 * Option '-d': duration of the mapping 93 * Option '-d': duration of the mapping
94 */ 94 */
95static unsigned long long duration = 5 * 60; 95static struct GNUNET_TIME_Relative duration = { 5 * 60 * 1000} ;
96 96
97 97
98/** 98/**
@@ -180,8 +180,7 @@ run (void *cls, char *const *args, const char *cfgfile,
180 uint8_t protocol; 180 uint8_t protocol;
181 struct GNUNET_TIME_Absolute etime; 181 struct GNUNET_TIME_Absolute etime;
182 182
183 etime = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 183 etime = GNUNET_TIME_relative_to_absolute (duration);
184 (unsigned int) duration));
185 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 184 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
186 &do_disconnect, NULL); 185 &do_disconnect, NULL);
187 handle = GNUNET_VPN_connect (cfg); 186 handle = GNUNET_VPN_connect (cfg);
@@ -301,9 +300,9 @@ main (int argc, char *const *argv)
301 {'a', "after-connect", NULL, 300 {'a', "after-connect", NULL,
302 gettext_noop ("print IP address only after mesh tunnel has been created"), 301 gettext_noop ("print IP address only after mesh tunnel has been created"),
303 0, &GNUNET_GETOPT_set_one, &ipv6}, 302 0, &GNUNET_GETOPT_set_one, &ipv6},
304 {'d', "duration", "SECONDS", 303 {'d', "duration", "TIME",
305 gettext_noop ("how long should the mapping be valid for new tunnels?"), 304 gettext_noop ("how long should the mapping be valid for new tunnels?"),
306 1, &GNUNET_GETOPT_set_ulong, &duration}, 305 1, &GNUNET_GETOPT_set_relative_time, &duration},
307 {'i', "ip", "IP", 306 {'i', "ip", "IP",
308 gettext_noop ("destination IP for the tunnel"), 307 gettext_noop ("destination IP for the tunnel"),
309 1, &GNUNET_GETOPT_set_string, &target_ip}, 308 1, &GNUNET_GETOPT_set_string, &target_ip},