diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2019-03-11 18:33:19 +0100 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2019-03-12 12:42:03 +0100 |
commit | 2667c5f0cd7ddc8b6880db28ca6dacccbb227167 (patch) | |
tree | ca71a076c0bd46a4a8618afb22e4cd34478a3d84 /daemon/network.h | |
parent | daemon/network: stop using combined UDP+TCP endpoints (diff) | |
download | knot-resolver-2667c5f0cd7ddc8b6880db28ca6dacccbb227167.tar.xz knot-resolver-2667c5f0cd7ddc8b6880db28ca6dacccbb227167.zip |
daemon/network: adapt _listen and _close to repeats
We could get multiple addr#port tuples even before the UDP+TCP split,
but now it would becom quite common, so the API needs to count on that.
Diffstat (limited to 'daemon/network.h')
-rw-r--r-- | daemon/network.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/daemon/network.h b/daemon/network.h index 61b9835c..36b88855 100644 --- a/daemon/network.h +++ b/daemon/network.h @@ -69,13 +69,17 @@ void network_init(struct network *net, uv_loop_t *loop, int tcp_backlog); void network_deinit(struct network *net); /** Start listenting on addr#port. - * \param flags see enum endpoint_flag; (NET_UDP | NET_TCP) is allowed. */ + * \param flags see enum endpoint_flag; (NET_UDP | NET_TCP) is allowed. + * \note if we did listen already, nothing is done and kr_ok() is returned. */ int network_listen(struct network *net, const char *addr, uint16_t port, uint16_t flags); /** Start listenting on an open file-descriptor. */ int network_listen_fd(struct network *net, int fd, bool use_tls); -int network_close(struct network *net, const char *addr, uint16_t port); +/** Stop listening on all addr#port with equal flags; flags == 0 means all of them. + * \return kr_error(ENOENT) if nothing matched. */ +int network_close(struct network *net, const char *addr, uint16_t port, uint16_t flags); + int network_set_tls_cert(struct network *net, const char *cert); int network_set_tls_key(struct network *net, const char *key); void network_new_hostname(struct network *net, struct engine *engine); |