xref: /openbsd-src/sbin/unwind/libunbound/util/configlexer.lex (revision 7037e34cdfd270b3989fb1829c7cd3439048bd3a)
1ae8c6e27Sflorian %{
2ae8c6e27Sflorian /*
3ae8c6e27Sflorian  * configlexer.lex - lexical analyzer for unbound config file
4ae8c6e27Sflorian  *
5ae8c6e27Sflorian  * Copyright (c) 2001-2006, NLnet Labs. All rights reserved
6ae8c6e27Sflorian  *
7ae8c6e27Sflorian  * See LICENSE for the license.
8ae8c6e27Sflorian  *
9ae8c6e27Sflorian  */
10ae8c6e27Sflorian 
11ae8c6e27Sflorian /* because flex keeps having sign-unsigned compare problems that are unfixed*/
12ae8c6e27Sflorian #if defined(__clang__)||(defined(__GNUC__)&&((__GNUC__ >4)||(defined(__GNUC_MINOR__)&&(__GNUC__ ==4)&&(__GNUC_MINOR__ >=2))))
13ae8c6e27Sflorian #pragma GCC diagnostic ignored "-Wsign-compare"
14ae8c6e27Sflorian #endif
15ae8c6e27Sflorian 
16ae8c6e27Sflorian #include <ctype.h>
17ae8c6e27Sflorian #include <strings.h>
18ae8c6e27Sflorian #ifdef HAVE_GLOB_H
19ae8c6e27Sflorian # include <glob.h>
20ae8c6e27Sflorian #endif
21ae8c6e27Sflorian 
22ae8c6e27Sflorian #include "util/config_file.h"
23ae8c6e27Sflorian #include "util/configparser.h"
24ae8c6e27Sflorian void ub_c_error(const char *message);
25ae8c6e27Sflorian 
26ae8c6e27Sflorian #if 0
27ae8c6e27Sflorian #define LEXOUT(s)  printf s /* used ONLY when debugging */
28ae8c6e27Sflorian #else
29ae8c6e27Sflorian #define LEXOUT(s)
30ae8c6e27Sflorian #endif
31ae8c6e27Sflorian 
32ae8c6e27Sflorian /** avoid warning in about fwrite return value */
33ae8c6e27Sflorian #define ECHO ub_c_error_msg("syntax error at text: %s", yytext)
34ae8c6e27Sflorian 
35ae8c6e27Sflorian /** A parser variable, this is a statement in the config file which is
36ae8c6e27Sflorian  * of the form variable: value1 value2 ...  nargs is the number of values. */
37ae8c6e27Sflorian #define YDVAR(nargs, var) \
38ae8c6e27Sflorian 	num_args=(nargs); \
39ae8c6e27Sflorian 	LEXOUT(("v(%s%d) ", yytext, num_args)); \
40ae8c6e27Sflorian 	if(num_args > 0) { BEGIN(val); } \
41ae8c6e27Sflorian 	return (var);
42ae8c6e27Sflorian 
43ae8c6e27Sflorian struct inc_state {
44ae8c6e27Sflorian 	char* filename;
45ae8c6e27Sflorian 	int line;
46ae8c6e27Sflorian 	YY_BUFFER_STATE buffer;
47ae8c6e27Sflorian 	struct inc_state* next;
48e47fef9eSflorian 	int inc_toplevel;
49ae8c6e27Sflorian };
50ae8c6e27Sflorian static struct inc_state* config_include_stack = NULL;
51ae8c6e27Sflorian static int inc_depth = 0;
52ae8c6e27Sflorian static int inc_prev = 0;
53ae8c6e27Sflorian static int num_args = 0;
54e47fef9eSflorian static int inc_toplevel = 0;
55ae8c6e27Sflorian 
56ae8c6e27Sflorian void init_cfg_parse(void)
57ae8c6e27Sflorian {
58ae8c6e27Sflorian 	config_include_stack = NULL;
59ae8c6e27Sflorian 	inc_depth = 0;
60ae8c6e27Sflorian 	inc_prev = 0;
61ae8c6e27Sflorian 	num_args = 0;
62e47fef9eSflorian 	inc_toplevel = 0;
63ae8c6e27Sflorian }
64ae8c6e27Sflorian 
65e47fef9eSflorian static void config_start_include(const char* filename, int toplevel)
66ae8c6e27Sflorian {
67ae8c6e27Sflorian 	FILE *input;
68ae8c6e27Sflorian 	struct inc_state* s;
69ae8c6e27Sflorian 	char* nm;
70e47fef9eSflorian 	if(inc_depth+1 > 100000) {
71ae8c6e27Sflorian 		ub_c_error_msg("too many include files");
72ae8c6e27Sflorian 		return;
73ae8c6e27Sflorian 	}
74ae8c6e27Sflorian 	if(*filename == '\0') {
75ae8c6e27Sflorian 		ub_c_error_msg("empty include file name");
76ae8c6e27Sflorian 		return;
77ae8c6e27Sflorian 	}
78ae8c6e27Sflorian 	s = (struct inc_state*)malloc(sizeof(*s));
79ae8c6e27Sflorian 	if(!s) {
80ae8c6e27Sflorian 		ub_c_error_msg("include %s: malloc failure", filename);
81ae8c6e27Sflorian 		return;
82ae8c6e27Sflorian 	}
83ae8c6e27Sflorian 	if(cfg_parser->chroot && strncmp(filename, cfg_parser->chroot,
84ae8c6e27Sflorian 		strlen(cfg_parser->chroot)) == 0) {
85ae8c6e27Sflorian 		filename += strlen(cfg_parser->chroot);
86ae8c6e27Sflorian 	}
87ae8c6e27Sflorian 	nm = strdup(filename);
88ae8c6e27Sflorian 	if(!nm) {
89ae8c6e27Sflorian 		ub_c_error_msg("include %s: strdup failure", filename);
90ae8c6e27Sflorian 		free(s);
91ae8c6e27Sflorian 		return;
92ae8c6e27Sflorian 	}
93ae8c6e27Sflorian 	input = fopen(filename, "r");
94ae8c6e27Sflorian 	if(!input) {
95ae8c6e27Sflorian 		ub_c_error_msg("cannot open include file '%s': %s",
96ae8c6e27Sflorian 			filename, strerror(errno));
97ae8c6e27Sflorian 		free(s);
98ae8c6e27Sflorian 		free(nm);
99ae8c6e27Sflorian 		return;
100ae8c6e27Sflorian 	}
101ae8c6e27Sflorian 	LEXOUT(("switch_to_include_file(%s)\n", filename));
102e47fef9eSflorian 	inc_depth++;
103ae8c6e27Sflorian 	s->filename = cfg_parser->filename;
104ae8c6e27Sflorian 	s->line = cfg_parser->line;
105ae8c6e27Sflorian 	s->buffer = YY_CURRENT_BUFFER;
106e47fef9eSflorian 	s->inc_toplevel = inc_toplevel;
107ae8c6e27Sflorian 	s->next = config_include_stack;
108ae8c6e27Sflorian 	config_include_stack = s;
109ae8c6e27Sflorian 	cfg_parser->filename = nm;
110ae8c6e27Sflorian 	cfg_parser->line = 1;
111e47fef9eSflorian 	inc_toplevel = toplevel;
112ae8c6e27Sflorian 	yy_switch_to_buffer(yy_create_buffer(input, YY_BUF_SIZE));
113ae8c6e27Sflorian }
114ae8c6e27Sflorian 
115e47fef9eSflorian static void config_start_include_glob(const char* filename, int toplevel)
116ae8c6e27Sflorian {
117ae8c6e27Sflorian 
118ae8c6e27Sflorian 	/* check for wildcards */
119ae8c6e27Sflorian #ifdef HAVE_GLOB
120ae8c6e27Sflorian 	glob_t g;
12157403691Sflorian 	int i, r, flags;
122ae8c6e27Sflorian 	if(!(!strchr(filename, '*') && !strchr(filename, '?') && !strchr(filename, '[') &&
123ae8c6e27Sflorian 		!strchr(filename, '{') && !strchr(filename, '~'))) {
124ae8c6e27Sflorian 		flags = 0
125ae8c6e27Sflorian #ifdef GLOB_ERR
126ae8c6e27Sflorian 			| GLOB_ERR
127ae8c6e27Sflorian #endif
128ae8c6e27Sflorian 			 /* do not set GLOB_NOSORT so the results are sorted
129ae8c6e27Sflorian 			    and in a predictable order. */
130ae8c6e27Sflorian #ifdef GLOB_BRACE
131ae8c6e27Sflorian 			| GLOB_BRACE
132ae8c6e27Sflorian #endif
133ae8c6e27Sflorian #ifdef GLOB_TILDE
134ae8c6e27Sflorian 			| GLOB_TILDE
135ae8c6e27Sflorian #endif
136ae8c6e27Sflorian 		;
137ae8c6e27Sflorian 		memset(&g, 0, sizeof(g));
138ae8c6e27Sflorian 		if(cfg_parser->chroot && strncmp(filename, cfg_parser->chroot,
139ae8c6e27Sflorian 			strlen(cfg_parser->chroot)) == 0) {
140ae8c6e27Sflorian 			filename += strlen(cfg_parser->chroot);
141ae8c6e27Sflorian 		}
142ae8c6e27Sflorian 		r = glob(filename, flags, NULL, &g);
143ae8c6e27Sflorian 		if(r) {
144ae8c6e27Sflorian 			/* some error */
145ae8c6e27Sflorian 			globfree(&g);
146ae8c6e27Sflorian 			if(r == GLOB_NOMATCH)
147ae8c6e27Sflorian 				return; /* no matches for pattern */
148e47fef9eSflorian 			config_start_include(filename, toplevel); /* let original deal with it */
149ae8c6e27Sflorian 			return;
150ae8c6e27Sflorian 		}
151ae8c6e27Sflorian 		/* process files found, if any */
15257403691Sflorian 		for(i=(int)g.gl_pathc-1; i>=0; i--) {
153e47fef9eSflorian 			config_start_include(g.gl_pathv[i], toplevel);
154ae8c6e27Sflorian 		}
155ae8c6e27Sflorian 		globfree(&g);
156ae8c6e27Sflorian 		return;
157ae8c6e27Sflorian 	}
158ae8c6e27Sflorian #endif /* HAVE_GLOB */
159ae8c6e27Sflorian 
160e47fef9eSflorian 	config_start_include(filename, toplevel);
161ae8c6e27Sflorian }
162ae8c6e27Sflorian 
163ae8c6e27Sflorian static void config_end_include(void)
164ae8c6e27Sflorian {
165ae8c6e27Sflorian 	struct inc_state* s = config_include_stack;
166ae8c6e27Sflorian 	--inc_depth;
167ae8c6e27Sflorian 	if(!s) return;
168ae8c6e27Sflorian 	free(cfg_parser->filename);
169ae8c6e27Sflorian 	cfg_parser->filename = s->filename;
170ae8c6e27Sflorian 	cfg_parser->line = s->line;
171ae8c6e27Sflorian 	yy_delete_buffer(YY_CURRENT_BUFFER);
172ae8c6e27Sflorian 	yy_switch_to_buffer(s->buffer);
173ae8c6e27Sflorian 	config_include_stack = s->next;
174e47fef9eSflorian 	inc_toplevel = s->inc_toplevel;
175ae8c6e27Sflorian 	free(s);
176ae8c6e27Sflorian }
177ae8c6e27Sflorian 
178ae8c6e27Sflorian #ifndef yy_set_bol /* compat definition, for flex 2.4.6 */
179ae8c6e27Sflorian #define yy_set_bol(at_bol) \
180ae8c6e27Sflorian         { \
181ae8c6e27Sflorian 	        if ( ! yy_current_buffer ) \
182ae8c6e27Sflorian 	                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
183ae8c6e27Sflorian 	        yy_current_buffer->yy_ch_buf[0] = ((at_bol)?'\n':' '); \
184ae8c6e27Sflorian         }
185ae8c6e27Sflorian #endif
186ae8c6e27Sflorian 
187ae8c6e27Sflorian %}
188ae8c6e27Sflorian %option noinput
189ae8c6e27Sflorian %option nounput
190ae8c6e27Sflorian %{
191ae8c6e27Sflorian #ifndef YY_NO_UNPUT
192ae8c6e27Sflorian #define YY_NO_UNPUT 1
193ae8c6e27Sflorian #endif
194ae8c6e27Sflorian #ifndef YY_NO_INPUT
195ae8c6e27Sflorian #define YY_NO_INPUT 1
196ae8c6e27Sflorian #endif
197ae8c6e27Sflorian %}
198ae8c6e27Sflorian 
199ae8c6e27Sflorian SPACE   [ \t]
200ae8c6e27Sflorian LETTER  [a-zA-Z]
201ae8c6e27Sflorian UNQUOTEDLETTER [^\'\"\n\r \t\\]|\\.
202ae8c6e27Sflorian UNQUOTEDLETTER_NOCOLON [^\:\'\"\n\r \t\\]|\\.
203ae8c6e27Sflorian NEWLINE [\r\n]
204ae8c6e27Sflorian COMMENT \#
205ae8c6e27Sflorian COLON 	\:
206ae8c6e27Sflorian DQANY     [^\"\n\r\\]|\\.
207ae8c6e27Sflorian SQANY     [^\'\n\r\\]|\\.
208ae8c6e27Sflorian 
209e47fef9eSflorian %x	quotedstring singlequotedstr include include_quoted val include_toplevel include_toplevel_quoted
210ae8c6e27Sflorian 
211ae8c6e27Sflorian %%
212ae8c6e27Sflorian <INITIAL,val>{SPACE}*	{
213ae8c6e27Sflorian 	LEXOUT(("SP ")); /* ignore */ }
214ae8c6e27Sflorian <INITIAL,val>{SPACE}*{COMMENT}.*	{
215ae8c6e27Sflorian 	/* note that flex makes the longest match and '.' is any but not nl */
216ae8c6e27Sflorian 	LEXOUT(("comment(%s) ", yytext)); /* ignore */ }
217ae8c6e27Sflorian server{COLON}			{ YDVAR(0, VAR_SERVER) }
218ae8c6e27Sflorian qname-minimisation{COLON}	{ YDVAR(1, VAR_QNAME_MINIMISATION) }
219ae8c6e27Sflorian qname-minimisation-strict{COLON} { YDVAR(1, VAR_QNAME_MINIMISATION_STRICT) }
220ae8c6e27Sflorian num-threads{COLON}		{ YDVAR(1, VAR_NUM_THREADS) }
221ae8c6e27Sflorian verbosity{COLON}		{ YDVAR(1, VAR_VERBOSITY) }
222ae8c6e27Sflorian port{COLON}			{ YDVAR(1, VAR_PORT) }
223ae8c6e27Sflorian outgoing-range{COLON}		{ YDVAR(1, VAR_OUTGOING_RANGE) }
224ae8c6e27Sflorian outgoing-port-permit{COLON}	{ YDVAR(1, VAR_OUTGOING_PORT_PERMIT) }
225ae8c6e27Sflorian outgoing-port-avoid{COLON}	{ YDVAR(1, VAR_OUTGOING_PORT_AVOID) }
226ae8c6e27Sflorian outgoing-num-tcp{COLON}		{ YDVAR(1, VAR_OUTGOING_NUM_TCP) }
227ae8c6e27Sflorian incoming-num-tcp{COLON}		{ YDVAR(1, VAR_INCOMING_NUM_TCP) }
228ae8c6e27Sflorian do-ip4{COLON}			{ YDVAR(1, VAR_DO_IP4) }
229ae8c6e27Sflorian do-ip6{COLON}			{ YDVAR(1, VAR_DO_IP6) }
230d500c338Sflorian do-nat64{COLON}			{ YDVAR(1, VAR_DO_NAT64) }
231e47fef9eSflorian prefer-ip4{COLON}		{ YDVAR(1, VAR_PREFER_IP4) }
232ae8c6e27Sflorian prefer-ip6{COLON}		{ YDVAR(1, VAR_PREFER_IP6) }
233ae8c6e27Sflorian do-udp{COLON}			{ YDVAR(1, VAR_DO_UDP) }
234ae8c6e27Sflorian do-tcp{COLON}			{ YDVAR(1, VAR_DO_TCP) }
235ae8c6e27Sflorian tcp-upstream{COLON}		{ YDVAR(1, VAR_TCP_UPSTREAM) }
236ae8c6e27Sflorian tcp-mss{COLON}			{ YDVAR(1, VAR_TCP_MSS) }
237ae8c6e27Sflorian outgoing-tcp-mss{COLON}		{ YDVAR(1, VAR_OUTGOING_TCP_MSS) }
238ae8c6e27Sflorian tcp-idle-timeout{COLON}		{ YDVAR(1, VAR_TCP_IDLE_TIMEOUT) }
239411c5950Sflorian max-reuse-tcp-queries{COLON}	{ YDVAR(1, VAR_MAX_REUSE_TCP_QUERIES) }
240411c5950Sflorian tcp-reuse-timeout{COLON}	{ YDVAR(1, VAR_TCP_REUSE_TIMEOUT) }
241411c5950Sflorian tcp-auth-query-timeout{COLON}	{ YDVAR(1, VAR_TCP_AUTH_QUERY_TIMEOUT) }
242ae8c6e27Sflorian edns-tcp-keepalive{COLON}	{ YDVAR(1, VAR_EDNS_TCP_KEEPALIVE) }
243ae8c6e27Sflorian edns-tcp-keepalive-timeout{COLON} { YDVAR(1, VAR_EDNS_TCP_KEEPALIVE_TIMEOUT) }
244d500c338Sflorian sock-queue-timeout{COLON} { YDVAR(1, VAR_SOCK_QUEUE_TIMEOUT) }
245ae8c6e27Sflorian ssl-upstream{COLON}		{ YDVAR(1, VAR_SSL_UPSTREAM) }
246ae8c6e27Sflorian tls-upstream{COLON}		{ YDVAR(1, VAR_SSL_UPSTREAM) }
247ae8c6e27Sflorian ssl-service-key{COLON}		{ YDVAR(1, VAR_SSL_SERVICE_KEY) }
248ae8c6e27Sflorian tls-service-key{COLON}		{ YDVAR(1, VAR_SSL_SERVICE_KEY) }
249ae8c6e27Sflorian ssl-service-pem{COLON}		{ YDVAR(1, VAR_SSL_SERVICE_PEM) }
250ae8c6e27Sflorian tls-service-pem{COLON}		{ YDVAR(1, VAR_SSL_SERVICE_PEM) }
251ae8c6e27Sflorian ssl-port{COLON}			{ YDVAR(1, VAR_SSL_PORT) }
252ae8c6e27Sflorian tls-port{COLON}			{ YDVAR(1, VAR_SSL_PORT) }
253ae8c6e27Sflorian ssl-cert-bundle{COLON}		{ YDVAR(1, VAR_TLS_CERT_BUNDLE) }
254ae8c6e27Sflorian tls-cert-bundle{COLON}		{ YDVAR(1, VAR_TLS_CERT_BUNDLE) }
255ae8c6e27Sflorian tls-win-cert{COLON}		{ YDVAR(1, VAR_TLS_WIN_CERT) }
2567a05b9dfSflorian tls-system-cert{COLON}		{ YDVAR(1, VAR_TLS_WIN_CERT) }
257ae8c6e27Sflorian additional-ssl-port{COLON}	{ YDVAR(1, VAR_TLS_ADDITIONAL_PORT) }
258ae8c6e27Sflorian additional-tls-port{COLON}	{ YDVAR(1, VAR_TLS_ADDITIONAL_PORT) }
259ae8c6e27Sflorian tls-additional-ports{COLON}	{ YDVAR(1, VAR_TLS_ADDITIONAL_PORT) }
260ae8c6e27Sflorian tls-additional-port{COLON}	{ YDVAR(1, VAR_TLS_ADDITIONAL_PORT) }
261e97c6e54Ssthen tls-session-ticket-keys{COLON}	{ YDVAR(1, VAR_TLS_SESSION_TICKET_KEYS) }
262e97c6e54Ssthen tls-ciphers{COLON}		{ YDVAR(1, VAR_TLS_CIPHERS) }
263e97c6e54Ssthen tls-ciphersuites{COLON}		{ YDVAR(1, VAR_TLS_CIPHERSUITES) }
264e47fef9eSflorian tls-use-sni{COLON}		{ YDVAR(1, VAR_TLS_USE_SNI) }
265f4f0f0ceSflorian https-port{COLON}		{ YDVAR(1, VAR_HTTPS_PORT) }
266f4f0f0ceSflorian http-endpoint{COLON}		{ YDVAR(1, VAR_HTTP_ENDPOINT) }
267f4f0f0ceSflorian http-max-streams{COLON}		{ YDVAR(1, VAR_HTTP_MAX_STREAMS) }
268f4f0f0ceSflorian http-query-buffer-size{COLON}	{ YDVAR(1, VAR_HTTP_QUERY_BUFFER_SIZE) }
269f4f0f0ceSflorian http-response-buffer-size{COLON} { YDVAR(1, VAR_HTTP_RESPONSE_BUFFER_SIZE) }
270f4f0f0ceSflorian http-nodelay{COLON}		{ YDVAR(1, VAR_HTTP_NODELAY) }
271853e076fSflorian http-notls-downstream{COLON}	{ YDVAR(1, VAR_HTTP_NOTLS_DOWNSTREAM) }
272ae8c6e27Sflorian use-systemd{COLON}		{ YDVAR(1, VAR_USE_SYSTEMD) }
273ae8c6e27Sflorian do-daemonize{COLON}		{ YDVAR(1, VAR_DO_DAEMONIZE) }
274ae8c6e27Sflorian interface{COLON}		{ YDVAR(1, VAR_INTERFACE) }
275ae8c6e27Sflorian ip-address{COLON}		{ YDVAR(1, VAR_INTERFACE) }
276ae8c6e27Sflorian outgoing-interface{COLON}	{ YDVAR(1, VAR_OUTGOING_INTERFACE) }
277ae8c6e27Sflorian interface-automatic{COLON}	{ YDVAR(1, VAR_INTERFACE_AUTOMATIC) }
2787a05b9dfSflorian interface-automatic-ports{COLON} { YDVAR(1, VAR_INTERFACE_AUTOMATIC_PORTS) }
279ae8c6e27Sflorian so-rcvbuf{COLON}		{ YDVAR(1, VAR_SO_RCVBUF) }
280ae8c6e27Sflorian so-sndbuf{COLON}		{ YDVAR(1, VAR_SO_SNDBUF) }
281ae8c6e27Sflorian so-reuseport{COLON}		{ YDVAR(1, VAR_SO_REUSEPORT) }
282ae8c6e27Sflorian ip-transparent{COLON}		{ YDVAR(1, VAR_IP_TRANSPARENT) }
283ae8c6e27Sflorian ip-freebind{COLON}		{ YDVAR(1, VAR_IP_FREEBIND) }
284e47fef9eSflorian ip-dscp{COLON}		{ YDVAR(1, VAR_IP_DSCP) }
285ae8c6e27Sflorian chroot{COLON}			{ YDVAR(1, VAR_CHROOT) }
286ae8c6e27Sflorian username{COLON}			{ YDVAR(1, VAR_USERNAME) }
287ae8c6e27Sflorian directory{COLON}		{ YDVAR(1, VAR_DIRECTORY) }
288ae8c6e27Sflorian logfile{COLON}			{ YDVAR(1, VAR_LOGFILE) }
289ae8c6e27Sflorian pidfile{COLON}			{ YDVAR(1, VAR_PIDFILE) }
290ae8c6e27Sflorian root-hints{COLON}		{ YDVAR(1, VAR_ROOT_HINTS) }
291e97c6e54Ssthen stream-wait-size{COLON}		{ YDVAR(1, VAR_STREAM_WAIT_SIZE) }
292ae8c6e27Sflorian edns-buffer-size{COLON}		{ YDVAR(1, VAR_EDNS_BUFFER_SIZE) }
293ae8c6e27Sflorian msg-buffer-size{COLON}		{ YDVAR(1, VAR_MSG_BUFFER_SIZE) }
294ae8c6e27Sflorian msg-cache-size{COLON}		{ YDVAR(1, VAR_MSG_CACHE_SIZE) }
295ae8c6e27Sflorian msg-cache-slabs{COLON}		{ YDVAR(1, VAR_MSG_CACHE_SLABS) }
296ae8c6e27Sflorian rrset-cache-size{COLON}		{ YDVAR(1, VAR_RRSET_CACHE_SIZE) }
297ae8c6e27Sflorian rrset-cache-slabs{COLON}	{ YDVAR(1, VAR_RRSET_CACHE_SLABS) }
298ae8c6e27Sflorian cache-max-ttl{COLON}     	{ YDVAR(1, VAR_CACHE_MAX_TTL) }
299ae8c6e27Sflorian cache-max-negative-ttl{COLON}   { YDVAR(1, VAR_CACHE_MAX_NEGATIVE_TTL) }
300096314feSflorian cache-min-negative-ttl{COLON}   { YDVAR(1, VAR_CACHE_MIN_NEGATIVE_TTL) }
301ae8c6e27Sflorian cache-min-ttl{COLON}     	{ YDVAR(1, VAR_CACHE_MIN_TTL) }
302ae8c6e27Sflorian infra-host-ttl{COLON}		{ YDVAR(1, VAR_INFRA_HOST_TTL) }
303ae8c6e27Sflorian infra-lame-ttl{COLON}		{ YDVAR(1, VAR_INFRA_LAME_TTL) }
304ae8c6e27Sflorian infra-cache-slabs{COLON}	{ YDVAR(1, VAR_INFRA_CACHE_SLABS) }
305ae8c6e27Sflorian infra-cache-numhosts{COLON}	{ YDVAR(1, VAR_INFRA_CACHE_NUMHOSTS) }
306ae8c6e27Sflorian infra-cache-lame-size{COLON}	{ YDVAR(1, VAR_INFRA_CACHE_LAME_SIZE) }
307ae8c6e27Sflorian infra-cache-min-rtt{COLON}	{ YDVAR(1, VAR_INFRA_CACHE_MIN_RTT) }
3086d08cb1bSflorian infra-cache-max-rtt{COLON}	{ YDVAR(1, VAR_INFRA_CACHE_MAX_RTT) }
309853e076fSflorian infra-keep-probing{COLON}	{ YDVAR(1, VAR_INFRA_KEEP_PROBING) }
310ae8c6e27Sflorian num-queries-per-thread{COLON}	{ YDVAR(1, VAR_NUM_QUERIES_PER_THREAD) }
311ae8c6e27Sflorian jostle-timeout{COLON}		{ YDVAR(1, VAR_JOSTLE_TIMEOUT) }
312ae8c6e27Sflorian delay-close{COLON}		{ YDVAR(1, VAR_DELAY_CLOSE) }
313853e076fSflorian udp-connect{COLON}		{ YDVAR(1, VAR_UDP_CONNECT) }
314ae8c6e27Sflorian target-fetch-policy{COLON}	{ YDVAR(1, VAR_TARGET_FETCH_POLICY) }
315ae8c6e27Sflorian harden-short-bufsize{COLON}	{ YDVAR(1, VAR_HARDEN_SHORT_BUFSIZE) }
316ae8c6e27Sflorian harden-large-queries{COLON}	{ YDVAR(1, VAR_HARDEN_LARGE_QUERIES) }
317ae8c6e27Sflorian harden-glue{COLON}		{ YDVAR(1, VAR_HARDEN_GLUE) }
318ae8c6e27Sflorian harden-dnssec-stripped{COLON}	{ YDVAR(1, VAR_HARDEN_DNSSEC_STRIPPED) }
319ae8c6e27Sflorian harden-below-nxdomain{COLON}	{ YDVAR(1, VAR_HARDEN_BELOW_NXDOMAIN) }
320ae8c6e27Sflorian harden-referral-path{COLON}	{ YDVAR(1, VAR_HARDEN_REFERRAL_PATH) }
321ae8c6e27Sflorian harden-algo-downgrade{COLON}	{ YDVAR(1, VAR_HARDEN_ALGO_DOWNGRADE) }
322d500c338Sflorian harden-unknown-additional{COLON}	{ YDVAR(1, VAR_HARDEN_UNKNOWN_ADDITIONAL) }
323ae8c6e27Sflorian use-caps-for-id{COLON}		{ YDVAR(1, VAR_USE_CAPS_FOR_ID) }
324ae8c6e27Sflorian caps-whitelist{COLON}		{ YDVAR(1, VAR_CAPS_WHITELIST) }
325f4f0f0ceSflorian caps-exempt{COLON}		{ YDVAR(1, VAR_CAPS_WHITELIST) }
326ae8c6e27Sflorian unwanted-reply-threshold{COLON}	{ YDVAR(1, VAR_UNWANTED_REPLY_THRESHOLD) }
327ae8c6e27Sflorian private-address{COLON}		{ YDVAR(1, VAR_PRIVATE_ADDRESS) }
328ae8c6e27Sflorian private-domain{COLON}		{ YDVAR(1, VAR_PRIVATE_DOMAIN) }
329ae8c6e27Sflorian prefetch-key{COLON}		{ YDVAR(1, VAR_PREFETCH_KEY) }
330ae8c6e27Sflorian prefetch{COLON}			{ YDVAR(1, VAR_PREFETCH) }
331ae8c6e27Sflorian deny-any{COLON}			{ YDVAR(1, VAR_DENY_ANY) }
332ae8c6e27Sflorian stub-zone{COLON}		{ YDVAR(0, VAR_STUB_ZONE) }
333ae8c6e27Sflorian name{COLON}			{ YDVAR(1, VAR_NAME) }
334ae8c6e27Sflorian stub-addr{COLON}		{ YDVAR(1, VAR_STUB_ADDR) }
335ae8c6e27Sflorian stub-host{COLON}		{ YDVAR(1, VAR_STUB_HOST) }
336ae8c6e27Sflorian stub-prime{COLON}		{ YDVAR(1, VAR_STUB_PRIME) }
337ae8c6e27Sflorian stub-first{COLON}		{ YDVAR(1, VAR_STUB_FIRST) }
338ae8c6e27Sflorian stub-no-cache{COLON}		{ YDVAR(1, VAR_STUB_NO_CACHE) }
339ae8c6e27Sflorian stub-ssl-upstream{COLON}	{ YDVAR(1, VAR_STUB_SSL_UPSTREAM) }
340ae8c6e27Sflorian stub-tls-upstream{COLON}	{ YDVAR(1, VAR_STUB_SSL_UPSTREAM) }
341a1a7ba80Sflorian stub-tcp-upstream{COLON}	{ YDVAR(1, VAR_STUB_TCP_UPSTREAM) }
342ae8c6e27Sflorian forward-zone{COLON}		{ YDVAR(0, VAR_FORWARD_ZONE) }
343ae8c6e27Sflorian forward-addr{COLON}		{ YDVAR(1, VAR_FORWARD_ADDR) }
344ae8c6e27Sflorian forward-host{COLON}		{ YDVAR(1, VAR_FORWARD_HOST) }
345ae8c6e27Sflorian forward-first{COLON}		{ YDVAR(1, VAR_FORWARD_FIRST) }
346ae8c6e27Sflorian forward-no-cache{COLON}		{ YDVAR(1, VAR_FORWARD_NO_CACHE) }
347ae8c6e27Sflorian forward-ssl-upstream{COLON}	{ YDVAR(1, VAR_FORWARD_SSL_UPSTREAM) }
348ae8c6e27Sflorian forward-tls-upstream{COLON}	{ YDVAR(1, VAR_FORWARD_SSL_UPSTREAM) }
349a1a7ba80Sflorian forward-tcp-upstream{COLON}	{ YDVAR(1, VAR_FORWARD_TCP_UPSTREAM) }
350ae8c6e27Sflorian auth-zone{COLON}		{ YDVAR(0, VAR_AUTH_ZONE) }
351d32eb43cSflorian rpz{COLON}			{ YDVAR(0, VAR_RPZ) }
352d32eb43cSflorian tags{COLON}			{ YDVAR(1, VAR_TAGS) }
353d32eb43cSflorian rpz-action-override{COLON}	{ YDVAR(1, VAR_RPZ_ACTION_OVERRIDE) }
354d32eb43cSflorian rpz-cname-override{COLON}	{ YDVAR(1, VAR_RPZ_CNAME_OVERRIDE) }
355d32eb43cSflorian rpz-log{COLON}			{ YDVAR(1, VAR_RPZ_LOG) }
356d32eb43cSflorian rpz-log-name{COLON}		{ YDVAR(1, VAR_RPZ_LOG_NAME) }
357a1a7ba80Sflorian rpz-signal-nxdomain-ra{COLON}	{ YDVAR(1, VAR_RPZ_SIGNAL_NXDOMAIN_RA) }
358ae8c6e27Sflorian zonefile{COLON}			{ YDVAR(1, VAR_ZONEFILE) }
359ae8c6e27Sflorian master{COLON}			{ YDVAR(1, VAR_MASTER) }
360f4f0f0ceSflorian primary{COLON}			{ YDVAR(1, VAR_MASTER) }
361ae8c6e27Sflorian url{COLON}			{ YDVAR(1, VAR_URL) }
362ae8c6e27Sflorian allow-notify{COLON}		{ YDVAR(1, VAR_ALLOW_NOTIFY) }
363ae8c6e27Sflorian for-downstream{COLON}		{ YDVAR(1, VAR_FOR_DOWNSTREAM) }
364ae8c6e27Sflorian for-upstream{COLON}		{ YDVAR(1, VAR_FOR_UPSTREAM) }
365ae8c6e27Sflorian fallback-enabled{COLON}		{ YDVAR(1, VAR_FALLBACK_ENABLED) }
366ae8c6e27Sflorian view{COLON}			{ YDVAR(0, VAR_VIEW) }
367ae8c6e27Sflorian view-first{COLON}		{ YDVAR(1, VAR_VIEW_FIRST) }
368ae8c6e27Sflorian do-not-query-address{COLON}	{ YDVAR(1, VAR_DO_NOT_QUERY_ADDRESS) }
369ae8c6e27Sflorian do-not-query-localhost{COLON}	{ YDVAR(1, VAR_DO_NOT_QUERY_LOCALHOST) }
370ae8c6e27Sflorian access-control{COLON}		{ YDVAR(2, VAR_ACCESS_CONTROL) }
3715c45b740Sflorian interface-action{COLON}		{ YDVAR(2, VAR_INTERFACE_ACTION) }
372ae8c6e27Sflorian send-client-subnet{COLON}	{ YDVAR(1, VAR_SEND_CLIENT_SUBNET) }
373ae8c6e27Sflorian client-subnet-zone{COLON}	{ YDVAR(1, VAR_CLIENT_SUBNET_ZONE) }
374ae8c6e27Sflorian client-subnet-always-forward{COLON} { YDVAR(1, VAR_CLIENT_SUBNET_ALWAYS_FORWARD) }
375ae8c6e27Sflorian client-subnet-opcode{COLON}	{ YDVAR(1, VAR_CLIENT_SUBNET_OPCODE) }
376ae8c6e27Sflorian max-client-subnet-ipv4{COLON}	{ YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV4) }
377ae8c6e27Sflorian max-client-subnet-ipv6{COLON}	{ YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV6) }
378ae8c6e27Sflorian min-client-subnet-ipv4{COLON}	{ YDVAR(1, VAR_MIN_CLIENT_SUBNET_IPV4) }
379ae8c6e27Sflorian min-client-subnet-ipv6{COLON}	{ YDVAR(1, VAR_MIN_CLIENT_SUBNET_IPV6) }
380ae8c6e27Sflorian max-ecs-tree-size-ipv4{COLON}	{ YDVAR(1, VAR_MAX_ECS_TREE_SIZE_IPV4) }
381ae8c6e27Sflorian max-ecs-tree-size-ipv6{COLON}	{ YDVAR(1, VAR_MAX_ECS_TREE_SIZE_IPV6) }
382ae8c6e27Sflorian hide-identity{COLON}		{ YDVAR(1, VAR_HIDE_IDENTITY) }
383ae8c6e27Sflorian hide-version{COLON}		{ YDVAR(1, VAR_HIDE_VERSION) }
384ae8c6e27Sflorian hide-trustanchor{COLON}		{ YDVAR(1, VAR_HIDE_TRUSTANCHOR) }
385411c5950Sflorian hide-http-user-agent{COLON}		{ YDVAR(1, VAR_HIDE_HTTP_USER_AGENT) }
386ae8c6e27Sflorian identity{COLON}			{ YDVAR(1, VAR_IDENTITY) }
387ae8c6e27Sflorian version{COLON}			{ YDVAR(1, VAR_VERSION) }
388411c5950Sflorian http-user-agent{COLON}			{ YDVAR(1, VAR_HTTP_USER_AGENT) }
389ae8c6e27Sflorian module-config{COLON}     	{ YDVAR(1, VAR_MODULE_CONF) }
390ae8c6e27Sflorian dlv-anchor{COLON}		{ YDVAR(1, VAR_DLV_ANCHOR) }
391ae8c6e27Sflorian dlv-anchor-file{COLON}		{ YDVAR(1, VAR_DLV_ANCHOR_FILE) }
392ae8c6e27Sflorian trust-anchor-file{COLON}	{ YDVAR(1, VAR_TRUST_ANCHOR_FILE) }
393ae8c6e27Sflorian auto-trust-anchor-file{COLON}	{ YDVAR(1, VAR_AUTO_TRUST_ANCHOR_FILE) }
394ae8c6e27Sflorian trusted-keys-file{COLON}	{ YDVAR(1, VAR_TRUSTED_KEYS_FILE) }
395ae8c6e27Sflorian trust-anchor{COLON}		{ YDVAR(1, VAR_TRUST_ANCHOR) }
396ae8c6e27Sflorian trust-anchor-signaling{COLON}	{ YDVAR(1, VAR_TRUST_ANCHOR_SIGNALING) }
397ae8c6e27Sflorian root-key-sentinel{COLON}	{ YDVAR(1, VAR_ROOT_KEY_SENTINEL) }
398ae8c6e27Sflorian val-override-date{COLON}	{ YDVAR(1, VAR_VAL_OVERRIDE_DATE) }
399ae8c6e27Sflorian val-sig-skew-min{COLON}		{ YDVAR(1, VAR_VAL_SIG_SKEW_MIN) }
400ae8c6e27Sflorian val-sig-skew-max{COLON}		{ YDVAR(1, VAR_VAL_SIG_SKEW_MAX) }
401411c5950Sflorian val-max-restart{COLON}		{ YDVAR(1, VAR_VAL_MAX_RESTART) }
402ae8c6e27Sflorian val-bogus-ttl{COLON}		{ YDVAR(1, VAR_BOGUS_TTL) }
403ae8c6e27Sflorian val-clean-additional{COLON}	{ YDVAR(1, VAR_VAL_CLEAN_ADDITIONAL) }
404ae8c6e27Sflorian val-permissive-mode{COLON}	{ YDVAR(1, VAR_VAL_PERMISSIVE_MODE) }
405ae8c6e27Sflorian aggressive-nsec{COLON}		{ YDVAR(1, VAR_AGGRESSIVE_NSEC) }
406ae8c6e27Sflorian ignore-cd-flag{COLON}		{ YDVAR(1, VAR_IGNORE_CD_FLAG) }
40754cc57acSflorian disable-edns-do{COLON}		{ YDVAR(1, VAR_DISABLE_EDNS_DO) }
408ae8c6e27Sflorian serve-expired{COLON}		{ YDVAR(1, VAR_SERVE_EXPIRED) }
409ae8c6e27Sflorian serve-expired-ttl{COLON}	{ YDVAR(1, VAR_SERVE_EXPIRED_TTL) }
410ae8c6e27Sflorian serve-expired-ttl-reset{COLON}	{ YDVAR(1, VAR_SERVE_EXPIRED_TTL_RESET) }
411d32eb43cSflorian serve-expired-reply-ttl{COLON}	{ YDVAR(1, VAR_SERVE_EXPIRED_REPLY_TTL) }
412d32eb43cSflorian serve-expired-client-timeout{COLON}	{ YDVAR(1, VAR_SERVE_EXPIRED_CLIENT_TIMEOUT) }
4137a05b9dfSflorian ede-serve-expired{COLON}	{ YDVAR(1, VAR_EDE_SERVE_EXPIRED) }
414a8eaceedSflorian serve-original-ttl{COLON}	{ YDVAR(1, VAR_SERVE_ORIGINAL_TTL) }
415ae8c6e27Sflorian fake-dsa{COLON}			{ YDVAR(1, VAR_FAKE_DSA) }
416ae8c6e27Sflorian fake-sha1{COLON}		{ YDVAR(1, VAR_FAKE_SHA1) }
417ae8c6e27Sflorian val-log-level{COLON}		{ YDVAR(1, VAR_VAL_LOG_LEVEL) }
418ae8c6e27Sflorian key-cache-size{COLON}		{ YDVAR(1, VAR_KEY_CACHE_SIZE) }
419ae8c6e27Sflorian key-cache-slabs{COLON}		{ YDVAR(1, VAR_KEY_CACHE_SLABS) }
420ae8c6e27Sflorian neg-cache-size{COLON}		{ YDVAR(1, VAR_NEG_CACHE_SIZE) }
421ae8c6e27Sflorian val-nsec3-keysize-iterations{COLON}	{
422ae8c6e27Sflorian 				  YDVAR(1, VAR_VAL_NSEC3_KEYSIZE_ITERATIONS) }
423411c5950Sflorian zonemd-permissive-mode{COLON}	{ YDVAR(1, VAR_ZONEMD_PERMISSIVE_MODE) }
424411c5950Sflorian zonemd-check{COLON}		{ YDVAR(1, VAR_ZONEMD_CHECK) }
425411c5950Sflorian zonemd-reject-absence{COLON}	{ YDVAR(1, VAR_ZONEMD_REJECT_ABSENCE) }
426ae8c6e27Sflorian add-holddown{COLON}		{ YDVAR(1, VAR_ADD_HOLDDOWN) }
427ae8c6e27Sflorian del-holddown{COLON}		{ YDVAR(1, VAR_DEL_HOLDDOWN) }
428ae8c6e27Sflorian keep-missing{COLON}		{ YDVAR(1, VAR_KEEP_MISSING) }
429ae8c6e27Sflorian permit-small-holddown{COLON}	{ YDVAR(1, VAR_PERMIT_SMALL_HOLDDOWN) }
430ae8c6e27Sflorian use-syslog{COLON}		{ YDVAR(1, VAR_USE_SYSLOG) }
431ae8c6e27Sflorian log-identity{COLON}		{ YDVAR(1, VAR_LOG_IDENTITY) }
432ae8c6e27Sflorian log-time-ascii{COLON}		{ YDVAR(1, VAR_LOG_TIME_ASCII) }
433ae8c6e27Sflorian log-queries{COLON}		{ YDVAR(1, VAR_LOG_QUERIES) }
434ae8c6e27Sflorian log-replies{COLON}		{ YDVAR(1, VAR_LOG_REPLIES) }
435e97c6e54Ssthen log-tag-queryreply{COLON}	{ YDVAR(1, VAR_LOG_TAG_QUERYREPLY) }
436ae8c6e27Sflorian log-local-actions{COLON}       { YDVAR(1, VAR_LOG_LOCAL_ACTIONS) }
437ae8c6e27Sflorian log-servfail{COLON}		{ YDVAR(1, VAR_LOG_SERVFAIL) }
43854cc57acSflorian log-destaddr{COLON}		{ YDVAR(1, VAR_LOG_DESTADDR) }
439ae8c6e27Sflorian local-zone{COLON}		{ YDVAR(2, VAR_LOCAL_ZONE) }
440ae8c6e27Sflorian local-data{COLON}		{ YDVAR(1, VAR_LOCAL_DATA) }
441ae8c6e27Sflorian local-data-ptr{COLON}		{ YDVAR(1, VAR_LOCAL_DATA_PTR) }
442ae8c6e27Sflorian unblock-lan-zones{COLON}	{ YDVAR(1, VAR_UNBLOCK_LAN_ZONES) }
443ae8c6e27Sflorian insecure-lan-zones{COLON}	{ YDVAR(1, VAR_INSECURE_LAN_ZONES) }
444ae8c6e27Sflorian statistics-interval{COLON}	{ YDVAR(1, VAR_STATISTICS_INTERVAL) }
445ae8c6e27Sflorian statistics-cumulative{COLON}	{ YDVAR(1, VAR_STATISTICS_CUMULATIVE) }
446ae8c6e27Sflorian extended-statistics{COLON}	{ YDVAR(1, VAR_EXTENDED_STATISTICS) }
447d500c338Sflorian statistics-inhibit-zero{COLON}	{ YDVAR(1, VAR_STATISTICS_INHIBIT_ZERO) }
448ae8c6e27Sflorian shm-enable{COLON}		{ YDVAR(1, VAR_SHM_ENABLE) }
449ae8c6e27Sflorian shm-key{COLON}			{ YDVAR(1, VAR_SHM_KEY) }
450ae8c6e27Sflorian remote-control{COLON}		{ YDVAR(0, VAR_REMOTE_CONTROL) }
451ae8c6e27Sflorian control-enable{COLON}		{ YDVAR(1, VAR_CONTROL_ENABLE) }
452ae8c6e27Sflorian control-interface{COLON}	{ YDVAR(1, VAR_CONTROL_INTERFACE) }
453ae8c6e27Sflorian control-port{COLON}		{ YDVAR(1, VAR_CONTROL_PORT) }
454ae8c6e27Sflorian control-use-cert{COLON}		{ YDVAR(1, VAR_CONTROL_USE_CERT) }
455ae8c6e27Sflorian server-key-file{COLON}		{ YDVAR(1, VAR_SERVER_KEY_FILE) }
456ae8c6e27Sflorian server-cert-file{COLON}		{ YDVAR(1, VAR_SERVER_CERT_FILE) }
457ae8c6e27Sflorian control-key-file{COLON}		{ YDVAR(1, VAR_CONTROL_KEY_FILE) }
458ae8c6e27Sflorian control-cert-file{COLON}	{ YDVAR(1, VAR_CONTROL_CERT_FILE) }
459ae8c6e27Sflorian python-script{COLON}		{ YDVAR(1, VAR_PYTHON_SCRIPT) }
460ae8c6e27Sflorian python{COLON}			{ YDVAR(0, VAR_PYTHON) }
461e47fef9eSflorian dynlib-file{COLON}		{ YDVAR(1, VAR_DYNLIB_FILE) }
462e47fef9eSflorian dynlib{COLON}			{ YDVAR(0, VAR_DYNLIB) }
463ae8c6e27Sflorian domain-insecure{COLON}		{ YDVAR(1, VAR_DOMAIN_INSECURE) }
464ae8c6e27Sflorian minimal-responses{COLON}	{ YDVAR(1, VAR_MINIMAL_RESPONSES) }
465ae8c6e27Sflorian rrset-roundrobin{COLON}		{ YDVAR(1, VAR_RRSET_ROUNDROBIN) }
466ae8c6e27Sflorian unknown-server-time-limit{COLON} { YDVAR(1, VAR_UNKNOWN_SERVER_TIME_LIMIT) }
467096314feSflorian discard-timeout{COLON}		{ YDVAR(1, VAR_DISCARD_TIMEOUT) }
468096314feSflorian wait-limit{COLON}		{ YDVAR(1, VAR_WAIT_LIMIT) }
469096314feSflorian wait-limit-cookie{COLON}	{ YDVAR(1, VAR_WAIT_LIMIT_COOKIE) }
470096314feSflorian wait-limit-netblock{COLON}	{ YDVAR(1, VAR_WAIT_LIMIT_NETBLOCK) }
471096314feSflorian wait-limit-cookie-netblock{COLON} { YDVAR(1, VAR_WAIT_LIMIT_COOKIE_NETBLOCK) }
472ae8c6e27Sflorian max-udp-size{COLON}		{ YDVAR(1, VAR_MAX_UDP_SIZE) }
473ae8c6e27Sflorian dns64-prefix{COLON}		{ YDVAR(1, VAR_DNS64_PREFIX) }
474ae8c6e27Sflorian dns64-synthall{COLON}		{ YDVAR(1, VAR_DNS64_SYNTHALL) }
475ae8c6e27Sflorian dns64-ignore-aaaa{COLON}	{ YDVAR(1, VAR_DNS64_IGNORE_AAAA) }
476d500c338Sflorian nat64-prefix{COLON}		{ YDVAR(1, VAR_NAT64_PREFIX) }
477ae8c6e27Sflorian define-tag{COLON}		{ YDVAR(1, VAR_DEFINE_TAG) }
478ae8c6e27Sflorian local-zone-tag{COLON}		{ YDVAR(2, VAR_LOCAL_ZONE_TAG) }
479ae8c6e27Sflorian access-control-tag{COLON}	{ YDVAR(2, VAR_ACCESS_CONTROL_TAG) }
480ae8c6e27Sflorian access-control-tag-action{COLON} { YDVAR(3, VAR_ACCESS_CONTROL_TAG_ACTION) }
481ae8c6e27Sflorian access-control-tag-data{COLON}	{ YDVAR(3, VAR_ACCESS_CONTROL_TAG_DATA) }
482ae8c6e27Sflorian access-control-view{COLON}	{ YDVAR(2, VAR_ACCESS_CONTROL_VIEW) }
4835c45b740Sflorian interface-tag{COLON}		{ YDVAR(2, VAR_INTERFACE_TAG) }
4845c45b740Sflorian interface-tag-action{COLON}	{ YDVAR(3, VAR_INTERFACE_TAG_ACTION) }
4855c45b740Sflorian interface-tag-data{COLON}	{ YDVAR(3, VAR_INTERFACE_TAG_DATA) }
4865c45b740Sflorian interface-view{COLON}		{ YDVAR(2, VAR_INTERFACE_VIEW) }
487ae8c6e27Sflorian local-zone-override{COLON}	{ YDVAR(3, VAR_LOCAL_ZONE_OVERRIDE) }
488ae8c6e27Sflorian dnstap{COLON}			{ YDVAR(0, VAR_DNSTAP) }
489ae8c6e27Sflorian dnstap-enable{COLON}		{ YDVAR(1, VAR_DNSTAP_ENABLE) }
490e47fef9eSflorian dnstap-bidirectional{COLON}	{ YDVAR(1, VAR_DNSTAP_BIDIRECTIONAL) }
491ae8c6e27Sflorian dnstap-socket-path{COLON}	{ YDVAR(1, VAR_DNSTAP_SOCKET_PATH) }
492e47fef9eSflorian dnstap-ip{COLON}		{ YDVAR(1, VAR_DNSTAP_IP) }
493e47fef9eSflorian dnstap-tls{COLON}		{ YDVAR(1, VAR_DNSTAP_TLS) }
494e47fef9eSflorian dnstap-tls-server-name{COLON}	{ YDVAR(1, VAR_DNSTAP_TLS_SERVER_NAME) }
495e47fef9eSflorian dnstap-tls-cert-bundle{COLON}	{ YDVAR(1, VAR_DNSTAP_TLS_CERT_BUNDLE) }
496e47fef9eSflorian dnstap-tls-client-key-file{COLON}	{
497e47fef9eSflorian 		YDVAR(1, VAR_DNSTAP_TLS_CLIENT_KEY_FILE) }
498e47fef9eSflorian dnstap-tls-client-cert-file{COLON}	{
499e47fef9eSflorian 		YDVAR(1, VAR_DNSTAP_TLS_CLIENT_CERT_FILE) }
500ae8c6e27Sflorian dnstap-send-identity{COLON}	{ YDVAR(1, VAR_DNSTAP_SEND_IDENTITY) }
501ae8c6e27Sflorian dnstap-send-version{COLON}	{ YDVAR(1, VAR_DNSTAP_SEND_VERSION) }
502ae8c6e27Sflorian dnstap-identity{COLON}		{ YDVAR(1, VAR_DNSTAP_IDENTITY) }
503ae8c6e27Sflorian dnstap-version{COLON}		{ YDVAR(1, VAR_DNSTAP_VERSION) }
504ae8c6e27Sflorian dnstap-log-resolver-query-messages{COLON}	{
505ae8c6e27Sflorian 		YDVAR(1, VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES) }
506ae8c6e27Sflorian dnstap-log-resolver-response-messages{COLON}	{
507ae8c6e27Sflorian 		YDVAR(1, VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES) }
508ae8c6e27Sflorian dnstap-log-client-query-messages{COLON}		{
509ae8c6e27Sflorian 		YDVAR(1, VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES) }
510ae8c6e27Sflorian dnstap-log-client-response-messages{COLON}	{
511ae8c6e27Sflorian 		YDVAR(1, VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES) }
512ae8c6e27Sflorian dnstap-log-forwarder-query-messages{COLON}	{
513ae8c6e27Sflorian 		YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES) }
514ae8c6e27Sflorian dnstap-log-forwarder-response-messages{COLON}	{
515ae8c6e27Sflorian 		YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES) }
516*7037e34cSflorian dnstap-sample-rate		{ YDVAR(1, VAR_DNSTAP_SAMPLE_RATE) }
517ae8c6e27Sflorian disable-dnssec-lame-check{COLON} { YDVAR(1, VAR_DISABLE_DNSSEC_LAME_CHECK) }
518ae8c6e27Sflorian ip-ratelimit{COLON}		{ YDVAR(1, VAR_IP_RATELIMIT) }
519d500c338Sflorian ip-ratelimit-cookie{COLON}	{ YDVAR(1, VAR_IP_RATELIMIT_COOKIE) }
520ae8c6e27Sflorian ratelimit{COLON}		{ YDVAR(1, VAR_RATELIMIT) }
521ae8c6e27Sflorian ip-ratelimit-slabs{COLON}		{ YDVAR(1, VAR_IP_RATELIMIT_SLABS) }
522ae8c6e27Sflorian ratelimit-slabs{COLON}		{ YDVAR(1, VAR_RATELIMIT_SLABS) }
523ae8c6e27Sflorian ip-ratelimit-size{COLON}		{ YDVAR(1, VAR_IP_RATELIMIT_SIZE) }
524ae8c6e27Sflorian ratelimit-size{COLON}		{ YDVAR(1, VAR_RATELIMIT_SIZE) }
525ae8c6e27Sflorian ratelimit-for-domain{COLON}	{ YDVAR(2, VAR_RATELIMIT_FOR_DOMAIN) }
526ae8c6e27Sflorian ratelimit-below-domain{COLON}	{ YDVAR(2, VAR_RATELIMIT_BELOW_DOMAIN) }
527ae8c6e27Sflorian ip-ratelimit-factor{COLON}		{ YDVAR(1, VAR_IP_RATELIMIT_FACTOR) }
528ae8c6e27Sflorian ratelimit-factor{COLON}		{ YDVAR(1, VAR_RATELIMIT_FACTOR) }
529a1a7ba80Sflorian ip-ratelimit-backoff{COLON}		{ YDVAR(1, VAR_IP_RATELIMIT_BACKOFF) }
530a1a7ba80Sflorian ratelimit-backoff{COLON}		{ YDVAR(1, VAR_RATELIMIT_BACKOFF) }
531a1a7ba80Sflorian outbound-msg-retry{COLON}		{ YDVAR(1, VAR_OUTBOUND_MSG_RETRY) }
532d500c338Sflorian max-sent-count{COLON}		{ YDVAR(1, VAR_MAX_SENT_COUNT) }
533d500c338Sflorian max-query-restarts{COLON}	{ YDVAR(1, VAR_MAX_QUERY_RESTARTS) }
534ae8c6e27Sflorian low-rtt{COLON}			{ YDVAR(1, VAR_LOW_RTT) }
535ae8c6e27Sflorian fast-server-num{COLON}		{ YDVAR(1, VAR_FAST_SERVER_NUM) }
536ae8c6e27Sflorian low-rtt-pct{COLON}		{ YDVAR(1, VAR_FAST_SERVER_PERMIL) }
537ae8c6e27Sflorian low-rtt-permil{COLON}		{ YDVAR(1, VAR_FAST_SERVER_PERMIL) }
538ae8c6e27Sflorian fast-server-permil{COLON}	{ YDVAR(1, VAR_FAST_SERVER_PERMIL) }
539ae8c6e27Sflorian response-ip-tag{COLON}		{ YDVAR(2, VAR_RESPONSE_IP_TAG) }
540ae8c6e27Sflorian response-ip{COLON}		{ YDVAR(2, VAR_RESPONSE_IP) }
541ae8c6e27Sflorian response-ip-data{COLON}		{ YDVAR(2, VAR_RESPONSE_IP_DATA) }
542ae8c6e27Sflorian dnscrypt{COLON}			{ YDVAR(0, VAR_DNSCRYPT) }
543ae8c6e27Sflorian dnscrypt-enable{COLON}		{ YDVAR(1, VAR_DNSCRYPT_ENABLE) }
544ae8c6e27Sflorian dnscrypt-port{COLON}		{ YDVAR(1, VAR_DNSCRYPT_PORT) }
545ae8c6e27Sflorian dnscrypt-provider{COLON}	{ YDVAR(1, VAR_DNSCRYPT_PROVIDER) }
546ae8c6e27Sflorian dnscrypt-secret-key{COLON}	{ YDVAR(1, VAR_DNSCRYPT_SECRET_KEY) }
547ae8c6e27Sflorian dnscrypt-provider-cert{COLON}	{ YDVAR(1, VAR_DNSCRYPT_PROVIDER_CERT) }
548ae8c6e27Sflorian dnscrypt-provider-cert-rotated{COLON}	{ YDVAR(1, VAR_DNSCRYPT_PROVIDER_CERT_ROTATED) }
549ae8c6e27Sflorian dnscrypt-shared-secret-cache-size{COLON}	{
550ae8c6e27Sflorian 		YDVAR(1, VAR_DNSCRYPT_SHARED_SECRET_CACHE_SIZE) }
551ae8c6e27Sflorian dnscrypt-shared-secret-cache-slabs{COLON}	{
552ae8c6e27Sflorian 		YDVAR(1, VAR_DNSCRYPT_SHARED_SECRET_CACHE_SLABS) }
553ae8c6e27Sflorian dnscrypt-nonce-cache-size{COLON}	{ YDVAR(1, VAR_DNSCRYPT_NONCE_CACHE_SIZE) }
554ae8c6e27Sflorian dnscrypt-nonce-cache-slabs{COLON}	{ YDVAR(1, VAR_DNSCRYPT_NONCE_CACHE_SLABS) }
555a8eaceedSflorian pad-responses{COLON}		{ YDVAR(1, VAR_PAD_RESPONSES) }
556a8eaceedSflorian pad-responses-block-size{COLON}	{ YDVAR(1, VAR_PAD_RESPONSES_BLOCK_SIZE) }
557a8eaceedSflorian pad-queries{COLON}		{ YDVAR(1, VAR_PAD_QUERIES) }
558a8eaceedSflorian pad-queries-block-size{COLON}	{ YDVAR(1, VAR_PAD_QUERIES_BLOCK_SIZE) }
559ae8c6e27Sflorian ipsecmod-enabled{COLON}		{ YDVAR(1, VAR_IPSECMOD_ENABLED) }
560ae8c6e27Sflorian ipsecmod-ignore-bogus{COLON}	{ YDVAR(1, VAR_IPSECMOD_IGNORE_BOGUS) }
561ae8c6e27Sflorian ipsecmod-hook{COLON}		{ YDVAR(1, VAR_IPSECMOD_HOOK) }
562ae8c6e27Sflorian ipsecmod-max-ttl{COLON}		{ YDVAR(1, VAR_IPSECMOD_MAX_TTL) }
563ae8c6e27Sflorian ipsecmod-whitelist{COLON}	{ YDVAR(1, VAR_IPSECMOD_WHITELIST) }
564f4f0f0ceSflorian ipsecmod-allow{COLON}		{ YDVAR(1, VAR_IPSECMOD_WHITELIST) }
565ae8c6e27Sflorian ipsecmod-strict{COLON}		{ YDVAR(1, VAR_IPSECMOD_STRICT) }
566ae8c6e27Sflorian cachedb{COLON}			{ YDVAR(0, VAR_CACHEDB) }
567ae8c6e27Sflorian backend{COLON}			{ YDVAR(1, VAR_CACHEDB_BACKEND) }
568ae8c6e27Sflorian secret-seed{COLON}		{ YDVAR(1, VAR_CACHEDB_SECRETSEED) }
56954cc57acSflorian cachedb-no-store{COLON}		{ YDVAR(1, VAR_CACHEDB_NO_STORE) }
570096314feSflorian cachedb-check-when-serve-expired{COLON}		{ YDVAR(1, VAR_CACHEDB_CHECK_WHEN_SERVE_EXPIRED) }
571ae8c6e27Sflorian redis-server-host{COLON}	{ YDVAR(1, VAR_CACHEDB_REDISHOST) }
572ae8c6e27Sflorian redis-server-port{COLON}	{ YDVAR(1, VAR_CACHEDB_REDISPORT) }
573d500c338Sflorian redis-server-path{COLON}	{ YDVAR(1, VAR_CACHEDB_REDISPATH) }
574d500c338Sflorian redis-server-password{COLON}	{ YDVAR(1, VAR_CACHEDB_REDISPASSWORD) }
575ae8c6e27Sflorian redis-timeout{COLON}		{ YDVAR(1, VAR_CACHEDB_REDISTIMEOUT) }
576e47fef9eSflorian redis-expire-records{COLON}	{ YDVAR(1, VAR_CACHEDB_REDISEXPIRERECORDS) }
57754cc57acSflorian redis-logical-db{COLON}		{ YDVAR(1, VAR_CACHEDB_REDISLOGICALDB) }
578da8c8390Sflorian ipset{COLON}			{ YDVAR(0, VAR_IPSET) }
579da8c8390Sflorian name-v4{COLON}			{ YDVAR(1, VAR_IPSET_NAME_V4) }
580da8c8390Sflorian name-v6{COLON}			{ YDVAR(1, VAR_IPSET_NAME_V6) }
581ae8c6e27Sflorian udp-upstream-without-downstream{COLON} { YDVAR(1, VAR_UDP_UPSTREAM_WITHOUT_DOWNSTREAM) }
582ae8c6e27Sflorian tcp-connection-limit{COLON}	{ YDVAR(2, VAR_TCP_CONNECTION_LIMIT) }
583d500c338Sflorian answer-cookie{COLON}		{ YDVAR(1, VAR_ANSWER_COOKIE ) }
584d500c338Sflorian cookie-secret{COLON}		{ YDVAR(1, VAR_COOKIE_SECRET) }
585*7037e34cSflorian cookie-secret-file{COLON}	{ YDVAR(1, VAR_COOKIE_SECRET_FILE) }
586853e076fSflorian edns-client-string{COLON}	{ YDVAR(2, VAR_EDNS_CLIENT_STRING) }
587853e076fSflorian edns-client-string-opcode{COLON} { YDVAR(1, VAR_EDNS_CLIENT_STRING_OPCODE) }
588a8eaceedSflorian nsid{COLON}			{ YDVAR(1, VAR_NSID ) }
5897a05b9dfSflorian ede{COLON}			{ YDVAR(1, VAR_EDE ) }
5905c45b740Sflorian proxy-protocol-port{COLON}	{ YDVAR(1, VAR_PROXY_PROTOCOL_PORT) }
591ae8c6e27Sflorian <INITIAL,val>{NEWLINE}		{ LEXOUT(("NL\n")); cfg_parser->line++; }
592ae8c6e27Sflorian 
593ae8c6e27Sflorian 	/* Quoted strings. Strip leading and ending quotes */
594ae8c6e27Sflorian <val>\"			{ BEGIN(quotedstring); LEXOUT(("QS ")); }
595ae8c6e27Sflorian <quotedstring><<EOF>>   {
596ae8c6e27Sflorian         yyerror("EOF inside quoted string");
597ae8c6e27Sflorian 	if(--num_args == 0) { BEGIN(INITIAL); }
598ae8c6e27Sflorian 	else		    { BEGIN(val); }
599ae8c6e27Sflorian }
600ae8c6e27Sflorian <quotedstring>{DQANY}*  { LEXOUT(("STR(%s) ", yytext)); yymore(); }
601ae8c6e27Sflorian <quotedstring>{NEWLINE} { yyerror("newline inside quoted string, no end \"");
602ae8c6e27Sflorian 			  cfg_parser->line++; BEGIN(INITIAL); }
603ae8c6e27Sflorian <quotedstring>\" {
604ae8c6e27Sflorian         LEXOUT(("QE "));
605ae8c6e27Sflorian 	if(--num_args == 0) { BEGIN(INITIAL); }
606ae8c6e27Sflorian 	else		    { BEGIN(val); }
607ae8c6e27Sflorian         yytext[yyleng - 1] = '\0';
608ae8c6e27Sflorian 	yylval.str = strdup(yytext);
609ae8c6e27Sflorian 	if(!yylval.str)
610ae8c6e27Sflorian 		yyerror("out of memory");
611ae8c6e27Sflorian         return STRING_ARG;
612ae8c6e27Sflorian }
613ae8c6e27Sflorian 
614ae8c6e27Sflorian 	/* Single Quoted strings. Strip leading and ending quotes */
615ae8c6e27Sflorian <val>\'			{ BEGIN(singlequotedstr); LEXOUT(("SQS ")); }
616ae8c6e27Sflorian <singlequotedstr><<EOF>>   {
617ae8c6e27Sflorian         yyerror("EOF inside quoted string");
618ae8c6e27Sflorian 	if(--num_args == 0) { BEGIN(INITIAL); }
619ae8c6e27Sflorian 	else		    { BEGIN(val); }
620ae8c6e27Sflorian }
621ae8c6e27Sflorian <singlequotedstr>{SQANY}*  { LEXOUT(("STR(%s) ", yytext)); yymore(); }
622ae8c6e27Sflorian <singlequotedstr>{NEWLINE} { yyerror("newline inside quoted string, no end '");
623ae8c6e27Sflorian 			     cfg_parser->line++; BEGIN(INITIAL); }
624ae8c6e27Sflorian <singlequotedstr>\' {
625ae8c6e27Sflorian         LEXOUT(("SQE "));
626ae8c6e27Sflorian 	if(--num_args == 0) { BEGIN(INITIAL); }
627ae8c6e27Sflorian 	else		    { BEGIN(val); }
628ae8c6e27Sflorian         yytext[yyleng - 1] = '\0';
629ae8c6e27Sflorian 	yylval.str = strdup(yytext);
630ae8c6e27Sflorian 	if(!yylval.str)
631ae8c6e27Sflorian 		yyerror("out of memory");
632ae8c6e27Sflorian         return STRING_ARG;
633ae8c6e27Sflorian }
634ae8c6e27Sflorian 
635ae8c6e27Sflorian 	/* include: directive */
636ae8c6e27Sflorian <INITIAL,val>include{COLON}	{
637ae8c6e27Sflorian 	LEXOUT(("v(%s) ", yytext)); inc_prev = YYSTATE; BEGIN(include); }
638ae8c6e27Sflorian <include><<EOF>>	{
639ae8c6e27Sflorian         yyerror("EOF inside include directive");
640ae8c6e27Sflorian         BEGIN(inc_prev);
641ae8c6e27Sflorian }
642ae8c6e27Sflorian <include>{SPACE}*	{ LEXOUT(("ISP ")); /* ignore */ }
643ae8c6e27Sflorian <include>{NEWLINE}	{ LEXOUT(("NL\n")); cfg_parser->line++;}
644ae8c6e27Sflorian <include>\"		{ LEXOUT(("IQS ")); BEGIN(include_quoted); }
645ae8c6e27Sflorian <include>{UNQUOTEDLETTER}*	{
646ae8c6e27Sflorian 	LEXOUT(("Iunquotedstr(%s) ", yytext));
647e47fef9eSflorian 	config_start_include_glob(yytext, 0);
648ae8c6e27Sflorian 	BEGIN(inc_prev);
649ae8c6e27Sflorian }
650ae8c6e27Sflorian <include_quoted><<EOF>>	{
651ae8c6e27Sflorian         yyerror("EOF inside quoted string");
652ae8c6e27Sflorian         BEGIN(inc_prev);
653ae8c6e27Sflorian }
654ae8c6e27Sflorian <include_quoted>{DQANY}*	{ LEXOUT(("ISTR(%s) ", yytext)); yymore(); }
655ae8c6e27Sflorian <include_quoted>{NEWLINE}	{ yyerror("newline before \" in include name");
656ae8c6e27Sflorian 				  cfg_parser->line++; BEGIN(inc_prev); }
657ae8c6e27Sflorian <include_quoted>\"	{
658ae8c6e27Sflorian 	LEXOUT(("IQE "));
659ae8c6e27Sflorian 	yytext[yyleng - 1] = '\0';
660e47fef9eSflorian 	config_start_include_glob(yytext, 0);
661ae8c6e27Sflorian 	BEGIN(inc_prev);
662ae8c6e27Sflorian }
663ae8c6e27Sflorian <INITIAL,val><<EOF>>	{
664ae8c6e27Sflorian 	LEXOUT(("LEXEOF "));
665ae8c6e27Sflorian 	yy_set_bol(1); /* Set beginning of line, so "^" rules match.  */
666ae8c6e27Sflorian 	if (!config_include_stack) {
667ae8c6e27Sflorian 		yyterminate();
668ae8c6e27Sflorian 	} else {
669e47fef9eSflorian 		int prev_toplevel = inc_toplevel;
670ae8c6e27Sflorian 		fclose(yyin);
671ae8c6e27Sflorian 		config_end_include();
672e47fef9eSflorian 		if(prev_toplevel) return (VAR_FORCE_TOPLEVEL);
673ae8c6e27Sflorian 	}
674ae8c6e27Sflorian }
675ae8c6e27Sflorian 
676e47fef9eSflorian 	/* include-toplevel: directive */
677e47fef9eSflorian <INITIAL,val>include-toplevel{COLON} {
678e47fef9eSflorian 	LEXOUT(("v(%s) ", yytext)); inc_prev = YYSTATE; BEGIN(include_toplevel);
679e47fef9eSflorian }
680e47fef9eSflorian <include_toplevel><<EOF>> {
681e47fef9eSflorian 	yyerror("EOF inside include_toplevel directive");
682e47fef9eSflorian 	BEGIN(inc_prev);
683e47fef9eSflorian }
684e47fef9eSflorian <include_toplevel>{SPACE}* { LEXOUT(("ITSP ")); /* ignore */ }
685e47fef9eSflorian <include_toplevel>{NEWLINE} { LEXOUT(("NL\n")); cfg_parser->line++; }
686e47fef9eSflorian <include_toplevel>\" { LEXOUT(("ITQS ")); BEGIN(include_toplevel_quoted); }
687e47fef9eSflorian <include_toplevel>{UNQUOTEDLETTER}* {
688e47fef9eSflorian 	LEXOUT(("ITunquotedstr(%s) ", yytext));
689e47fef9eSflorian 	config_start_include_glob(yytext, 1);
690e47fef9eSflorian 	BEGIN(inc_prev);
691e47fef9eSflorian 	return (VAR_FORCE_TOPLEVEL);
692e47fef9eSflorian }
693e47fef9eSflorian <include_toplevel_quoted><<EOF>> {
694e47fef9eSflorian 	yyerror("EOF inside quoted string");
695e47fef9eSflorian 	BEGIN(inc_prev);
696e47fef9eSflorian }
697e47fef9eSflorian <include_toplevel_quoted>{DQANY}* { LEXOUT(("ITSTR(%s) ", yytext)); yymore(); }
698e47fef9eSflorian <include_toplevel_quoted>{NEWLINE} {
699e47fef9eSflorian 	yyerror("newline before \" in include name");
700e47fef9eSflorian 	cfg_parser->line++; BEGIN(inc_prev);
701e47fef9eSflorian }
702e47fef9eSflorian <include_toplevel_quoted>\" {
703e47fef9eSflorian 	LEXOUT(("ITQE "));
704e47fef9eSflorian 	yytext[yyleng - 1] = '\0';
705e47fef9eSflorian 	config_start_include_glob(yytext, 1);
706e47fef9eSflorian 	BEGIN(inc_prev);
707e47fef9eSflorian 	return (VAR_FORCE_TOPLEVEL);
708e47fef9eSflorian }
709e47fef9eSflorian 
710ae8c6e27Sflorian <val>{UNQUOTEDLETTER}*	{ LEXOUT(("unquotedstr(%s) ", yytext));
711ae8c6e27Sflorian 			if(--num_args == 0) { BEGIN(INITIAL); }
712ae8c6e27Sflorian 			yylval.str = strdup(yytext); return STRING_ARG; }
713ae8c6e27Sflorian 
714ae8c6e27Sflorian {UNQUOTEDLETTER_NOCOLON}*	{
715ae8c6e27Sflorian 	ub_c_error_msg("unknown keyword '%s'", yytext);
716ae8c6e27Sflorian 	}
717ae8c6e27Sflorian 
718ae8c6e27Sflorian <*>.	{
719ae8c6e27Sflorian 	ub_c_error_msg("stray '%s'", yytext);
720ae8c6e27Sflorian 	}
721ae8c6e27Sflorian 
722ae8c6e27Sflorian %%
723