X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_network_lib.h;h=9e692bbbf6c21eacfe536a845e98e9f20328306a;hb=4e084e4842cddf5de988534c84e2d65bb122472f;hp=83d820a5be5f7827215b12ab328a7405764329c9;hpb=3104aa430ae360599dd54369a8cb1fd61f07894c;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 83d820a5b..9e692bbbf 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2009-2013 Christian Grothoff (and other contributing authors) + Copyright (C) 2009-2013 GNUnet e.V. GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -19,9 +19,14 @@ */ /** - * @file include/gnunet_network_lib.h - * @brief basic low-level networking interface * @author Nils Durner + * + * @file + * Basic low-level networking interface + * + * @defgroup network Network library + * Basic low-level networking interface + * @{ */ #ifndef GNUNET_NETWORK_LIB_H #define GNUNET_NETWORK_LIB_H @@ -239,7 +244,7 @@ GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, * How much data is available to be read on this descriptor? * * @param desc socket - * @returns #GNUNET_NO if no data is available, or on error! + * @returns #GNUNET_SYSERR if no data is available, or on error! */ ssize_t GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *desc); @@ -459,7 +464,7 @@ GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, * @return POSIX file descriptor */ int -GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); +GNUNET_NETWORK_get_fd (const struct GNUNET_NETWORK_Handle *desc); /** @@ -469,7 +474,7 @@ GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); * @return POSIX file descriptor */ struct sockaddr* -GNUNET_NETWORK_get_addr (struct GNUNET_NETWORK_Handle *desc); +GNUNET_NETWORK_get_addr (const struct GNUNET_NETWORK_Handle *desc); /** @@ -479,7 +484,7 @@ GNUNET_NETWORK_get_addr (struct GNUNET_NETWORK_Handle *desc); * @return socklen_t for sockaddr */ socklen_t -GNUNET_NETWORK_get_addrlen (struct GNUNET_NETWORK_Handle *desc); +GNUNET_NETWORK_get_addrlen (const struct GNUNET_NETWORK_Handle *desc); /** @@ -583,6 +588,18 @@ void GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); +/** + * Test if the given @a port is available. + * + * @param ipproto transport protocol to test (i.e. IPPROTO_TCP) + * @param port port number to test + * @return #GNUNET_OK if the port is available, #GNUNET_NO if not + */ +int +GNUNET_NETWORK_test_port_free (int ipproto, + uint16_t port); + + #if 0 /* keep Emacsens' auto-indent happy */ { #endif @@ -591,3 +608,5 @@ GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); #endif #endif /* GNUNET_NETWORK_LIB_H */ + +/** @} */ /* end of group */