- the socket stat counters have been moved from socket.h to stats.h.
- isc_nm_t now attaches to the same stats counter group as
isc_socketmgr_t, so that both managers can increment the same
set of statistics
- isc__nmsocket_init() now takes an interface as a paramter so that
the address family can be determined when initializing the socket.
- based on the address family and socket type, a group of statistics
counters will be associated with the socket - for example, UDP4Active
with IPv4 UDP sockets and TCP6Active with IPv6 TCP sockets. note
that no counters are currently associated with TCPDNS sockets; those
stats will be handled by the underlying TCP socket.
- the counters are not actually used by netmgr sockets yet; counter
increment and decrement calls will be added in a later commit.
isc_sockstatscounter_max),
"isc_stats_create");
isc_socketmgr_setstats(named_g_socketmgr, server->sockstats);
+ isc_nm_setstats(named_g_nm, server->sockstats);
CHECKFATAL(isc_stats_create(named_g_mctx, &server->zonestats,
dns_zonestatscounter_max),
* Simulate a broken firewall that blocks UDP messages larger than a given
* size.
*/
+
+void
+isc_nm_setstats(isc_nm_t *mgr, isc_stats_t *stats);
+/*%<
+ * Set a socket statistics counter set 'stats' for 'mgr'.
+ *
+ * Requires:
+ *\li 'mgr' is valid and doesn't have stats already set.
+ *
+ *\li stats is a valid set of statistics counters supporting the
+ * full range of socket-related stats counter numbers.
+ */
} isc_socket_options_t;
/*@}*/
-/*%
- * Statistics counters. Used as isc_statscounter_t values.
- */
-enum {
- isc_sockstatscounter_udp4open = 0,
- isc_sockstatscounter_udp6open = 1,
- isc_sockstatscounter_tcp4open = 2,
- isc_sockstatscounter_tcp6open = 3,
- isc_sockstatscounter_unixopen = 4,
-
- isc_sockstatscounter_udp4openfail = 5,
- isc_sockstatscounter_udp6openfail = 6,
- isc_sockstatscounter_tcp4openfail = 7,
- isc_sockstatscounter_tcp6openfail = 8,
- isc_sockstatscounter_unixopenfail = 9,
-
- isc_sockstatscounter_udp4close = 10,
- isc_sockstatscounter_udp6close = 11,
- isc_sockstatscounter_tcp4close = 12,
- isc_sockstatscounter_tcp6close = 13,
- isc_sockstatscounter_unixclose = 14,
- isc_sockstatscounter_fdwatchclose = 15,
-
- isc_sockstatscounter_udp4bindfail = 16,
- isc_sockstatscounter_udp6bindfail = 17,
- isc_sockstatscounter_tcp4bindfail = 18,
- isc_sockstatscounter_tcp6bindfail = 19,
- isc_sockstatscounter_unixbindfail = 20,
- isc_sockstatscounter_fdwatchbindfail = 21,
-
- isc_sockstatscounter_udp4connect = 22,
- isc_sockstatscounter_udp6connect = 23,
- isc_sockstatscounter_tcp4connect = 24,
- isc_sockstatscounter_tcp6connect = 25,
- isc_sockstatscounter_unixconnect = 26,
- isc_sockstatscounter_fdwatchconnect = 27,
-
- isc_sockstatscounter_udp4connectfail = 28,
- isc_sockstatscounter_udp6connectfail = 29,
- isc_sockstatscounter_tcp4connectfail = 30,
- isc_sockstatscounter_tcp6connectfail = 31,
- isc_sockstatscounter_unixconnectfail = 32,
- isc_sockstatscounter_fdwatchconnectfail = 33,
-
- isc_sockstatscounter_tcp4accept = 34,
- isc_sockstatscounter_tcp6accept = 35,
- isc_sockstatscounter_unixaccept = 36,
-
- isc_sockstatscounter_tcp4acceptfail = 37,
- isc_sockstatscounter_tcp6acceptfail = 38,
- isc_sockstatscounter_unixacceptfail = 39,
-
- isc_sockstatscounter_udp4sendfail = 40,
- isc_sockstatscounter_udp6sendfail = 41,
- isc_sockstatscounter_tcp4sendfail = 42,
- isc_sockstatscounter_tcp6sendfail = 43,
- isc_sockstatscounter_unixsendfail = 44,
- isc_sockstatscounter_fdwatchsendfail = 45,
-
- isc_sockstatscounter_udp4recvfail = 46,
- isc_sockstatscounter_udp6recvfail = 47,
- isc_sockstatscounter_tcp4recvfail = 48,
- isc_sockstatscounter_tcp6recvfail = 49,
- isc_sockstatscounter_unixrecvfail = 50,
- isc_sockstatscounter_fdwatchrecvfail = 51,
-
- isc_sockstatscounter_udp4active = 52,
- isc_sockstatscounter_udp6active = 53,
- isc_sockstatscounter_tcp4active = 54,
- isc_sockstatscounter_tcp6active = 55,
- isc_sockstatscounter_unixactive = 56,
-
- isc_sockstatscounter_rawopen = 57,
- isc_sockstatscounter_rawopenfail = 58,
- isc_sockstatscounter_rawclose = 59,
- isc_sockstatscounter_rawrecvfail = 60,
- isc_sockstatscounter_rawactive = 61,
-
- isc_sockstatscounter_max = 62
-};
-
/*@{*/
/*!
* _ATTACHED: Internal use only.
#include <isc/types.h>
+/*%
+ * Statistics counters. Used as isc_statscounter_t values.
+ */
+enum {
+ /*%
+ * Socket statistics counters.
+ */
+ isc_sockstatscounter_udp4open = 0,
+ isc_sockstatscounter_udp6open = 1,
+ isc_sockstatscounter_tcp4open = 2,
+ isc_sockstatscounter_tcp6open = 3,
+ isc_sockstatscounter_unixopen = 4,
+
+ isc_sockstatscounter_udp4openfail = 5,
+ isc_sockstatscounter_udp6openfail = 6,
+ isc_sockstatscounter_tcp4openfail = 7,
+ isc_sockstatscounter_tcp6openfail = 8,
+ isc_sockstatscounter_unixopenfail = 9,
+
+ isc_sockstatscounter_udp4close = 10,
+ isc_sockstatscounter_udp6close = 11,
+ isc_sockstatscounter_tcp4close = 12,
+ isc_sockstatscounter_tcp6close = 13,
+ isc_sockstatscounter_unixclose = 14,
+ isc_sockstatscounter_fdwatchclose = 15,
+
+ isc_sockstatscounter_udp4bindfail = 16,
+ isc_sockstatscounter_udp6bindfail = 17,
+ isc_sockstatscounter_tcp4bindfail = 18,
+ isc_sockstatscounter_tcp6bindfail = 19,
+ isc_sockstatscounter_unixbindfail = 20,
+ isc_sockstatscounter_fdwatchbindfail = 21,
+
+ isc_sockstatscounter_udp4connect = 22,
+ isc_sockstatscounter_udp6connect = 23,
+ isc_sockstatscounter_tcp4connect = 24,
+ isc_sockstatscounter_tcp6connect = 25,
+ isc_sockstatscounter_unixconnect = 26,
+ isc_sockstatscounter_fdwatchconnect = 27,
+
+ isc_sockstatscounter_udp4connectfail = 28,
+ isc_sockstatscounter_udp6connectfail = 29,
+ isc_sockstatscounter_tcp4connectfail = 30,
+ isc_sockstatscounter_tcp6connectfail = 31,
+ isc_sockstatscounter_unixconnectfail = 32,
+ isc_sockstatscounter_fdwatchconnectfail = 33,
+
+ isc_sockstatscounter_tcp4accept = 34,
+ isc_sockstatscounter_tcp6accept = 35,
+ isc_sockstatscounter_unixaccept = 36,
+
+ isc_sockstatscounter_tcp4acceptfail = 37,
+ isc_sockstatscounter_tcp6acceptfail = 38,
+ isc_sockstatscounter_unixacceptfail = 39,
+
+ isc_sockstatscounter_udp4sendfail = 40,
+ isc_sockstatscounter_udp6sendfail = 41,
+ isc_sockstatscounter_tcp4sendfail = 42,
+ isc_sockstatscounter_tcp6sendfail = 43,
+ isc_sockstatscounter_unixsendfail = 44,
+ isc_sockstatscounter_fdwatchsendfail = 45,
+
+ isc_sockstatscounter_udp4recvfail = 46,
+ isc_sockstatscounter_udp6recvfail = 47,
+ isc_sockstatscounter_tcp4recvfail = 48,
+ isc_sockstatscounter_tcp6recvfail = 49,
+ isc_sockstatscounter_unixrecvfail = 50,
+ isc_sockstatscounter_fdwatchrecvfail = 51,
+
+ isc_sockstatscounter_udp4active = 52,
+ isc_sockstatscounter_udp6active = 53,
+ isc_sockstatscounter_tcp4active = 54,
+ isc_sockstatscounter_tcp6active = 55,
+ isc_sockstatscounter_unixactive = 56,
+
+ isc_sockstatscounter_rawopen = 57,
+ isc_sockstatscounter_rawopenfail = 58,
+ isc_sockstatscounter_rawclose = 59,
+ isc_sockstatscounter_rawrecvfail = 60,
+ isc_sockstatscounter_rawactive = 61,
+
+ isc_sockstatscounter_max = 62
+};
+
ISC_LANG_BEGINDECLS
/*%<
#include <isc/region.h>
#include <isc/result.h>
#include <isc/sockaddr.h>
+#include <isc/stats.h>
#include <isc/thread.h>
#include <isc/util.h>
#include "uv-compat.h"
isc_condition_t wkstatecond;
isc__networker_t *workers;
+ isc_stats_t *stats;
+
isc_mempool_t *reqpool;
isc_mutex_t reqlock;
#define NMSOCK_MAGIC ISC_MAGIC('N', 'M', 'S', 'K')
#define VALID_NMSOCK(t) ISC_MAGIC_VALID(t, NMSOCK_MAGIC)
+/*%
+ * Index into socket stat counter arrays.
+ */
+enum {
+ STATID_OPEN = 0,
+ STATID_OPENFAIL = 1,
+ STATID_CLOSE = 2,
+ STATID_BINDFAIL = 3,
+ STATID_CONNECTFAIL = 4,
+ STATID_CONNECT = 5,
+ STATID_ACCEPTFAIL = 6,
+ STATID_ACCEPT = 7,
+ STATID_SENDFAIL = 8,
+ STATID_RECVFAIL = 9,
+ STATID_ACTIVE = 10
+};
+
struct isc_nmsocket {
/*% Unlocked, RO */
- int magic;
- int tid;
- isc_nmsocket_type type;
- isc_nm_t *mgr;
- isc_nmsocket_t *parent;
+ int magic;
+ int tid;
+ isc_nmsocket_type type;
+ isc_nm_t *mgr;
+ isc_nmsocket_t *parent;
/*%
* quota is the TCP client, attached when a TCP connection
* TCP client quota, stored in listening sockets but only
* attached in connected sockets.
*/
- isc_quota_t *quota;
- isc_quota_t *pquota;
- bool overquota;
+ isc_quota_t *quota;
+ isc_quota_t *pquota;
+ bool overquota;
+
+ /*%
+ * Socket statistics
+ */
+ const isc_statscounter_t *statsindex;
/*%
* TCP read timeout timer.
*/
- uv_timer_t timer;
- bool timer_initialized;
- uint64_t read_timeout;
+ uv_timer_t timer;
+ bool timer_initialized;
+ uint64_t read_timeout;
/*% outer socket is for 'wrapped' sockets - e.g. tcpdns in tcp */
- isc_nmsocket_t *outer;
+ isc_nmsocket_t *outer;
/*% server socket for connections */
- isc_nmsocket_t *server;
+ isc_nmsocket_t *server;
/*% Child sockets for multi-socket setups */
- isc_nmsocket_t *children;
- int nchildren;
- isc_nmiface_t *iface;
- isc_nmhandle_t *tcphandle;
+ isc_nmsocket_t *children;
+ int nchildren;
+ isc_nmiface_t *iface;
+ isc_nmhandle_t *tcphandle;
/*% Extra data allocated at the end of each isc_nmhandle_t */
- size_t extrahandlesize;
+ size_t extrahandlesize;
/*% TCP backlog */
- int backlog;
+ int backlog;
/*% libuv data */
- uv_os_sock_t fd;
- union uv_any_handle uv_handle;
+ uv_os_sock_t fd;
+ union uv_any_handle uv_handle;
/*% Peer address */
- isc_sockaddr_t peer;
+ isc_sockaddr_t peer;
/* Atomic */
/*% Number of running (e.g. listening) child sockets */
- atomic_int_fast32_t rchildren;
+ atomic_int_fast32_t rchildren;
/*%
* Socket is active if it's listening, working, etc. If it's
* closing, then it doesn't make a sense, for example, to
* push handles or reqs for reuse.
*/
- atomic_bool active;
- atomic_bool destroying;
+ atomic_bool active;
+ atomic_bool destroying;
/*%
* Socket is closed if it's not active and all the possible
* If active==false but closed==false, that means the socket
* is closing.
*/
- atomic_bool closed;
- atomic_bool listening;
- atomic_bool listen_error;
- isc_refcount_t references;
+ atomic_bool closed;
+ atomic_bool listening;
+ atomic_bool listen_error;
+ isc_refcount_t references;
/*%
* TCPDNS socket has been set not to pipeliine.
*/
- atomic_bool sequential;
+ atomic_bool sequential;
/*%
* TCPDNS socket has exceeded the maximum number of
* simultaneous requests per connecton, so will be temporarily
* restricted from pipelining.
*/
- atomic_bool overlimit;
+ atomic_bool overlimit;
/*%
* TCPDNS socket in sequential mode is currently processing a packet,
* we need to wait until it finishes.
*/
- atomic_bool processing;
+ atomic_bool processing;
/*%
* A TCP socket has had isc_nm_pauseread() called.
*/
- atomic_bool readpaused;
+ atomic_bool readpaused;
/*%
* A TCP or TCPDNS socket has been set to use the keepalive
* timeout instead of the default idle timeout.
*/
- atomic_bool keepalive;
+ atomic_bool keepalive;
/*%
* 'spare' handles for that can be reused to avoid allocations,
* for UDP.
*/
- isc_astack_t *inactivehandles;
- isc_astack_t *inactivereqs;
+ isc_astack_t *inactivehandles;
+ isc_astack_t *inactivereqs;
/*%
* Used to wait for TCP listening events to complete, and
* for the number of running children to reach zero during
* shutdown.
*/
- isc_mutex_t lock;
- isc_condition_t cond;
+ isc_mutex_t lock;
+ isc_condition_t cond;
/*%
* Used to pass a result back from TCP listening events.
*/
- isc_result_t result;
+ isc_result_t result;
/*%
* List of active handles.
* might want to change it to something lockless in the
* future.
*/
- atomic_int_fast32_t ah;
- size_t ah_size;
- size_t *ah_frees;
- isc_nmhandle_t **ah_handles;
+ atomic_int_fast32_t ah;
+ size_t ah_size;
+ size_t *ah_frees;
+ isc_nmhandle_t **ah_handles;
/*% Buffer for TCPDNS processing */
- size_t buf_size;
- size_t buf_len;
- unsigned char *buf;
+ size_t buf_size;
+ size_t buf_len;
+ unsigned char *buf;
/*%
* This function will be called with handle->sock
* as the argument whenever a handle's references drop
* to zero, after its reset callback has been called.
*/
- isc_nm_opaquecb_t closehandle_cb;
+ isc_nm_opaquecb_t closehandle_cb;
- isc__nm_readcb_t rcb;
- void *rcbarg;
+ isc__nm_readcb_t rcb;
+ void *rcbarg;
- isc__nm_cb_t accept_cb;
- void *accept_cbarg;
+ isc__nm_cb_t accept_cb;
+ void *accept_cbarg;
};
bool
void
isc__nmsocket_init(isc_nmsocket_t *sock, isc_nm_t *mgr,
- isc_nmsocket_type type);
+ isc_nmsocket_type type, isc_nmiface_t *iface);
/*%<
- * Initialize socket 'sock', attach it to 'mgr', and set it to type 'type'.
+ * Initialize socket 'sock', attach it to 'mgr', and set it to type 'type'
+ * and its interface to 'iface'.
*/
void
/*%<
* Actively wait for interlocked state.
*/
+
+void
+isc__nm_incstats(isc_nm_t *mgr, isc_statscounter_t counterid);
+/*%<
+ * Increment socket-related statistics counters.
+ */
+
+void
+isc__nm_decstats(isc_nm_t *mgr, isc_statscounter_t counterid);
+/*%<
+ * Decrement socket-related statistics counters.
+ */
#include <isc/region.h>
#include <isc/result.h>
#include <isc/sockaddr.h>
+#include <isc/stats.h>
#include <isc/thread.h>
#include <isc/util.h>
#include "uv-compat.h"
#include "netmgr-int.h"
+/*%
+ * Shortcut index arrays to get access to statistics counters.
+ */
+
+static const isc_statscounter_t udp4statsindex[] = {
+ isc_sockstatscounter_udp4open,
+ isc_sockstatscounter_udp4openfail,
+ isc_sockstatscounter_udp4close,
+ isc_sockstatscounter_udp4bindfail,
+ isc_sockstatscounter_udp4connectfail,
+ isc_sockstatscounter_udp4connect,
+ -1,
+ -1,
+ isc_sockstatscounter_udp4sendfail,
+ isc_sockstatscounter_udp4recvfail,
+ isc_sockstatscounter_udp4active
+};
+
+static const isc_statscounter_t udp6statsindex[] = {
+ isc_sockstatscounter_udp6open,
+ isc_sockstatscounter_udp6openfail,
+ isc_sockstatscounter_udp6close,
+ isc_sockstatscounter_udp6bindfail,
+ isc_sockstatscounter_udp6connectfail,
+ isc_sockstatscounter_udp6connect,
+ -1,
+ -1,
+ isc_sockstatscounter_udp6sendfail,
+ isc_sockstatscounter_udp6recvfail,
+ isc_sockstatscounter_udp6active
+};
+
+static const isc_statscounter_t tcp4statsindex[] = {
+ isc_sockstatscounter_tcp4open,
+ isc_sockstatscounter_tcp4openfail,
+ isc_sockstatscounter_tcp4close,
+ isc_sockstatscounter_tcp4bindfail,
+ isc_sockstatscounter_tcp4connectfail,
+ isc_sockstatscounter_tcp4connect,
+ isc_sockstatscounter_tcp4acceptfail,
+ isc_sockstatscounter_tcp4accept,
+ isc_sockstatscounter_tcp4sendfail,
+ isc_sockstatscounter_tcp4recvfail,
+ isc_sockstatscounter_tcp4active
+};
+
+static const isc_statscounter_t tcp6statsindex[] = {
+ isc_sockstatscounter_tcp6open,
+ isc_sockstatscounter_tcp6openfail,
+ isc_sockstatscounter_tcp6close,
+ isc_sockstatscounter_tcp6bindfail,
+ isc_sockstatscounter_tcp6connectfail,
+ isc_sockstatscounter_tcp6connect,
+ isc_sockstatscounter_tcp6acceptfail,
+ isc_sockstatscounter_tcp6accept,
+ isc_sockstatscounter_tcp6sendfail,
+ isc_sockstatscounter_tcp6recvfail,
+ isc_sockstatscounter_tcp6active
+};
+
+#if 0
+/* XXX: not currently used */
+static const isc_statscounter_t unixstatsindex[] = {
+ isc_sockstatscounter_unixopen,
+ isc_sockstatscounter_unixopenfail,
+ isc_sockstatscounter_unixclose,
+ isc_sockstatscounter_unixbindfail,
+ isc_sockstatscounter_unixconnectfail,
+ isc_sockstatscounter_unixconnect,
+ isc_sockstatscounter_unixacceptfail,
+ isc_sockstatscounter_unixaccept,
+ isc_sockstatscounter_unixsendfail,
+ isc_sockstatscounter_unixrecvfail,
+ isc_sockstatscounter_unixactive
+};
+#endif
+
/*
* libuv is not thread safe, but has mechanisms to pass messages
* between threads. Each socket is owned by a thread. For UDP
isc_thread_join(worker->thread, NULL);
}
+ if (mgr->stats != NULL) {
+ isc_stats_detach(&mgr->stats);
+ }
+
isc_condition_destroy(&mgr->wkstatecond);
isc_mutex_destroy(&mgr->lock);
void
isc__nmsocket_init(isc_nmsocket_t *sock, isc_nm_t *mgr,
- isc_nmsocket_type type)
+ isc_nmsocket_type type, isc_nmiface_t *iface)
{
+ uint16_t family;
+
+ REQUIRE(sock != NULL);
+ REQUIRE(mgr != NULL);
+ REQUIRE(iface!= NULL);
+
+ family = iface->addr.type.sa.sa_family;
+
*sock = (isc_nmsocket_t) {
.type = type,
+ .iface = iface,
.fd = -1,
.ah_size = 32,
.inactivehandles = isc_astack_new(mgr->mctx, 60),
.inactivereqs = isc_astack_new(mgr->mctx, 60)
};
+
isc_nm_attach(mgr, &sock->mgr);
sock->uv_handle.handle.data = sock;
sock->ah_handles[i] = NULL;
}
+ switch (type) {
+ case isc_nm_udpsocket:
+ case isc_nm_udplistener:
+ if (family == AF_INET) {
+ sock->statsindex = udp4statsindex;
+ } else {
+ sock->statsindex = udp6statsindex;
+ }
+ break;
+ case isc_nm_tcpsocket:
+ case isc_nm_tcplistener:
+ case isc_nm_tcpchildlistener:
+ if (family == AF_INET) {
+ sock->statsindex = tcp4statsindex;
+ } else {
+ sock->statsindex = tcp6statsindex;
+ }
+ break;
+ default:
+ break;
+ }
+
isc_mutex_init(&sock->lock);
isc_condition_init(&sock->cond);
isc_refcount_init(&sock->references, 1);
}
UNLOCK(&mgr->lock);
}
+
+void
+isc_nm_setstats(isc_nm_t *mgr, isc_stats_t *stats) {
+ REQUIRE(VALID_NM(mgr));
+ REQUIRE(mgr->stats == NULL);
+ REQUIRE(isc_stats_ncounters(stats) == isc_sockstatscounter_max);
+
+ isc_stats_attach(stats, &mgr->stats);
+}
+
+
+void
+isc__nm_incstats(isc_nm_t *mgr, isc_statscounter_t counterid) {
+ REQUIRE(VALID_NM(mgr));
+ REQUIRE(counterid != -1);
+
+ if (mgr->stats != NULL) {
+ isc_stats_increment(mgr->stats, counterid);
+ }
+}
+
+void
+isc__nm_decstats(isc_nm_t *mgr, isc_statscounter_t counterid) {
+ REQUIRE(VALID_NM(mgr));
+ REQUIRE(counterid != -1);
+
+ if (mgr->stats != NULL) {
+ isc_stats_decrement(mgr->stats, counterid);
+ }
+}
REQUIRE(VALID_NM(mgr));
nsock = isc_mem_get(mgr->mctx, sizeof(*nsock));
- isc__nmsocket_init(nsock, mgr, isc_nm_tcplistener);
- nsock->iface = iface;
+ isc__nmsocket_init(nsock, mgr, isc_nm_tcplistener, iface);
nsock->nchildren = mgr->nworkers;
atomic_init(&nsock->rchildren, mgr->nworkers);
nsock->children = isc_mem_get(mgr->mctx,
for (int i = 0; i < sock->nchildren; i++) {
isc_nmsocket_t *csock = &sock->children[i];
- isc__nmsocket_init(csock, sock->mgr, isc_nm_tcpchildlistener);
+ isc__nmsocket_init(csock, sock->mgr,
+ isc_nm_tcpchildlistener, sock->iface);
csock->parent = sock;
- csock->iface = sock->iface;
csock->tid = i;
csock->pquota = sock->pquota;
csock->backlog = sock->backlog;
}
csock = isc_mem_get(ssock->mgr->mctx, sizeof(isc_nmsocket_t));
- isc__nmsocket_init(csock, ssock->mgr, isc_nm_tcpsocket);
+ isc__nmsocket_init(csock, ssock->mgr, isc_nm_tcpsocket, ssock->iface);
csock->tid = isc_nm_tid();
csock->extrahandlesize = ssock->extrahandlesize;
- csock->iface = ssock->iface;
csock->quota = quota;
quota = NULL;
/* We need to create a 'wrapper' dnssocket for this connection */
dnssock = isc_mem_get(handle->sock->mgr->mctx, sizeof(*dnssock));
- isc__nmsocket_init(dnssock, handle->sock->mgr, isc_nm_tcpdnssocket);
+ isc__nmsocket_init(dnssock, handle->sock->mgr,
+ isc_nm_tcpdnssocket, handle->sock->iface);
/* We need to copy read callbacks from outer socket */
dnssock->rcb.recv = dnslistensock->rcb.recv;
dnssock->extrahandlesize = dnslistensock->extrahandlesize;
isc_nmsocket_attach(handle->sock, &dnssock->outer);
dnssock->peer = handle->sock->peer;
- dnssock->iface = handle->sock->iface;
dnssock->read_timeout = handle->sock->mgr->init;
dnssock->tid = isc_nm_tid();
dnssock->closehandle_cb = resume_processing;
REQUIRE(VALID_NM(mgr));
- isc__nmsocket_init(dnslistensock, mgr, isc_nm_tcpdnslistener);
- dnslistensock->iface = iface;
+ isc__nmsocket_init(dnslistensock, mgr, isc_nm_tcpdnslistener, iface);
dnslistensock->rcb.recv = cb;
dnslistensock->rcbarg = cbarg;
dnslistensock->accept_cb.accept = accept_cb;
* socket for each worker thread.
*/
nsock = isc_mem_get(mgr->mctx, sizeof(isc_nmsocket_t));
- isc__nmsocket_init(nsock, mgr, isc_nm_udplistener);
- nsock->iface = iface;
+ isc__nmsocket_init(nsock, mgr, isc_nm_udplistener, iface);
nsock->nchildren = mgr->nworkers;
atomic_init(&nsock->rchildren, mgr->nworkers);
nsock->children = isc_mem_get(mgr->mctx,
isc__netievent_udplisten_t *ievent = NULL;
isc_nmsocket_t *csock = &nsock->children[i];
- isc__nmsocket_init(csock, mgr, isc_nm_udpsocket);
+ isc__nmsocket_init(csock, mgr, isc_nm_udpsocket, iface);
csock->parent = nsock;
- csock->iface = iface;
csock->tid = i;
csock->extrahandlesize = extrahandlesize;
isc_nm_listenudp
isc_nm_maxudp
isc_nm_send
+isc_nm_setstats
isc_nm_start
isc_nm_tcp_gettimeouts
isc_nm_tcp_settimeouts