aboutsummaryrefslogtreecommitdiff
path: root/src/nat/gnunet-nat.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-02 19:15:51 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-02 19:15:51 +0100
commitf28533eb5fbd2b8e00bb351eb9fd1da322c70505 (patch)
tree793b1949dd681414d51ea18c151dd6684efa6b9f /src/nat/gnunet-nat.c
parent1082a8e39e4f3d9b908b14995653ac262f640adb (diff)
downloadgnunet-f28533eb5fbd2b8e00bb351eb9fd1da322c70505.tar.gz
gnunet-f28533eb5fbd2b8e00bb351eb9fd1da322c70505.zip
preparations for proper manual hole punching support in new NAT API
Diffstat (limited to 'src/nat/gnunet-nat.c')
-rw-r--r--src/nat/gnunet-nat.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nat/gnunet-nat.c b/src/nat/gnunet-nat.c
index a145dc800..81e4549b5 100644
--- a/src/nat/gnunet-nat.c
+++ b/src/nat/gnunet-nat.c
@@ -39,9 +39,10 @@ static int global_ret;
39static struct GNUNET_NAT_AutoHandle *ah; 39static struct GNUNET_NAT_AutoHandle *ah;
40 40
41/** 41/**
42 * Port we advertise. 42 * External hostname and port, if user manually punched
43 * the NAT.
43 */ 44 */
44static unsigned int adv_port; 45static char *hole_external;
45 46
46/** 47/**
47 * Flag set to 1 if we use IPPROTO_UDP. 48 * Flag set to 1 if we use IPPROTO_UDP.
@@ -568,7 +569,7 @@ run (void *cls,
568 { 569 {
569 nh = GNUNET_NAT_register (c, 570 nh = GNUNET_NAT_register (c,
570 proto, 571 proto,
571 (uint16_t) adv_port, 572 hole_external,
572 1, 573 1,
573 (const struct sockaddr **) &local_sa, 574 (const struct sockaddr **) &local_sa,
574 &local_len, 575 &local_len,
@@ -697,9 +698,9 @@ main (int argc,
697 {'r', "remote", "ADDRESS", 698 {'r', "remote", "ADDRESS",
698 gettext_noop ("which remote IP and port should be asked for connection reversal"), 699 gettext_noop ("which remote IP and port should be asked for connection reversal"),
699 GNUNET_YES, &GNUNET_GETOPT_set_string, &remote_addr }, 700 GNUNET_YES, &GNUNET_GETOPT_set_string, &remote_addr },
700 {'p', "port", NULL, 701 {'p', "punched", NULL,
701 gettext_noop ("port to use to advertise"), 702 gettext_noop ("external hostname and port of NAT, if punched manually; use AUTO for hostname for automatic determination of the external IP"),
702 GNUNET_YES, &GNUNET_GETOPT_set_uint, &adv_port }, 703 GNUNET_YES, &GNUNET_GETOPT_set_string, &hole_external },
703 {'s', "stun", NULL, 704 {'s', "stun", NULL,
704 gettext_noop ("enable STUN processing"), 705 gettext_noop ("enable STUN processing"),
705 GNUNET_NO, &GNUNET_GETOPT_set_one, &do_stun }, 706 GNUNET_NO, &GNUNET_GETOPT_set_one, &do_stun },