aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-06-09 21:11:42 +0000
committerChristian Grothoff <christian@grothoff.org>2011-06-09 21:11:42 +0000
commit9ffbe0b7a13b6f086f1d8bf5c770ed0476fe040d (patch)
tree13a3cc30307a6fb712305cec45a22849b978dc0b /src
parent16ff0278c95bcc70dcf0eff25a411f03887bda7c (diff)
downloadgnunet-9ffbe0b7a13b6f086f1d8bf5c770ed0476fe040d.tar.gz
gnunet-9ffbe0b7a13b6f086f1d8bf5c770ed0476fe040d.zip
pass cfg to nat
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_nat_lib.h4
-rw-r--r--src/nat/nat.c4
-rw-r--r--src/transport/plugin_transport_tcp.c3
3 files changed, 8 insertions, 3 deletions
diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h
index 6d158930a..14da4e684 100644
--- a/src/include/gnunet_nat_lib.h
+++ b/src/include/gnunet_nat_lib.h
@@ -57,6 +57,7 @@ struct GNUNET_NAT_Handle;
57 * of the local host's addresses should the external port be mapped. The port 57 * of the local host's addresses should the external port be mapped. The port
58 * is taken from the corresponding sockaddr_in[6] field. 58 * is taken from the corresponding sockaddr_in[6] field.
59 * 59 *
60 * @param cfg configuration to use
60 * @param addr the local address packets should be redirected to 61 * @param addr the local address packets should be redirected to
61 * @param addrlen actual lenght of the address 62 * @param addrlen actual lenght of the address
62 * @param callback function to call everytime the public IP address changes 63 * @param callback function to call everytime the public IP address changes
@@ -64,7 +65,8 @@ struct GNUNET_NAT_Handle;
64 * @return NULL on error, otherwise handle that can be used to unregister 65 * @return NULL on error, otherwise handle that can be used to unregister
65 */ 66 */
66struct GNUNET_NAT_Handle * 67struct GNUNET_NAT_Handle *
67GNUNET_NAT_register (const struct sockaddr *addr, 68GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg,
69 const struct sockaddr *addr,
68 socklen_t addrlen, 70 socklen_t addrlen,
69 GNUNET_NAT_AddressCallback callback, 71 GNUNET_NAT_AddressCallback callback,
70 void *callback_cls); 72 void *callback_cls);
diff --git a/src/nat/nat.c b/src/nat/nat.c
index ca6df0573..7e83134bd 100644
--- a/src/nat/nat.c
+++ b/src/nat/nat.c
@@ -366,6 +366,7 @@ nat_pulse (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
366 * of the local host's addresses should the external port be mapped. The port 366 * of the local host's addresses should the external port be mapped. The port
367 * is taken from the corresponding sockaddr_in[6] field. 367 * is taken from the corresponding sockaddr_in[6] field.
368 * 368 *
369 * @param cfg configuration to use
369 * @param addr the local address packets should be redirected to 370 * @param addr the local address packets should be redirected to
370 * @param addrlen actual lenght of the address 371 * @param addrlen actual lenght of the address
371 * @param callback function to call everytime the public IP address changes 372 * @param callback function to call everytime the public IP address changes
@@ -373,7 +374,8 @@ nat_pulse (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
373 * @return NULL on error, otherwise handle that can be used to unregister 374 * @return NULL on error, otherwise handle that can be used to unregister
374 */ 375 */
375struct GNUNET_NAT_Handle * 376struct GNUNET_NAT_Handle *
376GNUNET_NAT_register (const struct sockaddr *addr, 377GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg,
378 const struct sockaddr *addr,
377 socklen_t addrlen, 379 socklen_t addrlen,
378 GNUNET_NAT_AddressCallback callback, void *callback_cls) 380 GNUNET_NAT_AddressCallback callback, void *callback_cls)
379{ 381{
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 4a5cffa23..b85c04402 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -641,7 +641,8 @@ add_to_address_list (struct Plugin *plugin,
641 } 641 }
642 if ( (plugin->behind_nat == GNUNET_YES) && 642 if ( (plugin->behind_nat == GNUNET_YES) &&
643 (plugin->enable_upnp == GNUNET_YES) ) 643 (plugin->enable_upnp == GNUNET_YES) )
644 lal->nat = GNUNET_NAT_register (sa, salen, 644 lal->nat = GNUNET_NAT_register (plugin->env->cfg,
645 sa, salen,
645 &nat_port_map_callback, 646 &nat_port_map_callback,
646 lal); 647 lal);
647} 648}