diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-03-17 12:07:08 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-03-17 12:07:08 +0100 |
commit | 5b085881ab278a85c3ef3a1d91c58a5724a4e430 (patch) | |
tree | 6da52a32d424e01d68d98216f254612492ed1754 /src/gns | |
parent | 2951cdb72d730529e2382fca76607681cfc0a3c6 (diff) | |
parent | c253a40bae417335fab8446f3c7182c8c5d4833f (diff) | |
download | gnunet-5b085881ab278a85c3ef3a1d91c58a5724a4e430.tar.gz gnunet-5b085881ab278a85c3ef3a1d91c58a5724a4e430.zip |
Merge branch 'getopt'
Diffstat (limited to 'src/gns')
-rw-r--r-- | src/gns/gnunet-bcd.c | 12 | ||||
-rw-r--r-- | src/gns/gnunet-dns2gns.c | 48 | ||||
-rw-r--r-- | src/gns/gnunet-gns-proxy.c | 25 | ||||
-rw-r--r-- | src/gns/gnunet-gns.c | 56 |
4 files changed, 93 insertions, 48 deletions
diff --git a/src/gns/gnunet-bcd.c b/src/gns/gnunet-bcd.c index 21471350d..fb7ac10c1 100644 --- a/src/gns/gnunet-bcd.c +++ b/src/gns/gnunet-bcd.c | |||
@@ -514,10 +514,14 @@ run (void *cls, | |||
514 | int | 514 | int |
515 | main (int argc, char *const *argv) | 515 | main (int argc, char *const *argv) |
516 | { | 516 | { |
517 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 517 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
518 | {'p', "port", "PORT", | 518 | |
519 | gettext_noop ("Run HTTP serve on port PORT (default is 8888)"), 1, | 519 | GNUNET_GETOPT_OPTION_SET_UINT ('p', |
520 | &GNUNET_GETOPT_set_uint, &port}, | 520 | "port", |
521 | "PORT", | ||
522 | gettext_noop ("Run HTTP serve on port PORT (default is 8888)"), | ||
523 | &port), | ||
524 | |||
521 | GNUNET_GETOPT_OPTION_END | 525 | GNUNET_GETOPT_OPTION_END |
522 | }; | 526 | }; |
523 | int ret; | 527 | int ret; |
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index 813ecdf8e..c9b4bde9c 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c | |||
@@ -776,22 +776,38 @@ int | |||
776 | main (int argc, | 776 | main (int argc, |
777 | char *const *argv) | 777 | char *const *argv) |
778 | { | 778 | { |
779 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 779 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
780 | {'d', "dns", "IP", | 780 | |
781 | gettext_noop ("IP of recursive DNS resolver to use (required)"), 1, | 781 | GNUNET_GETOPT_OPTION_STRING ('d', |
782 | &GNUNET_GETOPT_set_string, &dns_ip}, | 782 | "dns", |
783 | {'f', "fcfs", "NAME", | 783 | "IP", |
784 | gettext_noop ("Authoritative FCFS suffix to use (optional); default: fcfs.zkey.eu"), 1, | 784 | gettext_noop ("IP of recursive DNS resolver to use (required)"), |
785 | &GNUNET_GETOPT_set_string, &fcfs_suffix}, | 785 | &dns_ip), |
786 | {'s', "suffix", "SUFFIX", | 786 | |
787 | gettext_noop ("Authoritative DNS suffix to use (optional); default: zkey.eu"), 1, | 787 | GNUNET_GETOPT_OPTION_STRING ('f', |
788 | &GNUNET_GETOPT_set_string, &dns_suffix}, | 788 | "fcfs", |
789 | {'p', "port", "UDPPORT", | 789 | "NAME", |
790 | gettext_noop ("UDP port to listen on for inbound DNS requests; default: 2853"), 1, | 790 | gettext_noop ("Authoritative FCFS suffix to use (optional); default: fcfs.zkey.eu"), |
791 | &GNUNET_GETOPT_set_uint, &listen_port}, | 791 | &fcfs_suffix), |
792 | {'z', "zone", "PUBLICKEY", | 792 | |
793 | gettext_noop ("Public key of the GNS zone to use (overrides default)"), 1, | 793 | GNUNET_GETOPT_OPTION_STRING ('s', |
794 | &GNUNET_GETOPT_set_string, &gns_zone_str}, | 794 | "suffix", |
795 | "SUFFIX", | ||
796 | gettext_noop ("Authoritative DNS suffix to use (optional); default: zkey.eu"), | ||
797 | &dns_suffix), | ||
798 | |||
799 | GNUNET_GETOPT_OPTION_SET_UINT ('p', | ||
800 | "port", | ||
801 | "UDPPORT", | ||
802 | gettext_noop ("UDP port to listen on for inbound DNS requests; default: 2853"), | ||
803 | &listen_port), | ||
804 | |||
805 | GNUNET_GETOPT_OPTION_STRING ('z', | ||
806 | "zone", | ||
807 | "PUBLICKEY", | ||
808 | gettext_noop ("Public key of the GNS zone to use (overrides default)"), | ||
809 | &gns_zone_str), | ||
810 | |||
795 | GNUNET_GETOPT_OPTION_END | 811 | GNUNET_GETOPT_OPTION_END |
796 | }; | 812 | }; |
797 | int ret; | 813 | int ret; |
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index c336848ce..35f42cdec 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c | |||
@@ -621,7 +621,7 @@ struct Socks5Request | |||
621 | /** | 621 | /** |
622 | * The port the proxy is running on (default 7777) | 622 | * The port the proxy is running on (default 7777) |
623 | */ | 623 | */ |
624 | static unsigned long port = GNUNET_GNS_PROXY_PORT; | 624 | static unsigned long long port = GNUNET_GNS_PROXY_PORT; |
625 | 625 | ||
626 | /** | 626 | /** |
627 | * The CA file (pem) to use for the proxy CA | 627 | * The CA file (pem) to use for the proxy CA |
@@ -3108,7 +3108,7 @@ run_cont () | |||
3108 | return; | 3108 | return; |
3109 | } | 3109 | } |
3110 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3110 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3111 | "Proxy listens on port %lu\n", | 3111 | "Proxy listens on port %llu\n", |
3112 | port); | 3112 | port); |
3113 | 3113 | ||
3114 | /* start MHD daemon for HTTP */ | 3114 | /* start MHD daemon for HTTP */ |
@@ -3261,13 +3261,20 @@ run (void *cls, | |||
3261 | int | 3261 | int |
3262 | main (int argc, char *const *argv) | 3262 | main (int argc, char *const *argv) |
3263 | { | 3263 | { |
3264 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 3264 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
3265 | {'p', "port", NULL, | 3265 | |
3266 | gettext_noop ("listen on specified port (default: 7777)"), 1, | 3266 | GNUNET_GETOPT_OPTION_SET_ULONG ('p', |
3267 | &GNUNET_GETOPT_set_ulong, &port}, | 3267 | "port", |
3268 | {'a', "authority", NULL, | 3268 | NULL, |
3269 | gettext_noop ("pem file to use as CA"), 1, | 3269 | gettext_noop ("listen on specified port (default: 7777)"), |
3270 | &GNUNET_GETOPT_set_string, &cafile_opt}, | 3270 | &port), |
3271 | |||
3272 | GNUNET_GETOPT_OPTION_STRING ('a', | ||
3273 | "authority", | ||
3274 | NULL, | ||
3275 | gettext_noop ("pem file to use as CA"), | ||
3276 | &cafile_opt), | ||
3277 | |||
3271 | GNUNET_GETOPT_OPTION_END | 3278 | GNUNET_GETOPT_OPTION_END |
3272 | }; | 3279 | }; |
3273 | static const char* page = | 3280 | static const char* page = |
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index a261e008b..c85ddfe81 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c | |||
@@ -420,25 +420,43 @@ int | |||
420 | main (int argc, | 420 | main (int argc, |
421 | char *const *argv) | 421 | char *const *argv) |
422 | { | 422 | { |
423 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 423 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
424 | {'u', "lookup", "NAME", | 424 | |
425 | gettext_noop ("Lookup a record for the given name"), 1, | 425 | GNUNET_GETOPT_OPTION_STRING ('u', |
426 | &GNUNET_GETOPT_set_string, &lookup_name}, | 426 | "lookup", |
427 | {'t', "type", "TYPE", | 427 | "NAME", |
428 | gettext_noop ("Specify the type of the record to lookup"), 1, | 428 | gettext_noop ("Lookup a record for the given name"), |
429 | &GNUNET_GETOPT_set_string, &lookup_type}, | 429 | &lookup_name), |
430 | { 'T', "timeout", "DELAY", | 430 | |
431 | gettext_noop ("Specify timeout for the lookup"), 1, | 431 | GNUNET_GETOPT_OPTION_STRING ('t', |
432 | &GNUNET_GETOPT_set_relative_time, &timeout }, | 432 | "type", |
433 | {'r', "raw", NULL, | 433 | "TYPE", |
434 | gettext_noop ("No unneeded output"), 0, | 434 | gettext_noop ("Specify the type of the record to lookup"), |
435 | &GNUNET_GETOPT_set_one, &raw}, | 435 | &lookup_type), |
436 | {'p', "public-key", "PKEY", | 436 | |
437 | gettext_noop ("Specify the public key of the zone to lookup the record in"), 1, | 437 | GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('T', |
438 | &GNUNET_GETOPT_set_string, &public_key}, | 438 | "timeout", |
439 | {'z', "zone", "NAME", | 439 | "DELAY", |
440 | gettext_noop ("Specify the name of the ego of the zone to lookup the record in"), 1, | 440 | gettext_noop ("Specify timeout for the lookup"), |
441 | &GNUNET_GETOPT_set_string, &zone_ego_name}, | 441 | &timeout), |
442 | |||
443 | GNUNET_GETOPT_OPTION_SET_ONE ('r', | ||
444 | "raw", | ||
445 | gettext_noop ("No unneeded output"), | ||
446 | &raw), | ||
447 | |||
448 | GNUNET_GETOPT_OPTION_STRING ('p', | ||
449 | "public-key", | ||
450 | "PKEY", | ||
451 | gettext_noop ("Specify the public key of the zone to lookup the record in"), | ||
452 | &public_key), | ||
453 | |||
454 | GNUNET_GETOPT_OPTION_STRING ('z', | ||
455 | "zone", | ||
456 | "NAME", | ||
457 | gettext_noop ("Specify the name of the ego of the zone to lookup the record in"), | ||
458 | &zone_ego_name), | ||
459 | |||
442 | GNUNET_GETOPT_OPTION_END | 460 | GNUNET_GETOPT_OPTION_END |
443 | }; | 461 | }; |
444 | int ret; | 462 | int ret; |