server.c revision 95f2377b4f180a564d35343c8d150e8f03c98a52
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * Copyright (C) 1999-2003 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and/or distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
362a27e81e6de298b6ff31457ad22380a6d825c2Mark Andrews * copyright notice and this permission notice appear in all copies.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
821644d49b73b49f2abc5463bc53a3132f612478Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
821644d49b73b49f2abc5463bc53a3132f612478Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
362a27e81e6de298b6ff31457ad22380a6d825c2Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
362a27e81e6de298b6ff31457ad22380a6d825c2Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * PERFORMANCE OF THIS SOFTWARE.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews/* $Id: server.c,v 1.554 2009/10/27 22:46:13 each Exp $ */
#ifdef DLZ
#ifdef HAVE_LIBSCF
#include <stdlib.h>
goto cleanup; \
goto cleanup; \
struct ns_dispatch {
unsigned int dispatchgen;
struct ns_cache {
struct dumpcontext {
struct viewlistentry {
struct zonelistentry {
const char *zone;
} empty_zones[] = {
#ifdef notyet
ISC_PLATFORM_NORETURN_PRE static void
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
isc_buffer_t b;
const char *str;
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (result);
* we have foo.example.com and bar.example.com, we'd get a match
* for baz.example.com, which is not the expected result.
goto cleanup;
return (result);
return (result);
static isc_result_t
isc_region_t r;
if (managed) {
const char *initmethod;
goto cleanup;
&viewclass));
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
goto cleanup;
return (result);
static isc_result_t
return (ISC_R_SUCCESS);
&view_keys);
return (ISC_R_UNEXPECTED);
if (auto_dlv) {
&builtin_keys);
&builtin_keys);
if (meta)
if (meta)
return (result);
static isc_result_t
const char *str;
isc_buffer_t b;
return (result);
static isc_result_t
unsigned int maxdispatchbuffers;
switch (af) {
case AF_INET:
case AF_INET6:
INSIST(0);
switch (af) {
case AF_INET:
case AF_INET6:
INSIST(0);
return (ISC_R_SUCCESS);
attrs = 0;
switch (af) {
case AF_INET:
case AF_INET6:
if (is_firstview) {
attrmask = 0;
switch (af) {
case AF_INET:
case AF_INET6:
return (ISC_R_SUCCESS);
buf);
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
unsigned int mode = 0;
const char *str;
isc_buffer_t b;
return (result);
return (result);
return (result);
mode = 0;
INSIST(0);
if (addroot) {
return (result);
static isc_result_t
const char *str;
unsigned int prefixlen;
return (result);
INSIST(0);
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
const char *str;
isc_buffer_t b;
return (result);
static isc_boolean_t
const char *str;
isc_buffer_t b;
0, NULL);
return (ISC_TRUE);
return (ISC_FALSE);
for (i = 0; i < dbtypec; i++)
static isc_result_t
if (on) {
return (result);
return (ISC_R_SUCCESS);
static ns_cache_t *
return (nsc);
return (NULL);
static isc_boolean_t
return (ISC_FALSE);
return (ISC_TRUE);
static isc_boolean_t
unsigned int new_cleaning_interval,
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_TRUE);
static isc_result_t
#ifdef DLZ
unsigned int dlzargc;
char **dlzargv;
unsigned int cleaning_interval;
const char *str;
unsigned int resopts = 0;
value);
goto cleanup;
actx));
#ifdef DLZ
if (s == NULL) {
goto cleanup;
goto cleanup;
goto cleanup;
value);
goto cleanup;
INSIST(0);
goto cleanup;
&pview);
goto cleanup;
zero_no_soattl)) {
&cache));
goto cleanup;
== NULL)));
== NULL)));
goto cleanup;
max_adb_size = 0;
if (max_cache_size != 0) {
if (max_adb_size == 0)
if (need_hints)
INSIST(0);
* configured in named.conf.
const char *str;
isc_buffer_t b;
0, NULL));
isc_buffer_t b;
const char *str;
0, NULL));
name));
if (empty_zones_enable) {
const char *empty;
int empty_zone = 0;
const char *str;
NULL));
NULL));
NULL));
&forwarders);
if (logit) {
&pview);
goto cleanup;
zonestats_on));
empty_dbtype));
ISC_TRUE);
return (result);
static isc_result_t
return (result);
static isc_result_t
return (ISC_R_RANGE);
NULL));
val);
return (ISC_R_RANGE);
NULL, 0));
return (result);
static isc_result_t
return (ISC_R_RANGE);
goto cleanup;
INSIST(0);
goto cleanup;
return (result);
static isc_result_t
const char *viewname;
&viewclass);
return (ISC_R_EXISTS);
return (result);
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
const char *zname;
const char *ztypestr;
goto cleanup;
return (ISC_R_FAILURE);
zname);
goto cleanup;
goto cleanup;
&only);
zname);
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
&pview);
goto cleanup;
goto cleanup;
forwardtype));
return (result);
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
const char *directory;
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
return (result);
goto clean;
goto clean;
return (ISC_R_SUCCESS);
return (result);
goto fail;
goto fail;
goto fail;
goto fail;
fail:
goto clean;
static unsigned int oldrequests = 0;
static isc_result_t
char *copy;
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
static isc_result_t
const char *resource;
if (positive)
if (positive)
hiport);
static isc_result_t
const char *type;
return (ISC_R_SUCCESS);
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
return (ISC_R_SUCCESS);
static isc_result_t
return (result);
&tsigkey));
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
unsigned int algtype;
return (result);
return (result);
if (need_deleteold) {
if (need_createnew) {
goto cleanup;
goto cleanup;
return (result);
return (result);
static isc_result_t
unsigned int maxsocks;
if (first_time) {
filename);
* option where the above parsing failed, parse resolv.conf.
if (ns_g_lwresdonly &&
&config);
&bindkeys_parser));
maxsocks = 0;
if (maxsocks != 0) {
reserved = 0;
&udpport_high),
&udpport_high),
if (ns_g_port != 0)
&listenon);
} else if (!ns_g_lwresdonly) {
listenon);
&listenon);
} else if (!ns_g_lwresdonly) {
listenon);
if (interface_interval == 0) {
if (heartbeat_interval == 0) {
else if (ns_g_lwresdonly)
&aclconfctx),
if (first_time) {
#ifdef PATH_RANDOMDEV
&ns_g_entropy);
if (first_time)
* files specified in named.conf get created by the
if (ns_g_logstderr) {
if (first_time) {
&categories);
const char *str;
else if (ns_g_memstatistics)
#ifdef ALLOW_FILTER_AAAA_ON_V4
INSIST(0);
return (result);
static isc_result_t
return (result);
static isc_result_t
return (result);
if (ns_g_lwresdonly)
ISC_TRUE),
if (flush)
sizeof(isc_event_t));
goto cleanup;
attrs = 0;
case AF_INET:
case AF_INET6:
goto cleanup;
attrmask = 0;
goto cleanup;
static isc_result_t
return (result);
static isc_result_t
return (result);
cleanup: ;
char *res;
return (res);
static isc_result_t
const char *zonetxt;
char *classtxt;
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_SUCCESS);
goto fail1;
goto fail1;
goto fail1;
return (result);
return (result);
return (ISC_R_UNEXPECTEDEND);
return (result);
return (result);
switch (result) {
case ISC_R_SUCCESS:
case DNS_R_CONTINUE:
case DNS_R_UPTODATE:
return (result);
return (ISC_R_SUCCESS);
return (result);
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_SUCCESS);
return (result);
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_SUCCESS);
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
static isc_result_t
return (result);
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
if (ns_g_port != 0) {
return (result);
return (ISC_R_RANGE);
return (result);
return (result);
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
static isc_result_t
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
return (result);
goto cleanup;
goto done;
goto resume;
goto cleanup;
goto nextzone;
goto nextzone;
goto cleanup;
goto nextview;
done:
char *ptr;
const char *sep;
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_NOMEMORY);
goto nextview;
return (ISC_R_SUCCESS);
return (result);
return (result);
char *ptr;
char *levelstr;
char *endp;
long newlevel;
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_RANGE);
return (ISC_R_SUCCESS);
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_UNEXPECTEDEND);
return (DNS_R_SYNTAX);
goto out;
if (changed)
out:
return (result);
return (ISC_R_UNEXPECTEDEND);
viewname);
if (!found) {
return (result);
isc_buffer_t b;
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_UNEXPECTEDEND);
return (result);
if (!found)
viewname);
return (result);
#ifdef ISC_PLATFORM_USETHREADS
#ifdef ISC_PLATFORM_USETHREADS
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);
static isc_result_t
unsigned int *foundkeys)
origin);
return (ISC_R_SUCCESS);
return (result);
goto nextkey;
(*foundkeys)++;
goto again;
return (result);
return (ISC_R_SUCCESS);
unsigned int foundkeys = 0;
char *target;
char *viewname;
return (ISC_R_UNEXPECTEDEND);
&foundkeys);
return (result);
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);
static isc_result_t
unsigned int *foundkeys)
const char *viewname;
origin);
return (ISC_R_SUCCESS);
return (result);
(*foundkeys)++;
sizeof(creatorstr));
return (ISC_R_NOSPACE);
return (result);
return (ISC_R_SUCCESS);
unsigned int foundkeys = 0;
&foundkeys);
return (result);
&foundkeys);
return (result);
if (foundkeys == 0) {
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);
return (result);
return (DNS_R_NOTMASTER);
return (result);
char *journal;
return (result);
return (tresult);
return (DNS_R_NOTMASTER);
if (freeze) {
if (frozen) {
if (frozen) {
switch (result) {
case ISC_R_SUCCESS:
case DNS_R_UPTODATE:
case DNS_R_CONTINUE:
sizeof(classstr));
return (result);
#ifdef HAVE_LIBSCF
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);