diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
commit | 61c39c60565b386e0e12ea669556b030e8cd7180 (patch) | |
tree | 59109aeab8297bdc996faca8c4e38ec7426c36cf /src/nat | |
parent | 780eb09dd8040ecf8649d40ddf8314464e0fc48e (diff) | |
download | gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.tar.gz gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.zip |
-remove trailing whitespace
Diffstat (limited to 'src/nat')
-rw-r--r-- | src/nat/gnunet-helper-nat-client-windows.c | 18 | ||||
-rw-r--r-- | src/nat/gnunet-helper-nat-server-windows.c | 6 | ||||
-rw-r--r-- | src/nat/gnunet-helper-nat-server.c | 2 | ||||
-rw-r--r-- | src/nat/nat.c | 2 | ||||
-rw-r--r-- | src/nat/nat_auto.c | 30 |
5 files changed, 29 insertions, 29 deletions
diff --git a/src/nat/gnunet-helper-nat-client-windows.c b/src/nat/gnunet-helper-nat-client-windows.c index 9121e7943..b949374f3 100644 --- a/src/nat/gnunet-helper-nat-client-windows.c +++ b/src/nat/gnunet-helper-nat-client-windows.c | |||
@@ -168,7 +168,7 @@ struct udp_header | |||
168 | }; | 168 | }; |
169 | 169 | ||
170 | /** | 170 | /** |
171 | * Will this binary be run in permissions testing mode? | 171 | * Will this binary be run in permissions testing mode? |
172 | */ | 172 | */ |
173 | static boolean privilege_testing = FALSE; | 173 | static boolean privilege_testing = FALSE; |
174 | 174 | ||
@@ -468,10 +468,10 @@ main (int argc, char *const *argv) | |||
468 | struct in_addr target; | 468 | struct in_addr target; |
469 | WSADATA wsaData; | 469 | WSADATA wsaData; |
470 | unsigned int p; | 470 | unsigned int p; |
471 | 471 | ||
472 | if (argc > 1 && 0 != strcmp (argv[1], "-d")){ | 472 | if (argc > 1 && 0 != strcmp (argv[1], "-d")){ |
473 | privilege_testing = TRUE; | 473 | privilege_testing = TRUE; |
474 | fprintf (stderr, | 474 | fprintf (stderr, |
475 | "%s", | 475 | "%s", |
476 | "DEBUG: Running binary in privilege testing mode."); | 476 | "DEBUG: Running binary in privilege testing mode."); |
477 | argv++; | 477 | argv++; |
@@ -489,14 +489,14 @@ main (int argc, char *const *argv) | |||
489 | (1 != inet_pton (AF_INET, argv[2], &target))) | 489 | (1 != inet_pton (AF_INET, argv[2], &target))) |
490 | { | 490 | { |
491 | fprintf (stderr, | 491 | fprintf (stderr, |
492 | "Error parsing IPv4 address: %s\n", | 492 | "Error parsing IPv4 address: %s\n", |
493 | strerror (errno)); | 493 | strerror (errno)); |
494 | return 1; | 494 | return 1; |
495 | } | 495 | } |
496 | if ((1 != sscanf (argv[3], "%u", &p)) || (0 == p) || (0xFFFF < p)) | 496 | if ((1 != sscanf (argv[3], "%u", &p)) || (0 == p) || (0xFFFF < p)) |
497 | { | 497 | { |
498 | fprintf (stderr, | 498 | fprintf (stderr, |
499 | "Error parsing port value `%s'\n", | 499 | "Error parsing port value `%s'\n", |
500 | argv[3]); | 500 | argv[3]); |
501 | return 1; | 501 | return 1; |
502 | } | 502 | } |
@@ -504,14 +504,14 @@ main (int argc, char *const *argv) | |||
504 | 504 | ||
505 | if (0 != WSAStartup (MAKEWORD (2, 1), &wsaData)) | 505 | if (0 != WSAStartup (MAKEWORD (2, 1), &wsaData)) |
506 | { | 506 | { |
507 | fprintf (stderr, | 507 | fprintf (stderr, |
508 | "%s", | 508 | "%s", |
509 | "Failed to find Winsock 2.1 or better.\n"); | 509 | "Failed to find Winsock 2.1 or better.\n"); |
510 | return 2; | 510 | return 2; |
511 | } | 511 | } |
512 | if (1 != inet_pton (AF_INET, DUMMY_IP, &dummy)) | 512 | if (1 != inet_pton (AF_INET, DUMMY_IP, &dummy)) |
513 | { | 513 | { |
514 | fprintf (stderr, | 514 | fprintf (stderr, |
515 | "%s", | 515 | "%s", |
516 | "Internal error converting dummy IP to binary.\n"); | 516 | "Internal error converting dummy IP to binary.\n"); |
517 | return 2; | 517 | return 2; |
@@ -522,7 +522,7 @@ main (int argc, char *const *argv) | |||
522 | send_icmp (&external, &target); | 522 | send_icmp (&external, &target); |
523 | send_icmp_udp (&external, &target); | 523 | send_icmp_udp (&external, &target); |
524 | } | 524 | } |
525 | closesocket (rawsock); | 525 | closesocket (rawsock); |
526 | WSACleanup (); | 526 | WSACleanup (); |
527 | return 0; | 527 | return 0; |
528 | } | 528 | } |
diff --git a/src/nat/gnunet-helper-nat-server-windows.c b/src/nat/gnunet-helper-nat-server-windows.c index 7962e3071..18040428f 100644 --- a/src/nat/gnunet-helper-nat-server-windows.c +++ b/src/nat/gnunet-helper-nat-server-windows.c | |||
@@ -188,7 +188,7 @@ struct udp_header | |||
188 | }; | 188 | }; |
189 | 189 | ||
190 | /** | 190 | /** |
191 | * Will this binary be run in permissions testing mode? | 191 | * Will this binary be run in permissions testing mode? |
192 | */ | 192 | */ |
193 | static boolean privilege_testing = FALSE; | 193 | static boolean privilege_testing = FALSE; |
194 | 194 | ||
@@ -533,7 +533,7 @@ main (int argc, char *const *argv) | |||
533 | WSADATA wsaData; | 533 | WSADATA wsaData; |
534 | unsigned int alt = 0; | 534 | unsigned int alt = 0; |
535 | 535 | ||
536 | if ( (argc > 1) && (0 != strcmp (argv[1], "-d"))) | 536 | if ( (argc > 1) && (0 != strcmp (argv[1], "-d"))) |
537 | { | 537 | { |
538 | privilege_testing = TRUE; | 538 | privilege_testing = TRUE; |
539 | fprintf (stderr, | 539 | fprintf (stderr, |
@@ -542,7 +542,7 @@ main (int argc, char *const *argv) | |||
542 | argv++; | 542 | argv++; |
543 | argc--; | 543 | argc--; |
544 | } | 544 | } |
545 | 545 | ||
546 | if (2 != argc) | 546 | if (2 != argc) |
547 | { | 547 | { |
548 | fprintf (stderr, | 548 | fprintf (stderr, |
diff --git a/src/nat/gnunet-helper-nat-server.c b/src/nat/gnunet-helper-nat-server.c index d3c890b98..37b875ee4 100644 --- a/src/nat/gnunet-helper-nat-server.c +++ b/src/nat/gnunet-helper-nat-server.c | |||
@@ -602,7 +602,7 @@ main (int argc, char *const *argv) | |||
602 | } | 602 | } |
603 | 603 | ||
604 | /* select failed (internal error or OS out of resources) */ | 604 | /* select failed (internal error or OS out of resources) */ |
605 | global_ret = 11; | 605 | global_ret = 11; |
606 | error_exit: | 606 | error_exit: |
607 | if (-1 != icmpsock) | 607 | if (-1 != icmpsock) |
608 | (void) close (icmpsock); | 608 | (void) close (icmpsock); |
diff --git a/src/nat/nat.c b/src/nat/nat.c index 0aefc4312..03a77ddc3 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c | |||
@@ -1147,7 +1147,7 @@ GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp, | |||
1147 | if ((h->internal_address != NULL) && | 1147 | if ((h->internal_address != NULL) && |
1148 | (inet_pton (AF_INET, h->internal_address, &in_addr) != 1)) | 1148 | (inet_pton (AF_INET, h->internal_address, &in_addr) != 1)) |
1149 | { | 1149 | { |
1150 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_WARNING, | 1150 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_WARNING, |
1151 | "nat", "INTERNAL_ADDRESS", | 1151 | "nat", "INTERNAL_ADDRESS", |
1152 | _("malformed")); | 1152 | _("malformed")); |
1153 | GNUNET_free (h->internal_address); | 1153 | GNUNET_free (h->internal_address); |
diff --git a/src/nat/nat_auto.c b/src/nat/nat_auto.c index 68689243e..3d0040a04 100644 --- a/src/nat/nat_auto.c +++ b/src/nat/nat_auto.c | |||
@@ -86,7 +86,7 @@ enum AutoPhase | |||
86 | * Last phase, we're done. | 86 | * Last phase, we're done. |
87 | */ | 87 | */ |
88 | AUTO_DONE | 88 | AUTO_DONE |
89 | 89 | ||
90 | }; | 90 | }; |
91 | 91 | ||
92 | 92 | ||
@@ -105,12 +105,12 @@ struct GNUNET_NAT_AutoHandle | |||
105 | * Function to call when done. | 105 | * Function to call when done. |
106 | */ | 106 | */ |
107 | GNUNET_NAT_AutoResultCallback fin_cb; | 107 | GNUNET_NAT_AutoResultCallback fin_cb; |
108 | 108 | ||
109 | /** | 109 | /** |
110 | * Closure for 'fin_cb'. | 110 | * Closure for 'fin_cb'. |
111 | */ | 111 | */ |
112 | void *fin_cb_cls; | 112 | void *fin_cb_cls; |
113 | 113 | ||
114 | /** | 114 | /** |
115 | * Handle for active 'GNUNET_NAT_mini_get_external_ipv4'-operation. | 115 | * Handle for active 'GNUNET_NAT_mini_get_external_ipv4'-operation. |
116 | */ | 116 | */ |
@@ -171,7 +171,7 @@ fail_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
171 | ah->task = GNUNET_SCHEDULER_NO_TASK; | 171 | ah->task = GNUNET_SCHEDULER_NO_TASK; |
172 | GNUNET_NAT_test_stop (ah->tst); | 172 | GNUNET_NAT_test_stop (ah->tst); |
173 | ah->tst = NULL; | 173 | ah->tst = NULL; |
174 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", | 174 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", |
175 | "ENABLE_ICMP_SERVER", | 175 | "ENABLE_ICMP_SERVER", |
176 | "NO"); | 176 | "NO"); |
177 | next_phase (ah); | 177 | next_phase (ah); |
@@ -195,10 +195,10 @@ result_callback (void *cls, int success) | |||
195 | GNUNET_NAT_test_stop (ah->tst); | 195 | GNUNET_NAT_test_stop (ah->tst); |
196 | ah->tst = NULL; | 196 | ah->tst = NULL; |
197 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 197 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
198 | success | 198 | success |
199 | ? _("NAT traversal with ICMP Server succeeded.\n") | 199 | ? _("NAT traversal with ICMP Server succeeded.\n") |
200 | : _("NAT traversal with ICMP Server failed.\n")); | 200 | : _("NAT traversal with ICMP Server failed.\n")); |
201 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", "ENABLE_ICMP_SERVER", | 201 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", "ENABLE_ICMP_SERVER", |
202 | success ? "YES": "NO"); | 202 | success ? "YES": "NO"); |
203 | next_phase (ah); | 203 | next_phase (ah); |
204 | } | 204 | } |
@@ -352,7 +352,7 @@ nipo (void *cls, const char *name, int isDefault, const struct sockaddr *addr, | |||
352 | 352 | ||
353 | 353 | ||
354 | /** | 354 | /** |
355 | * Determine our local IP addresses; detect internal IP & IPv6-support | 355 | * Determine our local IP addresses; detect internal IP & IPv6-support |
356 | * | 356 | * |
357 | * @param ah auto setup context | 357 | * @param ah auto setup context |
358 | */ | 358 | */ |
@@ -361,7 +361,7 @@ test_local_ip (struct GNUNET_NAT_AutoHandle *ah) | |||
361 | { | 361 | { |
362 | ah->have_v6 = GNUNET_NO; | 362 | ah->have_v6 = GNUNET_NO; |
363 | GNUNET_OS_network_interfaces_list (&nipo, ah); | 363 | GNUNET_OS_network_interfaces_list (&nipo, ah); |
364 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", "DISABLEV6", | 364 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", "DISABLEV6", |
365 | (GNUNET_YES == ah->have_v6) ? "NO" : "YES"); | 365 | (GNUNET_YES == ah->have_v6) ? "NO" : "YES"); |
366 | next_phase (ah); | 366 | next_phase (ah); |
367 | } | 367 | } |
@@ -396,10 +396,10 @@ test_upnpc (struct GNUNET_NAT_AutoHandle *ah) | |||
396 | /* FIXME: test if upnpc is actually working, that is, if transports | 396 | /* FIXME: test if upnpc is actually working, that is, if transports |
397 | start to work once we use UPnP */ | 397 | start to work once we use UPnP */ |
398 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 398 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
399 | (have_upnpc) | 399 | (have_upnpc) |
400 | ? _("upnpc found, enabling its use\n") | 400 | ? _("upnpc found, enabling its use\n") |
401 | : _("upnpc not found\n")); | 401 | : _("upnpc not found\n")); |
402 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", "ENABLE_UPNP", | 402 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", "ENABLE_UPNP", |
403 | (GNUNET_YES == have_upnpc) ? "YES" : "NO"); | 403 | (GNUNET_YES == have_upnpc) ? "YES" : "NO"); |
404 | next_phase (ah); | 404 | next_phase (ah); |
405 | } | 405 | } |
@@ -430,7 +430,7 @@ test_icmp_server (struct GNUNET_NAT_AutoHandle *ah) | |||
430 | GNUNET_free_non_null (tmp); | 430 | GNUNET_free_non_null (tmp); |
431 | GNUNET_free (binary); | 431 | GNUNET_free (binary); |
432 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 432 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
433 | (hns) | 433 | (hns) |
434 | ? _("gnunet-helper-nat-server found, testing it\n") | 434 | ? _("gnunet-helper-nat-server found, testing it\n") |
435 | : _("No working gnunet-helper-nat-server found\n")); | 435 | : _("No working gnunet-helper-nat-server found\n")); |
436 | if (hns) | 436 | if (hns) |
@@ -465,7 +465,7 @@ test_icmp_client (struct GNUNET_NAT_AutoHandle *ah) | |||
465 | GNUNET_free_non_null (tmp); | 465 | GNUNET_free_non_null (tmp); |
466 | GNUNET_free (binary); | 466 | GNUNET_free (binary); |
467 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 467 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
468 | (hnc) | 468 | (hnc) |
469 | ? _("gnunet-helper-nat-client found, enabling it\n") | 469 | ? _("gnunet-helper-nat-client found, enabling it\n") |
470 | : _("gnunet-helper-nat-client not found or behind NAT, disabling it\n")); | 470 | : _("gnunet-helper-nat-client not found or behind NAT, disabling it\n")); |
471 | next_phase (ah); | 471 | next_phase (ah); |
@@ -543,14 +543,14 @@ GNUNET_NAT_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
543 | ah->initial_cfg = GNUNET_CONFIGURATION_dup (cfg); | 543 | ah->initial_cfg = GNUNET_CONFIGURATION_dup (cfg); |
544 | 544 | ||
545 | /* never use loopback addresses if user wanted autoconfiguration */ | 545 | /* never use loopback addresses if user wanted autoconfiguration */ |
546 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", | 546 | GNUNET_CONFIGURATION_set_value_string (ah->cfg, "nat", |
547 | "USE_LOCALADDR", | 547 | "USE_LOCALADDR", |
548 | "NO"); | 548 | "NO"); |
549 | next_phase (ah); | 549 | next_phase (ah); |
550 | return ah; | 550 | return ah; |
551 | } | 551 | } |
552 | 552 | ||
553 | 553 | ||
554 | /** | 554 | /** |
555 | * Abort autoconfiguration. | 555 | * Abort autoconfiguration. |
556 | * | 556 | * |