confparser.y revision 761a1c3761dc4e83a5d11765a42fab2970c5352b
/* All these statics are protected by the above yacc_mutex */ * XXXJAB The #define for the default OMAPI port is not available * to us, so we make our own. /* This should be sufficient to permit multiple parsers and lexers if needed */ * 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 /* 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 /* Miscellaneous items (used in several places): */ * Note that we must consume the semicolon ending the * include statement before switching input streams. "options must come before all " * Clean out options so rest of config won't fail * or issue extra error messages "failed to create options structure: %s",
"error setting directory: %s: %s",
"cannot redefine random-device");
"error setting random-device: %s: %s",
"cannot redefine random-seed-file");
"error setting random-seed-file: %s: %s",
"set tkey-domain error: %s: %s",
"cannot redefine statistics-file");
"cannot redefine memstatistics-file");
"set memstatsfile error %s: %s",
"cannot redefine expert-mode");
"cannot redefine fake-iquery");
"cannot redefine host-statistics");
"cannot redefine deallocate-on-exit");
* Backwards compatibility, treated as * equivalent to provide-ixfr. "cannot redefine provide-ixfr");
"cannot redefine has-old-clients");
"cannot redefine auth-nxdomain");
"cannot redefine multiple-cnames");
"cannot redefine check-names");
"cannot redefine use-id-pool");
"cannot redefine rfc2308-type");
"cannot redefine provide-ixfr");
"cannot redefine request-ixfr");
"cannot redefine treat-cr-as-space");
"cannot redefine glue-from-cache");
"cannot redefine glue-from-auth");
"address-match-list empty implies" "listen statement ignored");
"failed to add listen statement");
"address-match-list empty implies" "listen statement ignored");
"cannot redefine options forwarders");
"failed to create forwarders list");
"failed to set forwarders list");
"cannot redefine query-source");
"failed to set query-source");
"cannot redefine query-source-v6");
"failed to set query-source-v6");
"cannot redefine transfer-source");
"failed to set transfer-source");
"cannot redefine transfer-source-v6");
"failed to set transfer-source-v6");
"cannot redefine allow-query list");
"cannot redefine allow-transfer list");
"failed to set allow-transfer");
"cannot redefine allow-recursion list");
"failed to set allow-recursion");
"cannot redefine also-notify");
"cannot redefine transfer-format");
"failed to set transfer-format");
"integer value too big: %u", $
2);
"cannot redefine max-transfer-time-in");
"failed to set max-transfer-time-in");
"integer value too big: %u", $
2);
"cannot redefine max-transfer-time-out");
"failed to set max-transfer-time-out");
"integer value too big: %u", $
2);
"cannot redefine max-transfer-idle-in");
"failed to set max-transfer-idle-in");
"integer value too big: %u", $
2);
"cannot redefine max-transfer-idle-out");
"failed to set max-transfer-idle-out");
"cannot redefine tcp-clients");
"failed to set tcp-clients");
"cannot redefine sig-validity-interval");
"failed to set sig-validity-interval");
"cannot redefine recursive-clients");
"failed to set recursive-clients");
"cannot redefine min-roots");
"failed to set min-roots");
"cannot redefine serial-queries");
"failed to set serial-queries");
"integer value too big: %u", $
2);
"cannot redefine cleaning-interval");
"failed to set cleaning-interval");
"integer value too big: %u", $
2);
"cannot redefine interface-interval");
"failed to set interface-interval");
"integer value too big: %u", $
2);
"cannot redefine statistics-interval");
"failed to set statistics-interval");
"cannot redefine max-ixfr-log-size");
"failed to set max-ixfr-log-size");
"cannot redefine max-ncache-ttl");
"failed to set max-ncache-ttl");
"cannot redefine max-cache-ttl");
"failed to set max-cache-ttl");
"integer value too big: %u", $
2);
"cannot redefine heartbeat-interval");
"failed to set heartbeat-interval");
"cannot redefine rrset-order list");
"failed to create rrset-order " "failed to set rrset-order");
"allow-update-forwarding");
"failed to set allow-update-forwarding");
"cannot redefine additional-data");
"failed to set additional-data");
"failed to build inet control structure");
"failed to build unix control structure");
"unknown type, assuming '*'");
"unknown ordering type '%s'" "failed to create rrset-order element");
"bad IP address, using IPv4 '*'");
"cannot have an IPv6 address in this context");
"bad IPv4 address, using '*'");
"cannot have an IPv4 address in this context");
"bad IPv6 address, using '*'");
"bad port specification using '*'");
"failed to create new iplist");
"failed to append master address");
"failed to append master address");
"number should be 0 or 1, assuming 1");
"cannot specific 'default' for " "cannot redefine max-cache-size");
"failed to set max-cache-size");
"invalid value %s: using 'unlimited'",
"invalid unit string '%s', Using " "unknown result: %s: using 'default'",
"value (%lu) too big, Reducing to %lu",
"cannot redefine transfers-in");
"cannot redefine transfers-out");
"failed to set transfers-out");
"cannot redefine transfers-per-ns");
"failed to set transfers-per-ns");
"failed to add forwarders " /* initialized in logging_init() */ "redefing channel %s", $
2);
"failed to add new file channel");
"failed to add file channel's path");
"cannot redefine channel %s", $
2);
"failed to add new syslog channel");
"can't get set channel facility");
"cannot redefine channel %s", $
2);
"failed to add new channel '%s'", $
2);
"cannot redefine channel %s", $
2);
"failed to add new channel '%s'", $
2);
"first statment inside a channel definition " "must be 'file' or 'syslog' or 'null'");
"cannot redefine category '%s'", $
2);
"failed to add new logging category");
"unknown severity '%s'", $
1);
"can't get current channel");
"can't get set channel severity");
"can't get current channel");
"can't get set channel severity(debug)");
"can't get current channel");
"can't get current channel");
"can't get current channel");
"can't get set channel versions");
"can't get current channel");
"can't get current channel");
"can't get set channel size");
"can't get set channel print-time");
"cannot redefine print-category");
"can't get set channel print-category");
"cannot redefine print-severity");
"can't get set channel print-severity");
* XXX validate the channel name refers to a previously "can't add new name to category");
* Check that this IP hasn't already been used. "failed to create peer structure");
"cannot redefine server bogus value");
"error setting server bogus value");
* Backwards compatibility, equivalent to request-ixfr. "cannot redefine peer transfers value");
"error setting peer transfers value");
"cannot redefine peer transfer-format " "error setting peer transfer-format " "undefined key '%s' referenced", $
2);
"error creating key name value");
"cannot redefine peer key value");
"error setting peer key value");
"address match key element (%s) " "referenced before defined", $
2);
"failed to create address match " "key element for %s", $
2);
"insufficient memory available");
"mask bits (%d) out of range: " "bad address match element");
"insufficient memory available");
"address out of range; skipping");
"mask bits out of range; " "failed to create indirect " }
else if (
strcmp($
1,
"none") == 0) {
"failed to create 'none'" }
else if (
strcmp($
1,
"localhost") == 0) {
"failed to create 'localhost'" }
else if (
strcmp($
1,
"localnets") == 0) {
"failed to create 'localnets'" "failed to create keylist");
"failed to set keylist");
"failed to set key details");
"failed to create viewtable");
"failed to create view %s", $
2);
"cannot redefine view forward");
"failed to set view forward");
"cannot redefine view forwarders");
"failed to set view forwarders");
"cannot redefine view allow-query");
"failed to set view allow-query");
"allow-update-forwarding");
"allow-update-forwarding");
"cannot redefine view allow-transfer");
"failed to set view allow-transfer");
"cannot redefine view allow-recursion");
"failed to set view allow-recursion");
"cannot redefine view sortlist");
"failed to set view sortlist");
"cannot redefine view topology");
"failed to set view topology");
"cannot redefine view match-clients");
"failed to set view match-clients");
"cannot redefine view check-names");
"failed to set view check-names");
"cannot redefine view auth-nxdomain");
"failed to set view auth-nxdomain");
"cannot redefine view recursion");
"failed to set view recursion");
"cannot redefine view provide-ixfr");
"failed to set view provide-ixfr");
"cannot redefine view request-ixfr");
"failed to set view request-ixfr");
"cannot redefine view fetch-glue");
"failed to set view fetch-glue");
"cannot redefine view notify");
"failed to set view notify");
"cannot redefine view rfc2308-type1");
"failed to set view rfc2308-type1");
"cannot redefine view glue-from-cache");
"failed to set view glue-from-cache");
"cannot redefine view glue-from-auth");
"failed to set view glue-from-auth");
"cannot redefine view query-source");
"failed to set view query-source");
"cannot redefine view query-source-v6");
"failed to set view query-source-v6");
"cannot redefine view transfer-source");
"failed to set view transfer-source");
"failed to set view transfer-source-v6");
"integer value too big: %u", $
2);
"max-transfer-time-out");
"max-transfer-time-out");
"integer value too big: %u", $
2);
"max-transfer-idle-out");
"max-transfer-idle-out");
"integer value too big: %u", $
2);
"failed to set view cleaning-interval");
"cannot redefine view min-roots");
"failed to set view min-roots");
"cannot redefine view lame-ttl");
"failed to set view lame-ttl");
"cannot redefine view max-ncache-ttl");
"failed to set view max-ncache-ttl");
"cannot redefine view max-cache-ttl");
"failed to set view max-cache-ttl");
"sig-validity-interval");
"sig-validity-interval");
"cannot redefine view additional-data");
"failed to set view additional-data");
"cannot redefine view transfer-format");
"failed to set view transfer-format");
"cannot redefine view also-notify");
"failed to set view also-notify");
"cannot specific 'default' for " "cannot redefine view max-cache-size");
"failed to set view max-cache-size");
"error creating ssu name value");
"identity (%s) must be an " "absolute (not relative) name",
"absolute (not relative) name",
"name (%s) has no wildcard " "failed to create acl %s", $
2);
* 'type' is no longer optional and must be the first statement in the "Failed to create zone list");
/* XXX internal name support needed! */ "Error creating new zone");
"Error adding new zone to list");
"first statement in a zone definition must " "references to zones not implemented yet");
"unknown class, assuming '*'");
* This rule is used in enforcing the requirement that zone_type must be * the first element in a zone statement "cannot redefine zone filename");
"failed to set zone file name");
"cannot redefine ixfr-base");
"failed to set zone ixfr_base");
"cannot redefine ixfr-tmp-file");
"failed to set zone ixfr_tmp-file");
"cannot redefine zone masters ips");
"failed to set zone masters ips");
"cannot redefine zone transfer-source");
"failed to set zone transfer-source");
"failed to set zone transfer-source-v6");
"cannot redefine zone check-names");
"failed to set zone check-names");
"cannot redefine zone allow-update");
"failed to set zone allow-update");
"allow-update-forwarding");
"allow-update-forwarding");
"cannot redefine zone allow-query");
"failed to set zone allow-query");
"cannot redefine zone allow-transfer");
"failed to set zone allow-transfer");
"cannot redefine zone forward");
"failed to set zone forward");
if ($
3 ==
NULL) {
/* user defined empty list */ "failed to create new zone " "cannot redefine zone forwarders");
"failed to set zone forwarders");
"integer value too big: %u", $
2);
"integer value too big: %u", $
2);
"max-transfer-time-out");
"max-transfer-time-out");
"integer value too big: %u", $
2);
"integer value too big: %u", $
2);
"max-transfer-idle-out");
"max-transfer-idle-out");
"sig-validity-interval");
"sig-validity-interval");
"failed to set zone max-ixfr-log-size");
"cannot redefine zone notify");
"failed to set zone notify");
"failed to set zone maintain-ixfr-base");
"failed to create a zone pubkey");
"failed to add a zone pubkey");
"cannot redefine zone also-notify");
"failed to set zone also-notify");
"cannot redefine zone dialup");
"failed to set zone dialup");
"cannot redefine enable-zone");
"failed to set enable-zone");
"cannot redefine zone database");
"failed to set zone database");
"failed to create new iplist");
"failed to create new iplist");
"failed to append master address");
"failed to append master address");
"Failed to create trusted key" "Failed to set trusted keys");
"No trusted key list defined!");
"Failed to create trusted key");
"Failed to append trusted key");
if ($
1 < 0 || $
1 >
65535) {
"invalid IP port number '%d'; " "setting port to 0", (
int)$
1);
* 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. * XXX Need a parameter to specify where error messages should go (syslog, * FILE, /dev/null etc.) Also some way to tell the function to obey logging * statments as appropriate. const char *
funcname =
"dns_parse_namedconf";
/* Lock down whole parser. */ * 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 "%s: Error creating mem context",
"%s: Error initializing keywords",
"%s: Error creating config context",
"%s: Error creating lexer",
* 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). /* Stick all the keywords into the main symbol table. */ /* Now the class names */ "%s: %lu: unbalanced parentheses",
"%s: %lu: token too big",
"%s: %lu: unexpected EOF",
"%s: %lu unknown lexer error (%d)",
* Yacc keeps token numbers above 128, it seems. * 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 "error message would overflow");
* For reporting items that are semantic, but not syntactic errors /* the only way to tell that we * closed the main file and not an included file for (; (c = *
in) !=
'\0';
in++) {
char addrbuf[
sizeof "xxx.xxx.xxx.xxx" +
1];