diff options
-rw-r--r-- | doc/man/gnunet-gns.1 | 15 | ||||
-rw-r--r-- | src/gns/gnunet-gns.c | 11 |
2 files changed, 19 insertions, 7 deletions
diff --git a/doc/man/gnunet-gns.1 b/doc/man/gnunet-gns.1 index 02eaa9e30..5fabc14f3 100644 --- a/doc/man/gnunet-gns.1 +++ b/doc/man/gnunet-gns.1 | |||
@@ -22,12 +22,6 @@ This is a quiet mode where only important information is displayed. | |||
22 | For example a lookup for an IP address will only yield the IP address, no | 22 | For example a lookup for an IP address will only yield the IP address, no |
23 | descriptive text. | 23 | descriptive text. |
24 | .B | 24 | .B |
25 | .IP "\-t TYPE, \-\-type=TYPE" | ||
26 | Resource Record Type (TYPE) to look for. | ||
27 | Supported TYPE's are: A, AAAA, CNAME, NS, PKEY, PSEU, TLSA, SRV, SOA, MX, LEHO, VPN, REV, PTR, TXT | ||
28 | |||
29 | Defaults to "A". | ||
30 | .B | ||
31 | .IP "\-h, \-\-help" | 25 | .IP "\-h, \-\-help" |
32 | Print short help on options. | 26 | Print short help on options. |
33 | .B | 27 | .B |
@@ -41,6 +35,15 @@ Resolve the specified name using the GNUnet Name System. | |||
41 | .IP "\-p PKEY, \-\-public-key=PKEY" | 35 | .IP "\-p PKEY, \-\-public-key=PKEY" |
42 | Public key of the zone to perform the lookup in. This option should be used if the lookup is to be performed against a zone not controlled by this peer (alternatively, you could pass a ".zkey" for the name). | 36 | Public key of the zone to perform the lookup in. This option should be used if the lookup is to be performed against a zone not controlled by this peer (alternatively, you could pass a ".zkey" for the name). |
43 | .B | 37 | .B |
38 | .IP "\-T DELAY, \-\-timeout=DELAY" | ||
39 | Set the timeout to DELAY. By default, gnunet\-gns will continue to try to resolve the name until there is a definitive answer or until the user aborts with CTRL\-C. | ||
40 | .B | ||
41 | .IP "\-t TYPE, \-\-type=TYPE" | ||
42 | Resource Record Type (TYPE) to look for. | ||
43 | Supported TYPE's are: A, AAAA, CNAME, NS, PKEY, PSEU, TLSA, SRV, SOA, MX, LEHO, VPN, REV, PTR, TXT | ||
44 | |||
45 | Defaults to "A". | ||
46 | .B | ||
44 | .IP "\-z NAME, \-\-zone=NAME" | 47 | .IP "\-z NAME, \-\-zone=NAME" |
45 | Name of the ego of the zone to lookup the record in. The public key associated with the ego will be used for the zone. | 48 | Name of the ego of the zone to lookup the record in. The public key associated with the ego will be used for the zone. |
46 | .B | 49 | .B |
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index aa35e7281..1f3ce8331 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c | |||
@@ -41,6 +41,11 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg; | |||
41 | static struct GNUNET_GNS_Handle *gns; | 41 | static struct GNUNET_GNS_Handle *gns; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * Desired timeout for the lookup (default is no timeout). | ||
45 | */ | ||
46 | static struct GNUNET_TIME_Relative timeout; | ||
47 | |||
48 | /** | ||
44 | * GNS name to lookup. (-u option) | 49 | * GNS name to lookup. (-u option) |
45 | */ | 50 | */ |
46 | static char *lookup_name; | 51 | static char *lookup_name; |
@@ -376,7 +381,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
376 | _("Failed to connect to GNS\n")); | 381 | _("Failed to connect to GNS\n")); |
377 | return; | 382 | return; |
378 | } | 383 | } |
379 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 384 | GNUNET_SCHEDULER_add_delayed (timeout, |
380 | &do_shutdown, NULL); | 385 | &do_shutdown, NULL); |
381 | if (NULL != public_key) | 386 | if (NULL != public_key) |
382 | { | 387 | { |
@@ -441,6 +446,9 @@ main (int argc, char *const *argv) | |||
441 | {'t', "type", "TYPE", | 446 | {'t', "type", "TYPE", |
442 | gettext_noop ("Specify the type of the record to lookup"), 1, | 447 | gettext_noop ("Specify the type of the record to lookup"), 1, |
443 | &GNUNET_GETOPT_set_string, &lookup_type}, | 448 | &GNUNET_GETOPT_set_string, &lookup_type}, |
449 | { 'T', "timeout", "DELAY", | ||
450 | gettext_noop ("Specify timeout for the lookup"), 1, | ||
451 | &GNUNET_GETOPT_set_relative_time, &timeout }, | ||
444 | {'r', "raw", NULL, | 452 | {'r', "raw", NULL, |
445 | gettext_noop ("No unneeded output"), 0, | 453 | gettext_noop ("No unneeded output"), 0, |
446 | &GNUNET_GETOPT_set_one, &raw}, | 454 | &GNUNET_GETOPT_set_one, &raw}, |
@@ -454,6 +462,7 @@ main (int argc, char *const *argv) | |||
454 | }; | 462 | }; |
455 | int ret; | 463 | int ret; |
456 | 464 | ||
465 | timeout = GNUNET_TIME_UNIT_FOREVER_REL; | ||
457 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 466 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) |
458 | return 2; | 467 | return 2; |
459 | 468 | ||