aboutsummaryrefslogtreecommitdiff
path: root/src/setup/gnunet-setup-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/setup/gnunet-setup-transport.c')
-rw-r--r--src/setup/gnunet-setup-transport.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/setup/gnunet-setup-transport.c b/src/setup/gnunet-setup-transport.c
index 6064410c..445f680b 100644
--- a/src/setup/gnunet-setup-transport.c
+++ b/src/setup/gnunet-setup-transport.c
@@ -166,12 +166,11 @@ update_icmp_server_enable_button (int on)
166 * Clean up and update GUI (with success). 166 * Clean up and update GUI (with success).
167 * 167 *
168 * @param cls closure (unused) 168 * @param cls closure (unused)
169 * @param success currently always #GNUNET_OK 169 * @param result error status
170 * @param emsg error message, NULL on success
171 */ 170 */
172static void 171static void
173result_callback (void *cls, int success, 172result_callback (void *cls,
174 const char *emsg) 173 enum GNUNET_NAT_FailureCode result)
175{ 174{
176 struct GNUNET_SetupAutoContext *ac = cls; 175 struct GNUNET_SetupAutoContext *ac = cls;
177 176
@@ -180,13 +179,16 @@ result_callback (void *cls, int success,
180 GNUNET_NAT_test_stop (ac->tst); 179 GNUNET_NAT_test_stop (ac->tst);
181 ac->tst = NULL; 180 ac->tst = NULL;
182 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 181 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
183 success 182 (GNUNET_NAT_ERROR_SUCCESS == result)
184 ? _("NAT traversal with ICMP Server succeeded.\n") 183 ? _("NAT traversal with ICMP Server succeeded.\n")
185 : _("NAT traversal with ICMP Server failed.\n")); 184 : _("NAT traversal with ICMP Server failed.\n"));
186 update_icmp_server_enable_button (success); 185 update_icmp_server_enable_button ((GNUNET_NAT_ERROR_SUCCESS == result));
187 if (NULL != cfg) 186 if (NULL != cfg)
188 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "ENABLE_ICMP_SERVER", 187 GNUNET_CONFIGURATION_set_value_string (cfg,
189 success ? "YES": "NO"); 188 "nat",
189 "ENABLE_ICMP_SERVER",
190 (GNUNET_NAT_ERROR_SUCCESS == result)
191 ? "YES": "NO");
190 next_phase (ac); 192 next_phase (ac);
191} 193}
192 194
@@ -233,7 +235,10 @@ reversal_test (void *cls,
233 _("Testing connection reversal with ICMP server.\n")); 235 _("Testing connection reversal with ICMP server.\n"));
234 GNUNET_assert (NULL != cfg); 236 GNUNET_assert (NULL != cfg);
235 GNUNET_RESOLVER_connect (cfg); 237 GNUNET_RESOLVER_connect (cfg);
236 ac->tst = GNUNET_NAT_test_start (cfg, GNUNET_YES, 0, 0, &result_callback, ac); 238 ac->tst = GNUNET_NAT_test_start (cfg,
239 GNUNET_YES,
240 0, 0,
241 &result_callback, ac);
237 if (NULL == ac->tst) 242 if (NULL == ac->tst)
238 { 243 {
239 next_phase (ac); 244 next_phase (ac);
@@ -261,12 +266,12 @@ test_online (struct GNUNET_SetupAutoContext *ac)
261 * 266 *
262 * @param cls closure with our setup context 267 * @param cls closure with our setup context
263 * @param addr the address, NULL on errors 268 * @param addr the address, NULL on errors
264 * @param emsg error message, NULL on success 269 * @param result error code
265 */ 270 */
266static void 271static void
267set_external_ipv4 (void *cls, 272set_external_ipv4 (void *cls,
268 const struct in_addr *addr, 273 const struct in_addr *addr,
269 const char *emsg) 274 enum GNUNET_NAT_FailureCode result)
270{ 275{
271 struct GNUNET_SetupAutoContext *ac = cls; 276 struct GNUNET_SetupAutoContext *ac = cls;
272 char buf[INET_ADDRSTRLEN]; 277 char buf[INET_ADDRSTRLEN];