aboutsummaryrefslogtreecommitdiff
path: root/src/nat
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-29 10:19:43 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-29 10:19:43 +0000
commitcddbdf5b928c68ab71b40c950b9f01ea68a9fbdb (patch)
treeb704e00a3af618b2cd174a7f89514eaebd82a1cf /src/nat
parentbb4fc4f4007988874f910d4de5492f9629301641 (diff)
downloadgnunet-cddbdf5b928c68ab71b40c950b9f01ea68a9fbdb.tar.gz
gnunet-cddbdf5b928c68ab71b40c950b9f01ea68a9fbdb.zip
run indent twice, it alternates between two 'canonical' forms, also run whitespace remover
Diffstat (limited to 'src/nat')
-rw-r--r--src/nat/gnunet-nat-server.c8
-rw-r--r--src/nat/nat.c16
-rw-r--r--src/nat/nat_mini.c12
-rw-r--r--src/nat/test_nat.c4
-rw-r--r--src/nat/test_nat_mini.c2
-rw-r--r--src/nat/test_nat_test.c2
6 files changed, 22 insertions, 22 deletions
diff --git a/src/nat/gnunet-nat-server.c b/src/nat/gnunet-nat-server.c
index 988e9fbc9..5e2390f35 100644
--- a/src/nat/gnunet-nat-server.c
+++ b/src/nat/gnunet-nat-server.c
@@ -83,7 +83,7 @@ struct TcpContext
83 */ 83 */
84 struct GNUNET_NETWORK_Handle *s; 84 struct GNUNET_NETWORK_Handle *s;
85 85
86 /** 86 /**
87 * Data to transmit. 87 * Data to transmit.
88 */ 88 */
89 uint16_t data; 89 uint16_t data;
@@ -122,7 +122,7 @@ tcp_send (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
122/** 122/**
123 * Try to send 'data' to the 123 * Try to send 'data' to the
124 * IP 'dst_ipv4' at port 'dport' via TCP. 124 * IP 'dst_ipv4' at port 'dport' via TCP.
125 * 125 *
126 * @param dst_ivp4 target IP 126 * @param dst_ivp4 target IP
127 * @param dport target port 127 * @param dport target port
128 * @param data data to send 128 * @param data data to send
@@ -169,7 +169,7 @@ try_send_tcp (uint32_t dst_ipv4, uint16_t dport, uint16_t data)
169/** 169/**
170 * Try to send 'data' to the 170 * Try to send 'data' to the
171 * IP 'dst_ipv4' at port 'dport' via UDP. 171 * IP 'dst_ipv4' at port 'dport' via UDP.
172 * 172 *
173 * @param dst_ivp4 target IP 173 * @param dst_ivp4 target IP
174 * @param dport target port 174 * @param dport target port
175 * @param data data to send 175 * @param data data to send
@@ -208,7 +208,7 @@ try_send_udp (uint32_t dst_ipv4, uint16_t dport, uint16_t data)
208/** 208/**
209 * We've received a request to probe a NAT 209 * We've received a request to probe a NAT
210 * traversal. Do it. 210 * traversal. Do it.
211 * 211 *
212 * @param cls unused 212 * @param cls unused
213 * @param client handle to client (we always close) 213 * @param client handle to client (we always close)
214 * @param msg message with details about what to test 214 * @param msg message with details about what to test
diff --git a/src/nat/nat.c b/src/nat/nat.c
index a037e3b20..891613fea 100644
--- a/src/nat/nat.c
+++ b/src/nat/nat.c
@@ -57,7 +57,7 @@
57 57
58/** 58/**
59 * Where did the given local address originate from? 59 * Where did the given local address originate from?
60 * To be used for debugging as well as in the future 60 * To be used for debugging as well as in the future
61 * to remove all addresses from a certain source when 61 * to remove all addresses from a certain source when
62 * we reevaluate the source. 62 * we reevaluate the source.
63 */ 63 */
@@ -368,7 +368,7 @@ start_gnunet_nat_server (struct GNUNET_NAT_Handle *h);
368/** 368/**
369 * Remove all addresses from the list of 'local' addresses 369 * Remove all addresses from the list of 'local' addresses
370 * that originated from the given source. 370 * that originated from the given source.
371 * 371 *
372 * @param plugin the plugin 372 * @param plugin the plugin
373 * @param src source that identifies addresses to remove 373 * @param src source that identifies addresses to remove
374 */ 374 */
@@ -396,8 +396,8 @@ remove_from_address_list_by_source (struct GNUNET_NAT_Handle *h,
396 396
397/** 397/**
398 * Add the given address to the list of 'local' addresses, thereby 398 * Add the given address to the list of 'local' addresses, thereby
399 * making it a 'legal' address for this peer to have. 399 * making it a 'legal' address for this peer to have.
400 * 400 *
401 * @param plugin the plugin 401 * @param plugin the plugin
402 * @param src where did the local address originate from? 402 * @param src where did the local address originate from?
403 * @param arg the address, some 'struct sockaddr' 403 * @param arg the address, some 'struct sockaddr'
@@ -431,7 +431,7 @@ add_to_address_list_as_is (struct GNUNET_NAT_Handle *h,
431 * making it a 'legal' address for this peer to have. Set the 431 * making it a 'legal' address for this peer to have. Set the
432 * port number in the process to the advertised port and possibly 432 * port number in the process to the advertised port and possibly
433 * also to zero (if we have the gnunet-helper-nat-server). 433 * also to zero (if we have the gnunet-helper-nat-server).
434 * 434 *
435 * @param plugin the plugin 435 * @param plugin the plugin
436 * @param src where did the local address originate from? 436 * @param src where did the local address originate from?
437 * @param arg the address, some 'struct sockaddr' 437 * @param arg the address, some 'struct sockaddr'
@@ -481,8 +481,8 @@ add_to_address_list (struct GNUNET_NAT_Handle *h, enum LocalAddressSource src,
481 481
482/** 482/**
483 * Add the given IP address to the list of 'local' addresses, thereby 483 * Add the given IP address to the list of 'local' addresses, thereby
484 * making it a 'legal' address for this peer to have. 484 * making it a 'legal' address for this peer to have.
485 * 485 *
486 * @param plugin the plugin 486 * @param plugin the plugin
487 * @param src where did the local address originate from? 487 * @param src where did the local address originate from?
488 * @param arg the address, some 'struct in_addr' or 'struct in6_addr' 488 * @param arg the address, some 'struct in_addr' or 'struct in6_addr'
@@ -1040,7 +1040,7 @@ add_from_bind (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1040 * @param address_callback function to call everytime the public IP address changes 1040 * @param address_callback function to call everytime the public IP address changes
1041 * @param reversal_callback function to call if someone wants connection reversal from us 1041 * @param reversal_callback function to call if someone wants connection reversal from us
1042 * @param callback_cls closure for callbacks 1042 * @param callback_cls closure for callbacks
1043 * @return NULL on error, otherwise handle that can be used to unregister 1043 * @return NULL on error, otherwise handle that can be used to unregister
1044 */ 1044 */
1045struct GNUNET_NAT_Handle * 1045struct GNUNET_NAT_Handle *
1046GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp, 1046GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp,
diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c
index 1f5a83d2d..52a4e86b0 100644
--- a/src/nat/nat_mini.c
+++ b/src/nat/nat_mini.c
@@ -361,12 +361,12 @@ process_refresh_output (void *cls, const char *line)
361 } 361 }
362 /* 362 /*
363 * we're looking for output of the form: 363 * we're looking for output of the form:
364 * 364 *
365 * "0 TCP 3000->192.168.2.150:3000 'libminiupnpc' ''" 365 * "0 TCP 3000->192.168.2.150:3000 'libminiupnpc' ''"
366 * "1 UDP 3001->192.168.2.150:3001 'libminiupnpc' ''" 366 * "1 UDP 3001->192.168.2.150:3001 'libminiupnpc' ''"
367 * 367 *
368 * the pattern we look for is: 368 * the pattern we look for is:
369 * 369 *
370 * "%s TCP PORT->STRING:OURPORT *" or 370 * "%s TCP PORT->STRING:OURPORT *" or
371 * "%s UDP PORT->STRING:OURPORT *" 371 * "%s UDP PORT->STRING:OURPORT *"
372 */ 372 */
@@ -439,7 +439,7 @@ process_map_output (void *cls, const char *line)
439 } 439 }
440 /* 440 /*
441 * The upnpc output we're after looks like this: 441 * The upnpc output we're after looks like this:
442 * 442 *
443 * "external 87.123.42.204:3000 TCP is redirected to internal 192.168.2.150:3000" 443 * "external 87.123.42.204:3000 TCP is redirected to internal 192.168.2.150:3000"
444 */ 444 */
445 if ((NULL == (ipaddr = strstr (line, " "))) || 445 if ((NULL == (ipaddr = strstr (line, " "))) ||
@@ -475,7 +475,7 @@ process_map_output (void *cls, const char *line)
475 * general-purpose 'GNUNET_NAT_register' code). However, it can be 475 * general-purpose 'GNUNET_NAT_register' code). However, it can be
476 * used if specifically UPnP-based NAT traversal is to be used or 476 * used if specifically UPnP-based NAT traversal is to be used or
477 * tested. 477 * tested.
478 * 478 *
479 * @param port port to map 479 * @param port port to map
480 * @param is_tcp GNUNET_YES to map TCP, GNUNET_NO for UDP 480 * @param is_tcp GNUNET_YES to map TCP, GNUNET_NO for UDP
481 * @param ac function to call with mapping result 481 * @param ac function to call with mapping result
@@ -539,7 +539,7 @@ process_unmap_output (void *cls, const char *line)
539 * this function will give 'upnpc' 1s to remove tha mapping, 539 * this function will give 'upnpc' 1s to remove tha mapping,
540 * so while this function is non-blocking, a task will be 540 * so while this function is non-blocking, a task will be
541 * left with the scheduler for up to 1s past this call. 541 * left with the scheduler for up to 1s past this call.
542 * 542 *
543 * @param mini the handle 543 * @param mini the handle
544 */ 544 */
545void 545void
diff --git a/src/nat/test_nat.c b/src/nat/test_nat.c
index 6a533798e..784fc6cc7 100644
--- a/src/nat/test_nat.c
+++ b/src/nat/test_nat.c
@@ -45,7 +45,7 @@
45 45
46 46
47/** 47/**
48 * Time to wait before stopping NAT, in seconds 48 * Time to wait before stopping NAT, in seconds
49 */ 49 */
50#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 50#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
51 51
@@ -87,7 +87,7 @@ struct addr_cls
87 87
88/** 88/**
89 * Return the address of the default interface, 89 * Return the address of the default interface,
90 * or any interface with a valid address if the default is not valid 90 * or any interface with a valid address if the default is not valid
91 * 91 *
92 * @param cls the 'struct addr_cls' 92 * @param cls the 'struct addr_cls'
93 * @param name name of the interface 93 * @param name name of the interface
diff --git a/src/nat/test_nat_mini.c b/src/nat/test_nat_mini.c
index 4aac3d17f..2c6da3b57 100644
--- a/src/nat/test_nat_mini.c
+++ b/src/nat/test_nat_mini.c
@@ -22,7 +22,7 @@
22 * Testcase for port redirection and public IP address retrieval. 22 * Testcase for port redirection and public IP address retrieval.
23 * This test never fails, because there need to be a NAT box set up for tha * 23 * This test never fails, because there need to be a NAT box set up for tha *
24 * @file nat/test_nat_mini.c 24 * @file nat/test_nat_mini.c
25 * @brief Testcase for NAT library - mini 25 * @brief Testcase for NAT library - mini
26 * @author Christian Grothoff 26 * @author Christian Grothoff
27 * 27 *
28 * TODO: actually use ARM to start resolver service to make DNS work! 28 * TODO: actually use ARM to start resolver service to make DNS work!
diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c
index b1e6235f9..b8db301aa 100644
--- a/src/nat/test_nat_test.c
+++ b/src/nat/test_nat_test.c
@@ -35,7 +35,7 @@
35 35
36 36
37/** 37/**
38 * Time to wait before stopping NAT test, in seconds 38 * Time to wait before stopping NAT test, in seconds
39 */ 39 */
40#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) 40#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
41 41