diff options
Diffstat (limited to 'src/include/gnunet_network_lib.h')
-rw-r--r-- | src/include/gnunet_network_lib.h | 188 |
1 files changed, 92 insertions, 96 deletions
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 6c02f3577..2a91621a3 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.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 | * @author Nils Durner | 22 | * @author Nils Durner |
@@ -49,9 +49,7 @@ struct GNUNET_NETWORK_Handle; | |||
49 | /** | 49 | /** |
50 | * @brief collection of IO descriptors | 50 | * @brief collection of IO descriptors |
51 | */ | 51 | */ |
52 | struct GNUNET_NETWORK_FDSet | 52 | struct GNUNET_NETWORK_FDSet { |
53 | { | ||
54 | |||
55 | /** | 53 | /** |
56 | * Maximum number of any socket descriptor in the set (plus one) | 54 | * Maximum number of any socket descriptor in the set (plus one) |
57 | */ | 55 | */ |
@@ -80,9 +78,7 @@ struct GNUNET_NETWORK_FDSet | |||
80 | * smaller than @e handles_size. | 78 | * smaller than @e handles_size. |
81 | */ | 79 | */ |
82 | unsigned int handles_pos; | 80 | unsigned int handles_pos; |
83 | |||
84 | #endif | 81 | #endif |
85 | |||
86 | }; | 82 | }; |
87 | 83 | ||
88 | #include "gnunet_disk_lib.h" | 84 | #include "gnunet_disk_lib.h" |
@@ -95,7 +91,7 @@ struct GNUNET_NETWORK_FDSet | |||
95 | * @return #GNUNET_OK if the PF is supported | 91 | * @return #GNUNET_OK if the PF is supported |
96 | */ | 92 | */ |
97 | int | 93 | int |
98 | GNUNET_NETWORK_test_pf (int pf); | 94 | GNUNET_NETWORK_test_pf(int pf); |
99 | 95 | ||
100 | 96 | ||
101 | /** | 97 | /** |
@@ -108,7 +104,7 @@ GNUNET_NETWORK_test_pf (int pf); | |||
108 | * @return shortened unixpath, NULL on error | 104 | * @return shortened unixpath, NULL on error |
109 | */ | 105 | */ |
110 | char * | 106 | char * |
111 | GNUNET_NETWORK_shorten_unixpath (char *unixpath); | 107 | GNUNET_NETWORK_shorten_unixpath(char *unixpath); |
112 | 108 | ||
113 | 109 | ||
114 | #ifndef WINDOWS | 110 | #ifndef WINDOWS |
@@ -122,7 +118,7 @@ GNUNET_NETWORK_shorten_unixpath (char *unixpath); | |||
122 | * @param un unix domain socket address to check | 118 | * @param un unix domain socket address to check |
123 | */ | 119 | */ |
124 | void | 120 | void |
125 | GNUNET_NETWORK_unix_precheck (const struct sockaddr_un *un); | 121 | GNUNET_NETWORK_unix_precheck(const struct sockaddr_un *un); |
126 | #endif | 122 | #endif |
127 | 123 | ||
128 | 124 | ||
@@ -137,9 +133,9 @@ GNUNET_NETWORK_unix_precheck (const struct sockaddr_un *un); | |||
137 | * @return client socket | 133 | * @return client socket |
138 | */ | 134 | */ |
139 | struct GNUNET_NETWORK_Handle * | 135 | struct GNUNET_NETWORK_Handle * |
140 | GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, | 136 | GNUNET_NETWORK_socket_accept(const struct GNUNET_NETWORK_Handle *desc, |
141 | struct sockaddr *address, | 137 | struct sockaddr *address, |
142 | socklen_t *address_len); | 138 | socklen_t *address_len); |
143 | 139 | ||
144 | 140 | ||
145 | /** | 141 | /** |
@@ -149,7 +145,7 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, | |||
149 | * @return NULL on error (including not supported on target platform) | 145 | * @return NULL on error (including not supported on target platform) |
150 | */ | 146 | */ |
151 | struct GNUNET_NETWORK_Handle * | 147 | struct GNUNET_NETWORK_Handle * |
152 | GNUNET_NETWORK_socket_box_native (SOCKTYPE fd); | 148 | GNUNET_NETWORK_socket_box_native(SOCKTYPE fd); |
153 | 149 | ||
154 | 150 | ||
155 | /** | 151 | /** |
@@ -160,8 +156,8 @@ GNUNET_NETWORK_socket_box_native (SOCKTYPE fd); | |||
160 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 156 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
161 | */ | 157 | */ |
162 | int | 158 | int |
163 | GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, | 159 | GNUNET_NETWORK_socket_set_blocking(struct GNUNET_NETWORK_Handle *fd, |
164 | int doBlock); | 160 | int doBlock); |
165 | 161 | ||
166 | 162 | ||
167 | /** | 163 | /** |
@@ -173,9 +169,9 @@ GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, | |||
173 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 169 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
174 | */ | 170 | */ |
175 | int | 171 | int |
176 | GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | 172 | GNUNET_NETWORK_socket_bind(struct GNUNET_NETWORK_Handle *desc, |
177 | const struct sockaddr *address, | 173 | const struct sockaddr *address, |
178 | socklen_t address_len); | 174 | socklen_t address_len); |
179 | 175 | ||
180 | /** | 176 | /** |
181 | * Close a socket. | 177 | * Close a socket. |
@@ -184,7 +180,7 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | |||
184 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 180 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
185 | */ | 181 | */ |
186 | int | 182 | int |
187 | GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | 183 | GNUNET_NETWORK_socket_close(struct GNUNET_NETWORK_Handle *desc); |
188 | 184 | ||
189 | 185 | ||
190 | /** | 186 | /** |
@@ -193,7 +189,7 @@ GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | |||
193 | * @param desc socket | 189 | * @param desc socket |
194 | */ | 190 | */ |
195 | void | 191 | void |
196 | GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc); | 192 | GNUNET_NETWORK_socket_free_memory_only_(struct GNUNET_NETWORK_Handle *desc); |
197 | 193 | ||
198 | 194 | ||
199 | /** | 195 | /** |
@@ -205,9 +201,9 @@ GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc); | |||
205 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 201 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
206 | */ | 202 | */ |
207 | int | 203 | int |
208 | GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | 204 | GNUNET_NETWORK_socket_connect(const struct GNUNET_NETWORK_Handle *desc, |
209 | const struct sockaddr *address, | 205 | const struct sockaddr *address, |
210 | socklen_t address_len); | 206 | socklen_t address_len); |
211 | 207 | ||
212 | 208 | ||
213 | /** | 209 | /** |
@@ -221,11 +217,11 @@ GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | |||
221 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 217 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
222 | */ | 218 | */ |
223 | int | 219 | int |
224 | GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | 220 | GNUNET_NETWORK_socket_getsockopt(const struct GNUNET_NETWORK_Handle *desc, |
225 | int level, | 221 | int level, |
226 | int optname, | 222 | int optname, |
227 | void *optval, | 223 | void *optval, |
228 | socklen_t *optlen); | 224 | socklen_t *optlen); |
229 | 225 | ||
230 | 226 | ||
231 | /** | 227 | /** |
@@ -236,8 +232,8 @@ GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | |||
236 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 232 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
237 | */ | 233 | */ |
238 | int | 234 | int |
239 | GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, | 235 | GNUNET_NETWORK_socket_listen(const struct GNUNET_NETWORK_Handle *desc, |
240 | int backlog); | 236 | int backlog); |
241 | 237 | ||
242 | 238 | ||
243 | /** | 239 | /** |
@@ -247,7 +243,7 @@ GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, | |||
247 | * @returns #GNUNET_SYSERR if no data is available, or on error! | 243 | * @returns #GNUNET_SYSERR if no data is available, or on error! |
248 | */ | 244 | */ |
249 | ssize_t | 245 | ssize_t |
250 | GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *desc); | 246 | GNUNET_NETWORK_socket_recvfrom_amount(const struct GNUNET_NETWORK_Handle *desc); |
251 | 247 | ||
252 | 248 | ||
253 | /** | 249 | /** |
@@ -261,11 +257,11 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *desc) | |||
261 | * @param addrlen length of the addr | 257 | * @param addrlen length of the addr |
262 | */ | 258 | */ |
263 | ssize_t | 259 | ssize_t |
264 | GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, | 260 | GNUNET_NETWORK_socket_recvfrom(const struct GNUNET_NETWORK_Handle *desc, |
265 | void *buffer, | 261 | void *buffer, |
266 | size_t length, | 262 | size_t length, |
267 | struct sockaddr *src_addr, | 263 | struct sockaddr *src_addr, |
268 | socklen_t *addrlen); | 264 | socklen_t *addrlen); |
269 | 265 | ||
270 | 266 | ||
271 | /** | 267 | /** |
@@ -277,9 +273,9 @@ GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, | |||
277 | * @return number of bytes read | 273 | * @return number of bytes read |
278 | */ | 274 | */ |
279 | ssize_t | 275 | ssize_t |
280 | GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | 276 | GNUNET_NETWORK_socket_recv(const struct GNUNET_NETWORK_Handle *desc, |
281 | void *buffer, | 277 | void *buffer, |
282 | size_t length); | 278 | size_t length); |
283 | 279 | ||
284 | 280 | ||
285 | /** | 281 | /** |
@@ -292,10 +288,10 @@ GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | |||
292 | * @return number of selected sockets, #GNUNET_SYSERR on error | 288 | * @return number of selected sockets, #GNUNET_SYSERR on error |
293 | */ | 289 | */ |
294 | int | 290 | int |
295 | GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | 291 | GNUNET_NETWORK_socket_select(struct GNUNET_NETWORK_FDSet *rfds, |
296 | struct GNUNET_NETWORK_FDSet *wfds, | 292 | struct GNUNET_NETWORK_FDSet *wfds, |
297 | struct GNUNET_NETWORK_FDSet *efds, | 293 | struct GNUNET_NETWORK_FDSet *efds, |
298 | struct GNUNET_TIME_Relative timeout); | 294 | struct GNUNET_TIME_Relative timeout); |
299 | 295 | ||
300 | 296 | ||
301 | /** | 297 | /** |
@@ -307,9 +303,9 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
307 | * @return number of bytes sent, #GNUNET_SYSERR on error | 303 | * @return number of bytes sent, #GNUNET_SYSERR on error |
308 | */ | 304 | */ |
309 | ssize_t | 305 | ssize_t |
310 | GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | 306 | GNUNET_NETWORK_socket_send(const struct GNUNET_NETWORK_Handle *desc, |
311 | const void *buffer, | 307 | const void *buffer, |
312 | size_t length); | 308 | size_t length); |
313 | 309 | ||
314 | 310 | ||
315 | /** | 311 | /** |
@@ -324,11 +320,11 @@ GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | |||
324 | * @return number of bytes sent, #GNUNET_SYSERR on error | 320 | * @return number of bytes sent, #GNUNET_SYSERR on error |
325 | */ | 321 | */ |
326 | ssize_t | 322 | ssize_t |
327 | GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, | 323 | GNUNET_NETWORK_socket_sendto(const struct GNUNET_NETWORK_Handle *desc, |
328 | const void *message, | 324 | const void *message, |
329 | size_t length, | 325 | size_t length, |
330 | const struct sockaddr *dest_addr, | 326 | const struct sockaddr *dest_addr, |
331 | socklen_t dest_len); | 327 | socklen_t dest_len); |
332 | 328 | ||
333 | 329 | ||
334 | /** | 330 | /** |
@@ -342,11 +338,11 @@ GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, | |||
342 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 338 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
343 | */ | 339 | */ |
344 | int | 340 | int |
345 | GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | 341 | GNUNET_NETWORK_socket_setsockopt(struct GNUNET_NETWORK_Handle *fd, |
346 | int level, | 342 | int level, |
347 | int option_name, | 343 | int option_name, |
348 | const void *option_value, | 344 | const void *option_value, |
349 | socklen_t option_len); | 345 | socklen_t option_len); |
350 | 346 | ||
351 | 347 | ||
352 | /** | 348 | /** |
@@ -357,8 +353,8 @@ GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | |||
357 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 353 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
358 | */ | 354 | */ |
359 | int | 355 | int |
360 | GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | 356 | GNUNET_NETWORK_socket_shutdown(struct GNUNET_NETWORK_Handle *desc, |
361 | int how); | 357 | int how); |
362 | 358 | ||
363 | 359 | ||
364 | /** | 360 | /** |
@@ -371,7 +367,7 @@ GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | |||
371 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 367 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
372 | */ | 368 | */ |
373 | int | 369 | int |
374 | GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | 370 | GNUNET_NETWORK_socket_disable_corking(struct GNUNET_NETWORK_Handle *desc); |
375 | 371 | ||
376 | 372 | ||
377 | /** | 373 | /** |
@@ -385,9 +381,9 @@ GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | |||
385 | * @return new socket, NULL on error | 381 | * @return new socket, NULL on error |
386 | */ | 382 | */ |
387 | struct GNUNET_NETWORK_Handle * | 383 | struct GNUNET_NETWORK_Handle * |
388 | GNUNET_NETWORK_socket_create (int domain, | 384 | GNUNET_NETWORK_socket_create(int domain, |
389 | int type, | 385 | int type, |
390 | int protocol); | 386 | int protocol); |
391 | 387 | ||
392 | 388 | ||
393 | /** | 389 | /** |
@@ -396,7 +392,7 @@ GNUNET_NETWORK_socket_create (int domain, | |||
396 | * @param fds fd set to clear | 392 | * @param fds fd set to clear |
397 | */ | 393 | */ |
398 | void | 394 | void |
399 | GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | 395 | GNUNET_NETWORK_fdset_zero(struct GNUNET_NETWORK_FDSet *fds); |
400 | 396 | ||
401 | 397 | ||
402 | /** | 398 | /** |
@@ -406,8 +402,8 @@ GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | |||
406 | * @param desc socket to add | 402 | * @param desc socket to add |
407 | */ | 403 | */ |
408 | void | 404 | void |
409 | GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | 405 | GNUNET_NETWORK_fdset_set(struct GNUNET_NETWORK_FDSet *fds, |
410 | const struct GNUNET_NETWORK_Handle *desc); | 406 | const struct GNUNET_NETWORK_Handle *desc); |
411 | 407 | ||
412 | 408 | ||
413 | #if WINDOWS | 409 | #if WINDOWS |
@@ -418,8 +414,8 @@ GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | |||
418 | * @param h the file handle to add | 414 | * @param h the file handle to add |
419 | */ | 415 | */ |
420 | void | 416 | void |
421 | GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet *fds, | 417 | GNUNET_NETWORK_fdset_handle_set_native_w32_handle(struct GNUNET_NETWORK_FDSet *fds, |
422 | HANDLE h); | 418 | HANDLE h); |
423 | #endif | 419 | #endif |
424 | 420 | ||
425 | 421 | ||
@@ -431,8 +427,8 @@ GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet * | |||
431 | * @return #GNUNET_YES if the socket is in the set | 427 | * @return #GNUNET_YES if the socket is in the set |
432 | */ | 428 | */ |
433 | int | 429 | int |
434 | GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | 430 | GNUNET_NETWORK_fdset_isset(const struct GNUNET_NETWORK_FDSet *fds, |
435 | const struct GNUNET_NETWORK_Handle *desc); | 431 | const struct GNUNET_NETWORK_Handle *desc); |
436 | 432 | ||
437 | 433 | ||
438 | /** | 434 | /** |
@@ -442,8 +438,8 @@ GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
442 | * @param src the fd set to add from | 438 | * @param src the fd set to add from |
443 | */ | 439 | */ |
444 | void | 440 | void |
445 | GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | 441 | GNUNET_NETWORK_fdset_add(struct GNUNET_NETWORK_FDSet *dst, |
446 | const struct GNUNET_NETWORK_FDSet *src); | 442 | const struct GNUNET_NETWORK_FDSet *src); |
447 | 443 | ||
448 | 444 | ||
449 | /** | 445 | /** |
@@ -453,8 +449,8 @@ GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | |||
453 | * @param from source | 449 | * @param from source |
454 | */ | 450 | */ |
455 | void | 451 | void |
456 | GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | 452 | GNUNET_NETWORK_fdset_copy(struct GNUNET_NETWORK_FDSet *to, |
457 | const struct GNUNET_NETWORK_FDSet *from); | 453 | const struct GNUNET_NETWORK_FDSet *from); |
458 | 454 | ||
459 | 455 | ||
460 | /** | 456 | /** |
@@ -464,7 +460,7 @@ GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | |||
464 | * @return POSIX file descriptor | 460 | * @return POSIX file descriptor |
465 | */ | 461 | */ |
466 | int | 462 | int |
467 | GNUNET_NETWORK_get_fd (const struct GNUNET_NETWORK_Handle *desc); | 463 | GNUNET_NETWORK_get_fd(const struct GNUNET_NETWORK_Handle *desc); |
468 | 464 | ||
469 | 465 | ||
470 | /** | 466 | /** |
@@ -474,7 +470,7 @@ GNUNET_NETWORK_get_fd (const struct GNUNET_NETWORK_Handle *desc); | |||
474 | * @return POSIX file descriptor | 470 | * @return POSIX file descriptor |
475 | */ | 471 | */ |
476 | struct sockaddr* | 472 | struct sockaddr* |
477 | GNUNET_NETWORK_get_addr (const struct GNUNET_NETWORK_Handle *desc); | 473 | GNUNET_NETWORK_get_addr(const struct GNUNET_NETWORK_Handle *desc); |
478 | 474 | ||
479 | 475 | ||
480 | /** | 476 | /** |
@@ -484,7 +480,7 @@ GNUNET_NETWORK_get_addr (const struct GNUNET_NETWORK_Handle *desc); | |||
484 | * @return socklen_t for sockaddr | 480 | * @return socklen_t for sockaddr |
485 | */ | 481 | */ |
486 | socklen_t | 482 | socklen_t |
487 | GNUNET_NETWORK_get_addrlen (const struct GNUNET_NETWORK_Handle *desc); | 483 | GNUNET_NETWORK_get_addrlen(const struct GNUNET_NETWORK_Handle *desc); |
488 | 484 | ||
489 | 485 | ||
490 | /** | 486 | /** |
@@ -495,9 +491,9 @@ GNUNET_NETWORK_get_addrlen (const struct GNUNET_NETWORK_Handle *desc); | |||
495 | * @param nfds the biggest socket number in from + 1 | 491 | * @param nfds the biggest socket number in from + 1 |
496 | */ | 492 | */ |
497 | void | 493 | void |
498 | GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | 494 | GNUNET_NETWORK_fdset_copy_native(struct GNUNET_NETWORK_FDSet *to, |
499 | const fd_set *from, | 495 | const fd_set *from, |
500 | int nfds); | 496 | int nfds); |
501 | 497 | ||
502 | 498 | ||
503 | /** | 499 | /** |
@@ -507,8 +503,8 @@ GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | |||
507 | * @param nfd native FD to set | 503 | * @param nfd native FD to set |
508 | */ | 504 | */ |
509 | void | 505 | void |
510 | GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, | 506 | GNUNET_NETWORK_fdset_set_native(struct GNUNET_NETWORK_FDSet *to, |
511 | int nfd); | 507 | int nfd); |
512 | 508 | ||
513 | 509 | ||
514 | /** | 510 | /** |
@@ -519,8 +515,8 @@ GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, | |||
519 | * @return #GNUNET_YES if to contains nfd | 515 | * @return #GNUNET_YES if to contains nfd |
520 | */ | 516 | */ |
521 | int | 517 | int |
522 | GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | 518 | GNUNET_NETWORK_fdset_test_native(const struct GNUNET_NETWORK_FDSet *to, |
523 | int nfd); | 519 | int nfd); |
524 | 520 | ||
525 | 521 | ||
526 | /** | 522 | /** |
@@ -530,8 +526,8 @@ GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | |||
530 | * @param h the file handle to add | 526 | * @param h the file handle to add |
531 | */ | 527 | */ |
532 | void | 528 | void |
533 | GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | 529 | GNUNET_NETWORK_fdset_handle_set(struct GNUNET_NETWORK_FDSet *fds, |
534 | const struct GNUNET_DISK_FileHandle *h); | 530 | const struct GNUNET_DISK_FileHandle *h); |
535 | 531 | ||
536 | 532 | ||
537 | /** | 533 | /** |
@@ -542,8 +538,8 @@ GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | |||
542 | * @param h the file handle to add | 538 | * @param h the file handle to add |
543 | */ | 539 | */ |
544 | void | 540 | void |
545 | GNUNET_NETWORK_fdset_handle_set_first (struct GNUNET_NETWORK_FDSet *fds, | 541 | GNUNET_NETWORK_fdset_handle_set_first(struct GNUNET_NETWORK_FDSet *fds, |
546 | const struct GNUNET_DISK_FileHandle *h); | 542 | const struct GNUNET_DISK_FileHandle *h); |
547 | 543 | ||
548 | 544 | ||
549 | /** | 545 | /** |
@@ -554,8 +550,8 @@ GNUNET_NETWORK_fdset_handle_set_first (struct GNUNET_NETWORK_FDSet *fds, | |||
554 | * @return #GNUNET_YES if the file handle is part of the set | 550 | * @return #GNUNET_YES if the file handle is part of the set |
555 | */ | 551 | */ |
556 | int | 552 | int |
557 | GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | 553 | GNUNET_NETWORK_fdset_handle_isset(const struct GNUNET_NETWORK_FDSet *fds, |
558 | const struct GNUNET_DISK_FileHandle *h); | 554 | const struct GNUNET_DISK_FileHandle *h); |
559 | 555 | ||
560 | 556 | ||
561 | /** | 557 | /** |
@@ -566,8 +562,8 @@ GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
566 | * @return #GNUNET_YES if they do overlap, #GNUNET_NO otherwise | 562 | * @return #GNUNET_YES if they do overlap, #GNUNET_NO otherwise |
567 | */ | 563 | */ |
568 | int | 564 | int |
569 | GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, | 565 | GNUNET_NETWORK_fdset_overlap(const struct GNUNET_NETWORK_FDSet *fds1, |
570 | const struct GNUNET_NETWORK_FDSet *fds2); | 566 | const struct GNUNET_NETWORK_FDSet *fds2); |
571 | 567 | ||
572 | 568 | ||
573 | /** | 569 | /** |
@@ -576,7 +572,7 @@ GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, | |||
576 | * @return a new fd set | 572 | * @return a new fd set |
577 | */ | 573 | */ |
578 | struct GNUNET_NETWORK_FDSet * | 574 | struct GNUNET_NETWORK_FDSet * |
579 | GNUNET_NETWORK_fdset_create (void); | 575 | GNUNET_NETWORK_fdset_create(void); |
580 | 576 | ||
581 | 577 | ||
582 | /** | 578 | /** |
@@ -585,7 +581,7 @@ GNUNET_NETWORK_fdset_create (void); | |||
585 | * @param fds fd set | 581 | * @param fds fd set |
586 | */ | 582 | */ |
587 | void | 583 | void |
588 | GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); | 584 | GNUNET_NETWORK_fdset_destroy(struct GNUNET_NETWORK_FDSet *fds); |
589 | 585 | ||
590 | 586 | ||
591 | /** | 587 | /** |
@@ -596,8 +592,8 @@ GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); | |||
596 | * @return #GNUNET_OK if the port is available, #GNUNET_NO if not | 592 | * @return #GNUNET_OK if the port is available, #GNUNET_NO if not |
597 | */ | 593 | */ |
598 | int | 594 | int |
599 | GNUNET_NETWORK_test_port_free (int ipproto, | 595 | GNUNET_NETWORK_test_port_free(int ipproto, |
600 | uint16_t port); | 596 | uint16_t port); |
601 | 597 | ||
602 | 598 | ||
603 | #if 0 /* keep Emacsens' auto-indent happy */ | 599 | #if 0 /* keep Emacsens' auto-indent happy */ |