aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-11-01 16:50:46 +0000
committerChristian Grothoff <christian@grothoff.org>2012-11-01 16:50:46 +0000
commit7e314e18ad91504e8d376e94c159d280addbc830 (patch)
tree5e410b998d6a5c97c51944df6db96519f5f91a0c
parente06757ef0a0744d67b0cc9616e3116e68615cbbc (diff)
downloadgnunet-gtk-7e314e18ad91504e8d376e94c159d280addbc830.tar.gz
gnunet-gtk-7e314e18ad91504e8d376e94c159d280addbc830.zip
-better logging, libexec fixes
-rw-r--r--src/setup/gnunet-setup-transport.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/setup/gnunet-setup-transport.c b/src/setup/gnunet-setup-transport.c
index aead2a43..02e27490 100644
--- a/src/setup/gnunet-setup-transport.c
+++ b/src/setup/gnunet-setup-transport.c
@@ -177,7 +177,14 @@ result_callback (void *cls, int success)
177 ac->tsk = GNUNET_SCHEDULER_NO_TASK; 177 ac->tsk = GNUNET_SCHEDULER_NO_TASK;
178 GNUNET_NAT_test_stop (ac->tst); 178 GNUNET_NAT_test_stop (ac->tst);
179 ac->tst = NULL; 179 ac->tst = NULL;
180 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
181 success
182 ? _("NAT traversal with ICMP Server succeeded.\n")
183 : _("NAT traversal with ICMP Server failed.\n"));
180 update_icmp_server_enable_button (success); 184 update_icmp_server_enable_button (success);
185 if (NULL != cfg)
186 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "ENABLE_ICMP_SERVER",
187 success ? "YES": "NO");
181 next_phase (ac); 188 next_phase (ac);
182} 189}
183 190
@@ -194,11 +201,15 @@ fail_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
194{ 201{
195 struct GNUNET_SetupAutoContext *ac = cls; 202 struct GNUNET_SetupAutoContext *ac = cls;
196 203
204 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
205 _("NAT traversal with ICMP Server timed out.\n"));
197 GNUNET_assert (NULL != ac->tst); 206 GNUNET_assert (NULL != ac->tst);
198 ac->tsk = GNUNET_SCHEDULER_NO_TASK; 207 ac->tsk = GNUNET_SCHEDULER_NO_TASK;
199 GNUNET_NAT_test_stop (ac->tst); 208 GNUNET_NAT_test_stop (ac->tst);
200 ac->tst = NULL; 209 ac->tst = NULL;
201 update_icmp_server_enable_button (GNUNET_NO); 210 update_icmp_server_enable_button (GNUNET_NO);
211 if (NULL != cfg)
212 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "ENABLE_ICMP_SERVER", "NO");
202 next_phase (ac); 213 next_phase (ac);
203} 214}
204 215
@@ -214,6 +225,8 @@ reversal_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
214{ 225{
215 struct GNUNET_SetupAutoContext *ac = cls; 226 struct GNUNET_SetupAutoContext *ac = cls;
216 227
228 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
229 _("Testing connection reversal with ICMP server.\n"));
217 GNUNET_assert (NULL != cfg); 230 GNUNET_assert (NULL != cfg);
218 GNUNET_RESOLVER_connect (cfg); 231 GNUNET_RESOLVER_connect (cfg);
219 ac->tst = GNUNET_NAT_test_start (cfg, GNUNET_YES, 0, 0, &result_callback, ac); 232 ac->tst = GNUNET_NAT_test_start (cfg, GNUNET_YES, 0, 0, &result_callback, ac);
@@ -332,6 +345,8 @@ nipo (void *cls, const char *name, int isDefault, const struct sockaddr *addr,
332 (! IN6_IS_ADDR_LINKLOCAL(addr)) ) 345 (! IN6_IS_ADDR_LINKLOCAL(addr)) )
333 { 346 {
334 *have_v6 = GNUNET_YES; 347 *have_v6 = GNUNET_YES;
348 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
349 _("This system has a global IPv6 address, setting IPv6 to supported.\n"));
335 return GNUNET_OK; 350 return GNUNET_OK;
336 } 351 }
337 if (addrlen != sizeof (struct sockaddr_in)) 352 if (addrlen != sizeof (struct sockaddr_in))
@@ -345,6 +360,9 @@ nipo (void *cls, const char *name, int isDefault, const struct sockaddr *addr,
345 return GNUNET_OK; 360 return GNUNET_OK;
346 } 361 }
347 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "INTERNAL_ADDRESS", buf); 362 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "INTERNAL_ADDRESS", buf);
363 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
364 _("Detected internal network address `%s'.\n"),
365 buf);
348 entry = 366 entry =
349 GTK_ENTRY (GNUNET_SETUP_get_object 367 GTK_ENTRY (GNUNET_SETUP_get_object
350 ("GNUNET_setup_transport_internal_ip_entry")); 368 ("GNUNET_setup_transport_internal_ip_entry"));
@@ -407,6 +425,10 @@ test_upnpc (struct GNUNET_SetupAutoContext *ac)
407 GNUNET_OS_check_helper_binary ("upnpc")); 425 GNUNET_OS_check_helper_binary ("upnpc"));
408 /* FIXME: test if upnpc is actually working, that is, if transports 426 /* FIXME: test if upnpc is actually working, that is, if transports
409 start to work once we use UPnP */ 427 start to work once we use UPnP */
428 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
429 (have_upnpc)
430 ? _("upnpc found, enabling its use\n")
431 : _("upnpc not found\n"));
410 gtk_toggle_button_set_active (button, 432 gtk_toggle_button_set_active (button,
411 have_upnpc 433 have_upnpc
412 ? TRUE 434 ? TRUE
@@ -442,6 +464,10 @@ test_icmp_server (struct GNUNET_SetupAutoContext *ac)
442 GNUNET_OS_check_helper_binary (binary))); 464 GNUNET_OS_check_helper_binary (binary)));
443 GNUNET_free_non_null (tmp); 465 GNUNET_free_non_null (tmp);
444 GNUNET_free (binary); 466 GNUNET_free (binary);
467 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
468 (hns)
469 ? _("gnunet-helper-nat-server found, testing it\n")
470 : _("No working gnunet-helper-nat-server found\n"));
445 if (hns) 471 if (hns)
446 GNUNET_SCHEDULER_add_now (&reversal_test, ac); 472 GNUNET_SCHEDULER_add_now (&reversal_test, ac);
447 else 473 else
@@ -474,6 +500,10 @@ test_icmp_client (struct GNUNET_SetupAutoContext *ac)
474 GNUNET_OS_check_helper_binary (binary))); 500 GNUNET_OS_check_helper_binary (binary)));
475 GNUNET_free_non_null (tmp); 501 GNUNET_free_non_null (tmp);
476 GNUNET_free (binary); 502 GNUNET_free (binary);
503 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
504 (hnc)
505 ? _("gnunet-helper-nat-client found, enabling it\n")
506 : _("gnunet-helper-nat-client not found or behind NAT, disabling it\n"));
477 button = 507 button =
478 GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object 508 GTK_TOGGLE_BUTTON (GNUNET_SETUP_get_object
479 ("GNUNET_setup_transport_icmp_client_enable_checkbutton")); 509 ("GNUNET_setup_transport_icmp_client_enable_checkbutton"));