diff options
Diffstat (limited to 'src/include/gnunet_network_lib.h')
-rw-r--r-- | src/include/gnunet_network_lib.h | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 97ab64add..764b7b29d 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2009-2013 GNUnet e.V. | 3 | Copyright (C) 2009-2013, 2022 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -19,7 +19,15 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @addtogroup libgnunetutil | ||
23 | * Multi-function utilities library for GNUnet programs | ||
24 | * @{ | ||
25 | * | ||
26 | * @addtogroup networking | ||
27 | * @{ | ||
28 | * | ||
22 | * @author Nils Durner | 29 | * @author Nils Durner |
30 | * @author Tobias Frisch | ||
23 | * | 31 | * |
24 | * @file | 32 | * @file |
25 | * Basic low-level networking interface | 33 | * Basic low-level networking interface |
@@ -31,6 +39,7 @@ | |||
31 | #ifndef GNUNET_NETWORK_LIB_H | 39 | #ifndef GNUNET_NETWORK_LIB_H |
32 | #define GNUNET_NETWORK_LIB_H | 40 | #define GNUNET_NETWORK_LIB_H |
33 | 41 | ||
42 | #include "gnunet_common.h" | ||
34 | #ifdef __cplusplus | 43 | #ifdef __cplusplus |
35 | extern "C" | 44 | extern "C" |
36 | { | 45 | { |
@@ -39,6 +48,14 @@ extern "C" | |||
39 | #endif | 48 | #endif |
40 | #endif | 49 | #endif |
41 | 50 | ||
51 | //#ifdef HAVE_SYS_SELECT_H | ||
52 | /* | ||
53 | * Include "sys/select.h" because it is required to use | ||
54 | * "fd_set" in "struct GNUNET_NETWORK_FDSet"! | ||
55 | */ | ||
56 | |||
57 | #include <sys/select.h> | ||
58 | //#endif | ||
42 | #ifdef HAVE_SYS_SOCKET_H | 59 | #ifdef HAVE_SYS_SOCKET_H |
43 | #include <sys/socket.h> | 60 | #include <sys/socket.h> |
44 | #endif | 61 | #endif |
@@ -78,7 +95,7 @@ struct GNUNET_NETWORK_FDSet | |||
78 | * @param pf protocol family to test (PF_INET, PF_INET6, PF_UNIX) | 95 | * @param pf protocol family to test (PF_INET, PF_INET6, PF_UNIX) |
79 | * @return #GNUNET_OK if the PF is supported | 96 | * @return #GNUNET_OK if the PF is supported |
80 | */ | 97 | */ |
81 | int | 98 | enum GNUNET_GenericReturnValue |
82 | GNUNET_NETWORK_test_pf (int pf); | 99 | GNUNET_NETWORK_test_pf (int pf); |
83 | 100 | ||
84 | 101 | ||
@@ -141,7 +158,7 @@ GNUNET_NETWORK_socket_box_native (int fd); | |||
141 | * @param doBlock blocking mode | 158 | * @param doBlock blocking mode |
142 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 159 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
143 | */ | 160 | */ |
144 | int | 161 | enum GNUNET_GenericReturnValue |
145 | GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, | 162 | GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, |
146 | int doBlock); | 163 | int doBlock); |
147 | 164 | ||
@@ -154,7 +171,7 @@ GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, | |||
154 | * @param address_len length of @a address | 171 | * @param address_len length of @a address |
155 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 172 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
156 | */ | 173 | */ |
157 | int | 174 | enum GNUNET_GenericReturnValue |
158 | GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | 175 | GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, |
159 | const struct sockaddr *address, | 176 | const struct sockaddr *address, |
160 | socklen_t address_len); | 177 | socklen_t address_len); |
@@ -165,7 +182,7 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | |||
165 | * @param desc socket to close | 182 | * @param desc socket to close |
166 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 183 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
167 | */ | 184 | */ |
168 | int | 185 | enum GNUNET_GenericReturnValue |
169 | GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | 186 | GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); |
170 | 187 | ||
171 | 188 | ||
@@ -186,7 +203,7 @@ GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc); | |||
186 | * @param address_len of @a address | 203 | * @param address_len of @a address |
187 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 204 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
188 | */ | 205 | */ |
189 | int | 206 | enum GNUNET_GenericReturnValue |
190 | GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | 207 | GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, |
191 | const struct sockaddr *address, | 208 | const struct sockaddr *address, |
192 | socklen_t address_len); | 209 | socklen_t address_len); |
@@ -202,7 +219,7 @@ GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | |||
202 | * @param optlen length of optval | 219 | * @param optlen length of optval |
203 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 220 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
204 | */ | 221 | */ |
205 | int | 222 | enum GNUNET_GenericReturnValue |
206 | GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | 223 | GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, |
207 | int level, | 224 | int level, |
208 | int optname, | 225 | int optname, |
@@ -217,7 +234,7 @@ GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | |||
217 | * @param backlog length of the listen queue | 234 | * @param backlog length of the listen queue |
218 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 235 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
219 | */ | 236 | */ |
220 | int | 237 | enum GNUNET_GenericReturnValue |
221 | GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, | 238 | GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, |
222 | int backlog); | 239 | int backlog); |
223 | 240 | ||
@@ -339,7 +356,7 @@ GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | |||
339 | * @param how type of shutdown | 356 | * @param how type of shutdown |
340 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 357 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
341 | */ | 358 | */ |
342 | int | 359 | enum GNUNET_GenericReturnValue |
343 | GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | 360 | GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, |
344 | int how); | 361 | int how); |
345 | 362 | ||
@@ -353,7 +370,7 @@ GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | |||
353 | * @param desc socket | 370 | * @param desc socket |
354 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 371 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
355 | */ | 372 | */ |
356 | int | 373 | enum GNUNET_GenericReturnValue |
357 | GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | 374 | GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); |
358 | 375 | ||
359 | 376 | ||
@@ -580,3 +597,7 @@ GNUNET_NETWORK_test_port_free (int ipproto, | |||
580 | #endif /* GNUNET_NETWORK_LIB_H */ | 597 | #endif /* GNUNET_NETWORK_LIB_H */ |
581 | 598 | ||
582 | /** @} */ /* end of group */ | 599 | /** @} */ /* end of group */ |
600 | |||
601 | /** @} */ /* end of group addition */ | ||
602 | |||
603 | /** @} */ /* end of group addition */ | ||