diff options
Diffstat (limited to 'src/transport/plugin_transport_udp.h')
-rw-r--r-- | src/transport/plugin_transport_udp.h | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h index cccb3ceb3..6bdc020ff 100644 --- a/src/transport/plugin_transport_udp.h +++ b/src/transport/plugin_transport_udp.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file transport/plugin_transport_udp.h | 22 | * @file transport/plugin_transport_udp.h |
@@ -41,7 +41,7 @@ | |||
41 | #include "gnunet_transport_plugin.h" | 41 | #include "gnunet_transport_plugin.h" |
42 | #include "transport.h" | 42 | #include "transport.h" |
43 | 43 | ||
44 | #define LOG(kind,...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__) | 44 | #define LOG(kind, ...) GNUNET_log_from(kind, "transport-udp", __VA_ARGS__) |
45 | 45 | ||
46 | #define PLUGIN_NAME "udp" | 46 | #define PLUGIN_NAME "udp" |
47 | 47 | ||
@@ -60,8 +60,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
60 | /** | 60 | /** |
61 | * Network format for IPv4 addresses. | 61 | * Network format for IPv4 addresses. |
62 | */ | 62 | */ |
63 | struct IPv4UdpAddress | 63 | struct IPv4UdpAddress { |
64 | { | ||
65 | /** | 64 | /** |
66 | * Optional options and flags for this address | 65 | * Optional options and flags for this address |
67 | */ | 66 | */ |
@@ -82,8 +81,7 @@ struct IPv4UdpAddress | |||
82 | /** | 81 | /** |
83 | * Network format for IPv6 addresses. | 82 | * Network format for IPv6 addresses. |
84 | */ | 83 | */ |
85 | struct IPv6UdpAddress | 84 | struct IPv6UdpAddress { |
86 | { | ||
87 | /** | 85 | /** |
88 | * Optional options and flags for this address | 86 | * Optional options and flags for this address |
89 | */ | 87 | */ |
@@ -105,8 +103,7 @@ GNUNET_NETWORK_STRUCT_END | |||
105 | * Either an IPv4 or IPv6 UDP address. Note that without a "length", | 103 | * Either an IPv4 or IPv6 UDP address. Note that without a "length", |
106 | * one cannot tell which one of the two types this address represents. | 104 | * one cannot tell which one of the two types this address represents. |
107 | */ | 105 | */ |
108 | union UdpAddress | 106 | union UdpAddress { |
109 | { | ||
110 | /** | 107 | /** |
111 | * IPv4 case. | 108 | * IPv4 case. |
112 | */ | 109 | */ |
@@ -134,9 +131,7 @@ struct PrettyPrinterContext; | |||
134 | /** | 131 | /** |
135 | * Encapsulation of all of the state of the plugin. | 132 | * Encapsulation of all of the state of the plugin. |
136 | */ | 133 | */ |
137 | struct Plugin | 134 | struct Plugin { |
138 | { | ||
139 | |||
140 | /** | 135 | /** |
141 | * Our environment. | 136 | * Our environment. |
142 | */ | 137 | */ |
@@ -302,7 +297,6 @@ struct Plugin | |||
302 | * Port we advertise on. | 297 | * Port we advertise on. |
303 | */ | 298 | */ |
304 | uint16_t aport; | 299 | uint16_t aport; |
305 | |||
306 | }; | 300 | }; |
307 | 301 | ||
308 | 302 | ||
@@ -318,9 +312,9 @@ struct Plugin | |||
318 | * @return string representing the same address | 312 | * @return string representing the same address |
319 | */ | 313 | */ |
320 | const char * | 314 | const char * |
321 | udp_address_to_string (void *cls, | 315 | udp_address_to_string(void *cls, |
322 | const void *addr, | 316 | const void *addr, |
323 | size_t addrlen); | 317 | size_t addrlen); |
324 | 318 | ||
325 | 319 | ||
326 | /** | 320 | /** |
@@ -335,22 +329,22 @@ udp_address_to_string (void *cls, | |||
335 | * @param network_type network type of the sender's address | 329 | * @param network_type network type of the sender's address |
336 | */ | 330 | */ |
337 | void | 331 | void |
338 | udp_broadcast_receive (struct Plugin *plugin, | 332 | udp_broadcast_receive(struct Plugin *plugin, |
339 | const char *buf, | 333 | const char *buf, |
340 | ssize_t size, | 334 | ssize_t size, |
341 | const union UdpAddress *udp_addr, | 335 | const union UdpAddress *udp_addr, |
342 | size_t udp_addr_len, | 336 | size_t udp_addr_len, |
343 | enum GNUNET_NetworkType network_type); | 337 | enum GNUNET_NetworkType network_type); |
344 | 338 | ||
345 | 339 | ||
346 | void | 340 | void |
347 | setup_broadcast (struct Plugin *plugin, | 341 | setup_broadcast(struct Plugin *plugin, |
348 | struct sockaddr_in6 *server_addrv6, | 342 | struct sockaddr_in6 *server_addrv6, |
349 | struct sockaddr_in *server_addrv4); | 343 | struct sockaddr_in *server_addrv4); |
350 | 344 | ||
351 | 345 | ||
352 | void | 346 | void |
353 | stop_broadcast (struct Plugin *plugin); | 347 | stop_broadcast(struct Plugin *plugin); |
354 | 348 | ||
355 | /*#ifndef PLUGIN_TRANSPORT_UDP_H*/ | 349 | /*#ifndef PLUGIN_TRANSPORT_UDP_H*/ |
356 | #endif | 350 | #endif |