pass cfg to nat
authorChristian Grothoff <christian@grothoff.org>
Thu, 9 Jun 2011 21:11:42 +0000 (21:11 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 9 Jun 2011 21:11:42 +0000 (21:11 +0000)
src/include/gnunet_nat_lib.h
src/nat/nat.c
src/transport/plugin_transport_tcp.c

index 6d158930a2a3aea8b243e5cf32d5efb9ffc38389..14da4e684244a9497796e22bc3431ff76045f72a 100644 (file)
@@ -57,6 +57,7 @@ struct GNUNET_NAT_Handle;
  * of the local host's addresses should the external port be mapped. The port
  * is taken from the corresponding sockaddr_in[6] field.
  *
+ * @param cfg configuration to use
  * @param addr the local address packets should be redirected to
  * @param addrlen actual lenght of the address
  * @param callback function to call everytime the public IP address changes
@@ -64,7 +65,8 @@ struct GNUNET_NAT_Handle;
  * @return NULL on error, otherwise handle that can be used to unregister 
  */
 struct GNUNET_NAT_Handle *
-GNUNET_NAT_register (const struct sockaddr *addr,
+GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                    const struct sockaddr *addr,
                     socklen_t addrlen,
                     GNUNET_NAT_AddressCallback callback, 
                     void *callback_cls);
index ca6df05736553a3281549bc406483aa2f3972869..7e83134bd57980e27c2dc75b978353a8c3cd0022 100644 (file)
@@ -366,6 +366,7 @@ nat_pulse (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * of the local host's addresses should the external port be mapped. The port
  * is taken from the corresponding sockaddr_in[6] field.
  *
+ * @param cfg configuration to use
  * @param addr the local address packets should be redirected to
  * @param addrlen actual lenght of the address
  * @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)
  * @return NULL on error, otherwise handle that can be used to unregister 
  */
 struct GNUNET_NAT_Handle *
-GNUNET_NAT_register (const struct sockaddr *addr,
+GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                    const struct sockaddr *addr,
                      socklen_t addrlen,
                      GNUNET_NAT_AddressCallback callback, void *callback_cls)
 {
index 4a5cffa23e431e5ad489fc1b61ff9849abfc8e51..b85c0440291e366c4d4e62c0fa62e037daa8ff5f 100644 (file)
@@ -641,7 +641,8 @@ add_to_address_list (struct Plugin *plugin,
     }
   if ( (plugin->behind_nat == GNUNET_YES) &&
        (plugin->enable_upnp == GNUNET_YES) )
-    lal->nat = GNUNET_NAT_register (sa, salen,
+    lal->nat = GNUNET_NAT_register (plugin->env->cfg,
+                                   sa, salen,
                                    &nat_port_map_callback,
                                    lal);
 }