gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r25873 - in gnunet: doc/man src/vpn


From: gnunet
Subject: [GNUnet-SVN] r25873 - in gnunet: doc/man src/vpn
Date: Thu, 24 Jan 2013 11:16:44 +0100

Author: grothoff
Date: 2013-01-24 11:16:44 +0100 (Thu, 24 Jan 2013)
New Revision: 25873

Modified:
   gnunet/doc/man/gnunet-vpn.1
   gnunet/src/vpn/gnunet-vpn.c
Log:
-parse time nicely

Modified: gnunet/doc/man/gnunet-vpn.1
===================================================================
--- gnunet/doc/man/gnunet-vpn.1 2013-01-24 10:11:13 UTC (rev 25872)
+++ gnunet/doc/man/gnunet-vpn.1 2013-01-24 10:16:44 UTC (rev 25873)
@@ -27,8 +27,8 @@
 .IP "\-c FILENAME,  \-\-config=FILENAME"
 Use the configuration file FILENAME.
 .B
-.IP "\-d SEC, \-\-duration SEC"
-The mapping should be established for SEC seconds.  Default is 5 minutes.
+.IP "\-d TIME, \-\-duration TIME"
+The mapping should be established for TIME.  The value given must be a number 
followed by a space and a time unit, for example "500 ms".  Note that the 
quotes are required on the shell. Default is 5 minutes.
 .B
 .IP "\-h, \-\-help"
 Print short help on options.

Modified: gnunet/src/vpn/gnunet-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-vpn.c 2013-01-24 10:11:13 UTC (rev 25872)
+++ gnunet/src/vpn/gnunet-vpn.c 2013-01-24 10:16:44 UTC (rev 25873)
@@ -92,7 +92,7 @@
 /**
  * Option '-d': duration of the mapping
  */
-static unsigned long long duration = 5 * 60;
+static struct GNUNET_TIME_Relative duration = { 5 * 60 * 1000} ;
 
 
 /**
@@ -180,8 +180,7 @@
   uint8_t protocol;
   struct GNUNET_TIME_Absolute etime;
 
-  etime = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS,
-                                                                          
(unsigned int) duration));
+  etime = GNUNET_TIME_relative_to_absolute (duration);
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
                                &do_disconnect, NULL);
   handle = GNUNET_VPN_connect (cfg);
@@ -301,9 +300,9 @@
     {'a', "after-connect", NULL,
      gettext_noop ("print IP address only after mesh tunnel has been created"),
      0, &GNUNET_GETOPT_set_one, &ipv6},
-    {'d', "duration", "SECONDS",
+    {'d', "duration", "TIME",
      gettext_noop ("how long should the mapping be valid for new tunnels?"),
-     1, &GNUNET_GETOPT_set_ulong, &duration},
+     1, &GNUNET_GETOPT_set_relative_time, &duration},
     {'i', "ip", "IP",
      gettext_noop ("destination IP for the tunnel"),
      1, &GNUNET_GETOPT_set_string, &target_ip},




reply via email to

[Prev in Thread] Current Thread [Next in Thread]