confparser.y revision 65c9645ca7385e68fb8be1b136cc498a3a9f325d
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * Copyright (c) 1996-2000 by Internet Software Consortium.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * Permission to use, copy, modify, and distribute this software for any
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * purpose with or without fee is hereby granted, provided that the above
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * copyright notice and this permission notice appear in all copies.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
8d5639ee43c088077303542cfded6e8468bbc9a4Bob Halley/* $Id: confparser.y,v 1.72 2000/05/06 10:18:46 brister Exp $ */
struct confrdtype_s {
struct confssu_s {
dns_name_t *ident;
unsigned int matchtype;
struct keydetails_s {
char *algorithm;
char *secret;
static int debug_lexer;
static int yylex(void);
static int yyparse(void);
const char *fmt, ...);
const char *fmt, ...);
static void yyerror(const char *);
const char *name);
char *text;
int number;
| L_FORWARDERS {
ordering);
$$ = dns_rdataclass_any;
$$ = dns_rdatatype_any;
$$ = ty;
o = DNS_DEFAULT_ORDERING;
$$ = dns_one_answer;
$$ = dns_many_answers;
| L_STRING
| L_STRING
| L_STRING
| L_STRING
if (port == 0)
$$ = list;
$$ = list;
$$ = addr;
$$ = addr;
$$ = DNS_C_DEFAULTPORT;
$$ = isc_boolean_true;
| L_TRUE
$$ = isc_boolean_true;
| L_NO
$$ = isc_boolean_false;
| L_FALSE
$$ = isc_boolean_false;
$$ = isc_boolean_true;
$$ = isc_boolean_false;
$$ = 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;
$$ = result;
if ($$ == DNS_C_SIZE_SPEC_DEFAULT) {
(unsigned long)newi);
$$ = newi; }
$$ = DNS_C_SIZE_SPEC_DEFAULT;
if ($$ == DNS_C_SIZE_SPEC_DEFAULT) {
(unsigned long) newi);
$$ = newi;
$$ = DNS_C_SIZE_SPEC_DEFAULT;
$$ = DNS_C_SIZE_SPEC_UNLIM;
| L_DEBUG
$$ = LOG_DAEMON;
| L_SYSLOG
$$ = LOG_SYSLOG;
$$ = LOG_DAEMON;
| L_NOTIFY
$$ = ml;
$$ = ml;
$$ = ime;
unsigned int prefixlen = 0;
case AF_INET:
case AF_INET6:
INSIST(0);
switch (tmpres) {
case ISC_R_FAILURE:
case ISC_R_NOMEMORY:
case ISC_R_SUCCESS:
$$ = ime;
$$ = NULL;
switch (tmpres) {
case ISC_R_FAILURE:
case ISC_R_NOMEMORY:
case ISC_R_SUCCESS:
$$ = ime;
$$ = NULL;
tmpres =
&ime,
switch (tmpres) {
case ISC_R_FAILURE:
case ISC_R_NOMEMORY:
case ISC_R_SUCCESS:
$$ = ime;
$$ = ime;
&elem);
&elem);
$$ = elem;
&list);
list,
| key_stmt
case dns_c_zone_hint:
case dns_c_zone_forward:
if (ok) {
&ssutable);
if (ok) {
if (!ok) {
if (ok) {
if (ok) {
if (ok) {
$$.ident = identity;
sizeof *identity);
$$ = ISC_TRUE;
| L_DENY {
$$ = ISC_FALSE;
$$ = DNS_SSUMATCHTYPE_NAME;
| L_SUBDOMAIN {
| L_WILDCARD {
| L_SELF {
$$ = DNS_SSUMATCHTYPE_SELF;
$$.idx = 0;
$$ = ty;
if (disabled) {
zone,
view,
$$ = cl;
$$ = cl;
$$ = 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;
$$ = list;
$$ = list;
$$ = dns_c_forw_only;
| L_FIRST
$$ = dns_c_forw_first;
&newlist);
static void init_action(void);
static int lasttoken;
struct token
char *token;
int yaccval;
{ NULL, 0 }
{ NULL, 0 }
init_action(void)
return (ISC_R_UNEXPECTED);
debug_lexer++;
funcname);
goto done;
funcname);
goto done;
funcname);
goto done;
funcname);
goto done;
goto done;
if (yyparse() != 0) {
done:
return (res);
static isc_result_t
keyword_init(void)
return (ISC_R_SUCCESS);
yylex(void)
switch(res) {
case ISC_R_SUCCESS:
case ISC_R_EOF:
res = 0;
case ISC_R_UNBALANCED:
case ISC_R_NOSPACE:
case ISC_R_UNEXPECTEDEND:
(int)res);
return (res);
char *tk;
if (token == 0)
>= sizeof buffer) {
abort();
switch (token) {
case L_STRING:
sizeof buffer) {
abort();
case L_QSTRING:
sizeof buffer) {
abort();
case L_IP6ADDR:
case L_IP4ADDR:
case L_INTEGER:
case L_END_INCLUDE:
(int)token);
return (buffer);
* (lex.c has the structures hidden). So we only report the current
if (is_warning) {
if (print_last_token) {
static isc_boolean_t
return ISC_TRUE;
return ISC_FALSE;
const char *tokstring;
case isc_tokentype_unknown:
if (debug_lexer) {
case isc_tokentype_special:
case isc_tokentype_string:
if (debug_lexer) {
case isc_tokentype_number:
if(debug_lexer) {
case isc_tokentype_qstring:
if (debug_lexer) {
case isc_tokentype_eof:
if (debug_lexer) {
res = 0;
if (debug_lexer) {
case isc_tokentype_initialws:
if (debug_lexer) {
case isc_tokentype_eol:
if (debug_lexer) {
case isc_tokentype_nomore:
if (debug_lexer) {
return (res);
int resval;
return (resval);
static isc_boolean_t
int c, units_done = 0;
if (units_done)
return (ISC_FALSE);
if (isdigit(c)) {
return (ISC_FALSE);
return (ISC_TRUE);
static isc_boolean_t
return ISC_FALSE;
return ISC_TRUE;
static isc_boolean_t
const char *p = string;
int dots = 0;
return (ISC_FALSE);
dots++;
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_FALSE);
return ISC_FALSE;
return ISC_TRUE;
static dns_peerlist_t *
return NULL;
return peers;
static isc_boolean_t
if (!rval) {
return (rval);