*
* This can be implemented using different methods, and we allow
* the main service to be notified about changes to what we believe
- * is our external IPv4 address.
+ * is our external IPv4 address.
*
* Note that this is explicitly only about NATed systems; if one
* of our network interfaces has a global IP address this does
* not count as "external".
*
- * TODO:
- * - implement NEW logic for external IP detection based on traceroute!
- *
* @file nat/gnunet-service-nat_externalip.c
* @brief Functions for monitoring external IPv4 addresses
* @author Christian Grothoff
* Kept in DLL.
*/
struct GN_ExternalIPMonitor *prev;
-
+
/**
* Function to call when we believe our external IPv4 address changed.
*/
/**
* Tell relevant clients about a change in our external
* IPv4 address.
- *
+ *
* @param add #GNUNET_YES to add, #GNUNET_NO to remove
* @param v4 the external address that changed
*/
* We learn our current external IP address. If it changed,
* notify all of our applicable clients. Also re-schedule
* #run_external_ip with an appropriate timeout.
- *
+ *
* @param cls NULL
* @param addr the address, NULL on errors
* @param result #GNUNET_NAT_ERROR_SUCCESS on success, otherwise the specific error code
enum GNUNET_NAT_StatusCode result)
{
char buf[INET_ADDRSTRLEN];
-
+
probe_external_ip_op = NULL;
GNUNET_SCHEDULER_cancel (probe_external_ip_task);
probe_external_ip_task
switch (result)
{
case GNUNET_NAT_ERROR_SUCCESS:
+ GNUNET_assert (NULL != addr);
if (addr->s_addr == mini_external_ipv4.s_addr)
return; /* not change */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
if (0 != mini_external_ipv4.s_addr)
notify_monitors_external_ipv4_change (GNUNET_NO,
&mini_external_ipv4);
- mini_external_ipv4.s_addr = 0;
+ mini_external_ipv4.s_addr = 0;
break;
}
}
NULL);
return;
}
- if (GNUNET_NO == have_nat)
+ if (GNUNET_NO == have_nat)
{
if (NULL != probe_external_ip_task)
{