projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
defining data structures for validation
[oweals/gnunet.git]
/
src
/
include
/
gnunet_network_lib.h
diff --git
a/src/include/gnunet_network_lib.h
b/src/include/gnunet_network_lib.h
index 8064140aa5e474f28dd96aa3c91436ee878d476c..6c02f3577193f5ef54a2edef33b1f7317fe9f04d 100644
(file)
--- a/
src/include/gnunet_network_lib.h
+++ b/
src/include/gnunet_network_lib.h
@@
-2,20
+2,20
@@
This file is part of GNUnet.
Copyright (C) 2009-2013 GNUnet e.V.
This file is part of GNUnet.
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
- by the Free Software Foundation
; either version 3, or (at your
- option) any later version.
+ GNUnet is free software
: you can redistribute it and/or modify it
+
under the terms of the GNU Affero
General Public License as published
+ by the Free Software Foundation
, either version 3 of the License,
+ o
r (at your o
ption) any later version.
GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ SPDX-License-Identifier: AGPL3.0-or-later
*/
/**
*/
/**
@@
-53,7
+53,7
@@
struct GNUNET_NETWORK_FDSet
{
/**
{
/**
- * Maximum number of any socket
socket
descriptor in the set (plus one)
+ * Maximum number of any socket descriptor in the set (plus one)
*/
int nsds;
*/
int nsds;
@@
-244,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
* 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);
*/
ssize_t
GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *desc);
@@
-464,7
+464,7
@@
GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to,
* @return POSIX file descriptor
*/
int
* @return POSIX file descriptor
*/
int
-GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc);
+GNUNET_NETWORK_get_fd (
const
struct GNUNET_NETWORK_Handle *desc);
/**
/**
@@
-474,7
+474,7
@@
GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc);
* @return POSIX file descriptor
*/
struct sockaddr*
* @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);
/**
/**
@@
-484,7
+484,7
@@
GNUNET_NETWORK_get_addr (struct GNUNET_NETWORK_Handle *desc);
* @return socklen_t for sockaddr
*/
socklen_t
* @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);
/**
/**
@@
-588,6
+588,18
@@
void
GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds);
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
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif