From 2ad934742422ecb63fe3fafdc8c73d067a9e2fb7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 24 Mar 2017 18:17:50 +0100 Subject: implement GNUNET_NETWORK_test_port_free() for testcases to conveniently check if a port is available --- src/include/gnunet_network_lib.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/include/gnunet_network_lib.h') diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index beca83807..d9d3d90e7 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h @@ -588,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 -- cgit v1.2.3