confparser.y revision 28d9fd53819cc163629c867466b20d8ebcae8842
%{
/*
* Copyright (C) 1996-2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/* $Id: confparser.y,v 1.99 2000/06/21 22:44:19 tale Exp $ */
#include <config.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
#include <dns/confcommon.h>
#include <dns/confparser.h>
#include <dns/rdataclass.h>
#include <dns/rdatatype.h>
/* Type keys for symtab lookup */
#define KEYWORD_SYM_TYPE 0x1
#define CLASS_SYM_TYPE 0x2
#define ACL_SYM_TYPE 0x3
/* used for holding a list of dns_rdatatype_t on the stack */
struct confrdtype_s {
};
/* used for holding ssu data on the stack */
struct confssu_s {
dns_name_t *ident;
unsigned int matchtype;
struct confrdtype_s rdatatypes;
};
struct keydetails_s {
char *algorithm;
char *secret;
};
static isc_mutex_t yacc_mutex;
/* All these statics are protected by the above yacc_mutex */
static dns_c_ctx_t *currcfg;
static isc_symtab_t *keywords;
static dns_c_cbks_t *callbacks;
static isc_lexspecials_t specials;
#define CONF_MAX_IDENT 1024
/* This should be sufficient to permit multiple parsers and lexers if needed */
#define yyparse dns__yyparse
#define YYDEBUG 1
/*
* Specify a small parser stack size. This is needed when
* using bison the generate the parser, because it puts
* the parser stack in a local variable, and the default
* initial stack size of 200 is big enough to cause a
* thread stack overflow. Berkeley yacc does not suffer
* from this problem as it allocates the parser stack
* using malloc.
*/
#define YYMAXDEPTH 200
#define YYINITDEPTH 200
static isc_result_t tmpres;
static int debug_lexer;
static in_port_t default_port;
int yyparse(void);
static int yylex(void);
const char *fmt, ...);
const char *fmt, ...);
static const char * token_to_keyword(int token);
static void yyerror(const char *);
const char *name);
/* returns true if (base * mult) would be too big.*/
/*
* #define global symbols that various versions of YACC export into our
* namespace. This won't work for all versions, but we hope to cover
* the popular ones.
*/
/*
* All YACCs
*/
#define yychar dns__yychar
#define yydebug dns__yydebug
#define yylval dns__yylval
#define yynerrs dns__yynerrs
/*
* BYACC
*/
#define yyerrflag dns__yyerrflag
#define yyssp dns__yyssp
#define yyval dns__yyval
#define yyvsp dns__yyvsp
/*
* AIX
*/
#define yypvt dns__yypvt
#define yystate dns__yystate
#define yytmp dns__yytmp
#define yyval dns__yyval
#define yyact dns__yyact
#define yychk dns__yychk
#define yydef dns__yydef
#define yyexca dns__yyexca
#define yypact dns__yypact
#define yypgo dns__yypgo
#define yyreds dns__yyreds
#define yytoks dns__yytoks
%}
%union {
char *text;
int number;
struct keydetails_s keydetails;
struct confrdtype_s rdatatypelist;
}
/* Misc */
/* Miscellaneous items (used in several places): */
%%
config_file: /* nothing */
;
;
;
/*
* Note that we must consume the semicolon ending the
* include statement before switching input streams.
*/
{
if (tmpres != ISC_R_SUCCESS) {
}
}
;
{
"options must come before all "
"zones and views");
}
if (tmpres == ISC_R_SUCCESS) {
/*
* Clean out options so rest of config won't fail
* or issue extra error messages
*/
}
if (tmpres != ISC_R_SUCCESS) {
"failed to create options structure: %s",
}
if (tmpres != ISC_R_SUCCESS) {
"options configuration "
"failed: %s",
}
}
}
;
;
options: /* nothin */
;
option: /* Empty */
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"error setting directory: %s: %s",
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine random-device");
} else if (tmpres != ISC_R_SUCCESS) {
"error setting random-device: %s: %s",
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine random-seed-file");
} else if (tmpres != ISC_R_SUCCESS) {
"error setting random-seed-file: %s: %s",
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"set tkey-domain error: %s: %s",
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine statistics-file");
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine memstatistics-file");
} else if (tmpres != ISC_R_SUCCESS) {
"set memstatsfile error %s: %s",
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine expert-mode");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine fake-iquery");
}
}
{
if (tmpres == ISC_R_EXISTS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine host-statistics");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine deallocate-on-exit");
}
}
{
if (tmpres == ISC_R_EXISTS) {
}
}
{
/*
* Backwards compatibility, treated as
* equivalent to provide-ixfr.
*/
if (tmpres == ISC_R_EXISTS) {
"cannot redefine provide-ixfr");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine has-old-clients");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine auth-nxdomain");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine multiple-cnames");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine check-names");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine use-id-pool");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine rfc2308-type");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine provide-ixfr");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine request-ixfr");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine treat-cr-as-space");
}
}
{
if ($4 == NULL) {
"address-match-list empty implies"
"listen statement ignored");
} else {
if (tmpres != ISC_R_SUCCESS) {
"failed to add listen statement");
}
}
}
{
if ($4 == NULL) {
"address-match-list empty implies"
"listen statement ignored");
} else {
if (tmpres != ISC_R_SUCCESS) {
"failed to add "
"v6listen statement");
}
}
}
{
if (tmpres == ISC_R_EXISTS) {
}
}
| L_FORWARDERS {
if (tmpres != ISC_R_NOTFOUND) {
"cannot redefine options forwarders");
}
if (tmpres != ISC_R_SUCCESS) {
"failed to create forwarders list");
}
if (tmpres != ISC_R_SUCCESS) {
"failed to set forwarders list");
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine query-source");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set query-source");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine query-source-v6");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set query-source-v6");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine transfer-source");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set transfer-source");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine transfer-source-v6");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set transfer-source-v6");
}
}
{
if ($3 == NULL)
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine allow-query list");
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine allow-transfer list");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set allow-transfer");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine allow-recursion list");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set allow-recursion");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
dns_c_iplist_detach(&$2);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine also-notify");
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine transfer-format");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set transfer-format");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine max-transfer-time-in");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set max-transfer-time-in");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine port");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set port");
}
default_port = $2;
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine max-transfer-time-out");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set max-transfer-time-out");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine max-transfer-idle-in");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set max-transfer-idle-in");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine max-transfer-idle-out");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set max-transfer-idle-out");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine tcp-clients");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set tcp-clients");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine sig-validity-interval");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set sig-validity-interval");
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine recursive-clients");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set recursive-clients");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine min-roots");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set min-roots");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine serial-queries");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set serial-queries");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine cleaning-interval");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set cleaning-interval");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine interface-interval");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set interface-interval");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine statistics-interval");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set statistics-interval");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine max-ixfr-log-size");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set max-ixfr-log-size");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine max-ncache-ttl");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set max-ncache-ttl");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine max-cache-ttl");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set max-cache-ttl");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine heartbeat-interval");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set heartbeat-interval");
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres != ISC_R_NOTFOUND) {
"cannot redefine rrset-order list");
} else {
if (tmpres != ISC_R_SUCCESS) {
"failed to create rrset-order "
"list");
}
ordering);
if (tmpres != ISC_R_SUCCESS) {
"failed to set rrset-order");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine "
"allow-update-forwarding");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set allow-update-forwarding");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine additional-data");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set additional-data");
}
}
;
/*
* Controls.
*/
{
}
if (tmpres != ISC_R_SUCCESS) {
}
;
;
control: /* Empty */
{
if (tmpres != ISC_R_SUCCESS) {
"failed to build inet control structure");
}
}
{
$2, $4, $6, $8);
if (tmpres != ISC_R_SUCCESS) {
"failed to build unix control structure");
}
}
;
;
ordering_class: /* nothing */
{
$$ = dns_rdataclass_any;
}
{
$$ = $2;
}
;
ordering_type: /* nothing */
{
$$ = dns_rdatatype_any;
}
{
} else {
if (tmpres != ISC_R_SUCCESS) {
"unknown type, assuming '*'");
}
}
$$ = ty;
}
;
ordering_name: /* nothing */
{
}
{
} else {
$$ = $2;
}
}
{
if (tmpres != ISC_R_SUCCESS) {
"unknown ordering type '%s'"
" using default", $5);
o = DNS_DEFAULT_ORDERING;
}
if (tmpres != ISC_R_SUCCESS) {
"failed to create rrset-order element");
}
}
{
$$ = dns_one_answer;
}
{
$$ = dns_many_answers;
}
;
| L_STRING
{
isc_sockaddr_any(&$$);
"bad IP address, using IPv4 '*'");
}
;
{
$$ = $1;
}
{
"cannot have an IPv6 address in this context");
}
| L_STRING
{
isc_sockaddr_any(&$$);
"bad IPv4 address, using '*'");
}
;
{
$$ = $1;
}
{
"cannot have an IPv4 address in this context");
}
| L_STRING
{
isc_sockaddr_any6(&$$);
"bad IPv6 address, using '*'");
}
;
{
$$ = $1;
}
| L_STRING
{
$$ = 0;
"bad port specification using '*'");
}
}
;
{
unsigned int i;
if (port == 0)
port = default_port;
}
}
$$ = list;
};
{
$$ = $1;
};
{
if (tmpres != ISC_R_SUCCESS) {
"failed to create new iplist");
}
if (tmpres != ISC_R_SUCCESS) {
"failed to append master address");
}
$$ = list;
}
{
if (tmpres != ISC_R_SUCCESS) {
"failed to append master address");
}
$$ = $1;
}
;
{
$$ = $2;
}
{
$$ = $2;
}
{
$$ = addr;
}
{
$$ = $4;
}
;
{
$$ = $2;
}
{
$$ = $2;
}
{
$$ = addr;
}
{
$$ = $4;
}
;
maybe_port: /* nothing */
{
$$ = default_port;
}
{
$$ = $2;
}
;
maybe_zero_port : /* nothing */
{
$$ = 0;
}
{
$$ = $2;
}
;
{
$$ = dns_c_ad_internal;
}
{
$$ = dns_c_ad_minimal;
}
{
$$ = dns_c_ad_maximal;
};
{
$$ = isc_boolean_true;
}
| L_TRUE
{
$$ = isc_boolean_true;
}
| L_NO
{
$$ = isc_boolean_false;
}
| L_FALSE
{
$$ = isc_boolean_false;
}
{
if ($1 == 1) {
$$ = isc_boolean_true;
} else if ($1 == 0) {
$$ = isc_boolean_false;
} else {
"number should be 0 or 1, assuming 1");
$$ = isc_boolean_true;
}
}
;
{
$$ = dns_trans_primary;
}
| L_SLAVE
{
$$ = dns_trans_secondary;
}
{
$$ = dns_trans_response;
}
;
{
$$ = dns_severity_warn;
}
| L_FAIL
{
$$ = dns_severity_fail;
}
| L_IGNORE
{
$$ = dns_severity_ignore;
}
;
{
$$ = dns_c_forw_only;
}
| L_FIRST
{
$$ = dns_c_forw_first;
}
{
$$ = dns_c_forw_noanswer;
}
{
$$ = dns_c_forw_nodomain;
}
;
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if ($2 == DNS_C_SIZE_SPEC_DEFAULT) {
"cannot specific 'default' for "
"'max-cache-size'");
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine max-cache-size");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set max-cache-size");
}
}
;
{
if (tmpres == ISC_R_SUCCESS) {
$$ = result;
} else if (tmpres == ISC_R_RANGE) {
$$ = DNS_C_SIZE_SPEC_UNLIM;
"invalid value %s: using 'unlimited'",
$1);
} else if (tmpres == ISC_R_FAILURE) {
"invalid unit string '%s', Using "
"'default'", $1);
$$ = DNS_C_SIZE_SPEC_DEFAULT;
} else {
"unknown result: %s: using 'default'",
$$ = DNS_C_SIZE_SPEC_DEFAULT;
}
}
{
$$ = (isc_uint32_t)$1;
if ($$ == DNS_C_SIZE_SPEC_DEFAULT) {
"value (%lu) too big, Reducing to %lu",
(unsigned long) $$,
(unsigned long) newi);
$$ = newi;
}
}
{
$$ = DNS_C_SIZE_SPEC_DEFAULT;
}
{
$$ = DNS_C_SIZE_SPEC_UNLIM;
}
;
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine transfers-in");
} else if (tmpres != ISC_R_SUCCESS) {
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine transfers-out");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set transfers-out");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine transfers-per-ns");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set transfers-per-ns");
}
}
;
opt_forwarders_list: /* nothing */ {
}
;
;
{
if (tmpres != ISC_R_SUCCESS) {
"failed to add forwarders "
"address element");
}
}
;
/*
* Logging
*/
{
/* initialized in logging_init() */
}
;
;
;
$2, &newc);
if (tmpres == ISC_R_EXISTS) {
"redefing channel %s", $2);
} else if (tmpres != ISC_R_SUCCESS) {
"failed to add new file channel");
}
if (tmpres != ISC_R_SUCCESS) {
"failed to add file channel's path");
}
$2, &newc);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine channel %s", $2);
} else if (tmpres != ISC_R_SUCCESS) {
"failed to add new syslog channel");
}
if (tmpres != ISC_R_SUCCESS) {
"can't get set channel facility");
}
$2, &newc);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine channel %s", $2);
} else if (tmpres != ISC_R_SUCCESS) {
"failed to add new channel '%s'", $2);
}
$2, &newc);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine channel %s", $2);
} else if (tmpres != ISC_R_SUCCESS) {
"failed to add new channel '%s'", $2);
}
"first statment inside a channel definition "
"must be 'file' or 'syslog' or 'null'");
}
;
;
optional_channel_opt_list: /* empty */
;
if (tmpres == ISC_R_EXISTS) {
"cannot redefine category '%s'", $2);
} else if (tmpres != ISC_R_SUCCESS) {
"failed to add new logging category");
}
;
{
if (tmpres != ISC_R_SUCCESS) {
"unknown severity '%s'", $1);
}
if (tmpres != ISC_R_SUCCESS) {
"can't get current channel");
}
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel severity");
}
}
| L_DEBUG
{
if (tmpres != ISC_R_SUCCESS) {
"can't get current channel");
}
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel severity(debug)");
}
}
{
if (tmpres != ISC_R_SUCCESS) {
"can't get current channel");
}
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel "
"severity (debug)");
}
if (tmpres != ISC_R_SUCCESS) {
"can't get set channel "
"severity debug level");
}
}
{
if (tmpres != ISC_R_SUCCESS) {
"can't get current channel");
}
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel "
"severity (dynamic)");
}
}
;
{
if (tmpres != ISC_R_SUCCESS) {
"can't get current channel");
}
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel versions");
}
}
{
if (tmpres != ISC_R_SUCCESS) {
"can't get current channel");
}
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel "
"versions (unlimited)");
}
}
;
{
if (tmpres != ISC_R_SUCCESS) {
"can't get current channel");
}
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel size");
}
}
;
maybe_file_modifiers: /* nothing */
;
{
if (tmpres != ISC_R_SUCCESS) {
$$ = LOG_DAEMON;
}
}
| L_SYSLOG
{
$$ = LOG_SYSLOG;
}
;
maybe_syslog_facility: /* nothing */
{
$$ = LOG_DAEMON;
}
{
$$ = $1;
}
;
;
{
if (tmpres != ISC_R_SUCCESS) {
}
if (tmpres == ISC_R_EXISTS) {
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel print-time");
}
}
{
if (tmpres != ISC_R_SUCCESS) {
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine print-category");
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel print-category");
}
}
{
if (tmpres != ISC_R_SUCCESS) {
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine print-severity");
} else if (tmpres != ISC_R_SUCCESS) {
"can't get set channel print-severity");
}
}
;
{
}
;
{
/*
* XXX validate the channel name refers to a previously
* defined channel
*/
if (tmpres != ISC_R_SUCCESS) {
}
if (tmpres != ISC_R_SUCCESS) {
"can't add new name to category");
}
}
;
;
{
$$ = $1;
}
{
}
| L_NOTIFY
{
}
;
/*
* Server Information
*/
{
/*
* Check that this IP hasn't already been used.
*/
if (tmpres == ISC_R_SUCCESS) {
}
if (tmpres != ISC_R_SUCCESS) {
"failed to create peer structure");
}
}
;
;
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine server bogus value");
} else if (tmpres != ISC_R_SUCCESS) {
"error setting server bogus value");
}
}
{
/*
* Backwards compatibility, equivalent to request-ixfr.
*/
if (tmpres == ISC_R_EXISTS) {
"cannot redefine peer "
"request-ixfr value");
} else if(tmpres != ISC_R_SUCCESS) {
"error setting peer "
"request-ixfr value");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine peer "
"provide-ixfr value");
} else if(tmpres != ISC_R_SUCCESS) {
"error setting peer "
"provide-ixfr value");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine peer "
"request-ixfr value");
} else if(tmpres != ISC_R_SUCCESS) {
"error setting peer "
"request-ixfr value");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine peer transfers value");
} else if (tmpres != ISC_R_SUCCESS) {
"error setting peer transfers value");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine peer transfer-format "
"value");
} else if (tmpres != ISC_R_SUCCESS) {
"error setting peer transfer-format "
"value");
}
}
"undefined key '%s' referenced", $2);
}
if (tmpres != ISC_R_SUCCESS) {
"error creating key name value");
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine peer key value");
} else if (tmpres != ISC_R_SUCCESS) {
"error setting peer key value");
}
}
;
{
$$ = $2;
}
{
$$ = $1;
};
/*
* Address Matching
*/
{
dns_c_ipmatchlist_t *ml = 0;
if ($1 != NULL) {
if (tmpres != ISC_R_SUCCESS) {
&$1);
}
}
$$ = ml;
}
{
if (tmpres != ISC_R_SUCCESS) {
&$2);
}
}
if ($2 != NULL) {
}
$$ = ml;
}
;
{
if ($2 != NULL) {
dns_c_ipmatch_negate($2);
}
$$ = $2;
}
{
"address match key element (%s) "
"referenced before defined", $2);
} else {
if (tmpres != ISC_R_SUCCESS) {
"failed to create address match "
"key element for %s", $2);
}
}
$$ = ime;
}
;
{
unsigned int prefixlen = 0;
case AF_INET:
prefixlen = 32;
break;
case AF_INET6:
prefixlen = 128;
break;
default:
INSIST(0);
break;
}
switch (tmpres) {
case ISC_R_FAILURE:
break;
case ISC_R_NOMEMORY:
"insufficient memory available");
break;
case ISC_R_SUCCESS:
break;
}
$$ = ime;
}
{
if ($3 < 0 ||
"mask bits (%d) out of range: "
"skipping", (int)$3);
$$ = NULL;
} else {
$1, $3);
switch (tmpres) {
case ISC_R_FAILURE:
"bad address match element");
break;
case ISC_R_NOMEMORY:
"insufficient memory available");
break;
case ISC_R_SUCCESS:
break;
}
}
$$ = ime;
}
{
if ($1 > 255) {
"address out of range; skipping");
} else {
if ($3 < 0 || $3 > 32) {
"mask bits out of range; "
"skipping");
$$ = NULL;
} else {
tmpres =
&ime,
$3);
switch (tmpres) {
case ISC_R_FAILURE:
"bad address match "
"element");
break;
case ISC_R_NOMEMORY:
"insufficient memory "
"available");
break;
case ISC_R_SUCCESS:
break;
}
}
}
$$ = ime;
}
{
if ($2 != NULL) {
$2, NULL);
if (tmpres != ISC_R_SUCCESS) {
"failed to create indirect "
"ipmatch list");
}
}
dns_c_ipmatchlist_detach(&$2);
$$ = ime;
}
;
{
if (tmpres != ISC_R_SUCCESS) {
"failed to create 'any'"
" ipmatch element");
}
if (tmpres != ISC_R_SUCCESS) {
"failed to create 'none'"
" ipmatch element");
}
&elem);
if (tmpres != ISC_R_SUCCESS) {
"failed to create 'localhost'"
" ipmatch element");
}
&elem);
if (tmpres != ISC_R_SUCCESS) {
"failed to create 'localnets'"
" ipmatch element");
}
} else {
$1, &acl);
if (tmpres == ISC_R_NOTFOUND) {
"undefined acl '%s' "
"referenced", $1);
} else {
&elem, $1);
if (tmpres != ISC_R_SUCCESS) {
"failed to create "
"IPE-ACL");
}
}
}
$$ = elem;
}
;
/*
* Keys
*/
{
} else {
}
if (tmpres == ISC_R_NOTFOUND) {
&list);
if (tmpres != ISC_R_SUCCESS) {
"failed to create keylist");
}
list,
} else {
}
if (tmpres != ISC_R_SUCCESS) {
"failed to set keylist");
}
}
if (tmpres != ISC_R_SUCCESS) {
}
if (tmpres == ISC_R_SUCCESS) {
}
if (tmpres != ISC_R_SUCCESS) {
"failed to set key details");
}
}
;
{
$$.algorithm = $1;
$$.secret = $2;
}
{
$$.algorithm = $2;
$$.secret = $1;
}
;
{
$$ = $2;
}
;
{
$$ = $2;
}
;
/*
* Views
*/
{
if (tmpres != ISC_R_SUCCESS) {
"failed to create viewtable");
}
}
if (tmpres != ISC_R_SUCCESS) {
"failed to create view %s", $2);
}
};
;
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view forward");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view forward");
}
}
{
$3, ISC_FALSE);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view forwarders");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view forwarders");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view allow-query");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view allow-query");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view "
"allow-update-forwarding");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view "
"allow-update-forwarding");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view allow-transfer");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view allow-transfer");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view allow-recursion");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view allow-recursion");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view sortlist");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view sortlist");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view topology");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view topology");
}
}
{
dns_c_ipmatchlist_detach(&$3);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view match-clients");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view match-clients");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view check-names");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view check-names");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view auth-nxdomain");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view auth-nxdomain");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view recursion");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view recursion");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view provide-ixfr");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view provide-ixfr");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view request-ixfr");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view request-ixfr");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view fetch-glue");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view fetch-glue");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view notify");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view notify");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view rfc2308-type1");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view rfc2308-type1");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view query-source");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view query-source");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view query-source-v6");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view query-source-v6");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view transfer-source");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view transfer-source");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view "
"transfer-source-v6");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view transfer-source-v6");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view "
"max-transfer-time-out");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view "
"max-transfer-time-out");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view "
"max-transfer-idle-out");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view "
"max-transfer-idle-out");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view "
"cleaning-interval");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view cleaning-interval");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view min-roots");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view min-roots");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view lame-ttl");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view lame-ttl");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view max-ncache-ttl");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view max-ncache-ttl");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view max-cache-ttl");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view max-cache-ttl");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view "
"sig-validity-interval");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view "
"sig-validity-interval");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view additional-data");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view additional-data");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view transfer-format");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view transfer-format");
}
}
{
dns_c_iplist_detach(&$2);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view also-notify");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view also-notify");
}
}
{
if ($2 == DNS_C_SIZE_SPEC_DEFAULT) {
"cannot specific 'default' for "
"'max-cache-size'");
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine view max-cache-size");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set view max-cache-size");
}
}
| key_stmt
;
case dns_c_zone_hint:
"statements");
break;
case dns_c_zone_forward:
"statements");
break;
default:
/* nothing */
break;
}
if (ok) {
if (tmpres == ISC_R_NOTFOUND) {
&ssutable);
if (tmpres != ISC_R_SUCCESS) {
"failed to create "
"ssutable");
}
}
if (ok) {
}
}
$1.name,
if (tmpres != ISC_R_SUCCESS) {
"error creating ssu "
"identity value");
}
if (!ok) {
}
};
{
if (tmpres != ISC_R_SUCCESS) {
"error creating ssu name value");
}
if (ok) {
if (tmpres != ISC_R_SUCCESS) {
"error creating ssu "
"identity value");
}
}
if (ok) {
if (!dns_name_isabsolute(identity)) {
"identity (%s) must be an "
"absolute (not relative) name",
$2);
}
if (!dns_name_isabsolute(name)) {
"name (%s) must be an "
"absolute (not relative) name",
$4);
}
if ($3 == DNS_SSUMATCHTYPE_WILDCARD &&
!dns_name_iswildcard(name)) {
"name (%s) has no wildcard "
"character ",
$4);
}
}
if (ok) {
$$.grant = $1;
$$.ident = identity;
$$.matchtype = $3;
$$.rdatatypes = $5;
} else {
sizeof *identity);
}
}
sizeof (dns_rdatatype_t) * 256);
}
};
$$ = ISC_TRUE;
}
| L_DENY {
$$ = ISC_FALSE;
};
$$ = DNS_SSUMATCHTYPE_NAME;
}
| L_SUBDOMAIN {
}
| L_WILDCARD {
}
| L_SELF {
$$ = DNS_SSUMATCHTYPE_SELF;
};
rdatatype_list: /* nothing */
{
$$.idx = 0;
}
$$ = $1;
};
if (tmpres != ISC_R_SUCCESS) {
}
$$ = ty;
};
/*
* ACLs
*/
{
if (tmpres != ISC_R_SUCCESS) {
"failed to create acl %s", $2);
}
}
;
/*
* Zones
*/
{
$$ = $1;
}
;
/*
* 'type' is no longer optional and must be the first statement in the
* zone block.
*/
{
if (tmpres != ISC_R_SUCCESS) {
"Failed to create zone list");
}
}
/* XXX internal name support needed! */
if (tmpres != ISC_R_SUCCESS) {
"Error creating new zone");
}
if (tmpres != ISC_R_SUCCESS) {
"Error adding new zone to list");
}
}
if (tmpres != ISC_R_SUCCESS) {
}
zone,
view,
if (tmpres != ISC_R_SUCCESS) {
"zone configuration "
"for '%s' failed: %s",
}
}
}
{
"first statement in a zone definition must "
"be 'type'");
}
{
"references to zones not implemented yet");
}
;
optional_zone_options_list: /* Empty */
;
{
if (tmpres != ISC_R_SUCCESS) {
}
$$ = cl;
}
{
} else {
if (tmpres != ISC_R_SUCCESS) {
"unknown class, assuming '*'");
}
}
$$ = cl;
}
optional_class: /* Empty */
{
$$ = dns_rdataclass_in;
}
;
{
$$ = dns_c_zone_master;
}
| L_SLAVE
{
$$ = dns_c_zone_slave;
}
| L_HINT
{
$$ = dns_c_zone_hint;
}
| L_STUB
{
$$ = dns_c_zone_stub;
}
{
$$ = dns_c_zone_forward;
}
;
;
/*
* This rule is used in enforcing the requirement that zone_type must be
* the first element in a zone statement
*/
;
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone filename");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone file name");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine ixfr-base");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone ixfr_base");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine ixfr-tmp-file");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone ixfr_tmp-file");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone masters ips");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone masters ips");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone transfer-source");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone transfer-source");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone "
"transfer-source-v6");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone transfer-source-v6");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone check-names");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone check-names");
}
}
{
$3, ISC_FALSE);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone allow-update");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone allow-update");
}
}
{
$3, ISC_FALSE);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone "
"allow-update-forwarding");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone "
"allow-update-forwarding");
}
}
{
$3, ISC_FALSE);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone allow-query");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone allow-query");
}
}
{
$3, ISC_FALSE);
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone allow-transfer");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone allow-transfer");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone forward");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone forward");
}
}
{
5, &iplist);
if (tmpres != ISC_R_SUCCESS) {
"failed to create new zone "
"iplist");
}
} else {
iplist = $3;
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone forwarders");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone forwarders");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone "
"max-transfer-time-in");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone "
"max-transfer-time-in");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone "
"max-transfer-time-out");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone "
"max-transfer-time-out");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone "
"max-transfer-idle-in");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone "
"max-transfer-idle-in");
}
}
{
"integer value too big: %u", $2);
}
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone "
"max-transfer-idle-out");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone "
"max-transfer-idle-out");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone "
"sig-validity-interval");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone "
"sig-validity-interval");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone "
"max-ixfr-log-size");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone max-ixfr-log-size");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone notify");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone notify");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone "
"maintain-ixfr-base");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone maintain-ixfr-base");
}
}
{
if (tmpres != ISC_R_SUCCESS) {
"failed to create a zone pubkey");
}
if (tmpres != ISC_R_SUCCESS) {
"failed to add a zone pubkey");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone also-notify");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone also-notify");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone dialup");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone dialup");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine enable-zone");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set enable-zone");
}
}
{
if (tmpres == ISC_R_EXISTS) {
"cannot redefine zone database");
} else if (tmpres != ISC_R_SUCCESS) {
"failed to set zone database");
}
}
;
{
isc_sockaddr_fromin(&$$, &$1, 0);
}
;
{
isc_sockaddr_fromin6(&$$, &$1, 0);
};
;
;
opt_in_addr_list: /* nothing */
{
if (tmpres != ISC_R_SUCCESS) {
"failed to create new iplist");
}
$$ = list;
}
;
{
if (tmpres != ISC_R_SUCCESS) {
"failed to create new iplist");
}
if (tmpres != ISC_R_SUCCESS) {
"failed to append master address");
}
$$ = list;
}
{
if (tmpres != ISC_R_SUCCESS) {
"failed to append master address");
}
$$ = $1;
}
;
{
$$ = dns_c_forw_only;
}
| L_FIRST
{
$$ = dns_c_forw_first;
}
;
;
/*
* Trusted Key statement
*/
{
&newlist);
} else {
}
if (tmpres == ISC_R_NOTFOUND) {
if (tmpres != ISC_R_SUCCESS) {
"Failed to create trusted key"
" list");
}
} else {
}
if (tmpres != ISC_R_SUCCESS) {
"Failed to set trusted keys");
}
}
;
;
{
} else {
}
if (tmpres != ISC_R_SUCCESS) {
"No trusted key list defined!");
}
if (tmpres != ISC_R_SUCCESS) {
"Failed to create trusted key");
}
if (tmpres != ISC_R_SUCCESS) {
"Failed to append trusted key");
}
}
;
/*
* Misc.
*/
{
if ($1 < 0 || $1 > 65535) {
"invalid IP port number '%d'; "
"setting port to 0", (int)$1);
$1 = 0;
} else {
$$ = $1;
}
}
;
;
%%
static int intuit_token(const char *string);
static isc_result_t keyword_init(void);
static void init_action(void);
static YYSTYPE lastyylval;
static int lasttoken;
/*
* Definition of all unique keyword tokens to be recognised by the
* lexer. All the 'L_' tokens defined in parser.y must be defined here too.
*/
struct token
{
const char *token;
int yaccval;
};
static struct token keyword_tokens [] = {
{ "{", L_LBRACE },
{ "}", L_RBRACE },
{ ";", L_EOS },
{ "/", L_SLASH },
{ "!", L_BANG },
{ "acl", L_ACL },
{ "additional-data", L_ADDITIONAL_DATA },
{ "address", L_ADDRESS },
{ "algorithm", L_ALGID },
{ "allow", L_ALLOW },
{ "allow-query", L_ALLOW_QUERY },
{ "allow-transfer", L_ALLOW_TRANSFER },
{ "allow-recursion", L_ALLOW_RECURSION },
{ "allow-update", L_ALLOW_UPDATE },
{ "allow-update-forwarding", L_ALLOW_UPDATE_FORWARDING },
{ "also-notify", L_ALSO_NOTIFY },
{ "auth-nxdomain", L_AUTH_NXDOMAIN },
{ "blackhole", L_BLACKHOLE },
{ "bogus", L_BOGUS },
{ "max-cache-size", L_MAX_CACHE_SIZE },
{ "category", L_CATEGORY },
{ "class", L_CLASS },
{ "channel", L_CHANNEL },
{ "check-names", L_CHECK_NAMES },
{ "cleaning-interval", L_CLEAN_INTERVAL },
{ "controls", L_CONTROLS },
{ "coresize", L_CORESIZE },
{ "database", L_DATABASE },
{ "datasize", L_DATASIZE },
{ "deallocate-on-exit", L_DEALLOC_ON_EXIT },
{ "debug", L_DEBUG },
{ "default", L_DEFAULT },
{ "dialup", L_DIALUP },
{ "directory", L_DIRECTORY },
{ "dump-file", L_DUMP_FILE },
{ "dynamic", L_DYNAMIC },
{ "enable-zone", L_ENABLE_ZONE },
{ "expert-mode", L_EXPERT_MODE },
{ "fail", L_FAIL },
{ "fake-iquery", L_FAKE_IQUERY },
{ "false", L_FALSE },
{ "fetch-glue", L_FETCH_GLUE },
{ "file", L_FILE },
{ "files", L_FILES },
{ "first", L_FIRST },
{ "forward", L_FORWARD },
{ "forwarders", L_FORWARDERS },
{ "grant", L_GRANT },
{ "deny", L_DENY },
{ "subdomain", L_SUBDOMAIN },
{ "self", L_SELF },
{ "wildcard", L_WILDCARD },
{ "group", L_GROUP },
{ "has-old-clients", L_HAS_OLD_CLIENTS },
{ "heartbeat-interval", L_HEARTBEAT },
{ "hint", L_HINT },
{ "host-statistics", L_HOSTSTATS },
{ "if-no-answer", L_IF_NO_ANSWER },
{ "if-no-domain", L_IF_NO_DOMAIN },
{ "ignore", L_IGNORE },
{ "include", L_INCLUDE },
{ "inet", L_INET },
{ "interface-interval", L_INTERFACE_INTERVAL },
{ "internal", L_INTERNAL },
{ "ixfr-base", L_FILE_IXFR },
{ "ixfr-tmp-file", L_IXFR_TMP },
{ "key", L_SEC_KEY },
{ "keys", L_KEYS },
{ "lame-ttl", L_LAME_TTL },
{ "listen-on", L_LISTEN_ON },
{ "listen-on-v6", L_LISTEN_ON_V6 },
{ "logging", L_LOGGING },
{ "maintain-ixfr-base", L_MAINTAIN_IXFR_BASE },
{ "many-answers", L_MANY_ANSWERS },
{ "master", L_MASTER },
{ "masters", L_MASTERS },
{ "match-clients", L_MATCH_CLIENTS },
{ "max-ixfr-log-size", L_MAX_LOG_SIZE_IXFR },
{ "max-cache-ttl", L_MAX_CACHE_TTL },
{ "max-ncache-ttl", L_MAX_NCACHE_TTL },
{ "max-transfer-time-in", L_MAX_TRANSFER_TIME_IN },
{ "max-transfer-time-out", L_MAX_TRANSFER_TIME_OUT },
{ "max-transfer-idle-in", L_MAX_TRANSFER_IDLE_IN },
{ "max-transfer-idle-out", L_MAX_TRANSFER_IDLE_OUT },
{ "maximal", L_MAXIMAL },
{ "memstatistics-file", L_MEMSTATS_FILE },
{ "multiple-cnames", L_MULTIPLE_CNAMES },
{ "min-roots", L_MIN_ROOTS },
{ "minimal", L_MINIMAL },
{ "name", L_NAME },
{ "named-xfer", L_NAMED_XFER },
{ "no", L_NO },
{ "notify", L_NOTIFY },
{ "null", L_NULL_OUTPUT },
{ "one-answer", L_ONE_ANSWER },
{ "only", L_ONLY },
{ "order", L_ORDER },
{ "options", L_OPTIONS },
{ "owner", L_OWNER },
{ "perm", L_PERM },
{ "pid-file", L_PIDFILE },
{ "port", L_PORT },
{ "print-category", L_PRINT_CATEGORY },
{ "print-severity", L_PRINT_SEVERITY },
{ "print-time", L_PRINT_TIME },
{ "provide-ixfr", L_PROVIDE_IXFR },
{ "pubkey", L_PUBKEY },
{ "query-source", L_QUERY_SOURCE },
{ "query-source-v6", L_QUERY_SOURCE_V6 },
{ "random-device", L_RANDOM_DEVICE },
{ "random-seed-file", L_RANDOM_SEED_FILE },
{ "request-ixfr", L_REQUEST_IXFR },
{ "rfc2308-type1", L_RFC2308_TYPE1 },
{ "rrset-order", L_RRSET_ORDER },
{ "recursion", L_RECURSION },
{ "recursive-clients", L_RECURSIVE_CLIENTS },
{ "response", L_RESPONSE },
{ "secret", L_SECRET },
{ "server", L_SERVER },
{ "serial-queries", L_SERIAL_QUERIES },
{ "severity", L_SEVERITY },
{ "sig-validity-interval", L_SIG_VALIDITY_INTERVAL },
{ "size", L_SIZE },
{ "slave", L_SLAVE },
{ "sortlist", L_SORTLIST },
{ "stacksize", L_STACKSIZE },
{ "statistics-file", L_STATS_FILE },
{ "statistics-interval", L_STATS_INTERVAL },
{ "stderr", L_STDERR },
{ "stub", L_STUB },
{ "support-ixfr", L_SUPPORT_IXFR },
{ "syslog", L_SYSLOG },
{ "tcp-clients", L_TCP_CLIENTS },
{ "tkey-domain", L_TKEY_DOMAIN },
{ "tkey-dhkey", L_TKEY_DHKEY },
{ "topology", L_TOPOLOGY },
{ "transfer-format", L_TRANSFER_FORMAT },
{ "transfer-source", L_TRANSFER_SOURCE },
{ "transfer-source-v6", L_TRANSFER_SOURCE_V6 },
{ "transfers", L_TRANSFERS },
{ "transfers-in", L_TRANSFERS_IN },
{ "transfers-out", L_TRANSFERS_OUT },
{ "transfers-per-ns", L_TRANSFERS_PER_NS },
{ "treat-cr-as-space", L_TREAT_CR_AS_SPACE },
{ "true", L_TRUE },
{ "trusted-keys", L_TRUSTED_KEYS },
{ "type", L_TYPE },
{ "unix", L_UNIX },
{ "unlimited", L_UNLIMITED },
{ "update-policy", L_UPDATE_POLICY },
{ "use-id-pool", L_USE_ID_POOL },
{ "use-ixfr", L_USE_IXFR },
{ "version", L_VERSION },
{ "versions", L_VERSIONS },
{ "view", L_VIEW },
{ "warn", L_WARN },
{ "yes", L_YES },
{ "zone", L_ZONE },
{ NULL, 0 }
};
static struct token class_symbol_tokens[] = {
{ "IN", dns_rdataclass_in },
#if 0 /* XXX expand */
{ "CHAOS", dns_rdataclass_chaos },
{ "HS", dns_rdataclass_hs },
{ "HESIOD", dns_rdataclass_hs },
#endif
{ "ANY", dns_rdataclass_any },
{ "NONE", dns_rdataclass_none },
{ NULL, 0 }
};
static void
init_action(void)
{
}
/*
* XXX Need a parameter to specify where error messages should go (syslog,
* statments as appropriate.
*/
{
const char *funcname = "dns_parse_namedconf";
/* Lock down whole parser. */
return (ISC_R_UNEXPECTED);
}
#if 1
debug_lexer++;
}
#endif
/*
* This memory context is only used by the lexer routines (and must
* stay that way). Any memory that must live past the return of
* yyparse() must be allocated via the 'mem' parameter to this
* function.
*/
if (res != ISC_R_SUCCESS) {
"%s: Error creating mem context",
funcname);
goto done;
}
res = keyword_init();
if (res != ISC_R_SUCCESS) {
"%s: Error initializing keywords",
funcname);
goto done;
}
if (res != ISC_R_SUCCESS) {
"%s: Error creating config context",
funcname);
goto done;
}
if (res != ISC_R_SUCCESS) {
"%s: Error creating lexer",
funcname);
goto done;
}
if (res != ISC_R_SUCCESS) {
"%s: open: %s", filename,
goto done;
}
if (yyparse() != 0) {
res = ISC_R_FAILURE;
/*
* Syntax errors in the config file make it very difficult
* to clean up memory properly (which causes assertion
* failure when the memory manager is destroyed).
*/
} else {
res = ISC_R_SUCCESS;
}
done:
if (res == ISC_R_SUCCESS) {
if (res != ISC_R_SUCCESS) {
}
}
return (res);
}
/***
*** PRIVATE
***/
static isc_result_t
keyword_init(void)
{
&keywords) == ISC_R_SUCCESS);
/* Stick all the keywords into the main symbol table. */
}
/* Now the class names */
}
return (ISC_R_SUCCESS);
}
static int
yylex(void)
{
int options = (ISC_LEXOPT_EOF |
switch(res) {
case ISC_R_SUCCESS:
break;
case ISC_R_EOF:
res = 0;
break;
case ISC_R_UNBALANCED:
"%s: %lu: unbalanced parentheses",
res = -1;
break;
case ISC_R_NOSPACE:
"%s: %lu: token too big",
res = -1;
break;
case ISC_R_UNEXPECTEDEND:
"%s: %lu: unexpected EOF",
res = -1;
break;
default:
"%s: %lu unknown lexer error (%d)",
(int)res);
res = -1;
break;
}
lastyylval = yylval;
return (res);
}
static char *
static char buffer[1024];
const char *tk;
/*
* Yacc keeps token numbers above 128, it seems.
*/
if (token < 128) {
if (token == 0)
else
>= sizeof buffer) {
abort();
}
} else {
switch (token) {
case L_STRING:
sizeof buffer) {
abort();
}
break;
case L_QSTRING:
sizeof buffer) {
abort();
}
break;
case L_IP6ADDR:
break;
case L_IP4ADDR:
break;
case L_INTEGER:
break;
case L_END_INCLUDE:
break;
default:
(int)token);
} else {
}
break;
}
}
return (buffer);
}
static const char *
token_to_keyword(int token) {
int i;
break;
}
}
return (keyword_tokens[i].token);
}
static void
{
static char message[2048];
int level = ISC_LOG_ERROR;
/*
* We can't get a trace of the include files we may be nested in
* (lex.c has the structures hidden). So we only report the current
* file.
*/
filename = "(none)";
}
if (is_warning) {
}
"error message would overflow");
if (print_last_token) {
} else {
}
} else {
} else {
}
}
}
/*
* For reporting items that are semantic, but not syntactic errors
*/
static void
{
}
static void
{
}
static isc_boolean_t
return ISC_TRUE;
} else {
return ISC_FALSE;
}
}
static void
{
}
static int
{
int res = -1;
const char *tokstring;
char tmpident [2];
case isc_tokentype_unknown:
if (debug_lexer) {
}
res = -1;
break;
case isc_tokentype_special:
case isc_tokentype_string:
} else {
}
if (res != ISC_R_SUCCESS) {
} else {
}
if (debug_lexer) {
}
break;
case isc_tokentype_number:
if(debug_lexer) {
}
break;
case isc_tokentype_qstring:
res = -1;
} else {
}
if (debug_lexer) {
}
break;
case isc_tokentype_eof:
/* the only way to tell that we
* closed the main file and not an included file
*/
if (debug_lexer) {
}
res = 0;
} else {
if (debug_lexer) {
}
res = L_END_INCLUDE;
}
break;
case isc_tokentype_initialws:
if (debug_lexer) {
}
res = -1;
break;
case isc_tokentype_eol:
if (debug_lexer) {
}
res = -1;
break;
case isc_tokentype_nomore:
if (debug_lexer) {
}
res = -1;
break;
}
return (res);
}
static int
intuit_token(const char *string)
{
int resval;
} else {
resval = -1;
} else {
}
}
return (resval);
}
/*
* Conversion Routines
*/
static isc_result_t
int c, units_done = 0;
isc_uint32_t result = 0L;
if (units_done)
return (ISC_R_FAILURE);
if (isdigit((unsigned char)c)) {
result *= 10;
result += (c - '0');
} else {
return (ISC_R_FAILURE);
}
switch (c) {
case 'k':
case 'K':
return (ISC_R_RANGE);
}
result *= 1024;
units_done = 1;
break;
case 'm':
case 'M':
return (ISC_R_RANGE);
}
units_done = 1;
break;
case 'g':
case 'G':
return (ISC_R_RANGE);
}
units_done = 1;
break;
default:
return (ISC_R_FAILURE);
}
}
}
return (ISC_R_SUCCESS);
}
static isc_boolean_t
{
return ISC_FALSE;
}
return ISC_TRUE;
}
static isc_boolean_t
{
const char *p = string;
int dots = 0;
char dot = '.';
while (*p) {
return (ISC_FALSE);
} else if (!isdigit(*p & 0xff)) {
dots++;
}
p++;
}
if (dots > 3) {
return (ISC_FALSE);
} else if (dots < 3) {
if (dots == 1) {
} else {
return (ISC_FALSE);
}
} else if (dots == 2) {
} else {
return (ISC_FALSE);
}
}
} else {
return (ISC_FALSE);
}
return ISC_FALSE;
}
return ISC_TRUE;
}
static dns_peerlist_t *
{
} else {
}
if (tmpres != ISC_R_SUCCESS) {
return NULL;
}
} else {
}
} else if (result == ISC_R_NOTFOUND) {
/* nothing */
} else if (result != ISC_R_SUCCESS) {
}
return peers;
}
static isc_boolean_t
{
}
if (!rval) {
}
return (rval);
}