aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_network_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-06-07 18:37:09 +0000
committerChristian Grothoff <christian@grothoff.org>2014-06-07 18:37:09 +0000
commitaf0501960d6041f27758678c8f8ffdc3ed7ac6c9 (patch)
treec2aefd184f975731f5e2957f979af2dd05dc352e /src/include/gnunet_network_lib.h
parentef0def7ccde140b2b4558761dfd46cbb16c625f4 (diff)
downloadgnunet-af0501960d6041f27758678c8f8ffdc3ed7ac6c9.tar.gz
gnunet-af0501960d6041f27758678c8f8ffdc3ed7ac6c9.zip
-indent, doxygen
Diffstat (limited to 'src/include/gnunet_network_lib.h')
-rw-r--r--src/include/gnunet_network_lib.h59
1 files changed, 37 insertions, 22 deletions
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index 0081f0973..cc01a8133 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -167,7 +167,7 @@ GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc);
167 * 167 *
168 * @param desc socket to connect 168 * @param desc socket to connect
169 * @param address peer address 169 * @param address peer address
170 * @param address_len of address 170 * @param address_len of @a address
171 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 171 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
172 */ 172 */
173int 173int
@@ -188,8 +188,10 @@ GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
188 */ 188 */
189int 189int
190GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, 190GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc,
191 int level, int optname, void *optval, 191 int level,
192 socklen_t * optlen); 192 int optname,
193 void *optval,
194 socklen_t *optlen);
193 195
194 196
195/** 197/**
@@ -211,8 +213,7 @@ GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc,
211 * @returns #GNUNET_NO if no data is available, or on error! 213 * @returns #GNUNET_NO if no data is available, or on error!
212 */ 214 */
213ssize_t 215ssize_t
214GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle 216GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *desc);
215 *desc);
216 217
217 218
218/** 219/**
@@ -227,8 +228,10 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle
227 */ 228 */
228ssize_t 229ssize_t
229GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, 230GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc,
230 void *buffer, size_t length, 231 void *buffer,
231 struct sockaddr *src_addr, socklen_t *addrlen); 232 size_t length,
233 struct sockaddr *src_addr,
234 socklen_t *addrlen);
232 235
233 236
234/** 237/**
@@ -241,11 +244,13 @@ GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc,
241 */ 244 */
242ssize_t 245ssize_t
243GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, 246GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc,
244 void *buffer, size_t length); 247 void *buffer,
248 size_t length);
245 249
246 250
247/** 251/**
248 * Check if sockets meet certain conditions 252 * Check if sockets meet certain conditions.
253 *
249 * @param rfds set of sockets to be checked for readability 254 * @param rfds set of sockets to be checked for readability
250 * @param wfds set of sockets to be checked for writability 255 * @param wfds set of sockets to be checked for writability
251 * @param efds set of sockets to be checked for exceptions 256 * @param efds set of sockets to be checked for exceptions
@@ -269,7 +274,8 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
269 */ 274 */
270ssize_t 275ssize_t
271GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, 276GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc,
272 const void *buffer, size_t length); 277 const void *buffer,
278 size_t length);
273 279
274 280
275/** 281/**
@@ -278,14 +284,15 @@ GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc,
278 * 284 *
279 * @param desc socket 285 * @param desc socket
280 * @param message data to send 286 * @param message data to send
281 * @param length size of the data 287 * @param length size of the data in @a message
282 * @param dest_addr destination address 288 * @param dest_addr destination address
283 * @param dest_len length of address 289 * @param dest_len length of @a dest_addr
284 * @return number of bytes sent, #GNUNET_SYSERR on error 290 * @return number of bytes sent, #GNUNET_SYSERR on error
285 */ 291 */
286ssize_t 292ssize_t
287GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, 293GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc,
288 const void *message, size_t length, 294 const void *message,
295 size_t length,
289 const struct sockaddr *dest_addr, 296 const struct sockaddr *dest_addr,
290 socklen_t dest_len); 297 socklen_t dest_len);
291 298
@@ -297,12 +304,14 @@ GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc,
297 * @param level protocol level of the option 304 * @param level protocol level of the option
298 * @param option_name option identifier 305 * @param option_name option identifier
299 * @param option_value value to set 306 * @param option_value value to set
300 * @param option_len size of option_value 307 * @param option_len size of @a option_value
301 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 308 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
302 */ 309 */
303int 310int
304GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, int level, 311GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd,
305 int option_name, const void *option_value, 312 int level,
313 int option_name,
314 const void *option_value,
306 socklen_t option_len); 315 socklen_t option_len);
307 316
308 317
@@ -314,7 +323,8 @@ GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, int level,
314 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 323 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
315 */ 324 */
316int 325int
317GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, int how); 326GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc,
327 int how);
318 328
319 329
320/** 330/**
@@ -341,7 +351,9 @@ GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc);
341 * @return new socket, NULL on error 351 * @return new socket, NULL on error
342 */ 352 */
343struct GNUNET_NETWORK_Handle * 353struct GNUNET_NETWORK_Handle *
344GNUNET_NETWORK_socket_create (int domain, int type, int protocol); 354GNUNET_NETWORK_socket_create (int domain,
355 int type,
356 int protocol);
345 357
346 358
347/** 359/**
@@ -372,7 +384,7 @@ GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds,
372 * @param h the file handle to add 384 * @param h the file handle to add
373 */ 385 */
374void 386void
375GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet *fds 387GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet *fds,
376 HANDLE h); 388 HANDLE h);
377#endif 389#endif
378 390
@@ -450,7 +462,8 @@ GNUNET_NETWORK_get_addrlen (struct GNUNET_NETWORK_Handle *desc);
450 */ 462 */
451void 463void
452GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, 464GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
453 const fd_set *from, int nfds); 465 const fd_set *from,
466 int nfds);
454 467
455 468
456/** 469/**
@@ -460,7 +473,8 @@ GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
460 * @param nfd native FD to set 473 * @param nfd native FD to set
461 */ 474 */
462void 475void
463GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); 476GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to,
477 int nfd);
464 478
465 479
466/** 480/**
@@ -468,7 +482,7 @@ GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd);
468 * 482 *
469 * @param to set to test, NULL for empty set 483 * @param to set to test, NULL for empty set
470 * @param nfd native FD to test, -1 for none 484 * @param nfd native FD to test, -1 for none
471 * @return GNUNET_YES if to contains nfd 485 * @return #GNUNET_YES if to contains nfd
472 */ 486 */
473int 487int
474GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, 488GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to,
@@ -488,6 +502,7 @@ GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds,
488 502
489/** 503/**
490 * Check if a file handle is part of an fd set 504 * Check if a file handle is part of an fd set
505 *
491 * @param fds fd set 506 * @param fds fd set
492 * @param h file handle 507 * @param h file handle
493 * @return #GNUNET_YES if the file handle is part of the set 508 * @return #GNUNET_YES if the file handle is part of the set