mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 23:55:27 +00:00
2134. [func] Additional statistics support. [RT #16666]
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
|||||||
|
2134. [func] Additional statistics support. [RT #16666]
|
||||||
|
|
||||||
2133. [port] powerpc: Support both IBM and MacOS Power PC
|
2133. [port] powerpc: Support both IBM and MacOS Power PC
|
||||||
assembler syntaxes. [RT #16647]
|
assembler syntaxes. [RT #16647]
|
||||||
|
|
||||||
|
@@ -4,3 +4,4 @@ Makefile
|
|||||||
*.lo
|
*.lo
|
||||||
named
|
named
|
||||||
lwresd
|
lwresd
|
||||||
|
bind9.xsl.h
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
# PERFORMANCE OF THIS SOFTWARE.
|
# PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
# $Id: Makefile.in,v 1.90 2006/12/22 01:59:43 marka Exp $
|
# $Id: Makefile.in,v 1.91 2007/02/13 02:49:08 marka Exp $
|
||||||
|
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
@@ -133,7 +133,7 @@ clean distclean maintainer-clean::
|
|||||||
rm -f ${TARGETS} ${OBJS} ${GENERATED}
|
rm -f ${TARGETS} ${OBJS} ${GENERATED}
|
||||||
|
|
||||||
bind9.xsl.h: bind9.xsl convertxsl.pl
|
bind9.xsl.h: bind9.xsl convertxsl.pl
|
||||||
perl convertxsl.pl < ${srcdir}/bind9.xsl > bind9.xsl.h
|
${PERL} convertxsl.pl < ${srcdir}/bind9.xsl > bind9.xsl.h
|
||||||
|
|
||||||
server.@O@: bind9.xsl.h
|
server.@O@: bind9.xsl.h
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
- PERFORMANCE OF THIS SOFTWARE.
|
- PERFORMANCE OF THIS SOFTWARE.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- $Id: bind9.xsl,v 1.11 2007/01/15 01:29:43 marka Exp $ -->
|
<!-- $Id: bind9.xsl,v 1.12 2007/02/13 02:49:08 marka Exp $ -->
|
||||||
|
|
||||||
<xsl:stylesheet version="1.0"
|
<xsl:stylesheet version="1.0"
|
||||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
@@ -108,28 +108,173 @@ tr.lrow {
|
|||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br />
|
<br/>
|
||||||
|
|
||||||
<xsl:for-each select="views/view">
|
<xsl:for-each select="views/view">
|
||||||
<table>
|
<table>
|
||||||
<tr class="rowh">
|
<tr class="rowh">
|
||||||
<th colspan="4">Zones for View <xsl:value-of select="name" /></th>
|
<th colspan="11">Zones for View <xsl:value-of select="name"/></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="rowh">
|
<tr class="rowh">
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Class</th>
|
||||||
|
<th>Serial</th>
|
||||||
|
<th>Success</th>
|
||||||
|
<th>Referral</th>
|
||||||
|
<th>NXRRSET</th>
|
||||||
|
<th>NXDOMAIN</th>
|
||||||
|
<th>Recursion</th>
|
||||||
|
<th>Failure</th>
|
||||||
|
<th>Duplicate</th>
|
||||||
|
<th>Dropped</th>
|
||||||
|
</tr>
|
||||||
|
<xsl:for-each select="zones/zone">
|
||||||
|
<tr class="lrow">
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="name"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="rdataclass"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="serial"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="counters/success"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="counters/referral"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="counters/nxrrset"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="counters/nxdomain"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="counters/recursion"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="counters/failure"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="counters/duplicate"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="counters/dropped"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</xsl:for-each>
|
||||||
|
</table>
|
||||||
|
<br/>
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr class="rowh">
|
||||||
|
<th colspan="7">Network Status</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="rowh">
|
||||||
|
<th>ID</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Class</th>
|
<th>Type</th>
|
||||||
<th>Serial</th>
|
<th>References</th>
|
||||||
</tr>
|
<th>LocalAddress</th>
|
||||||
<xsl:for-each select="zones/zone">
|
<th>PeerAddress</th>
|
||||||
<tr class="lrow">
|
<th>State</th>
|
||||||
<td><xsl:value-of select="name"/></td>
|
</tr>
|
||||||
<td><xsl:value-of select="rdataclass"/></td>
|
<xsl:for-each select="socketmgr/sockets/socket">
|
||||||
<td><xsl:value-of select="serial"/></td>
|
<tr class="lrow">
|
||||||
</tr>
|
<td>
|
||||||
|
<xsl:value-of select="id"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="name"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="type"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="references"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="local-address"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="peer-address"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:for-each select="states">
|
||||||
|
<xsl:value-of select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</table>
|
</table>
|
||||||
<br />
|
<br/>
|
||||||
</xsl:for-each>
|
<table>
|
||||||
|
<tr class="rowh">
|
||||||
|
<th colspan="2">Task Manager Configuration</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="lrow">
|
||||||
|
<td>Thread-Model</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="taskmgr/thread-model/type"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="lrow">
|
||||||
|
<td>Worker Threads</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="taskmgr/thread-model/worker-threads"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="lrow">
|
||||||
|
<td>Default Quantum</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="taskmgr/thread-model/default-quantum"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="lrow">
|
||||||
|
<td>Tasks Running</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="taskmgr/thread-model/tasks-running"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<br/>
|
||||||
|
<table>
|
||||||
|
<tr class="rowh">
|
||||||
|
<th colspan="5">Tasks</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="rowh">
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>References</th>
|
||||||
|
<th>State</th>
|
||||||
|
<th>Quantum</th>
|
||||||
|
</tr>
|
||||||
|
<xsl:for-each select="taskmgr/tasks/task">
|
||||||
|
<tr class="lrow">
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="id"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="name"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="references"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="state"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="quantum"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</xsl:for-each>
|
||||||
|
</table>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: client.c,v 1.240 2006/12/04 01:52:45 marka Exp $ */
|
/* $Id: client.c,v 1.241 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -2064,6 +2064,7 @@ client_newconn(isc_task_t *task, isc_event_t *event) {
|
|||||||
*/
|
*/
|
||||||
if (nevent->result == ISC_R_SUCCESS) {
|
if (nevent->result == ISC_R_SUCCESS) {
|
||||||
client->tcpsocket = nevent->newsocket;
|
client->tcpsocket = nevent->newsocket;
|
||||||
|
isc_socket_setname(client->tcpsocket, "client-tcp", NULL);
|
||||||
client->state = NS_CLIENTSTATE_READING;
|
client->state = NS_CLIENTSTATE_READING;
|
||||||
INSIST(client->recursionquota == NULL);
|
INSIST(client->recursionquota == NULL);
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: controlconf.c,v 1.51 2006/12/07 04:46:27 marka Exp $ */
|
/* $Id: controlconf.c,v 1.52 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -603,6 +603,7 @@ control_newconn(isc_task_t *task, isc_event_t *event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sock = nevent->newsocket;
|
sock = nevent->newsocket;
|
||||||
|
isc_socket_setname(sock, "control", NULL);
|
||||||
(void)isc_socket_getpeername(sock, &peeraddr);
|
(void)isc_socket_getpeername(sock, &peeraddr);
|
||||||
if (listener->type == isc_sockettype_tcp &&
|
if (listener->type == isc_sockettype_tcp &&
|
||||||
!address_ok(&peeraddr, listener->acl)) {
|
!address_ok(&peeraddr, listener->acl)) {
|
||||||
@@ -1149,6 +1150,8 @@ add_listener(ns_controls_t *cp, controllistener_t **listenerp,
|
|||||||
result = isc_socket_create(ns_g_socketmgr,
|
result = isc_socket_create(ns_g_socketmgr,
|
||||||
isc_sockaddr_pf(&listener->address),
|
isc_sockaddr_pf(&listener->address),
|
||||||
type, &listener->sock);
|
type, &listener->sock);
|
||||||
|
if (result == ISC_R_SUCCESS)
|
||||||
|
isc_socket_setname(listener->sock, "control", NULL);
|
||||||
|
|
||||||
if (result == ISC_R_SUCCESS)
|
if (result == ISC_R_SUCCESS)
|
||||||
result = isc_socket_bind(listener->sock,
|
result = isc_socket_bind(listener->sock,
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: interfacemgr.c,v 1.87 2007/02/06 00:01:23 marka Exp $ */
|
/* $Id: interfacemgr.c,v 1.88 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -304,6 +304,7 @@ ns_interface_accepttcp(ns_interface_t *ifp) {
|
|||||||
isc_result_totext(result));
|
isc_result_totext(result));
|
||||||
goto tcp_socket_failure;
|
goto tcp_socket_failure;
|
||||||
}
|
}
|
||||||
|
isc_socket_setname(ifp->tcpsocket, "dispatcher", NULL);
|
||||||
#ifndef ISC_ALLOW_MAPPED
|
#ifndef ISC_ALLOW_MAPPED
|
||||||
isc_socket_ipv6only(ifp->tcpsocket, ISC_TRUE);
|
isc_socket_ipv6only(ifp->tcpsocket, ISC_TRUE);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: lwdclient.c,v 1.19 2005/04/29 00:22:27 marka Exp $ */
|
/* $Id: lwdclient.c,v 1.20 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -102,6 +102,7 @@ ns_lwdclientmgr_create(ns_lwreslistener_t *listener, unsigned int nclients,
|
|||||||
result = isc_task_create(taskmgr, 0, &cm->task);
|
result = isc_task_create(taskmgr, 0, &cm->task);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
goto errout;
|
goto errout;
|
||||||
|
isc_task_setname(cm->task, "lwdclient", NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This MUST be last, since there is no way to cancel an onshutdown...
|
* This MUST be last, since there is no way to cancel an onshutdown...
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: server.c,v 1.476 2007/02/02 02:18:05 marka Exp $ */
|
/* $Id: server.c,v 1.477 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ render_xsl(const char *url, const char *querystring, void *args,
|
|||||||
void **freecb_args);
|
void **freecb_args);
|
||||||
|
|
||||||
void
|
void
|
||||||
server_generatexml(ns_server_t *server, unsigned int *buflen, xmlChar **buf);
|
server_generatexml(ns_server_t *server, int *buflen, xmlChar **buf);
|
||||||
|
|
||||||
#endif /* HAVE_LIBXML2 */
|
#endif /* HAVE_LIBXML2 */
|
||||||
|
|
||||||
@@ -3663,11 +3663,13 @@ server_httpd_create(ns_server_t *server)
|
|||||||
task = NULL;
|
task = NULL;
|
||||||
result = isc_task_create(ns_g_taskmgr, 0, &task);
|
result = isc_task_create(ns_g_taskmgr, 0, &task);
|
||||||
INSIST(result == ISC_R_SUCCESS);
|
INSIST(result == ISC_R_SUCCESS);
|
||||||
|
isc_task_setname(task, "httpd", NULL);
|
||||||
|
|
||||||
sock = NULL;
|
sock = NULL;
|
||||||
result = isc_socket_create(ns_g_socketmgr, PF_INET,
|
result = isc_socket_create(ns_g_socketmgr, PF_INET,
|
||||||
isc_sockettype_tcp, &sock);
|
isc_sockettype_tcp, &sock);
|
||||||
INSIST(result == ISC_R_SUCCESS);
|
INSIST(result == ISC_R_SUCCESS);
|
||||||
|
isc_socket_setname(sock, "httpd", NULL);
|
||||||
|
|
||||||
result = isc_socket_bind(sock, &server->httpd_sockaddr);
|
result = isc_socket_bind(sock, &server->httpd_sockaddr);
|
||||||
INSIST(result == ISC_R_SUCCESS);
|
INSIST(result == ISC_R_SUCCESS);
|
||||||
@@ -5259,7 +5261,7 @@ ns_smf_add_message(isc_buffer_t *text) {
|
|||||||
#define SPACES 3
|
#define SPACES 3
|
||||||
|
|
||||||
void
|
void
|
||||||
server_generatexml(ns_server_t *server, unsigned int *buflen, xmlChar **buf)
|
server_generatexml(ns_server_t *server, int *buflen, xmlChar **buf)
|
||||||
{
|
{
|
||||||
char boottime[sizeof "yyyy-mm-ddThh:mm:ssZ"];
|
char boottime[sizeof "yyyy-mm-ddThh:mm:ssZ"];
|
||||||
char nowstr[sizeof "yyyy-mm-ddThh:mm:ssZ"];
|
char nowstr[sizeof "yyyy-mm-ddThh:mm:ssZ"];
|
||||||
@@ -5299,6 +5301,14 @@ server_generatexml(ns_server_t *server, unsigned int *buflen, xmlChar **buf)
|
|||||||
}
|
}
|
||||||
TRY0(xmlTextWriterEndElement(writer)); /* views */
|
TRY0(xmlTextWriterEndElement(writer)); /* views */
|
||||||
|
|
||||||
|
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "socketmgr"));
|
||||||
|
isc_socketmgr_renderxml(ns_g_socketmgr, writer);
|
||||||
|
TRY0(xmlTextWriterEndElement(writer)); /* socketmgr */
|
||||||
|
|
||||||
|
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "taskmgr"));
|
||||||
|
isc_taskmgr_renderxml(ns_g_taskmgr, writer);
|
||||||
|
TRY0(xmlTextWriterEndElement(writer)); /* taskmgr */
|
||||||
|
|
||||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "server"));
|
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "server"));
|
||||||
xmlTextWriterStartElement(writer, ISC_XMLCHAR "boot-time");
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "boot-time");
|
||||||
xmlTextWriterWriteString(writer, ISC_XMLCHAR boottime);
|
xmlTextWriterWriteString(writer, ISC_XMLCHAR boottime);
|
||||||
@@ -5318,6 +5328,10 @@ server_generatexml(ns_server_t *server, unsigned int *buflen, xmlChar **buf)
|
|||||||
xmlTextWriterEndElement(writer); /* counters */
|
xmlTextWriterEndElement(writer); /* counters */
|
||||||
xmlTextWriterEndElement(writer); /* server */
|
xmlTextWriterEndElement(writer); /* server */
|
||||||
|
|
||||||
|
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "memory"));
|
||||||
|
isc_mem_renderxml(server->mctx, writer);
|
||||||
|
TRY0(xmlTextWriterEndElement(writer)); /* memory */
|
||||||
|
|
||||||
TRY0(xmlTextWriterEndElement(writer)); /* statistics */
|
TRY0(xmlTextWriterEndElement(writer)); /* statistics */
|
||||||
TRY0(xmlTextWriterEndElement(writer)); /* bind */
|
TRY0(xmlTextWriterEndElement(writer)); /* bind */
|
||||||
TRY0(xmlTextWriterEndElement(writer)); /* isc */
|
TRY0(xmlTextWriterEndElement(writer)); /* isc */
|
||||||
@@ -5345,7 +5359,7 @@ render_index(const char *url, const char *querystring, void *arg,
|
|||||||
void **freecb_args)
|
void **freecb_args)
|
||||||
{
|
{
|
||||||
unsigned char *msg;
|
unsigned char *msg;
|
||||||
unsigned int msglen;
|
int msglen;
|
||||||
ns_server_t *server = arg;
|
ns_server_t *server = arg;
|
||||||
|
|
||||||
UNUSED(url);
|
UNUSED(url);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dispatch.c,v 1.130 2007/02/07 05:40:50 marka Exp $ */
|
/* $Id: dispatch.c,v 1.131 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -1072,6 +1072,7 @@ create_socket(isc_socketmgr_t *mgr, isc_sockaddr_t *local,
|
|||||||
isc_sockettype_udp, &sock);
|
isc_sockettype_udp, &sock);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
|
isc_socket_setname(sock, "dispatcher", NULL);
|
||||||
|
|
||||||
#ifndef ISC_ALLOW_MAPPED
|
#ifndef ISC_ALLOW_MAPPED
|
||||||
isc_socket_ipv6only(sock, ISC_TRUE);
|
isc_socket_ipv6only(sock, ISC_TRUE);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: xfrin.c,v 1.148 2006/12/18 23:58:13 marka Exp $ */
|
/* $Id: xfrin.c,v 1.149 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -856,6 +856,7 @@ xfrin_start(dns_xfrin_ctx_t *xfr) {
|
|||||||
isc_sockaddr_pf(&xfr->sourceaddr),
|
isc_sockaddr_pf(&xfr->sourceaddr),
|
||||||
isc_sockettype_tcp,
|
isc_sockettype_tcp,
|
||||||
&xfr->socket));
|
&xfr->socket));
|
||||||
|
isc_socket_setname(xfr->socket, "xfrin", NULL);
|
||||||
#ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
|
#ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
|
||||||
CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr));
|
CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr));
|
||||||
#endif
|
#endif
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: httpd.c,v 1.7 2006/12/22 04:20:52 marka Exp $ */
|
/* $Id: httpd.c,v 1.8 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -513,6 +513,7 @@ isc_httpd_accept(isc_task_t *task, isc_event_t *ev)
|
|||||||
ISC_LIST_APPEND(httpdmgr->running, httpd, link);
|
ISC_LIST_APPEND(httpdmgr->running, httpd, link);
|
||||||
ISC_HTTPD_SETRECV(httpd);
|
ISC_HTTPD_SETRECV(httpd);
|
||||||
httpd->sock = nev->newsocket;
|
httpd->sock = nev->newsocket;
|
||||||
|
isc_socket_setname(httpd->sock, "httpd", NULL);
|
||||||
httpd->flags = 0;
|
httpd->flags = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: mem.h,v 1.69 2006/12/22 01:45:00 marka Exp $ */
|
/* $Id: mem.h,v 1.70 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
#ifndef ISC_MEM_H
|
#ifndef ISC_MEM_H
|
||||||
#define ISC_MEM_H 1
|
#define ISC_MEM_H 1
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <isc/mutex.h>
|
#include <isc/mutex.h>
|
||||||
#include <isc/platform.h>
|
#include <isc/platform.h>
|
||||||
#include <isc/types.h>
|
#include <isc/types.h>
|
||||||
|
#include <isc/xml.h>
|
||||||
|
|
||||||
ISC_LANG_BEGINDECLS
|
ISC_LANG_BEGINDECLS
|
||||||
|
|
||||||
@@ -538,6 +539,11 @@ isc__mempool_get(isc_mempool_t * _ISC_MEM_FLARG);
|
|||||||
void
|
void
|
||||||
isc__mempool_put(isc_mempool_t *, void * _ISC_MEM_FLARG);
|
isc__mempool_put(isc_mempool_t *, void * _ISC_MEM_FLARG);
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBXML2
|
||||||
|
void
|
||||||
|
isc_mem_renderxml(isc_mem_t *mgr, xmlTextWriterPtr writer);
|
||||||
|
#endif /* HAVE_LIBXML2 */
|
||||||
|
|
||||||
ISC_LANG_ENDDECLS
|
ISC_LANG_ENDDECLS
|
||||||
|
|
||||||
#endif /* ISC_MEM_H */
|
#endif /* ISC_MEM_H */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: socket.h,v 1.70 2007/01/12 00:14:51 marka Exp $ */
|
/* $Id: socket.h,v 1.71 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
#ifndef ISC_SOCKET_H
|
#ifndef ISC_SOCKET_H
|
||||||
#define ISC_SOCKET_H 1
|
#define ISC_SOCKET_H 1
|
||||||
@@ -64,6 +64,7 @@
|
|||||||
#include <isc/time.h>
|
#include <isc/time.h>
|
||||||
#include <isc/region.h>
|
#include <isc/region.h>
|
||||||
#include <isc/sockaddr.h>
|
#include <isc/sockaddr.h>
|
||||||
|
#include <isc/xml.h>
|
||||||
|
|
||||||
ISC_LANG_BEGINDECLS
|
ISC_LANG_BEGINDECLS
|
||||||
|
|
||||||
@@ -795,6 +796,33 @@ isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
|
|||||||
* \li #ISC_R_FAILURE
|
* \li #ISC_R_FAILURE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void isc_socket_setname(isc_socket_t *socket, const char *name, void *tag);
|
||||||
|
/*%<
|
||||||
|
* Set the name and optional tag for a socket. This allows tracking of the
|
||||||
|
* owner or purpose for this socket, and is useful for tracing and statistics
|
||||||
|
* reporting.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const char *isc_socket_getname(isc_socket_t *socket);
|
||||||
|
/*%<
|
||||||
|
* Get the name associated with a socket, if any.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void *isc_socket_gettag(isc_socket_t *socket);
|
||||||
|
/*%<
|
||||||
|
* Get the tag associated with a socket, if any.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBXML2
|
||||||
|
|
||||||
|
void
|
||||||
|
isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer);
|
||||||
|
/*%<
|
||||||
|
* Render internal statistics and other state into the XML document.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* HAVE_LIBXML2 */
|
||||||
|
|
||||||
ISC_LANG_ENDDECLS
|
ISC_LANG_ENDDECLS
|
||||||
|
|
||||||
#endif /* ISC_SOCKET_H */
|
#endif /* ISC_SOCKET_H */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: task.h,v 1.59 2007/01/12 00:14:51 marka Exp $ */
|
/* $Id: task.h,v 1.60 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
#ifndef ISC_TASK_H
|
#ifndef ISC_TASK_H
|
||||||
#define ISC_TASK_H 1
|
#define ISC_TASK_H 1
|
||||||
@@ -84,6 +84,7 @@
|
|||||||
#include <isc/lang.h>
|
#include <isc/lang.h>
|
||||||
#include <isc/stdtime.h>
|
#include <isc/stdtime.h>
|
||||||
#include <isc/types.h>
|
#include <isc/types.h>
|
||||||
|
#include <isc/xml.h>
|
||||||
|
|
||||||
#define ISC_TASKEVENT_FIRSTEVENT (ISC_EVENTCLASS_TASK + 0)
|
#define ISC_TASKEVENT_FIRSTEVENT (ISC_EVENTCLASS_TASK + 0)
|
||||||
#define ISC_TASKEVENT_SHUTDOWN (ISC_EVENTCLASS_TASK + 1)
|
#define ISC_TASKEVENT_SHUTDOWN (ISC_EVENTCLASS_TASK + 1)
|
||||||
@@ -611,6 +612,13 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp);
|
|||||||
* have been freed.
|
* have been freed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBXML2
|
||||||
|
|
||||||
|
void
|
||||||
|
isc_taskmgr_renderxml(isc_taskmgr_t *mgr, xmlTextWriterPtr writer);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
ISC_LANG_ENDDECLS
|
ISC_LANG_ENDDECLS
|
||||||
|
|
||||||
#endif /* ISC_TASK_H */
|
#endif /* ISC_TASK_H */
|
||||||
|
119
lib/isc/mem.c
119
lib/isc/mem.c
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: mem.c,v 1.128 2006/12/08 05:09:16 marka Exp $ */
|
/* $Id: mem.c,v 1.129 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -33,9 +33,9 @@
|
|||||||
#include <isc/once.h>
|
#include <isc/once.h>
|
||||||
#include <isc/ondestroy.h>
|
#include <isc/ondestroy.h>
|
||||||
#include <isc/string.h>
|
#include <isc/string.h>
|
||||||
|
|
||||||
#include <isc/mutex.h>
|
#include <isc/mutex.h>
|
||||||
#include <isc/util.h>
|
#include <isc/util.h>
|
||||||
|
#include <isc/xml.h>
|
||||||
|
|
||||||
#define MCTXLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) LOCK(l)
|
#define MCTXLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) LOCK(l)
|
||||||
#define MCTXUNLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) UNLOCK(l)
|
#define MCTXUNLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) UNLOCK(l)
|
||||||
@@ -1952,3 +1952,118 @@ isc_mem_checkdestroyed(FILE *file) {
|
|||||||
}
|
}
|
||||||
UNLOCK(&lock);
|
UNLOCK(&lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBXML2
|
||||||
|
|
||||||
|
void
|
||||||
|
isc_mem_renderxml(isc_mem_t *ctx, xmlTextWriterPtr writer)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
const struct stats *s;
|
||||||
|
const isc_mempool_t *pool;
|
||||||
|
|
||||||
|
REQUIRE(VALID_CONTEXT(ctx));
|
||||||
|
MCTXLOCK(ctx, &ctx->lock);
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", ctx->references);
|
||||||
|
xmlTextWriterEndElement(writer);
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "buckets");
|
||||||
|
for (i = 0; i <= ctx->max_size; i++) {
|
||||||
|
s = &ctx->stats[i];
|
||||||
|
|
||||||
|
if (s->totalgets == 0U && s->gets == 0U)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "bucket");
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "size");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", i);
|
||||||
|
xmlTextWriterEndElement(writer); /* size */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "totalgets");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%lu", s->totalgets);
|
||||||
|
xmlTextWriterEndElement(writer); /* totalgets */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "gets");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%lu", s->gets);
|
||||||
|
xmlTextWriterEndElement(writer); /* gets */
|
||||||
|
|
||||||
|
if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0 &&
|
||||||
|
(s->blocks != 0U || s->freefrags != 0U)) {
|
||||||
|
xmlTextWriterStartElement(writer,
|
||||||
|
ISC_XMLCHAR "blocks");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%lu",
|
||||||
|
s->blocks);
|
||||||
|
xmlTextWriterEndElement(writer); /* blocks */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer,
|
||||||
|
ISC_XMLCHAR "freefrags");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%lu",
|
||||||
|
s->freefrags);
|
||||||
|
xmlTextWriterEndElement(writer); /* freefrags */
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlTextWriterEndElement(writer); /* bucket */
|
||||||
|
}
|
||||||
|
xmlTextWriterEndElement(writer); /* buckets */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note that since a pool can be locked now, these stats might be
|
||||||
|
* somewhat off if the pool is in active use at the time the stats
|
||||||
|
* are dumped. The link fields are protected by the isc_mem_t's
|
||||||
|
* lock, however, so walking this list and extracting integers from
|
||||||
|
* stats fields is always safe.
|
||||||
|
*/
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "pools");
|
||||||
|
pool = ISC_LIST_HEAD(ctx->pools);
|
||||||
|
while (pool != NULL) {
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "pool");
|
||||||
|
|
||||||
|
xmlTextWriterWriteElement(writer, ISC_XMLCHAR "name",
|
||||||
|
ISC_XMLCHAR pool->name);
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "size");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", pool->size);
|
||||||
|
xmlTextWriterEndElement(writer); /* size */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "maxalloc");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%u", pool->maxalloc);
|
||||||
|
xmlTextWriterEndElement(writer); /* maxalloc */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "allocated");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%u", pool->allocated);
|
||||||
|
xmlTextWriterEndElement(writer); /* allocated */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "freecount");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%u", pool->freecount);
|
||||||
|
xmlTextWriterEndElement(writer); /* freecount */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "freemax");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%u", pool->freemax);
|
||||||
|
xmlTextWriterEndElement(writer); /* freemax */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "fillcount");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%u", pool->fillcount);
|
||||||
|
xmlTextWriterEndElement(writer); /* fillcount */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "gets");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%u", pool->gets);
|
||||||
|
xmlTextWriterEndElement(writer); /* gets */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "locked");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%s",
|
||||||
|
((pool->lock == NULL) ? "No" : "Yes"));
|
||||||
|
xmlTextWriterEndElement(writer); /* locked */
|
||||||
|
|
||||||
|
xmlTextWriterEndElement(writer); /* pool */
|
||||||
|
|
||||||
|
pool = ISC_LIST_NEXT(pool, link);
|
||||||
|
}
|
||||||
|
xmlTextWriterEndElement(writer); /* pools */
|
||||||
|
|
||||||
|
MCTXUNLOCK(ctx, &ctx->lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* HAVE_LIBXML2 */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: task.c,v 1.102 2007/01/12 00:14:51 marka Exp $ */
|
/* $Id: task.c,v 1.103 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file
|
/*! \file
|
||||||
* \author Principal Author: Bob Halley
|
* \author Principal Author: Bob Halley
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <isc/task.h>
|
#include <isc/task.h>
|
||||||
#include <isc/thread.h>
|
#include <isc/thread.h>
|
||||||
#include <isc/util.h>
|
#include <isc/util.h>
|
||||||
|
#include <isc/xml.h>
|
||||||
|
|
||||||
#ifndef ISC_PLATFORM_USETHREADS
|
#ifndef ISC_PLATFORM_USETHREADS
|
||||||
#include "task_p.h"
|
#include "task_p.h"
|
||||||
@@ -67,6 +68,10 @@ typedef enum {
|
|||||||
task_state_done
|
task_state_done
|
||||||
} task_state_t;
|
} task_state_t;
|
||||||
|
|
||||||
|
static const char *statenames[] = {
|
||||||
|
"idle", "ready", "running", "done",
|
||||||
|
};
|
||||||
|
|
||||||
#define TASK_MAGIC ISC_MAGIC('T', 'A', 'S', 'K')
|
#define TASK_MAGIC ISC_MAGIC('T', 'A', 'S', 'K')
|
||||||
#define VALID_TASK(t) ISC_MAGIC_VALID(t, TASK_MAGIC)
|
#define VALID_TASK(t) ISC_MAGIC_VALID(t, TASK_MAGIC)
|
||||||
|
|
||||||
@@ -1296,3 +1301,86 @@ isc_task_endexclusive(isc_task_t *task) {
|
|||||||
UNUSED(task);
|
UNUSED(task);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBXML2
|
||||||
|
|
||||||
|
void
|
||||||
|
isc_taskmgr_renderxml(isc_taskmgr_t *mgr, xmlTextWriterPtr writer)
|
||||||
|
{
|
||||||
|
isc_task_t *task;
|
||||||
|
|
||||||
|
LOCK(&mgr->lock);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Write out the thread-model, and some details about each depending
|
||||||
|
* on which type is enabled.
|
||||||
|
*/
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "thread-model");
|
||||||
|
#ifdef ISC_PLATFORM_USETHREADS
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "type");
|
||||||
|
xmlTextWriterWriteString(writer, ISC_XMLCHAR "threaded");
|
||||||
|
xmlTextWriterEndElement(writer); /* type */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "worker-threads");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", mgr->workers);
|
||||||
|
xmlTextWriterEndElement(writer); /* worker-threads */
|
||||||
|
#else /* ISC_PLATFORM_USETHREADS */
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "type");
|
||||||
|
xmlTextWriterWriteString(writer, ISC_XMLCHAR "non-threaded");
|
||||||
|
xmlTextWriterEndElement(writer); /* type */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", mgr->refs);
|
||||||
|
xmlTextWriterEndElement(writer); /* references */
|
||||||
|
#endif /* ISC_PLATFORM_USETHREADS */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "default-quantum");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", mgr->default_quantum);
|
||||||
|
xmlTextWriterEndElement(writer); /* default-quantum */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "tasks-running");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", mgr->tasks_running);
|
||||||
|
xmlTextWriterEndElement(writer); /* tasks-running */
|
||||||
|
|
||||||
|
xmlTextWriterEndElement(writer); /* thread-model */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "tasks");
|
||||||
|
task = ISC_LIST_HEAD(mgr->tasks);
|
||||||
|
while (task != NULL) {
|
||||||
|
LOCK(&task->lock);
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "task");
|
||||||
|
|
||||||
|
if (task->name[0] != 0) {
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "name");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%s",
|
||||||
|
task->name);
|
||||||
|
xmlTextWriterEndElement(writer); /* name */
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", task->references);
|
||||||
|
xmlTextWriterEndElement(writer); /* references */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "id");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%p", task);
|
||||||
|
xmlTextWriterEndElement(writer); /* id */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "state");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%s",
|
||||||
|
statenames[task->state]);
|
||||||
|
xmlTextWriterEndElement(writer); /* state */
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "quantum");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", task->quantum);
|
||||||
|
xmlTextWriterEndElement(writer); /* quantum */
|
||||||
|
|
||||||
|
xmlTextWriterEndElement(writer);
|
||||||
|
|
||||||
|
UNLOCK(&task->lock);
|
||||||
|
task = ISC_LIST_NEXT(task, link);
|
||||||
|
}
|
||||||
|
xmlTextWriterEndElement(writer); /* tasks */
|
||||||
|
|
||||||
|
UNLOCK(&mgr->lock);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LIBXML2 */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: taskpool.c,v 1.15 2005/11/30 03:33:49 marka Exp $ */
|
/* $Id: taskpool.c,v 1.16 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -66,6 +66,7 @@ isc_taskpool_create(isc_taskmgr_t *tmgr, isc_mem_t *mctx,
|
|||||||
isc_taskpool_destroy(&pool);
|
isc_taskpool_destroy(&pool);
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
isc_task_setname(pool->tasks[i], "taskpool", NULL);
|
||||||
}
|
}
|
||||||
*poolp = pool;
|
*poolp = pool;
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: socket.c,v 1.268 2007/01/10 18:56:20 explorer Exp $ */
|
/* $Id: socket.c,v 1.269 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -56,6 +56,7 @@
|
|||||||
#include <isc/task.h>
|
#include <isc/task.h>
|
||||||
#include <isc/thread.h>
|
#include <isc/thread.h>
|
||||||
#include <isc/util.h>
|
#include <isc/util.h>
|
||||||
|
#include <isc/xml.h>
|
||||||
|
|
||||||
#include "errno2result.h"
|
#include "errno2result.h"
|
||||||
|
|
||||||
@@ -63,6 +64,11 @@
|
|||||||
#include "socket_p.h"
|
#include "socket_p.h"
|
||||||
#endif /* ISC_PLATFORM_USETHREADS */
|
#endif /* ISC_PLATFORM_USETHREADS */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Support names for sockets.
|
||||||
|
*/
|
||||||
|
#define ISC_SOCKET_NAMES 1
|
||||||
|
|
||||||
/*%
|
/*%
|
||||||
* Some systems define the socket length argument as an int, some as size_t,
|
* Some systems define the socket length argument as an int, some as size_t,
|
||||||
* some as socklen_t. This is here so it can be easily changed if needed.
|
* some as socklen_t. This is here so it can be easily changed if needed.
|
||||||
@@ -155,6 +161,11 @@ struct isc_socket {
|
|||||||
int fd;
|
int fd;
|
||||||
int pf;
|
int pf;
|
||||||
|
|
||||||
|
#ifdef ISC_SOCKET_NAMES
|
||||||
|
char name[16];
|
||||||
|
void * tag;
|
||||||
|
#endif
|
||||||
|
|
||||||
ISC_LIST(isc_socketevent_t) send_list;
|
ISC_LIST(isc_socketevent_t) send_list;
|
||||||
ISC_LIST(isc_socketevent_t) recv_list;
|
ISC_LIST(isc_socketevent_t) recv_list;
|
||||||
ISC_LIST(isc_socket_newconnev_t) accept_list;
|
ISC_LIST(isc_socket_newconnev_t) accept_list;
|
||||||
@@ -1621,6 +1632,11 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
|
|||||||
}
|
}
|
||||||
#endif /* defined(USE_CMSG) || defined(SO_RCVBUF) */
|
#endif /* defined(USE_CMSG) || defined(SO_RCVBUF) */
|
||||||
|
|
||||||
|
#ifdef ISC_SOCKET_NAMES
|
||||||
|
memset(sock->name, 0, sizeof(sock->name));
|
||||||
|
sock->tag = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
sock->references = 1;
|
sock->references = 1;
|
||||||
*socketp = sock;
|
*socketp = sock;
|
||||||
|
|
||||||
@@ -3958,3 +3974,144 @@ isc__socketmgr_dispatch(fd_set *readset, fd_set *writeset, int maxfd) {
|
|||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
}
|
}
|
||||||
#endif /* ISC_PLATFORM_USETHREADS */
|
#endif /* ISC_PLATFORM_USETHREADS */
|
||||||
|
|
||||||
|
void
|
||||||
|
isc_socket_setname(isc_socket_t *socket, const char *name, void *tag) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Name 'socket'.
|
||||||
|
*/
|
||||||
|
|
||||||
|
REQUIRE(VALID_SOCKET(socket));
|
||||||
|
|
||||||
|
#ifdef ISC_SOCKET_NAMES
|
||||||
|
LOCK(&socket->lock);
|
||||||
|
memset(socket->name, 0, sizeof(socket->name));
|
||||||
|
strncpy(socket->name, name, sizeof(socket->name) - 1);
|
||||||
|
socket->tag = tag;
|
||||||
|
UNLOCK(&socket->lock);
|
||||||
|
#else
|
||||||
|
UNUSED(name);
|
||||||
|
UNUSED(tag);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
isc_socket_getname(isc_socket_t *socket) {
|
||||||
|
return (socket->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
isc_socket_gettag(isc_socket_t *socket) {
|
||||||
|
return (socket->tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBXML2
|
||||||
|
|
||||||
|
static const char *
|
||||||
|
_socktype(int type)
|
||||||
|
{
|
||||||
|
if (type == 1)
|
||||||
|
return ("udp");
|
||||||
|
else if (type == 2)
|
||||||
|
return ("tcp");
|
||||||
|
else if (type == 3)
|
||||||
|
return ("unix");
|
||||||
|
else if (type == 4)
|
||||||
|
return ("fdwatch");
|
||||||
|
else
|
||||||
|
return ("not-initialized");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer)
|
||||||
|
{
|
||||||
|
isc_socket_t *sock;
|
||||||
|
char peerbuf[ISC_SOCKADDR_FORMATSIZE];
|
||||||
|
isc_sockaddr_t addr;
|
||||||
|
ISC_SOCKADDR_LEN_T len;
|
||||||
|
|
||||||
|
LOCK(&mgr->lock);
|
||||||
|
|
||||||
|
#ifndef ISC_PLATFORM_USETHREADS
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", mgr->refs);
|
||||||
|
xmlTextWriterEndElement(writer);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "sockets");
|
||||||
|
sock = ISC_LIST_HEAD(mgr->socklist);
|
||||||
|
while (sock != NULL) {
|
||||||
|
LOCK(&sock->lock);
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "socket");
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "id");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%p", sock);
|
||||||
|
xmlTextWriterEndElement(writer);
|
||||||
|
|
||||||
|
if (sock->name[0] != 0) {
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "name");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%s",
|
||||||
|
sock->name);
|
||||||
|
xmlTextWriterEndElement(writer); /* name */
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
|
||||||
|
xmlTextWriterWriteFormatString(writer, "%d", sock->references);
|
||||||
|
xmlTextWriterEndElement(writer);
|
||||||
|
|
||||||
|
xmlTextWriterWriteElement(writer, ISC_XMLCHAR "type",
|
||||||
|
ISC_XMLCHAR _socktype(sock->type));
|
||||||
|
|
||||||
|
if (sock->connected) {
|
||||||
|
isc_sockaddr_format(&sock->peer_address, peerbuf,
|
||||||
|
sizeof(peerbuf));
|
||||||
|
xmlTextWriterWriteElement(writer,
|
||||||
|
ISC_XMLCHAR "peer-address",
|
||||||
|
ISC_XMLCHAR peerbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
len = sizeof(addr);
|
||||||
|
if (getsockname(sock->fd, &addr.type.sa, (void *)&len) == 0) {
|
||||||
|
isc_sockaddr_format(&addr, peerbuf, sizeof(peerbuf));
|
||||||
|
xmlTextWriterWriteElement(writer,
|
||||||
|
ISC_XMLCHAR "local-address",
|
||||||
|
ISC_XMLCHAR peerbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(writer, ISC_XMLCHAR "states");
|
||||||
|
if (sock->pending_recv)
|
||||||
|
xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
|
||||||
|
ISC_XMLCHAR "pending-receive");
|
||||||
|
if (sock->pending_send)
|
||||||
|
xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
|
||||||
|
ISC_XMLCHAR "pending-send");
|
||||||
|
if (sock->pending_accept)
|
||||||
|
xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
|
||||||
|
ISC_XMLCHAR "pending_accept");
|
||||||
|
if (sock->listener)
|
||||||
|
xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
|
||||||
|
ISC_XMLCHAR "listener");
|
||||||
|
if (sock->connected)
|
||||||
|
xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
|
||||||
|
ISC_XMLCHAR "connected");
|
||||||
|
if (sock->connecting)
|
||||||
|
xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
|
||||||
|
ISC_XMLCHAR "connecting");
|
||||||
|
if (sock->bound)
|
||||||
|
xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
|
||||||
|
ISC_XMLCHAR "bound");
|
||||||
|
|
||||||
|
xmlTextWriterEndElement(writer); /* states */
|
||||||
|
|
||||||
|
xmlTextWriterEndElement(writer); /* socket */
|
||||||
|
|
||||||
|
UNLOCK(&sock->lock);
|
||||||
|
sock = ISC_LIST_NEXT(sock, link);
|
||||||
|
}
|
||||||
|
xmlTextWriterEndElement(writer); /* sockets */
|
||||||
|
|
||||||
|
UNLOCK(&mgr->lock);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LIBXML2 */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: time.c,v 1.51 2006/12/22 01:59:43 marka Exp $ */
|
/* $Id: time.c,v 1.52 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -433,6 +433,6 @@ isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len) {
|
|||||||
REQUIRE(len > 0);
|
REQUIRE(len > 0);
|
||||||
|
|
||||||
now = (time_t)t->seconds;
|
now = (time_t)t->seconds;
|
||||||
flen = strftime(buf, len, "%Y-%d-%dT%H:%M:%SZ", gmtime(&now));
|
flen = strftime(buf, len, "%Y-%m-%dT%H:%M:%SZ", gmtime(&now));
|
||||||
INSIST(flen < len);
|
INSIST(flen < len);
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: socket.c,v 1.47 2007/02/01 23:55:21 marka Exp $ */
|
/* $Id: socket.c,v 1.48 2007/02/13 02:49:08 marka Exp $ */
|
||||||
|
|
||||||
/* This code has been rewritten to take advantage of Windows Sockets
|
/* This code has been rewritten to take advantage of Windows Sockets
|
||||||
* I/O Completion Ports and Events. I/O Completion Ports is ONLY
|
* I/O Completion Ports and Events. I/O Completion Ports is ONLY
|
||||||
@@ -91,6 +91,8 @@
|
|||||||
|
|
||||||
#include "errno2result.h"
|
#include "errno2result.h"
|
||||||
|
|
||||||
|
#define ISC_SOCKET_NAMES 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define this macro to control the behavior of connection
|
* Define this macro to control the behavior of connection
|
||||||
* resets on UDP sockets. See Microsoft KnowledgeBase Article Q263823
|
* resets on UDP sockets. See Microsoft KnowledgeBase Article Q263823
|
||||||
@@ -3816,3 +3818,35 @@ isc_socket_permunix(isc_sockaddr_t *addr, isc_uint32_t perm,
|
|||||||
UNUSED(group);
|
UNUSED(group);
|
||||||
return (ISC_R_NOTIMPLEMENTED);
|
return (ISC_R_NOTIMPLEMENTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
isc_socket_setname(isc_socket_t *socket, const char *name, void *tag) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Name 'socket'.
|
||||||
|
*/
|
||||||
|
|
||||||
|
REQUIRE(VALID_SOCKET(socket));
|
||||||
|
|
||||||
|
#ifdef ISC_SOCKET_NAMES
|
||||||
|
LOCK(&socket->lock);
|
||||||
|
memset(socket->name, 0, sizeof(socket->name));
|
||||||
|
strncpy(socket->name, name, sizeof(socket->name) - 1);
|
||||||
|
socket->tag = tag;
|
||||||
|
UNLOCK(&socket->lock);
|
||||||
|
#else
|
||||||
|
UNUSED(name);
|
||||||
|
UNUSED(tag);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
isc_socket_getname(isc_socket_t *socket) {
|
||||||
|
return (socket->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
isc_socket_gettag(isc_socket_t *socket) {
|
||||||
|
return (socket->tag);
|
||||||
|
}
|
||||||
|
@@ -79,7 +79,7 @@
|
|||||||
./bin/dnssec/win32/signzone.dsp X 2001,2004,2005,2006
|
./bin/dnssec/win32/signzone.dsp X 2001,2004,2005,2006
|
||||||
./bin/dnssec/win32/signzone.dsw X 2001
|
./bin/dnssec/win32/signzone.dsw X 2001
|
||||||
./bin/dnssec/win32/signzone.mak X 2001,2004,2005,2006
|
./bin/dnssec/win32/signzone.mak X 2001,2004,2005,2006
|
||||||
./bin/named/.cvsignore X 1999,2000,2001
|
./bin/named/.cvsignore X 1999,2000,2001,2007
|
||||||
./bin/named/Makefile.in MAKE 1998,1999,2000,2001,2002,2004,2005,2006
|
./bin/named/Makefile.in MAKE 1998,1999,2000,2001,2002,2004,2005,2006
|
||||||
./bin/named/bind9.xsl SGML 2006,2007
|
./bin/named/bind9.xsl SGML 2006,2007
|
||||||
./bin/named/builtin.c C 2001,2002,2003,2004,2005
|
./bin/named/builtin.c C 2001,2002,2003,2004,2005
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
./bin/named/log.c C 1999,2000,2001,2002,2004,2005,2006
|
./bin/named/log.c C 1999,2000,2001,2002,2004,2005,2006
|
||||||
./bin/named/logconf.c C 1999,2000,2001,2004,2005,2006
|
./bin/named/logconf.c C 1999,2000,2001,2004,2005,2006
|
||||||
./bin/named/lwaddr.c C 2000,2001,2004,2005
|
./bin/named/lwaddr.c C 2000,2001,2004,2005
|
||||||
./bin/named/lwdclient.c C 2000,2001,2004,2005
|
./bin/named/lwdclient.c C 2000,2001,2004,2005,2007
|
||||||
./bin/named/lwderror.c C 2000,2001,2004,2005
|
./bin/named/lwderror.c C 2000,2001,2004,2005
|
||||||
./bin/named/lwdgabn.c C 2000,2001,2004,2005,2006
|
./bin/named/lwdgabn.c C 2000,2001,2004,2005,2006
|
||||||
./bin/named/lwdgnba.c C 2000,2001,2002,2004,2005
|
./bin/named/lwdgnba.c C 2000,2001,2002,2004,2005
|
||||||
@@ -2173,7 +2173,7 @@
|
|||||||
./lib/isc/symtab.c C 1996,1997,1998,1999,2000,2001,2004,2005
|
./lib/isc/symtab.c C 1996,1997,1998,1999,2000,2001,2004,2005
|
||||||
./lib/isc/task.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007
|
./lib/isc/task.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007
|
||||||
./lib/isc/task_p.h C 2000,2001,2004,2005
|
./lib/isc/task_p.h C 2000,2001,2004,2005
|
||||||
./lib/isc/taskpool.c C 1999,2000,2001,2004,2005
|
./lib/isc/taskpool.c C 1999,2000,2001,2004,2005,2007
|
||||||
./lib/isc/timer.c C 1998,1999,2000,2001,2002,2004,2005
|
./lib/isc/timer.c C 1998,1999,2000,2001,2002,2004,2005
|
||||||
./lib/isc/timer_p.h C 2000,2001,2004,2005
|
./lib/isc/timer_p.h C 2000,2001,2004,2005
|
||||||
./lib/isc/unix/.cvsignore X 1998,1999,2000,2001
|
./lib/isc/unix/.cvsignore X 1998,1999,2000,2001
|
||||||
|
Reference in New Issue
Block a user