aboutsummaryrefslogtreecommitdiff
path: root/src/nat/gnunet-service-nat_externalip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nat/gnunet-service-nat_externalip.c')
-rw-r--r--src/nat/gnunet-service-nat_externalip.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/nat/gnunet-service-nat_externalip.c b/src/nat/gnunet-service-nat_externalip.c
index 979d2f0f5..8df6f48a5 100644
--- a/src/nat/gnunet-service-nat_externalip.c
+++ b/src/nat/gnunet-service-nat_externalip.c
@@ -23,15 +23,12 @@
23 * 23 *
24 * This can be implemented using different methods, and we allow 24 * This can be implemented using different methods, and we allow
25 * the main service to be notified about changes to what we believe 25 * the main service to be notified about changes to what we believe
26 * is our external IPv4 address. 26 * is our external IPv4 address.
27 * 27 *
28 * Note that this is explicitly only about NATed systems; if one 28 * Note that this is explicitly only about NATed systems; if one
29 * of our network interfaces has a global IP address this does 29 * of our network interfaces has a global IP address this does
30 * not count as "external". 30 * not count as "external".
31 * 31 *
32 * TODO:
33 * - implement NEW logic for external IP detection based on traceroute!
34 *
35 * @file nat/gnunet-service-nat_externalip.c 32 * @file nat/gnunet-service-nat_externalip.c
36 * @brief Functions for monitoring external IPv4 addresses 33 * @brief Functions for monitoring external IPv4 addresses
37 * @author Christian Grothoff 34 * @author Christian Grothoff
@@ -86,7 +83,7 @@ struct GN_ExternalIPMonitor
86 * Kept in DLL. 83 * Kept in DLL.
87 */ 84 */
88 struct GN_ExternalIPMonitor *prev; 85 struct GN_ExternalIPMonitor *prev;
89 86
90 /** 87 /**
91 * Function to call when we believe our external IPv4 address changed. 88 * Function to call when we believe our external IPv4 address changed.
92 */ 89 */
@@ -131,7 +128,7 @@ static struct in_addr mini_external_ipv4;
131/** 128/**
132 * Tell relevant clients about a change in our external 129 * Tell relevant clients about a change in our external
133 * IPv4 address. 130 * IPv4 address.
134 * 131 *
135 * @param add #GNUNET_YES to add, #GNUNET_NO to remove 132 * @param add #GNUNET_YES to add, #GNUNET_NO to remove
136 * @param v4 the external address that changed 133 * @param v4 the external address that changed
137 */ 134 */
@@ -162,7 +159,7 @@ run_external_ip (void *cls);
162 * We learn our current external IP address. If it changed, 159 * We learn our current external IP address. If it changed,
163 * notify all of our applicable clients. Also re-schedule 160 * notify all of our applicable clients. Also re-schedule
164 * #run_external_ip with an appropriate timeout. 161 * #run_external_ip with an appropriate timeout.
165 * 162 *
166 * @param cls NULL 163 * @param cls NULL
167 * @param addr the address, NULL on errors 164 * @param addr the address, NULL on errors
168 * @param result #GNUNET_NAT_ERROR_SUCCESS on success, otherwise the specific error code 165 * @param result #GNUNET_NAT_ERROR_SUCCESS on success, otherwise the specific error code
@@ -173,7 +170,7 @@ handle_external_ip (void *cls,
173 enum GNUNET_NAT_StatusCode result) 170 enum GNUNET_NAT_StatusCode result)
174{ 171{
175 char buf[INET_ADDRSTRLEN]; 172 char buf[INET_ADDRSTRLEN];
176 173
177 probe_external_ip_op = NULL; 174 probe_external_ip_op = NULL;
178 GNUNET_SCHEDULER_cancel (probe_external_ip_task); 175 GNUNET_SCHEDULER_cancel (probe_external_ip_task);
179 probe_external_ip_task 176 probe_external_ip_task
@@ -204,7 +201,7 @@ handle_external_ip (void *cls,
204 if (0 != mini_external_ipv4.s_addr) 201 if (0 != mini_external_ipv4.s_addr)
205 notify_monitors_external_ipv4_change (GNUNET_NO, 202 notify_monitors_external_ipv4_change (GNUNET_NO,
206 &mini_external_ipv4); 203 &mini_external_ipv4);
207 mini_external_ipv4.s_addr = 0; 204 mini_external_ipv4.s_addr = 0;
208 break; 205 break;
209 } 206 }
210} 207}
@@ -254,7 +251,7 @@ GN_nat_status_changed (int have_nat)
254 NULL); 251 NULL);
255 return; 252 return;
256 } 253 }
257 if (GNUNET_NO == have_nat) 254 if (GNUNET_NO == have_nat)
258 { 255 {
259 if (NULL != probe_external_ip_task) 256 if (NULL != probe_external_ip_task)
260 { 257 {