xref: /openbsd-src/sbin/unwind/libunbound/util/configparser.y (revision 7037e34cdfd270b3989fb1829c7cd3439048bd3a)
1ae8c6e27Sflorian /*
2ae8c6e27Sflorian  * configparser.y -- yacc grammar for unbound configuration files
3ae8c6e27Sflorian  *
4ae8c6e27Sflorian  * Copyright (c) 2001-2006, NLnet Labs. All rights reserved.
5ae8c6e27Sflorian  *
6ae8c6e27Sflorian  * Copyright (c) 2007, NLnet Labs. All rights reserved.
7ae8c6e27Sflorian  *
8ae8c6e27Sflorian  * This software is open source.
9ae8c6e27Sflorian  *
10ae8c6e27Sflorian  * Redistribution and use in source and binary forms, with or without
11ae8c6e27Sflorian  * modification, are permitted provided that the following conditions
12ae8c6e27Sflorian  * are met:
13ae8c6e27Sflorian  *
14ae8c6e27Sflorian  * Redistributions of source code must retain the above copyright notice,
15ae8c6e27Sflorian  * this list of conditions and the following disclaimer.
16ae8c6e27Sflorian  *
17ae8c6e27Sflorian  * Redistributions in binary form must reproduce the above copyright notice,
18ae8c6e27Sflorian  * this list of conditions and the following disclaimer in the documentation
19ae8c6e27Sflorian  * and/or other materials provided with the distribution.
20ae8c6e27Sflorian  *
21ae8c6e27Sflorian  * Neither the name of the NLNET LABS nor the names of its contributors may
22ae8c6e27Sflorian  * be used to endorse or promote products derived from this software without
23ae8c6e27Sflorian  * specific prior written permission.
24ae8c6e27Sflorian  *
25ae8c6e27Sflorian  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26ae8c6e27Sflorian  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27ae8c6e27Sflorian  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28ae8c6e27Sflorian  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29ae8c6e27Sflorian  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30ae8c6e27Sflorian  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
31ae8c6e27Sflorian  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32ae8c6e27Sflorian  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33ae8c6e27Sflorian  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34ae8c6e27Sflorian  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35ae8c6e27Sflorian  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36ae8c6e27Sflorian  */
37ae8c6e27Sflorian 
38ae8c6e27Sflorian %{
39ae8c6e27Sflorian #include "config.h"
40ae8c6e27Sflorian 
41ae8c6e27Sflorian #include <stdarg.h>
42ae8c6e27Sflorian #include <stdio.h>
43ae8c6e27Sflorian #include <string.h>
44ae8c6e27Sflorian #include <stdlib.h>
45ae8c6e27Sflorian #include <assert.h>
46ae8c6e27Sflorian 
47ae8c6e27Sflorian #include "util/configyyrename.h"
48ae8c6e27Sflorian #include "util/config_file.h"
49ae8c6e27Sflorian #include "util/net_help.h"
50d500c338Sflorian #include "sldns/str2wire.h"
51ae8c6e27Sflorian 
52ae8c6e27Sflorian int ub_c_lex(void);
53ae8c6e27Sflorian void ub_c_error(const char *message);
54ae8c6e27Sflorian 
55ae8c6e27Sflorian static void validate_respip_action(const char* action);
565c45b740Sflorian static void validate_acl_action(const char* action);
57ae8c6e27Sflorian 
58ae8c6e27Sflorian /* these need to be global, otherwise they cannot be used inside yacc */
59ae8c6e27Sflorian extern struct config_parser_state* cfg_parser;
60ae8c6e27Sflorian 
61ae8c6e27Sflorian #if 0
62ae8c6e27Sflorian #define OUTYY(s)  printf s /* used ONLY when debugging */
63ae8c6e27Sflorian #else
64ae8c6e27Sflorian #define OUTYY(s)
65ae8c6e27Sflorian #endif
66ae8c6e27Sflorian 
67ae8c6e27Sflorian %}
68ae8c6e27Sflorian %union {
69ae8c6e27Sflorian 	char*	str;
70ae8c6e27Sflorian };
71ae8c6e27Sflorian 
72ae8c6e27Sflorian %token SPACE LETTER NEWLINE COMMENT COLON ANY ZONESTR
73ae8c6e27Sflorian %token <str> STRING_ARG
74e47fef9eSflorian %token VAR_FORCE_TOPLEVEL
75ae8c6e27Sflorian %token VAR_SERVER VAR_VERBOSITY VAR_NUM_THREADS VAR_PORT
76e47fef9eSflorian %token VAR_OUTGOING_RANGE VAR_INTERFACE VAR_PREFER_IP4
77d500c338Sflorian %token VAR_DO_IP4 VAR_DO_IP6 VAR_DO_NAT64 VAR_PREFER_IP6 VAR_DO_UDP VAR_DO_TCP
78ae8c6e27Sflorian %token VAR_TCP_MSS VAR_OUTGOING_TCP_MSS VAR_TCP_IDLE_TIMEOUT
79ae8c6e27Sflorian %token VAR_EDNS_TCP_KEEPALIVE VAR_EDNS_TCP_KEEPALIVE_TIMEOUT
80d500c338Sflorian %token VAR_SOCK_QUEUE_TIMEOUT
81ae8c6e27Sflorian %token VAR_CHROOT VAR_USERNAME VAR_DIRECTORY VAR_LOGFILE VAR_PIDFILE
82ae8c6e27Sflorian %token VAR_MSG_CACHE_SIZE VAR_MSG_CACHE_SLABS VAR_NUM_QUERIES_PER_THREAD
83ae8c6e27Sflorian %token VAR_RRSET_CACHE_SIZE VAR_RRSET_CACHE_SLABS VAR_OUTGOING_NUM_TCP
84ae8c6e27Sflorian %token VAR_INFRA_HOST_TTL VAR_INFRA_LAME_TTL VAR_INFRA_CACHE_SLABS
85ae8c6e27Sflorian %token VAR_INFRA_CACHE_NUMHOSTS VAR_INFRA_CACHE_LAME_SIZE VAR_NAME
86ae8c6e27Sflorian %token VAR_STUB_ZONE VAR_STUB_HOST VAR_STUB_ADDR VAR_TARGET_FETCH_POLICY
87ae8c6e27Sflorian %token VAR_HARDEN_SHORT_BUFSIZE VAR_HARDEN_LARGE_QUERIES
88ae8c6e27Sflorian %token VAR_FORWARD_ZONE VAR_FORWARD_HOST VAR_FORWARD_ADDR
89ae8c6e27Sflorian %token VAR_DO_NOT_QUERY_ADDRESS VAR_HIDE_IDENTITY VAR_HIDE_VERSION
90ae8c6e27Sflorian %token VAR_IDENTITY VAR_VERSION VAR_HARDEN_GLUE VAR_MODULE_CONF
91ae8c6e27Sflorian %token VAR_TRUST_ANCHOR_FILE VAR_TRUST_ANCHOR VAR_VAL_OVERRIDE_DATE
92ae8c6e27Sflorian %token VAR_BOGUS_TTL VAR_VAL_CLEAN_ADDITIONAL VAR_VAL_PERMISSIVE_MODE
93ae8c6e27Sflorian %token VAR_INCOMING_NUM_TCP VAR_MSG_BUFFER_SIZE VAR_KEY_CACHE_SIZE
94ae8c6e27Sflorian %token VAR_KEY_CACHE_SLABS VAR_TRUSTED_KEYS_FILE
95ae8c6e27Sflorian %token VAR_VAL_NSEC3_KEYSIZE_ITERATIONS VAR_USE_SYSLOG
96ae8c6e27Sflorian %token VAR_OUTGOING_INTERFACE VAR_ROOT_HINTS VAR_DO_NOT_QUERY_LOCALHOST
97ae8c6e27Sflorian %token VAR_CACHE_MAX_TTL VAR_HARDEN_DNSSEC_STRIPPED VAR_ACCESS_CONTROL
98ae8c6e27Sflorian %token VAR_LOCAL_ZONE VAR_LOCAL_DATA VAR_INTERFACE_AUTOMATIC
99ae8c6e27Sflorian %token VAR_STATISTICS_INTERVAL VAR_DO_DAEMONIZE VAR_USE_CAPS_FOR_ID
100ae8c6e27Sflorian %token VAR_STATISTICS_CUMULATIVE VAR_OUTGOING_PORT_PERMIT
101ae8c6e27Sflorian %token VAR_OUTGOING_PORT_AVOID VAR_DLV_ANCHOR_FILE VAR_DLV_ANCHOR
102ae8c6e27Sflorian %token VAR_NEG_CACHE_SIZE VAR_HARDEN_REFERRAL_PATH VAR_PRIVATE_ADDRESS
103ae8c6e27Sflorian %token VAR_PRIVATE_DOMAIN VAR_REMOTE_CONTROL VAR_CONTROL_ENABLE
104ae8c6e27Sflorian %token VAR_CONTROL_INTERFACE VAR_CONTROL_PORT VAR_SERVER_KEY_FILE
105ae8c6e27Sflorian %token VAR_SERVER_CERT_FILE VAR_CONTROL_KEY_FILE VAR_CONTROL_CERT_FILE
106411c5950Sflorian %token VAR_CONTROL_USE_CERT VAR_TCP_REUSE_TIMEOUT VAR_MAX_REUSE_TCP_QUERIES
107ae8c6e27Sflorian %token VAR_EXTENDED_STATISTICS VAR_LOCAL_DATA_PTR VAR_JOSTLE_TIMEOUT
108ae8c6e27Sflorian %token VAR_STUB_PRIME VAR_UNWANTED_REPLY_THRESHOLD VAR_LOG_TIME_ASCII
109ae8c6e27Sflorian %token VAR_DOMAIN_INSECURE VAR_PYTHON VAR_PYTHON_SCRIPT VAR_VAL_SIG_SKEW_MIN
110411c5950Sflorian %token VAR_VAL_SIG_SKEW_MAX VAR_VAL_MAX_RESTART VAR_CACHE_MIN_TTL
111411c5950Sflorian %token VAR_VAL_LOG_LEVEL VAR_AUTO_TRUST_ANCHOR_FILE VAR_KEEP_MISSING
112411c5950Sflorian %token VAR_ADD_HOLDDOWN VAR_DEL_HOLDDOWN VAR_SO_RCVBUF VAR_EDNS_BUFFER_SIZE
113411c5950Sflorian %token VAR_PREFETCH VAR_PREFETCH_KEY VAR_SO_SNDBUF VAR_SO_REUSEPORT
114411c5950Sflorian %token VAR_HARDEN_BELOW_NXDOMAIN VAR_IGNORE_CD_FLAG VAR_LOG_QUERIES
115411c5950Sflorian %token VAR_LOG_REPLIES VAR_LOG_LOCAL_ACTIONS VAR_TCP_UPSTREAM
116411c5950Sflorian %token VAR_SSL_UPSTREAM VAR_TCP_AUTH_QUERY_TIMEOUT VAR_SSL_SERVICE_KEY
117411c5950Sflorian %token VAR_SSL_SERVICE_PEM VAR_SSL_PORT VAR_FORWARD_FIRST
118ae8c6e27Sflorian %token VAR_STUB_SSL_UPSTREAM VAR_FORWARD_SSL_UPSTREAM VAR_TLS_CERT_BUNDLE
119a1a7ba80Sflorian %token VAR_STUB_TCP_UPSTREAM VAR_FORWARD_TCP_UPSTREAM
120f4f0f0ceSflorian %token VAR_HTTPS_PORT VAR_HTTP_ENDPOINT VAR_HTTP_MAX_STREAMS
121f4f0f0ceSflorian %token VAR_HTTP_QUERY_BUFFER_SIZE VAR_HTTP_RESPONSE_BUFFER_SIZE
122853e076fSflorian %token VAR_HTTP_NODELAY VAR_HTTP_NOTLS_DOWNSTREAM
123ae8c6e27Sflorian %token VAR_STUB_FIRST VAR_MINIMAL_RESPONSES VAR_RRSET_ROUNDROBIN
124853e076fSflorian %token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE VAR_UDP_CONNECT
125ae8c6e27Sflorian %token VAR_UNBLOCK_LAN_ZONES VAR_INSECURE_LAN_ZONES
1266d08cb1bSflorian %token VAR_INFRA_CACHE_MIN_RTT VAR_INFRA_CACHE_MAX_RTT VAR_INFRA_KEEP_PROBING
127ae8c6e27Sflorian %token VAR_DNS64_PREFIX VAR_DNS64_SYNTHALL VAR_DNS64_IGNORE_AAAA
128d500c338Sflorian %token VAR_NAT64_PREFIX
129e47fef9eSflorian %token VAR_DNSTAP VAR_DNSTAP_ENABLE VAR_DNSTAP_SOCKET_PATH VAR_DNSTAP_IP
130e47fef9eSflorian %token VAR_DNSTAP_TLS VAR_DNSTAP_TLS_SERVER_NAME VAR_DNSTAP_TLS_CERT_BUNDLE
131e47fef9eSflorian %token VAR_DNSTAP_TLS_CLIENT_KEY_FILE VAR_DNSTAP_TLS_CLIENT_CERT_FILE
132e47fef9eSflorian %token VAR_DNSTAP_SEND_IDENTITY VAR_DNSTAP_SEND_VERSION VAR_DNSTAP_BIDIRECTIONAL
133ae8c6e27Sflorian %token VAR_DNSTAP_IDENTITY VAR_DNSTAP_VERSION
134ae8c6e27Sflorian %token VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES
135ae8c6e27Sflorian %token VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES
136ae8c6e27Sflorian %token VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES
137ae8c6e27Sflorian %token VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES
138ae8c6e27Sflorian %token VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES
139ae8c6e27Sflorian %token VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES
140*7037e34cSflorian %token VAR_DNSTAP_SAMPLE_RATE
141ae8c6e27Sflorian %token VAR_RESPONSE_IP_TAG VAR_RESPONSE_IP VAR_RESPONSE_IP_DATA
142ae8c6e27Sflorian %token VAR_HARDEN_ALGO_DOWNGRADE VAR_IP_TRANSPARENT
143e47fef9eSflorian %token VAR_IP_DSCP
144ae8c6e27Sflorian %token VAR_DISABLE_DNSSEC_LAME_CHECK
145ae8c6e27Sflorian %token VAR_IP_RATELIMIT VAR_IP_RATELIMIT_SLABS VAR_IP_RATELIMIT_SIZE
146ae8c6e27Sflorian %token VAR_RATELIMIT VAR_RATELIMIT_SLABS VAR_RATELIMIT_SIZE
147d500c338Sflorian %token VAR_OUTBOUND_MSG_RETRY VAR_MAX_SENT_COUNT VAR_MAX_QUERY_RESTARTS
148ae8c6e27Sflorian %token VAR_RATELIMIT_FOR_DOMAIN VAR_RATELIMIT_BELOW_DOMAIN
149ae8c6e27Sflorian %token VAR_IP_RATELIMIT_FACTOR VAR_RATELIMIT_FACTOR
150a1a7ba80Sflorian %token VAR_IP_RATELIMIT_BACKOFF VAR_RATELIMIT_BACKOFF
151ae8c6e27Sflorian %token VAR_SEND_CLIENT_SUBNET VAR_CLIENT_SUBNET_ZONE
152ae8c6e27Sflorian %token VAR_CLIENT_SUBNET_ALWAYS_FORWARD VAR_CLIENT_SUBNET_OPCODE
153ae8c6e27Sflorian %token VAR_MAX_CLIENT_SUBNET_IPV4 VAR_MAX_CLIENT_SUBNET_IPV6
154ae8c6e27Sflorian %token VAR_MIN_CLIENT_SUBNET_IPV4 VAR_MIN_CLIENT_SUBNET_IPV6
155ae8c6e27Sflorian %token VAR_MAX_ECS_TREE_SIZE_IPV4 VAR_MAX_ECS_TREE_SIZE_IPV6
156ae8c6e27Sflorian %token VAR_CAPS_WHITELIST VAR_CACHE_MAX_NEGATIVE_TTL VAR_PERMIT_SMALL_HOLDDOWN
157096314feSflorian %token VAR_CACHE_MIN_NEGATIVE_TTL
158ae8c6e27Sflorian %token VAR_QNAME_MINIMISATION VAR_QNAME_MINIMISATION_STRICT VAR_IP_FREEBIND
159ae8c6e27Sflorian %token VAR_DEFINE_TAG VAR_LOCAL_ZONE_TAG VAR_ACCESS_CONTROL_TAG
160ae8c6e27Sflorian %token VAR_LOCAL_ZONE_OVERRIDE VAR_ACCESS_CONTROL_TAG_ACTION
161ae8c6e27Sflorian %token VAR_ACCESS_CONTROL_TAG_DATA VAR_VIEW VAR_ACCESS_CONTROL_VIEW
162ae8c6e27Sflorian %token VAR_VIEW_FIRST VAR_SERVE_EXPIRED VAR_SERVE_EXPIRED_TTL
163d32eb43cSflorian %token VAR_SERVE_EXPIRED_TTL_RESET VAR_SERVE_EXPIRED_REPLY_TTL
1647a05b9dfSflorian %token VAR_SERVE_EXPIRED_CLIENT_TIMEOUT VAR_EDE_SERVE_EXPIRED
1657a05b9dfSflorian %token VAR_SERVE_ORIGINAL_TTL VAR_FAKE_DSA
166d32eb43cSflorian %token VAR_FAKE_SHA1 VAR_LOG_IDENTITY VAR_HIDE_TRUSTANCHOR
167411c5950Sflorian %token VAR_HIDE_HTTP_USER_AGENT VAR_HTTP_USER_AGENT
168d32eb43cSflorian %token VAR_TRUST_ANCHOR_SIGNALING VAR_AGGRESSIVE_NSEC VAR_USE_SYSTEMD
169d32eb43cSflorian %token VAR_SHM_ENABLE VAR_SHM_KEY VAR_ROOT_KEY_SENTINEL
170ae8c6e27Sflorian %token VAR_DNSCRYPT VAR_DNSCRYPT_ENABLE VAR_DNSCRYPT_PORT VAR_DNSCRYPT_PROVIDER
171ae8c6e27Sflorian %token VAR_DNSCRYPT_SECRET_KEY VAR_DNSCRYPT_PROVIDER_CERT
172ae8c6e27Sflorian %token VAR_DNSCRYPT_PROVIDER_CERT_ROTATED
173ae8c6e27Sflorian %token VAR_DNSCRYPT_SHARED_SECRET_CACHE_SIZE
174ae8c6e27Sflorian %token VAR_DNSCRYPT_SHARED_SECRET_CACHE_SLABS
175ae8c6e27Sflorian %token VAR_DNSCRYPT_NONCE_CACHE_SIZE
176ae8c6e27Sflorian %token VAR_DNSCRYPT_NONCE_CACHE_SLABS
177a8eaceedSflorian %token VAR_PAD_RESPONSES VAR_PAD_RESPONSES_BLOCK_SIZE
178a8eaceedSflorian %token VAR_PAD_QUERIES VAR_PAD_QUERIES_BLOCK_SIZE
179ae8c6e27Sflorian %token VAR_IPSECMOD_ENABLED VAR_IPSECMOD_HOOK VAR_IPSECMOD_IGNORE_BOGUS
180ae8c6e27Sflorian %token VAR_IPSECMOD_MAX_TTL VAR_IPSECMOD_WHITELIST VAR_IPSECMOD_STRICT
181ae8c6e27Sflorian %token VAR_CACHEDB VAR_CACHEDB_BACKEND VAR_CACHEDB_SECRETSEED
182ae8c6e27Sflorian %token VAR_CACHEDB_REDISHOST VAR_CACHEDB_REDISPORT VAR_CACHEDB_REDISTIMEOUT
183d500c338Sflorian %token VAR_CACHEDB_REDISEXPIRERECORDS VAR_CACHEDB_REDISPATH VAR_CACHEDB_REDISPASSWORD
18454cc57acSflorian %token VAR_CACHEDB_REDISLOGICALDB
185ae8c6e27Sflorian %token VAR_UDP_UPSTREAM_WITHOUT_DOWNSTREAM VAR_FOR_UPSTREAM
186ae8c6e27Sflorian %token VAR_AUTH_ZONE VAR_ZONEFILE VAR_MASTER VAR_URL VAR_FOR_DOWNSTREAM
187ae8c6e27Sflorian %token VAR_FALLBACK_ENABLED VAR_TLS_ADDITIONAL_PORT VAR_LOW_RTT VAR_LOW_RTT_PERMIL
188ae8c6e27Sflorian %token VAR_FAST_SERVER_PERMIL VAR_FAST_SERVER_NUM
189ae8c6e27Sflorian %token VAR_ALLOW_NOTIFY VAR_TLS_WIN_CERT VAR_TCP_CONNECTION_LIMIT
190d500c338Sflorian %token VAR_ANSWER_COOKIE VAR_COOKIE_SECRET VAR_IP_RATELIMIT_COOKIE
191ae8c6e27Sflorian %token VAR_FORWARD_NO_CACHE VAR_STUB_NO_CACHE VAR_LOG_SERVFAIL VAR_DENY_ANY
192e97c6e54Ssthen %token VAR_UNKNOWN_SERVER_TIME_LIMIT VAR_LOG_TAG_QUERYREPLY
193096314feSflorian %token VAR_DISCARD_TIMEOUT VAR_WAIT_LIMIT VAR_WAIT_LIMIT_COOKIE
194096314feSflorian %token VAR_WAIT_LIMIT_NETBLOCK VAR_WAIT_LIMIT_COOKIE_NETBLOCK
195e47fef9eSflorian %token VAR_STREAM_WAIT_SIZE VAR_TLS_CIPHERS VAR_TLS_CIPHERSUITES VAR_TLS_USE_SNI
196da8c8390Sflorian %token VAR_IPSET VAR_IPSET_NAME_V4 VAR_IPSET_NAME_V6
197d32eb43cSflorian %token VAR_TLS_SESSION_TICKET_KEYS VAR_RPZ VAR_TAGS VAR_RPZ_ACTION_OVERRIDE
198d32eb43cSflorian %token VAR_RPZ_CNAME_OVERRIDE VAR_RPZ_LOG VAR_RPZ_LOG_NAME
199853e076fSflorian %token VAR_DYNLIB VAR_DYNLIB_FILE VAR_EDNS_CLIENT_STRING
200a8eaceedSflorian %token VAR_EDNS_CLIENT_STRING_OPCODE VAR_NSID
201411c5950Sflorian %token VAR_ZONEMD_PERMISSIVE_MODE VAR_ZONEMD_CHECK VAR_ZONEMD_REJECT_ABSENCE
2027a05b9dfSflorian %token VAR_RPZ_SIGNAL_NXDOMAIN_RA VAR_INTERFACE_AUTOMATIC_PORTS VAR_EDE
2035c45b740Sflorian %token VAR_INTERFACE_ACTION VAR_INTERFACE_VIEW VAR_INTERFACE_TAG
2045c45b740Sflorian %token VAR_INTERFACE_TAG_ACTION VAR_INTERFACE_TAG_DATA
205d500c338Sflorian %token VAR_PROXY_PROTOCOL_PORT VAR_STATISTICS_INHIBIT_ZERO
20654cc57acSflorian %token VAR_HARDEN_UNKNOWN_ADDITIONAL VAR_DISABLE_EDNS_DO VAR_CACHEDB_NO_STORE
207096314feSflorian %token VAR_LOG_DESTADDR VAR_CACHEDB_CHECK_WHEN_SERVE_EXPIRED
208*7037e34cSflorian %token VAR_COOKIE_SECRET_FILE
209ae8c6e27Sflorian 
210ae8c6e27Sflorian %%
211ae8c6e27Sflorian toplevelvars: /* empty */ | toplevelvars toplevelvar ;
212ae8c6e27Sflorian toplevelvar: serverstart contents_server | stubstart contents_stub |
213ae8c6e27Sflorian 	forwardstart contents_forward | pythonstart contents_py |
214ae8c6e27Sflorian 	rcstart contents_rc | dtstart contents_dt | viewstart contents_view |
215ae8c6e27Sflorian 	dnscstart contents_dnsc | cachedbstart contents_cachedb |
216d32eb43cSflorian 	ipsetstart contents_ipset | authstart contents_auth |
217e47fef9eSflorian 	rpzstart contents_rpz | dynlibstart contents_dl |
218e47fef9eSflorian 	force_toplevel
219ae8c6e27Sflorian 	;
220e47fef9eSflorian force_toplevel: VAR_FORCE_TOPLEVEL
221e47fef9eSflorian 	{
222e47fef9eSflorian 		OUTYY(("\nP(force-toplevel)\n"));
2235c45b740Sflorian 		cfg_parser->started_toplevel = 0;
224e47fef9eSflorian 	}
225e47fef9eSflorian 	;
226ae8c6e27Sflorian /* server: declaration */
227ae8c6e27Sflorian serverstart: VAR_SERVER
228ae8c6e27Sflorian 	{
229ae8c6e27Sflorian 		OUTYY(("\nP(server:)\n"));
2305c45b740Sflorian 		cfg_parser->started_toplevel = 1;
231ae8c6e27Sflorian 	}
232ae8c6e27Sflorian 	;
233ae8c6e27Sflorian contents_server: contents_server content_server
234ae8c6e27Sflorian 	| ;
235ae8c6e27Sflorian content_server: server_num_threads | server_verbosity | server_port |
236ae8c6e27Sflorian 	server_outgoing_range | server_do_ip4 |
237d500c338Sflorian 	server_do_ip6 | server_do_nat64 | server_prefer_ip4 |
238d500c338Sflorian 	server_prefer_ip6 | server_do_udp | server_do_tcp |
239ae8c6e27Sflorian 	server_tcp_mss | server_outgoing_tcp_mss | server_tcp_idle_timeout |
240ae8c6e27Sflorian 	server_tcp_keepalive | server_tcp_keepalive_timeout |
241d500c338Sflorian 	server_sock_queue_timeout |
242ae8c6e27Sflorian 	server_interface | server_chroot | server_username |
243ae8c6e27Sflorian 	server_directory | server_logfile | server_pidfile |
244ae8c6e27Sflorian 	server_msg_cache_size | server_msg_cache_slabs |
245ae8c6e27Sflorian 	server_num_queries_per_thread | server_rrset_cache_size |
246ae8c6e27Sflorian 	server_rrset_cache_slabs | server_outgoing_num_tcp |
247ae8c6e27Sflorian 	server_infra_host_ttl | server_infra_lame_ttl |
248ae8c6e27Sflorian 	server_infra_cache_slabs | server_infra_cache_numhosts |
249ae8c6e27Sflorian 	server_infra_cache_lame_size | server_target_fetch_policy |
250ae8c6e27Sflorian 	server_harden_short_bufsize | server_harden_large_queries |
251ae8c6e27Sflorian 	server_do_not_query_address | server_hide_identity |
252ae8c6e27Sflorian 	server_hide_version | server_identity | server_version |
253411c5950Sflorian 	server_hide_http_user_agent | server_http_user_agent |
254ae8c6e27Sflorian 	server_harden_glue | server_module_conf | server_trust_anchor_file |
255ae8c6e27Sflorian 	server_trust_anchor | server_val_override_date | server_bogus_ttl |
256ae8c6e27Sflorian 	server_val_clean_additional | server_val_permissive_mode |
257ae8c6e27Sflorian 	server_incoming_num_tcp | server_msg_buffer_size |
258ae8c6e27Sflorian 	server_key_cache_size | server_key_cache_slabs |
259ae8c6e27Sflorian 	server_trusted_keys_file | server_val_nsec3_keysize_iterations |
260ae8c6e27Sflorian 	server_use_syslog | server_outgoing_interface | server_root_hints |
261ae8c6e27Sflorian 	server_do_not_query_localhost | server_cache_max_ttl |
262ae8c6e27Sflorian 	server_harden_dnssec_stripped | server_access_control |
263ae8c6e27Sflorian 	server_local_zone | server_local_data | server_interface_automatic |
264ae8c6e27Sflorian 	server_statistics_interval | server_do_daemonize |
265ae8c6e27Sflorian 	server_use_caps_for_id | server_statistics_cumulative |
266ae8c6e27Sflorian 	server_outgoing_port_permit | server_outgoing_port_avoid |
267ae8c6e27Sflorian 	server_dlv_anchor_file | server_dlv_anchor | server_neg_cache_size |
268ae8c6e27Sflorian 	server_harden_referral_path | server_private_address |
269ae8c6e27Sflorian 	server_private_domain | server_extended_statistics |
270ae8c6e27Sflorian 	server_local_data_ptr | server_jostle_timeout |
271ae8c6e27Sflorian 	server_unwanted_reply_threshold | server_log_time_ascii |
272ae8c6e27Sflorian 	server_domain_insecure | server_val_sig_skew_min |
273411c5950Sflorian 	server_val_sig_skew_max | server_val_max_restart |
274411c5950Sflorian 	server_cache_min_ttl | server_val_log_level |
275ae8c6e27Sflorian 	server_auto_trust_anchor_file |	server_add_holddown |
276ae8c6e27Sflorian 	server_del_holddown | server_keep_missing | server_so_rcvbuf |
277ae8c6e27Sflorian 	server_edns_buffer_size | server_prefetch | server_prefetch_key |
278ae8c6e27Sflorian 	server_so_sndbuf | server_harden_below_nxdomain | server_ignore_cd_flag |
279ae8c6e27Sflorian 	server_log_queries | server_log_replies | server_tcp_upstream | server_ssl_upstream |
280ae8c6e27Sflorian 	server_log_local_actions |
281ae8c6e27Sflorian 	server_ssl_service_key | server_ssl_service_pem | server_ssl_port |
282f4f0f0ceSflorian 	server_https_port | server_http_endpoint | server_http_max_streams |
283f4f0f0ceSflorian 	server_http_query_buffer_size | server_http_response_buffer_size |
284853e076fSflorian 	server_http_nodelay | server_http_notls_downstream |
285ae8c6e27Sflorian 	server_minimal_responses | server_rrset_roundrobin | server_max_udp_size |
286853e076fSflorian 	server_so_reuseport | server_delay_close | server_udp_connect |
287ae8c6e27Sflorian 	server_unblock_lan_zones | server_insecure_lan_zones |
288ae8c6e27Sflorian 	server_dns64_prefix | server_dns64_synthall | server_dns64_ignore_aaaa |
289d500c338Sflorian 	server_nat64_prefix |
2906d08cb1bSflorian 	server_infra_cache_min_rtt | server_infra_cache_max_rtt | server_harden_algo_downgrade |
291ae8c6e27Sflorian 	server_ip_transparent | server_ip_ratelimit | server_ratelimit |
292853e076fSflorian 	server_ip_dscp | server_infra_keep_probing |
293ae8c6e27Sflorian 	server_ip_ratelimit_slabs | server_ratelimit_slabs |
294ae8c6e27Sflorian 	server_ip_ratelimit_size | server_ratelimit_size |
295ae8c6e27Sflorian 	server_ratelimit_for_domain |
296ae8c6e27Sflorian 	server_ratelimit_below_domain | server_ratelimit_factor |
297a1a7ba80Sflorian 	server_ip_ratelimit_factor | server_ratelimit_backoff |
298a1a7ba80Sflorian 	server_ip_ratelimit_backoff | server_outbound_msg_retry |
299d500c338Sflorian 	server_max_sent_count | server_max_query_restarts |
300a1a7ba80Sflorian 	server_send_client_subnet | server_client_subnet_zone |
301a1a7ba80Sflorian 	server_client_subnet_always_forward | server_client_subnet_opcode |
302ae8c6e27Sflorian 	server_max_client_subnet_ipv4 | server_max_client_subnet_ipv6 |
303ae8c6e27Sflorian 	server_min_client_subnet_ipv4 | server_min_client_subnet_ipv6 |
304ae8c6e27Sflorian 	server_max_ecs_tree_size_ipv4 | server_max_ecs_tree_size_ipv6 |
305ae8c6e27Sflorian 	server_caps_whitelist | server_cache_max_negative_ttl |
306096314feSflorian 	server_cache_min_negative_ttl |
307ae8c6e27Sflorian 	server_permit_small_holddown | server_qname_minimisation |
308ae8c6e27Sflorian 	server_ip_freebind | server_define_tag | server_local_zone_tag |
309ae8c6e27Sflorian 	server_disable_dnssec_lame_check | server_access_control_tag |
310ae8c6e27Sflorian 	server_local_zone_override | server_access_control_tag_action |
311ae8c6e27Sflorian 	server_access_control_tag_data | server_access_control_view |
3125c45b740Sflorian 	server_interface_action | server_interface_view | server_interface_tag |
3135c45b740Sflorian 	server_interface_tag_action | server_interface_tag_data |
314a8eaceedSflorian 	server_qname_minimisation_strict |
315a8eaceedSflorian 	server_pad_responses | server_pad_responses_block_size |
316a8eaceedSflorian 	server_pad_queries | server_pad_queries_block_size |
317a8eaceedSflorian 	server_serve_expired |
318ae8c6e27Sflorian 	server_serve_expired_ttl | server_serve_expired_ttl_reset |
319d32eb43cSflorian 	server_serve_expired_reply_ttl | server_serve_expired_client_timeout |
3207a05b9dfSflorian 	server_ede_serve_expired | server_serve_original_ttl | server_fake_dsa |
321a8eaceedSflorian 	server_log_identity | server_use_systemd |
322ae8c6e27Sflorian 	server_response_ip_tag | server_response_ip | server_response_ip_data |
323ae8c6e27Sflorian 	server_shm_enable | server_shm_key | server_fake_sha1 |
324ae8c6e27Sflorian 	server_hide_trustanchor | server_trust_anchor_signaling |
325ae8c6e27Sflorian 	server_root_key_sentinel |
326ae8c6e27Sflorian 	server_ipsecmod_enabled | server_ipsecmod_hook |
327ae8c6e27Sflorian 	server_ipsecmod_ignore_bogus | server_ipsecmod_max_ttl |
328ae8c6e27Sflorian 	server_ipsecmod_whitelist | server_ipsecmod_strict |
329ae8c6e27Sflorian 	server_udp_upstream_without_downstream | server_aggressive_nsec |
330ae8c6e27Sflorian 	server_tls_cert_bundle | server_tls_additional_port | server_low_rtt |
331ae8c6e27Sflorian 	server_fast_server_permil | server_fast_server_num  | server_tls_win_cert |
332ae8c6e27Sflorian 	server_tcp_connection_limit | server_log_servfail | server_deny_any |
333e97c6e54Ssthen 	server_unknown_server_time_limit | server_log_tag_queryreply |
334096314feSflorian 	server_discard_timeout | server_wait_limit | server_wait_limit_cookie |
335096314feSflorian 	server_wait_limit_netblock | server_wait_limit_cookie_netblock |
336e97c6e54Ssthen 	server_stream_wait_size | server_tls_ciphers |
337e47fef9eSflorian 	server_tls_ciphersuites | server_tls_session_ticket_keys |
338d500c338Sflorian 	server_answer_cookie | server_cookie_secret | server_ip_ratelimit_cookie |
339853e076fSflorian 	server_tls_use_sni | server_edns_client_string |
340411c5950Sflorian 	server_edns_client_string_opcode | server_nsid |
341411c5950Sflorian 	server_zonemd_permissive_mode | server_max_reuse_tcp_queries |
3427a05b9dfSflorian 	server_tcp_reuse_timeout | server_tcp_auth_query_timeout |
3435c45b740Sflorian 	server_interface_automatic_ports | server_ede |
344d500c338Sflorian 	server_proxy_protocol_port | server_statistics_inhibit_zero |
34554cc57acSflorian 	server_harden_unknown_additional | server_disable_edns_do |
346*7037e34cSflorian 	server_log_destaddr | server_cookie_secret_file
347ae8c6e27Sflorian 	;
348ae8c6e27Sflorian stubstart: VAR_STUB_ZONE
349ae8c6e27Sflorian 	{
350ae8c6e27Sflorian 		struct config_stub* s;
351ae8c6e27Sflorian 		OUTYY(("\nP(stub_zone:)\n"));
3525c45b740Sflorian 		cfg_parser->started_toplevel = 1;
353ae8c6e27Sflorian 		s = (struct config_stub*)calloc(1, sizeof(struct config_stub));
354ae8c6e27Sflorian 		if(s) {
355ae8c6e27Sflorian 			s->next = cfg_parser->cfg->stubs;
356ae8c6e27Sflorian 			cfg_parser->cfg->stubs = s;
357a1a7ba80Sflorian 		} else {
358ae8c6e27Sflorian 			yyerror("out of memory");
359ae8c6e27Sflorian 		}
360a1a7ba80Sflorian 	}
361ae8c6e27Sflorian 	;
362*7037e34cSflorian contents_stub: content_stub contents_stub
363*7037e34cSflorian 	|
364*7037e34cSflorian 	{
365*7037e34cSflorian 		/* stub end */
366*7037e34cSflorian 		if(cfg_parser->cfg->stubs &&
367*7037e34cSflorian 			!cfg_parser->cfg->stubs->name)
368*7037e34cSflorian 			yyerror("stub-zone without name");
369*7037e34cSflorian 	};
370ae8c6e27Sflorian content_stub: stub_name | stub_host | stub_addr | stub_prime | stub_first |
371a1a7ba80Sflorian 	stub_no_cache | stub_ssl_upstream | stub_tcp_upstream
372ae8c6e27Sflorian 	;
373ae8c6e27Sflorian forwardstart: VAR_FORWARD_ZONE
374ae8c6e27Sflorian 	{
375ae8c6e27Sflorian 		struct config_stub* s;
376ae8c6e27Sflorian 		OUTYY(("\nP(forward_zone:)\n"));
3775c45b740Sflorian 		cfg_parser->started_toplevel = 1;
378ae8c6e27Sflorian 		s = (struct config_stub*)calloc(1, sizeof(struct config_stub));
379ae8c6e27Sflorian 		if(s) {
380ae8c6e27Sflorian 			s->next = cfg_parser->cfg->forwards;
381ae8c6e27Sflorian 			cfg_parser->cfg->forwards = s;
382a1a7ba80Sflorian 		} else {
383ae8c6e27Sflorian 			yyerror("out of memory");
384ae8c6e27Sflorian 		}
385a1a7ba80Sflorian 	}
386ae8c6e27Sflorian 	;
387*7037e34cSflorian contents_forward: content_forward contents_forward
388*7037e34cSflorian 	|
389*7037e34cSflorian 	{
390*7037e34cSflorian 		/* forward end */
391*7037e34cSflorian 		if(cfg_parser->cfg->forwards &&
392*7037e34cSflorian 			!cfg_parser->cfg->forwards->name)
393*7037e34cSflorian 			yyerror("forward-zone without name");
394*7037e34cSflorian 	};
395ae8c6e27Sflorian content_forward: forward_name | forward_host | forward_addr | forward_first |
396a1a7ba80Sflorian 	forward_no_cache | forward_ssl_upstream | forward_tcp_upstream
397ae8c6e27Sflorian 	;
398ae8c6e27Sflorian viewstart: VAR_VIEW
399ae8c6e27Sflorian 	{
400ae8c6e27Sflorian 		struct config_view* s;
401ae8c6e27Sflorian 		OUTYY(("\nP(view:)\n"));
4025c45b740Sflorian 		cfg_parser->started_toplevel = 1;
403ae8c6e27Sflorian 		s = (struct config_view*)calloc(1, sizeof(struct config_view));
404ae8c6e27Sflorian 		if(s) {
405ae8c6e27Sflorian 			s->next = cfg_parser->cfg->views;
406ae8c6e27Sflorian 			cfg_parser->cfg->views = s;
407a1a7ba80Sflorian 		} else {
408ae8c6e27Sflorian 			yyerror("out of memory");
409ae8c6e27Sflorian 		}
410a1a7ba80Sflorian 	}
411ae8c6e27Sflorian 	;
412*7037e34cSflorian contents_view: content_view contents_view
413*7037e34cSflorian 	|
414*7037e34cSflorian 	{
415*7037e34cSflorian 		/* view end */
416*7037e34cSflorian 		if(cfg_parser->cfg->views &&
417*7037e34cSflorian 			!cfg_parser->cfg->views->name)
418*7037e34cSflorian 			yyerror("view without name");
419*7037e34cSflorian 	};
420ae8c6e27Sflorian content_view: view_name | view_local_zone | view_local_data | view_first |
421ae8c6e27Sflorian 		view_response_ip | view_response_ip_data | view_local_data_ptr
422ae8c6e27Sflorian 	;
423ae8c6e27Sflorian authstart: VAR_AUTH_ZONE
424ae8c6e27Sflorian 	{
425ae8c6e27Sflorian 		struct config_auth* s;
426ae8c6e27Sflorian 		OUTYY(("\nP(auth_zone:)\n"));
4275c45b740Sflorian 		cfg_parser->started_toplevel = 1;
428ae8c6e27Sflorian 		s = (struct config_auth*)calloc(1, sizeof(struct config_auth));
429ae8c6e27Sflorian 		if(s) {
430ae8c6e27Sflorian 			s->next = cfg_parser->cfg->auths;
431ae8c6e27Sflorian 			cfg_parser->cfg->auths = s;
432ae8c6e27Sflorian 			/* defaults for auth zone */
433ae8c6e27Sflorian 			s->for_downstream = 1;
434ae8c6e27Sflorian 			s->for_upstream = 1;
435ae8c6e27Sflorian 			s->fallback_enabled = 0;
436411c5950Sflorian 			s->zonemd_check = 0;
437411c5950Sflorian 			s->zonemd_reject_absence = 0;
438d32eb43cSflorian 			s->isrpz = 0;
439a1a7ba80Sflorian 		} else {
440ae8c6e27Sflorian 			yyerror("out of memory");
441ae8c6e27Sflorian 		}
442a1a7ba80Sflorian 	}
443ae8c6e27Sflorian 	;
444ae8c6e27Sflorian contents_auth: contents_auth content_auth
445ae8c6e27Sflorian 	| ;
446ae8c6e27Sflorian content_auth: auth_name | auth_zonefile | auth_master | auth_url |
447ae8c6e27Sflorian 	auth_for_downstream | auth_for_upstream | auth_fallback_enabled |
448411c5950Sflorian 	auth_allow_notify | auth_zonemd_check | auth_zonemd_reject_absence
449ae8c6e27Sflorian 	;
450d32eb43cSflorian 
451d32eb43cSflorian rpz_tag: VAR_TAGS STRING_ARG
452d32eb43cSflorian 	{
453d32eb43cSflorian 		uint8_t* bitlist;
454d32eb43cSflorian 		size_t len = 0;
455d32eb43cSflorian 		OUTYY(("P(server_local_zone_tag:%s)\n", $2));
456d32eb43cSflorian 		bitlist = config_parse_taglist(cfg_parser->cfg, $2,
457d32eb43cSflorian 			&len);
458d32eb43cSflorian 		free($2);
459d32eb43cSflorian 		if(!bitlist) {
460d32eb43cSflorian 			yyerror("could not parse tags, (define-tag them first)");
461d32eb43cSflorian 		}
462d32eb43cSflorian 		if(bitlist) {
463d32eb43cSflorian 			cfg_parser->cfg->auths->rpz_taglist = bitlist;
464d32eb43cSflorian 			cfg_parser->cfg->auths->rpz_taglistlen = len;
465d32eb43cSflorian 
466d32eb43cSflorian 		}
467d32eb43cSflorian 	}
468d32eb43cSflorian 	;
469d32eb43cSflorian 
470d32eb43cSflorian rpz_action_override: VAR_RPZ_ACTION_OVERRIDE STRING_ARG
471d32eb43cSflorian 	{
472d32eb43cSflorian 		OUTYY(("P(rpz_action_override:%s)\n", $2));
473d32eb43cSflorian 		if(strcmp($2, "nxdomain")!=0 && strcmp($2, "nodata")!=0 &&
474d32eb43cSflorian 		   strcmp($2, "passthru")!=0 && strcmp($2, "drop")!=0 &&
475d32eb43cSflorian 		   strcmp($2, "cname")!=0 && strcmp($2, "disabled")!=0) {
476d32eb43cSflorian 			yyerror("rpz-action-override action: expected nxdomain, "
477d32eb43cSflorian 				"nodata, passthru, drop, cname or disabled");
478d32eb43cSflorian 			free($2);
479d32eb43cSflorian 			cfg_parser->cfg->auths->rpz_action_override = NULL;
480d32eb43cSflorian 		}
481d32eb43cSflorian 		else {
482d32eb43cSflorian 			cfg_parser->cfg->auths->rpz_action_override = $2;
483d32eb43cSflorian 		}
484d32eb43cSflorian 	}
485d32eb43cSflorian 	;
486d32eb43cSflorian 
487d32eb43cSflorian rpz_cname_override: VAR_RPZ_CNAME_OVERRIDE STRING_ARG
488d32eb43cSflorian 	{
489d32eb43cSflorian 		OUTYY(("P(rpz_cname_override:%s)\n", $2));
490d32eb43cSflorian 		free(cfg_parser->cfg->auths->rpz_cname);
491d32eb43cSflorian 		cfg_parser->cfg->auths->rpz_cname = $2;
492d32eb43cSflorian 	}
493d32eb43cSflorian 	;
494d32eb43cSflorian 
495d32eb43cSflorian rpz_log: VAR_RPZ_LOG STRING_ARG
496d32eb43cSflorian 	{
497d32eb43cSflorian 		OUTYY(("P(rpz_log:%s)\n", $2));
498d32eb43cSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
499d32eb43cSflorian 			yyerror("expected yes or no.");
500d32eb43cSflorian 		else cfg_parser->cfg->auths->rpz_log = (strcmp($2, "yes")==0);
501d32eb43cSflorian 		free($2);
502d32eb43cSflorian 	}
503d32eb43cSflorian 	;
504d32eb43cSflorian 
505d32eb43cSflorian rpz_log_name: VAR_RPZ_LOG_NAME STRING_ARG
506d32eb43cSflorian 	{
507d32eb43cSflorian 		OUTYY(("P(rpz_log_name:%s)\n", $2));
508d32eb43cSflorian 		free(cfg_parser->cfg->auths->rpz_log_name);
509d32eb43cSflorian 		cfg_parser->cfg->auths->rpz_log_name = $2;
510d32eb43cSflorian 	}
511d32eb43cSflorian 	;
512a1a7ba80Sflorian rpz_signal_nxdomain_ra: VAR_RPZ_SIGNAL_NXDOMAIN_RA STRING_ARG
513a1a7ba80Sflorian 	{
514a1a7ba80Sflorian 		OUTYY(("P(rpz_signal_nxdomain_ra:%s)\n", $2));
515a1a7ba80Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
516a1a7ba80Sflorian 			yyerror("expected yes or no.");
517a1a7ba80Sflorian 		else cfg_parser->cfg->auths->rpz_signal_nxdomain_ra = (strcmp($2, "yes")==0);
518a1a7ba80Sflorian 		free($2);
519a1a7ba80Sflorian 	}
520a1a7ba80Sflorian 	;
521d32eb43cSflorian 
522d32eb43cSflorian rpzstart: VAR_RPZ
523d32eb43cSflorian 	{
524d32eb43cSflorian 		struct config_auth* s;
525d32eb43cSflorian 		OUTYY(("\nP(rpz:)\n"));
5265c45b740Sflorian 		cfg_parser->started_toplevel = 1;
527d32eb43cSflorian 		s = (struct config_auth*)calloc(1, sizeof(struct config_auth));
528d32eb43cSflorian 		if(s) {
529d32eb43cSflorian 			s->next = cfg_parser->cfg->auths;
530d32eb43cSflorian 			cfg_parser->cfg->auths = s;
531d32eb43cSflorian 			/* defaults for RPZ auth zone */
532d32eb43cSflorian 			s->for_downstream = 0;
533d32eb43cSflorian 			s->for_upstream = 0;
534d32eb43cSflorian 			s->fallback_enabled = 0;
535d32eb43cSflorian 			s->isrpz = 1;
536a1a7ba80Sflorian 		} else {
537d32eb43cSflorian 			yyerror("out of memory");
538d32eb43cSflorian 		}
539a1a7ba80Sflorian 	}
540d32eb43cSflorian 	;
541d32eb43cSflorian contents_rpz: contents_rpz content_rpz
542d32eb43cSflorian 	| ;
543d32eb43cSflorian content_rpz: auth_name | auth_zonefile | rpz_tag | auth_master | auth_url |
544d32eb43cSflorian 	   auth_allow_notify | rpz_action_override | rpz_cname_override |
545a1a7ba80Sflorian 	   rpz_log | rpz_log_name | rpz_signal_nxdomain_ra | auth_for_downstream
546d32eb43cSflorian 	;
547ae8c6e27Sflorian server_num_threads: VAR_NUM_THREADS STRING_ARG
548ae8c6e27Sflorian 	{
549ae8c6e27Sflorian 		OUTYY(("P(server_num_threads:%s)\n", $2));
550ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
551ae8c6e27Sflorian 			yyerror("number expected");
552ae8c6e27Sflorian 		else cfg_parser->cfg->num_threads = atoi($2);
553ae8c6e27Sflorian 		free($2);
554ae8c6e27Sflorian 	}
555ae8c6e27Sflorian 	;
556ae8c6e27Sflorian server_verbosity: VAR_VERBOSITY STRING_ARG
557ae8c6e27Sflorian 	{
558ae8c6e27Sflorian 		OUTYY(("P(server_verbosity:%s)\n", $2));
559ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
560ae8c6e27Sflorian 			yyerror("number expected");
561ae8c6e27Sflorian 		else cfg_parser->cfg->verbosity = atoi($2);
562ae8c6e27Sflorian 		free($2);
563ae8c6e27Sflorian 	}
564ae8c6e27Sflorian 	;
565ae8c6e27Sflorian server_statistics_interval: VAR_STATISTICS_INTERVAL STRING_ARG
566ae8c6e27Sflorian 	{
567ae8c6e27Sflorian 		OUTYY(("P(server_statistics_interval:%s)\n", $2));
568ae8c6e27Sflorian 		if(strcmp($2, "") == 0 || strcmp($2, "0") == 0)
569ae8c6e27Sflorian 			cfg_parser->cfg->stat_interval = 0;
570ae8c6e27Sflorian 		else if(atoi($2) == 0)
571ae8c6e27Sflorian 			yyerror("number expected");
572ae8c6e27Sflorian 		else cfg_parser->cfg->stat_interval = atoi($2);
573ae8c6e27Sflorian 		free($2);
574ae8c6e27Sflorian 	}
575ae8c6e27Sflorian 	;
576ae8c6e27Sflorian server_statistics_cumulative: VAR_STATISTICS_CUMULATIVE STRING_ARG
577ae8c6e27Sflorian 	{
578ae8c6e27Sflorian 		OUTYY(("P(server_statistics_cumulative:%s)\n", $2));
579ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
580ae8c6e27Sflorian 			yyerror("expected yes or no.");
581ae8c6e27Sflorian 		else cfg_parser->cfg->stat_cumulative = (strcmp($2, "yes")==0);
582ae8c6e27Sflorian 		free($2);
583ae8c6e27Sflorian 	}
584ae8c6e27Sflorian 	;
585ae8c6e27Sflorian server_extended_statistics: VAR_EXTENDED_STATISTICS STRING_ARG
586ae8c6e27Sflorian 	{
587ae8c6e27Sflorian 		OUTYY(("P(server_extended_statistics:%s)\n", $2));
588ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
589ae8c6e27Sflorian 			yyerror("expected yes or no.");
590ae8c6e27Sflorian 		else cfg_parser->cfg->stat_extended = (strcmp($2, "yes")==0);
591ae8c6e27Sflorian 		free($2);
592ae8c6e27Sflorian 	}
593ae8c6e27Sflorian 	;
594d500c338Sflorian server_statistics_inhibit_zero: VAR_STATISTICS_INHIBIT_ZERO STRING_ARG
595d500c338Sflorian 	{
596d500c338Sflorian 		OUTYY(("P(server_statistics_inhibit_zero:%s)\n", $2));
597d500c338Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
598d500c338Sflorian 			yyerror("expected yes or no.");
599d500c338Sflorian 		else cfg_parser->cfg->stat_inhibit_zero = (strcmp($2, "yes")==0);
600d500c338Sflorian 		free($2);
601d500c338Sflorian 	}
602d500c338Sflorian 	;
603ae8c6e27Sflorian server_shm_enable: VAR_SHM_ENABLE STRING_ARG
604ae8c6e27Sflorian 	{
605ae8c6e27Sflorian 		OUTYY(("P(server_shm_enable:%s)\n", $2));
606ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
607ae8c6e27Sflorian 			yyerror("expected yes or no.");
608ae8c6e27Sflorian 		else cfg_parser->cfg->shm_enable = (strcmp($2, "yes")==0);
609ae8c6e27Sflorian 		free($2);
610ae8c6e27Sflorian 	}
611ae8c6e27Sflorian 	;
612ae8c6e27Sflorian server_shm_key: VAR_SHM_KEY STRING_ARG
613ae8c6e27Sflorian 	{
614ae8c6e27Sflorian 		OUTYY(("P(server_shm_key:%s)\n", $2));
615ae8c6e27Sflorian 		if(strcmp($2, "") == 0 || strcmp($2, "0") == 0)
616ae8c6e27Sflorian 			cfg_parser->cfg->shm_key = 0;
617ae8c6e27Sflorian 		else if(atoi($2) == 0)
618ae8c6e27Sflorian 			yyerror("number expected");
619ae8c6e27Sflorian 		else cfg_parser->cfg->shm_key = atoi($2);
620ae8c6e27Sflorian 		free($2);
621ae8c6e27Sflorian 	}
622ae8c6e27Sflorian 	;
623ae8c6e27Sflorian server_port: VAR_PORT STRING_ARG
624ae8c6e27Sflorian 	{
625ae8c6e27Sflorian 		OUTYY(("P(server_port:%s)\n", $2));
626ae8c6e27Sflorian 		if(atoi($2) == 0)
627ae8c6e27Sflorian 			yyerror("port number expected");
628ae8c6e27Sflorian 		else cfg_parser->cfg->port = atoi($2);
629ae8c6e27Sflorian 		free($2);
630ae8c6e27Sflorian 	}
631ae8c6e27Sflorian 	;
632ae8c6e27Sflorian server_send_client_subnet: VAR_SEND_CLIENT_SUBNET STRING_ARG
633ae8c6e27Sflorian 	{
634ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
635ae8c6e27Sflorian 		OUTYY(("P(server_send_client_subnet:%s)\n", $2));
636ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->client_subnet, $2))
637ae8c6e27Sflorian 			fatal_exit("out of memory adding client-subnet");
638ae8c6e27Sflorian 	#else
639ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
640d32eb43cSflorian 		free($2);
641ae8c6e27Sflorian 	#endif
642ae8c6e27Sflorian 	}
643ae8c6e27Sflorian 	;
644ae8c6e27Sflorian server_client_subnet_zone: VAR_CLIENT_SUBNET_ZONE STRING_ARG
645ae8c6e27Sflorian 	{
646ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
647ae8c6e27Sflorian 		OUTYY(("P(server_client_subnet_zone:%s)\n", $2));
648ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->client_subnet_zone,
649ae8c6e27Sflorian 			$2))
650ae8c6e27Sflorian 			fatal_exit("out of memory adding client-subnet-zone");
651ae8c6e27Sflorian 	#else
652ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
653d32eb43cSflorian 		free($2);
654ae8c6e27Sflorian 	#endif
655ae8c6e27Sflorian 	}
656ae8c6e27Sflorian 	;
657ae8c6e27Sflorian server_client_subnet_always_forward:
658ae8c6e27Sflorian 	VAR_CLIENT_SUBNET_ALWAYS_FORWARD STRING_ARG
659ae8c6e27Sflorian 	{
660ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
661ae8c6e27Sflorian 		OUTYY(("P(server_client_subnet_always_forward:%s)\n", $2));
662ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
663ae8c6e27Sflorian 			yyerror("expected yes or no.");
664ae8c6e27Sflorian 		else
665ae8c6e27Sflorian 			cfg_parser->cfg->client_subnet_always_forward =
666ae8c6e27Sflorian 				(strcmp($2, "yes")==0);
667ae8c6e27Sflorian 	#else
668ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
669ae8c6e27Sflorian 	#endif
670ae8c6e27Sflorian 		free($2);
671ae8c6e27Sflorian 	}
672ae8c6e27Sflorian 	;
673ae8c6e27Sflorian server_client_subnet_opcode: VAR_CLIENT_SUBNET_OPCODE STRING_ARG
674ae8c6e27Sflorian 	{
675ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
676ae8c6e27Sflorian 		OUTYY(("P(client_subnet_opcode:%s)\n", $2));
677ae8c6e27Sflorian 		OUTYY(("P(Deprecated option, ignoring)\n"));
678ae8c6e27Sflorian 	#else
679ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
680ae8c6e27Sflorian 	#endif
681ae8c6e27Sflorian 		free($2);
682ae8c6e27Sflorian 	}
683ae8c6e27Sflorian 	;
684ae8c6e27Sflorian server_max_client_subnet_ipv4: VAR_MAX_CLIENT_SUBNET_IPV4 STRING_ARG
685ae8c6e27Sflorian 	{
686ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
687ae8c6e27Sflorian 		OUTYY(("P(max_client_subnet_ipv4:%s)\n", $2));
688ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
689ae8c6e27Sflorian 			yyerror("IPv4 subnet length expected");
690ae8c6e27Sflorian 		else if (atoi($2) > 32)
691ae8c6e27Sflorian 			cfg_parser->cfg->max_client_subnet_ipv4 = 32;
692ae8c6e27Sflorian 		else if (atoi($2) < 0)
693ae8c6e27Sflorian 			cfg_parser->cfg->max_client_subnet_ipv4 = 0;
694ae8c6e27Sflorian 		else cfg_parser->cfg->max_client_subnet_ipv4 = (uint8_t)atoi($2);
695ae8c6e27Sflorian 	#else
696ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
697ae8c6e27Sflorian 	#endif
698ae8c6e27Sflorian 		free($2);
699ae8c6e27Sflorian 	}
700ae8c6e27Sflorian 	;
701ae8c6e27Sflorian server_max_client_subnet_ipv6: VAR_MAX_CLIENT_SUBNET_IPV6 STRING_ARG
702ae8c6e27Sflorian 	{
703ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
704ae8c6e27Sflorian 		OUTYY(("P(max_client_subnet_ipv6:%s)\n", $2));
705ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
706ae8c6e27Sflorian 			yyerror("Ipv6 subnet length expected");
707ae8c6e27Sflorian 		else if (atoi($2) > 128)
708ae8c6e27Sflorian 			cfg_parser->cfg->max_client_subnet_ipv6 = 128;
709ae8c6e27Sflorian 		else if (atoi($2) < 0)
710ae8c6e27Sflorian 			cfg_parser->cfg->max_client_subnet_ipv6 = 0;
711ae8c6e27Sflorian 		else cfg_parser->cfg->max_client_subnet_ipv6 = (uint8_t)atoi($2);
712ae8c6e27Sflorian 	#else
713ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
714ae8c6e27Sflorian 	#endif
715ae8c6e27Sflorian 		free($2);
716ae8c6e27Sflorian 	}
717ae8c6e27Sflorian 	;
718ae8c6e27Sflorian server_min_client_subnet_ipv4: VAR_MIN_CLIENT_SUBNET_IPV4 STRING_ARG
719ae8c6e27Sflorian 	{
720ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
721ae8c6e27Sflorian 		OUTYY(("P(min_client_subnet_ipv4:%s)\n", $2));
722ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
723ae8c6e27Sflorian 			yyerror("IPv4 subnet length expected");
724ae8c6e27Sflorian 		else if (atoi($2) > 32)
725ae8c6e27Sflorian 			cfg_parser->cfg->min_client_subnet_ipv4 = 32;
726ae8c6e27Sflorian 		else if (atoi($2) < 0)
727ae8c6e27Sflorian 			cfg_parser->cfg->min_client_subnet_ipv4 = 0;
728ae8c6e27Sflorian 		else cfg_parser->cfg->min_client_subnet_ipv4 = (uint8_t)atoi($2);
729ae8c6e27Sflorian 	#else
730ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
731ae8c6e27Sflorian 	#endif
732ae8c6e27Sflorian 		free($2);
733ae8c6e27Sflorian 	}
734ae8c6e27Sflorian 	;
735ae8c6e27Sflorian server_min_client_subnet_ipv6: VAR_MIN_CLIENT_SUBNET_IPV6 STRING_ARG
736ae8c6e27Sflorian 	{
737ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
738ae8c6e27Sflorian 		OUTYY(("P(min_client_subnet_ipv6:%s)\n", $2));
739ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
740ae8c6e27Sflorian 			yyerror("Ipv6 subnet length expected");
741ae8c6e27Sflorian 		else if (atoi($2) > 128)
742ae8c6e27Sflorian 			cfg_parser->cfg->min_client_subnet_ipv6 = 128;
743ae8c6e27Sflorian 		else if (atoi($2) < 0)
744ae8c6e27Sflorian 			cfg_parser->cfg->min_client_subnet_ipv6 = 0;
745ae8c6e27Sflorian 		else cfg_parser->cfg->min_client_subnet_ipv6 = (uint8_t)atoi($2);
746ae8c6e27Sflorian 	#else
747ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
748ae8c6e27Sflorian 	#endif
749ae8c6e27Sflorian 		free($2);
750ae8c6e27Sflorian 	}
751ae8c6e27Sflorian 	;
752ae8c6e27Sflorian server_max_ecs_tree_size_ipv4: VAR_MAX_ECS_TREE_SIZE_IPV4 STRING_ARG
753ae8c6e27Sflorian 	{
754ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
755ae8c6e27Sflorian 		OUTYY(("P(max_ecs_tree_size_ipv4:%s)\n", $2));
756ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
757ae8c6e27Sflorian 			yyerror("IPv4 ECS tree size expected");
758ae8c6e27Sflorian 		else if (atoi($2) < 0)
759ae8c6e27Sflorian 			cfg_parser->cfg->max_ecs_tree_size_ipv4 = 0;
760ae8c6e27Sflorian 		else cfg_parser->cfg->max_ecs_tree_size_ipv4 = (uint32_t)atoi($2);
761ae8c6e27Sflorian 	#else
762ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
763ae8c6e27Sflorian 	#endif
764ae8c6e27Sflorian 		free($2);
765ae8c6e27Sflorian 	}
766ae8c6e27Sflorian 	;
767ae8c6e27Sflorian server_max_ecs_tree_size_ipv6: VAR_MAX_ECS_TREE_SIZE_IPV6 STRING_ARG
768ae8c6e27Sflorian 	{
769ae8c6e27Sflorian 	#ifdef CLIENT_SUBNET
770ae8c6e27Sflorian 		OUTYY(("P(max_ecs_tree_size_ipv6:%s)\n", $2));
771ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
772ae8c6e27Sflorian 			yyerror("IPv6 ECS tree size expected");
773ae8c6e27Sflorian 		else if (atoi($2) < 0)
774ae8c6e27Sflorian 			cfg_parser->cfg->max_ecs_tree_size_ipv6 = 0;
775ae8c6e27Sflorian 		else cfg_parser->cfg->max_ecs_tree_size_ipv6 = (uint32_t)atoi($2);
776ae8c6e27Sflorian 	#else
777ae8c6e27Sflorian 		OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
778ae8c6e27Sflorian 	#endif
779ae8c6e27Sflorian 		free($2);
780ae8c6e27Sflorian 	}
781ae8c6e27Sflorian 	;
782ae8c6e27Sflorian server_interface: VAR_INTERFACE STRING_ARG
783ae8c6e27Sflorian 	{
784ae8c6e27Sflorian 		OUTYY(("P(server_interface:%s)\n", $2));
785ae8c6e27Sflorian 		if(cfg_parser->cfg->num_ifs == 0)
786ae8c6e27Sflorian 			cfg_parser->cfg->ifs = calloc(1, sizeof(char*));
787ae8c6e27Sflorian 		else cfg_parser->cfg->ifs = realloc(cfg_parser->cfg->ifs,
788ae8c6e27Sflorian 				(cfg_parser->cfg->num_ifs+1)*sizeof(char*));
789ae8c6e27Sflorian 		if(!cfg_parser->cfg->ifs)
790ae8c6e27Sflorian 			yyerror("out of memory");
791ae8c6e27Sflorian 		else
792ae8c6e27Sflorian 			cfg_parser->cfg->ifs[cfg_parser->cfg->num_ifs++] = $2;
793ae8c6e27Sflorian 	}
794ae8c6e27Sflorian 	;
795ae8c6e27Sflorian server_outgoing_interface: VAR_OUTGOING_INTERFACE STRING_ARG
796ae8c6e27Sflorian 	{
797ae8c6e27Sflorian 		OUTYY(("P(server_outgoing_interface:%s)\n", $2));
798ae8c6e27Sflorian 		if(cfg_parser->cfg->num_out_ifs == 0)
799ae8c6e27Sflorian 			cfg_parser->cfg->out_ifs = calloc(1, sizeof(char*));
800ae8c6e27Sflorian 		else cfg_parser->cfg->out_ifs = realloc(
801ae8c6e27Sflorian 			cfg_parser->cfg->out_ifs,
802ae8c6e27Sflorian 			(cfg_parser->cfg->num_out_ifs+1)*sizeof(char*));
803ae8c6e27Sflorian 		if(!cfg_parser->cfg->out_ifs)
804ae8c6e27Sflorian 			yyerror("out of memory");
805ae8c6e27Sflorian 		else
806ae8c6e27Sflorian 			cfg_parser->cfg->out_ifs[
807ae8c6e27Sflorian 				cfg_parser->cfg->num_out_ifs++] = $2;
808ae8c6e27Sflorian 	}
809ae8c6e27Sflorian 	;
810ae8c6e27Sflorian server_outgoing_range: VAR_OUTGOING_RANGE STRING_ARG
811ae8c6e27Sflorian 	{
812ae8c6e27Sflorian 		OUTYY(("P(server_outgoing_range:%s)\n", $2));
813ae8c6e27Sflorian 		if(atoi($2) == 0)
814ae8c6e27Sflorian 			yyerror("number expected");
815ae8c6e27Sflorian 		else cfg_parser->cfg->outgoing_num_ports = atoi($2);
816ae8c6e27Sflorian 		free($2);
817ae8c6e27Sflorian 	}
818ae8c6e27Sflorian 	;
819ae8c6e27Sflorian server_outgoing_port_permit: VAR_OUTGOING_PORT_PERMIT STRING_ARG
820ae8c6e27Sflorian 	{
821ae8c6e27Sflorian 		OUTYY(("P(server_outgoing_port_permit:%s)\n", $2));
822ae8c6e27Sflorian 		if(!cfg_mark_ports($2, 1,
823ae8c6e27Sflorian 			cfg_parser->cfg->outgoing_avail_ports, 65536))
824ae8c6e27Sflorian 			yyerror("port number or range (\"low-high\") expected");
825ae8c6e27Sflorian 		free($2);
826ae8c6e27Sflorian 	}
827ae8c6e27Sflorian 	;
828ae8c6e27Sflorian server_outgoing_port_avoid: VAR_OUTGOING_PORT_AVOID STRING_ARG
829ae8c6e27Sflorian 	{
830ae8c6e27Sflorian 		OUTYY(("P(server_outgoing_port_avoid:%s)\n", $2));
831ae8c6e27Sflorian 		if(!cfg_mark_ports($2, 0,
832ae8c6e27Sflorian 			cfg_parser->cfg->outgoing_avail_ports, 65536))
833ae8c6e27Sflorian 			yyerror("port number or range (\"low-high\") expected");
834ae8c6e27Sflorian 		free($2);
835ae8c6e27Sflorian 	}
836ae8c6e27Sflorian 	;
837ae8c6e27Sflorian server_outgoing_num_tcp: VAR_OUTGOING_NUM_TCP STRING_ARG
838ae8c6e27Sflorian 	{
839ae8c6e27Sflorian 		OUTYY(("P(server_outgoing_num_tcp:%s)\n", $2));
840ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
841ae8c6e27Sflorian 			yyerror("number expected");
842ae8c6e27Sflorian 		else cfg_parser->cfg->outgoing_num_tcp = atoi($2);
843ae8c6e27Sflorian 		free($2);
844ae8c6e27Sflorian 	}
845ae8c6e27Sflorian 	;
846ae8c6e27Sflorian server_incoming_num_tcp: VAR_INCOMING_NUM_TCP STRING_ARG
847ae8c6e27Sflorian 	{
848ae8c6e27Sflorian 		OUTYY(("P(server_incoming_num_tcp:%s)\n", $2));
849ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
850ae8c6e27Sflorian 			yyerror("number expected");
851ae8c6e27Sflorian 		else cfg_parser->cfg->incoming_num_tcp = atoi($2);
852ae8c6e27Sflorian 		free($2);
853ae8c6e27Sflorian 	}
854ae8c6e27Sflorian 	;
855ae8c6e27Sflorian server_interface_automatic: VAR_INTERFACE_AUTOMATIC STRING_ARG
856ae8c6e27Sflorian 	{
857ae8c6e27Sflorian 		OUTYY(("P(server_interface_automatic:%s)\n", $2));
858ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
859ae8c6e27Sflorian 			yyerror("expected yes or no.");
860ae8c6e27Sflorian 		else cfg_parser->cfg->if_automatic = (strcmp($2, "yes")==0);
861ae8c6e27Sflorian 		free($2);
862ae8c6e27Sflorian 	}
863ae8c6e27Sflorian 	;
8647a05b9dfSflorian server_interface_automatic_ports: VAR_INTERFACE_AUTOMATIC_PORTS STRING_ARG
8657a05b9dfSflorian 	{
8667a05b9dfSflorian 		OUTYY(("P(server_interface_automatic_ports:%s)\n", $2));
8677a05b9dfSflorian 		free(cfg_parser->cfg->if_automatic_ports);
8687a05b9dfSflorian 		cfg_parser->cfg->if_automatic_ports = $2;
8697a05b9dfSflorian 	}
8707a05b9dfSflorian 	;
871ae8c6e27Sflorian server_do_ip4: VAR_DO_IP4 STRING_ARG
872ae8c6e27Sflorian 	{
873ae8c6e27Sflorian 		OUTYY(("P(server_do_ip4:%s)\n", $2));
874ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
875ae8c6e27Sflorian 			yyerror("expected yes or no.");
876ae8c6e27Sflorian 		else cfg_parser->cfg->do_ip4 = (strcmp($2, "yes")==0);
877ae8c6e27Sflorian 		free($2);
878ae8c6e27Sflorian 	}
879ae8c6e27Sflorian 	;
880ae8c6e27Sflorian server_do_ip6: VAR_DO_IP6 STRING_ARG
881ae8c6e27Sflorian 	{
882ae8c6e27Sflorian 		OUTYY(("P(server_do_ip6:%s)\n", $2));
883ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
884ae8c6e27Sflorian 			yyerror("expected yes or no.");
885ae8c6e27Sflorian 		else cfg_parser->cfg->do_ip6 = (strcmp($2, "yes")==0);
886ae8c6e27Sflorian 		free($2);
887ae8c6e27Sflorian 	}
888ae8c6e27Sflorian 	;
889d500c338Sflorian server_do_nat64: VAR_DO_NAT64 STRING_ARG
890d500c338Sflorian 	{
891d500c338Sflorian 		OUTYY(("P(server_do_nat64:%s)\n", $2));
892d500c338Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
893d500c338Sflorian 			yyerror("expected yes or no.");
894d500c338Sflorian 		else cfg_parser->cfg->do_nat64 = (strcmp($2, "yes")==0);
895d500c338Sflorian 		free($2);
896d500c338Sflorian 	}
897d500c338Sflorian 	;
898ae8c6e27Sflorian server_do_udp: VAR_DO_UDP STRING_ARG
899ae8c6e27Sflorian 	{
900ae8c6e27Sflorian 		OUTYY(("P(server_do_udp:%s)\n", $2));
901ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
902ae8c6e27Sflorian 			yyerror("expected yes or no.");
903ae8c6e27Sflorian 		else cfg_parser->cfg->do_udp = (strcmp($2, "yes")==0);
904ae8c6e27Sflorian 		free($2);
905ae8c6e27Sflorian 	}
906ae8c6e27Sflorian 	;
907ae8c6e27Sflorian server_do_tcp: VAR_DO_TCP STRING_ARG
908ae8c6e27Sflorian 	{
909ae8c6e27Sflorian 		OUTYY(("P(server_do_tcp:%s)\n", $2));
910ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
911ae8c6e27Sflorian 			yyerror("expected yes or no.");
912ae8c6e27Sflorian 		else cfg_parser->cfg->do_tcp = (strcmp($2, "yes")==0);
913ae8c6e27Sflorian 		free($2);
914ae8c6e27Sflorian 	}
915ae8c6e27Sflorian 	;
916e47fef9eSflorian server_prefer_ip4: VAR_PREFER_IP4 STRING_ARG
917e47fef9eSflorian 	{
918e47fef9eSflorian 		OUTYY(("P(server_prefer_ip4:%s)\n", $2));
919e47fef9eSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
920e47fef9eSflorian 			yyerror("expected yes or no.");
921e47fef9eSflorian 		else cfg_parser->cfg->prefer_ip4 = (strcmp($2, "yes")==0);
922e47fef9eSflorian 		free($2);
923e47fef9eSflorian 	}
924e47fef9eSflorian 	;
925ae8c6e27Sflorian server_prefer_ip6: VAR_PREFER_IP6 STRING_ARG
926ae8c6e27Sflorian 	{
927ae8c6e27Sflorian 		OUTYY(("P(server_prefer_ip6:%s)\n", $2));
928ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
929ae8c6e27Sflorian 			yyerror("expected yes or no.");
930ae8c6e27Sflorian 		else cfg_parser->cfg->prefer_ip6 = (strcmp($2, "yes")==0);
931ae8c6e27Sflorian 		free($2);
932ae8c6e27Sflorian 	}
933ae8c6e27Sflorian 	;
934ae8c6e27Sflorian server_tcp_mss: VAR_TCP_MSS STRING_ARG
935ae8c6e27Sflorian 	{
936ae8c6e27Sflorian 		OUTYY(("P(server_tcp_mss:%s)\n", $2));
937ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
938ae8c6e27Sflorian 				yyerror("number expected");
939ae8c6e27Sflorian 		else cfg_parser->cfg->tcp_mss = atoi($2);
940ae8c6e27Sflorian 		free($2);
941ae8c6e27Sflorian 	}
942ae8c6e27Sflorian 	;
943ae8c6e27Sflorian server_outgoing_tcp_mss: VAR_OUTGOING_TCP_MSS STRING_ARG
944ae8c6e27Sflorian 	{
945ae8c6e27Sflorian 		OUTYY(("P(server_outgoing_tcp_mss:%s)\n", $2));
946ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
947ae8c6e27Sflorian 			yyerror("number expected");
948ae8c6e27Sflorian 		else cfg_parser->cfg->outgoing_tcp_mss = atoi($2);
949ae8c6e27Sflorian 		free($2);
950ae8c6e27Sflorian 	}
951ae8c6e27Sflorian 	;
952ae8c6e27Sflorian server_tcp_idle_timeout: VAR_TCP_IDLE_TIMEOUT STRING_ARG
953ae8c6e27Sflorian 	{
954ae8c6e27Sflorian 		OUTYY(("P(server_tcp_idle_timeout:%s)\n", $2));
955ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
956ae8c6e27Sflorian 			yyerror("number expected");
957ae8c6e27Sflorian 		else if (atoi($2) > 120000)
958ae8c6e27Sflorian 			cfg_parser->cfg->tcp_idle_timeout = 120000;
959ae8c6e27Sflorian 		else if (atoi($2) < 1)
960ae8c6e27Sflorian 			cfg_parser->cfg->tcp_idle_timeout = 1;
961ae8c6e27Sflorian 		else cfg_parser->cfg->tcp_idle_timeout = atoi($2);
962ae8c6e27Sflorian 		free($2);
963ae8c6e27Sflorian 	}
964ae8c6e27Sflorian 	;
965411c5950Sflorian server_max_reuse_tcp_queries: VAR_MAX_REUSE_TCP_QUERIES STRING_ARG
966411c5950Sflorian 	{
967411c5950Sflorian 		OUTYY(("P(server_max_reuse_tcp_queries:%s)\n", $2));
968411c5950Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
969411c5950Sflorian 			yyerror("number expected");
970411c5950Sflorian 		else if (atoi($2) < 1)
971411c5950Sflorian 			cfg_parser->cfg->max_reuse_tcp_queries = 0;
972411c5950Sflorian 		else cfg_parser->cfg->max_reuse_tcp_queries = atoi($2);
973411c5950Sflorian 		free($2);
974411c5950Sflorian 	}
975411c5950Sflorian 	;
976411c5950Sflorian server_tcp_reuse_timeout: VAR_TCP_REUSE_TIMEOUT STRING_ARG
977411c5950Sflorian 	{
978411c5950Sflorian 		OUTYY(("P(server_tcp_reuse_timeout:%s)\n", $2));
979411c5950Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
980411c5950Sflorian 			yyerror("number expected");
981411c5950Sflorian 		else if (atoi($2) < 1)
982411c5950Sflorian 			cfg_parser->cfg->tcp_reuse_timeout = 0;
983411c5950Sflorian 		else cfg_parser->cfg->tcp_reuse_timeout = atoi($2);
984411c5950Sflorian 		free($2);
985411c5950Sflorian 	}
986411c5950Sflorian 	;
987411c5950Sflorian server_tcp_auth_query_timeout: VAR_TCP_AUTH_QUERY_TIMEOUT STRING_ARG
988411c5950Sflorian 	{
989411c5950Sflorian 		OUTYY(("P(server_tcp_auth_query_timeout:%s)\n", $2));
990411c5950Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
991411c5950Sflorian 			yyerror("number expected");
992411c5950Sflorian 		else if (atoi($2) < 1)
993411c5950Sflorian 			cfg_parser->cfg->tcp_auth_query_timeout = 0;
994411c5950Sflorian 		else cfg_parser->cfg->tcp_auth_query_timeout = atoi($2);
995411c5950Sflorian 		free($2);
996411c5950Sflorian 	}
997411c5950Sflorian 	;
998ae8c6e27Sflorian server_tcp_keepalive: VAR_EDNS_TCP_KEEPALIVE STRING_ARG
999ae8c6e27Sflorian 	{
1000ae8c6e27Sflorian 		OUTYY(("P(server_tcp_keepalive:%s)\n", $2));
1001ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1002ae8c6e27Sflorian 			yyerror("expected yes or no.");
1003ae8c6e27Sflorian 		else cfg_parser->cfg->do_tcp_keepalive = (strcmp($2, "yes")==0);
1004ae8c6e27Sflorian 		free($2);
1005ae8c6e27Sflorian 	}
1006ae8c6e27Sflorian 	;
1007ae8c6e27Sflorian server_tcp_keepalive_timeout: VAR_EDNS_TCP_KEEPALIVE_TIMEOUT STRING_ARG
1008ae8c6e27Sflorian 	{
1009ae8c6e27Sflorian 		OUTYY(("P(server_tcp_keepalive_timeout:%s)\n", $2));
1010ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
1011ae8c6e27Sflorian 			yyerror("number expected");
1012ae8c6e27Sflorian 		else if (atoi($2) > 6553500)
1013ae8c6e27Sflorian 			cfg_parser->cfg->tcp_keepalive_timeout = 6553500;
1014ae8c6e27Sflorian 		else if (atoi($2) < 1)
1015ae8c6e27Sflorian 			cfg_parser->cfg->tcp_keepalive_timeout = 0;
1016ae8c6e27Sflorian 		else cfg_parser->cfg->tcp_keepalive_timeout = atoi($2);
1017ae8c6e27Sflorian 		free($2);
1018ae8c6e27Sflorian 	}
1019ae8c6e27Sflorian 	;
1020d500c338Sflorian server_sock_queue_timeout: VAR_SOCK_QUEUE_TIMEOUT STRING_ARG
1021d500c338Sflorian 	{
1022d500c338Sflorian 		OUTYY(("P(server_sock_queue_timeout:%s)\n", $2));
1023d500c338Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
1024d500c338Sflorian 			yyerror("number expected");
1025d500c338Sflorian 		else if (atoi($2) > 6553500)
1026d500c338Sflorian 			cfg_parser->cfg->sock_queue_timeout = 6553500;
1027d500c338Sflorian 		else if (atoi($2) < 1)
1028d500c338Sflorian 			cfg_parser->cfg->sock_queue_timeout = 0;
1029d500c338Sflorian 		else cfg_parser->cfg->sock_queue_timeout = atoi($2);
1030d500c338Sflorian 		free($2);
1031d500c338Sflorian 	}
1032d500c338Sflorian 	;
1033ae8c6e27Sflorian server_tcp_upstream: VAR_TCP_UPSTREAM STRING_ARG
1034ae8c6e27Sflorian 	{
1035ae8c6e27Sflorian 		OUTYY(("P(server_tcp_upstream:%s)\n", $2));
1036ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1037ae8c6e27Sflorian 			yyerror("expected yes or no.");
1038ae8c6e27Sflorian 		else cfg_parser->cfg->tcp_upstream = (strcmp($2, "yes")==0);
1039ae8c6e27Sflorian 		free($2);
1040ae8c6e27Sflorian 	}
1041ae8c6e27Sflorian 	;
1042ae8c6e27Sflorian server_udp_upstream_without_downstream: VAR_UDP_UPSTREAM_WITHOUT_DOWNSTREAM STRING_ARG
1043ae8c6e27Sflorian 	{
1044ae8c6e27Sflorian 		OUTYY(("P(server_udp_upstream_without_downstream:%s)\n", $2));
1045ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1046ae8c6e27Sflorian 			yyerror("expected yes or no.");
1047ae8c6e27Sflorian 		else cfg_parser->cfg->udp_upstream_without_downstream = (strcmp($2, "yes")==0);
1048ae8c6e27Sflorian 		free($2);
1049ae8c6e27Sflorian 	}
1050ae8c6e27Sflorian 	;
1051ae8c6e27Sflorian server_ssl_upstream: VAR_SSL_UPSTREAM STRING_ARG
1052ae8c6e27Sflorian 	{
1053ae8c6e27Sflorian 		OUTYY(("P(server_ssl_upstream:%s)\n", $2));
1054ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1055ae8c6e27Sflorian 			yyerror("expected yes or no.");
1056ae8c6e27Sflorian 		else cfg_parser->cfg->ssl_upstream = (strcmp($2, "yes")==0);
1057ae8c6e27Sflorian 		free($2);
1058ae8c6e27Sflorian 	}
1059ae8c6e27Sflorian 	;
1060ae8c6e27Sflorian server_ssl_service_key: VAR_SSL_SERVICE_KEY STRING_ARG
1061ae8c6e27Sflorian 	{
1062ae8c6e27Sflorian 		OUTYY(("P(server_ssl_service_key:%s)\n", $2));
1063ae8c6e27Sflorian 		free(cfg_parser->cfg->ssl_service_key);
1064ae8c6e27Sflorian 		cfg_parser->cfg->ssl_service_key = $2;
1065ae8c6e27Sflorian 	}
1066ae8c6e27Sflorian 	;
1067ae8c6e27Sflorian server_ssl_service_pem: VAR_SSL_SERVICE_PEM STRING_ARG
1068ae8c6e27Sflorian 	{
1069ae8c6e27Sflorian 		OUTYY(("P(server_ssl_service_pem:%s)\n", $2));
1070ae8c6e27Sflorian 		free(cfg_parser->cfg->ssl_service_pem);
1071ae8c6e27Sflorian 		cfg_parser->cfg->ssl_service_pem = $2;
1072ae8c6e27Sflorian 	}
1073ae8c6e27Sflorian 	;
1074ae8c6e27Sflorian server_ssl_port: VAR_SSL_PORT STRING_ARG
1075ae8c6e27Sflorian 	{
1076ae8c6e27Sflorian 		OUTYY(("P(server_ssl_port:%s)\n", $2));
1077ae8c6e27Sflorian 		if(atoi($2) == 0)
1078ae8c6e27Sflorian 			yyerror("port number expected");
1079ae8c6e27Sflorian 		else cfg_parser->cfg->ssl_port = atoi($2);
1080ae8c6e27Sflorian 		free($2);
1081ae8c6e27Sflorian 	}
1082ae8c6e27Sflorian 	;
1083ae8c6e27Sflorian server_tls_cert_bundle: VAR_TLS_CERT_BUNDLE STRING_ARG
1084ae8c6e27Sflorian 	{
1085ae8c6e27Sflorian 		OUTYY(("P(server_tls_cert_bundle:%s)\n", $2));
1086ae8c6e27Sflorian 		free(cfg_parser->cfg->tls_cert_bundle);
1087ae8c6e27Sflorian 		cfg_parser->cfg->tls_cert_bundle = $2;
1088ae8c6e27Sflorian 	}
1089ae8c6e27Sflorian 	;
1090ae8c6e27Sflorian server_tls_win_cert: VAR_TLS_WIN_CERT STRING_ARG
1091ae8c6e27Sflorian 	{
1092ae8c6e27Sflorian 		OUTYY(("P(server_tls_win_cert:%s)\n", $2));
1093ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1094ae8c6e27Sflorian 			yyerror("expected yes or no.");
1095ae8c6e27Sflorian 		else cfg_parser->cfg->tls_win_cert = (strcmp($2, "yes")==0);
1096ae8c6e27Sflorian 		free($2);
1097ae8c6e27Sflorian 	}
1098ae8c6e27Sflorian 	;
1099ae8c6e27Sflorian server_tls_additional_port: VAR_TLS_ADDITIONAL_PORT STRING_ARG
1100ae8c6e27Sflorian 	{
1101ae8c6e27Sflorian 		OUTYY(("P(server_tls_additional_port:%s)\n", $2));
1102ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->tls_additional_port,
1103ae8c6e27Sflorian 			$2))
1104ae8c6e27Sflorian 			yyerror("out of memory");
1105ae8c6e27Sflorian 	}
1106ae8c6e27Sflorian 	;
1107e97c6e54Ssthen server_tls_ciphers: VAR_TLS_CIPHERS STRING_ARG
1108e97c6e54Ssthen 	{
1109e97c6e54Ssthen 		OUTYY(("P(server_tls_ciphers:%s)\n", $2));
1110e97c6e54Ssthen 		free(cfg_parser->cfg->tls_ciphers);
1111e97c6e54Ssthen 		cfg_parser->cfg->tls_ciphers = $2;
1112e97c6e54Ssthen 	}
1113e97c6e54Ssthen 	;
1114e97c6e54Ssthen server_tls_ciphersuites: VAR_TLS_CIPHERSUITES STRING_ARG
1115e97c6e54Ssthen 	{
1116e97c6e54Ssthen 		OUTYY(("P(server_tls_ciphersuites:%s)\n", $2));
1117e97c6e54Ssthen 		free(cfg_parser->cfg->tls_ciphersuites);
1118e97c6e54Ssthen 		cfg_parser->cfg->tls_ciphersuites = $2;
1119e97c6e54Ssthen 	}
1120e97c6e54Ssthen 	;
1121e97c6e54Ssthen server_tls_session_ticket_keys: VAR_TLS_SESSION_TICKET_KEYS STRING_ARG
1122e97c6e54Ssthen 	{
1123e97c6e54Ssthen 		OUTYY(("P(server_tls_session_ticket_keys:%s)\n", $2));
1124e97c6e54Ssthen 		if(!cfg_strlist_append(&cfg_parser->cfg->tls_session_ticket_keys,
1125e97c6e54Ssthen 			$2))
1126e97c6e54Ssthen 			yyerror("out of memory");
1127e97c6e54Ssthen 	}
1128e97c6e54Ssthen 	;
1129e47fef9eSflorian server_tls_use_sni: VAR_TLS_USE_SNI STRING_ARG
1130e47fef9eSflorian 	{
1131e47fef9eSflorian 		OUTYY(("P(server_tls_use_sni:%s)\n", $2));
1132e47fef9eSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1133e47fef9eSflorian 			yyerror("expected yes or no.");
1134e47fef9eSflorian 		else cfg_parser->cfg->tls_use_sni = (strcmp($2, "yes")==0);
1135e47fef9eSflorian 		free($2);
1136e47fef9eSflorian 	}
1137e47fef9eSflorian 	;
1138f4f0f0ceSflorian server_https_port: VAR_HTTPS_PORT STRING_ARG
1139f4f0f0ceSflorian 	{
1140f4f0f0ceSflorian 		OUTYY(("P(server_https_port:%s)\n", $2));
1141f4f0f0ceSflorian 		if(atoi($2) == 0)
1142f4f0f0ceSflorian 			yyerror("port number expected");
1143f4f0f0ceSflorian 		else cfg_parser->cfg->https_port = atoi($2);
1144853e076fSflorian 		free($2);
1145f4f0f0ceSflorian 	};
1146f4f0f0ceSflorian server_http_endpoint: VAR_HTTP_ENDPOINT STRING_ARG
1147f4f0f0ceSflorian 	{
1148f4f0f0ceSflorian 		OUTYY(("P(server_http_endpoint:%s)\n", $2));
1149f4f0f0ceSflorian 		free(cfg_parser->cfg->http_endpoint);
1150f4f0f0ceSflorian 		if($2 && $2[0] != '/') {
1151f4f0f0ceSflorian 			cfg_parser->cfg->http_endpoint = malloc(strlen($2)+2);
1152f4f0f0ceSflorian 			if(!cfg_parser->cfg->http_endpoint)
1153f4f0f0ceSflorian 				yyerror("out of memory");
1154f4f0f0ceSflorian 			cfg_parser->cfg->http_endpoint[0] = '/';
1155f4f0f0ceSflorian 			memmove(cfg_parser->cfg->http_endpoint+1, $2,
1156f4f0f0ceSflorian 				strlen($2)+1);
1157f4f0f0ceSflorian 			free($2);
1158f4f0f0ceSflorian 		} else {
1159f4f0f0ceSflorian 			cfg_parser->cfg->http_endpoint = $2;
1160f4f0f0ceSflorian 		}
1161f4f0f0ceSflorian 	};
1162f4f0f0ceSflorian server_http_max_streams: VAR_HTTP_MAX_STREAMS STRING_ARG
1163f4f0f0ceSflorian 	{
1164f4f0f0ceSflorian 		OUTYY(("P(server_http_max_streams:%s)\n", $2));
1165f4f0f0ceSflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
1166f4f0f0ceSflorian 			yyerror("number expected");
1167f4f0f0ceSflorian 		else cfg_parser->cfg->http_max_streams = atoi($2);
1168f4f0f0ceSflorian 		free($2);
1169f4f0f0ceSflorian 	};
1170f4f0f0ceSflorian server_http_query_buffer_size: VAR_HTTP_QUERY_BUFFER_SIZE STRING_ARG
1171f4f0f0ceSflorian 	{
1172f4f0f0ceSflorian 		OUTYY(("P(server_http_query_buffer_size:%s)\n", $2));
1173f4f0f0ceSflorian 		if(!cfg_parse_memsize($2,
1174f4f0f0ceSflorian 			&cfg_parser->cfg->http_query_buffer_size))
1175f4f0f0ceSflorian 			yyerror("memory size expected");
1176f4f0f0ceSflorian 		free($2);
1177f4f0f0ceSflorian 	};
1178f4f0f0ceSflorian server_http_response_buffer_size: VAR_HTTP_RESPONSE_BUFFER_SIZE STRING_ARG
1179f4f0f0ceSflorian 	{
1180f4f0f0ceSflorian 		OUTYY(("P(server_http_response_buffer_size:%s)\n", $2));
1181f4f0f0ceSflorian 		if(!cfg_parse_memsize($2,
1182f4f0f0ceSflorian 			&cfg_parser->cfg->http_response_buffer_size))
1183f4f0f0ceSflorian 			yyerror("memory size expected");
1184f4f0f0ceSflorian 		free($2);
1185f4f0f0ceSflorian 	};
1186f4f0f0ceSflorian server_http_nodelay: VAR_HTTP_NODELAY STRING_ARG
1187f4f0f0ceSflorian 	{
1188f4f0f0ceSflorian 		OUTYY(("P(server_http_nodelay:%s)\n", $2));
1189f4f0f0ceSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1190f4f0f0ceSflorian 			yyerror("expected yes or no.");
1191f4f0f0ceSflorian 		else cfg_parser->cfg->http_nodelay = (strcmp($2, "yes")==0);
1192f4f0f0ceSflorian 		free($2);
1193d500c338Sflorian 	};
1194853e076fSflorian server_http_notls_downstream: VAR_HTTP_NOTLS_DOWNSTREAM STRING_ARG
1195853e076fSflorian 	{
1196853e076fSflorian 		OUTYY(("P(server_http_notls_downstream:%s)\n", $2));
1197853e076fSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1198853e076fSflorian 			yyerror("expected yes or no.");
1199853e076fSflorian 		else cfg_parser->cfg->http_notls_downstream = (strcmp($2, "yes")==0);
1200853e076fSflorian 		free($2);
1201f4f0f0ceSflorian 	};
1202ae8c6e27Sflorian server_use_systemd: VAR_USE_SYSTEMD STRING_ARG
1203ae8c6e27Sflorian 	{
1204ae8c6e27Sflorian 		OUTYY(("P(server_use_systemd:%s)\n", $2));
1205ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1206ae8c6e27Sflorian 			yyerror("expected yes or no.");
1207ae8c6e27Sflorian 		else cfg_parser->cfg->use_systemd = (strcmp($2, "yes")==0);
1208ae8c6e27Sflorian 		free($2);
1209ae8c6e27Sflorian 	}
1210ae8c6e27Sflorian 	;
1211ae8c6e27Sflorian server_do_daemonize: VAR_DO_DAEMONIZE STRING_ARG
1212ae8c6e27Sflorian 	{
1213ae8c6e27Sflorian 		OUTYY(("P(server_do_daemonize:%s)\n", $2));
1214ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1215ae8c6e27Sflorian 			yyerror("expected yes or no.");
1216ae8c6e27Sflorian 		else cfg_parser->cfg->do_daemonize = (strcmp($2, "yes")==0);
1217ae8c6e27Sflorian 		free($2);
1218ae8c6e27Sflorian 	}
1219ae8c6e27Sflorian 	;
1220ae8c6e27Sflorian server_use_syslog: VAR_USE_SYSLOG STRING_ARG
1221ae8c6e27Sflorian 	{
1222ae8c6e27Sflorian 		OUTYY(("P(server_use_syslog:%s)\n", $2));
1223ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1224ae8c6e27Sflorian 			yyerror("expected yes or no.");
1225ae8c6e27Sflorian 		else cfg_parser->cfg->use_syslog = (strcmp($2, "yes")==0);
1226ae8c6e27Sflorian #if !defined(HAVE_SYSLOG_H) && !defined(UB_ON_WINDOWS)
1227ae8c6e27Sflorian 		if(strcmp($2, "yes") == 0)
1228ae8c6e27Sflorian 			yyerror("no syslog services are available. "
1229ae8c6e27Sflorian 				"(reconfigure and compile to add)");
1230ae8c6e27Sflorian #endif
1231ae8c6e27Sflorian 		free($2);
1232ae8c6e27Sflorian 	}
1233ae8c6e27Sflorian 	;
1234ae8c6e27Sflorian server_log_time_ascii: VAR_LOG_TIME_ASCII STRING_ARG
1235ae8c6e27Sflorian 	{
1236ae8c6e27Sflorian 		OUTYY(("P(server_log_time_ascii:%s)\n", $2));
1237ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1238ae8c6e27Sflorian 			yyerror("expected yes or no.");
1239ae8c6e27Sflorian 		else cfg_parser->cfg->log_time_ascii = (strcmp($2, "yes")==0);
1240ae8c6e27Sflorian 		free($2);
1241ae8c6e27Sflorian 	}
1242ae8c6e27Sflorian 	;
1243ae8c6e27Sflorian server_log_queries: VAR_LOG_QUERIES STRING_ARG
1244ae8c6e27Sflorian 	{
1245ae8c6e27Sflorian 		OUTYY(("P(server_log_queries:%s)\n", $2));
1246ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1247ae8c6e27Sflorian 			yyerror("expected yes or no.");
1248ae8c6e27Sflorian 		else cfg_parser->cfg->log_queries = (strcmp($2, "yes")==0);
1249ae8c6e27Sflorian 		free($2);
1250ae8c6e27Sflorian 	}
1251ae8c6e27Sflorian 	;
1252ae8c6e27Sflorian server_log_replies: VAR_LOG_REPLIES STRING_ARG
1253ae8c6e27Sflorian 	{
1254ae8c6e27Sflorian 		OUTYY(("P(server_log_replies:%s)\n", $2));
1255ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1256ae8c6e27Sflorian 			yyerror("expected yes or no.");
1257ae8c6e27Sflorian 		else cfg_parser->cfg->log_replies = (strcmp($2, "yes")==0);
1258ae8c6e27Sflorian 		free($2);
1259ae8c6e27Sflorian 	}
1260ae8c6e27Sflorian 	;
1261e97c6e54Ssthen server_log_tag_queryreply: VAR_LOG_TAG_QUERYREPLY STRING_ARG
1262e97c6e54Ssthen 	{
1263e97c6e54Ssthen 		OUTYY(("P(server_log_tag_queryreply:%s)\n", $2));
1264e97c6e54Ssthen 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1265e97c6e54Ssthen 			yyerror("expected yes or no.");
1266e97c6e54Ssthen 		else cfg_parser->cfg->log_tag_queryreply = (strcmp($2, "yes")==0);
1267e97c6e54Ssthen 		free($2);
1268e97c6e54Ssthen 	}
1269e97c6e54Ssthen 	;
1270ae8c6e27Sflorian server_log_servfail: VAR_LOG_SERVFAIL STRING_ARG
1271ae8c6e27Sflorian 	{
1272ae8c6e27Sflorian 		OUTYY(("P(server_log_servfail:%s)\n", $2));
1273ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1274ae8c6e27Sflorian 			yyerror("expected yes or no.");
1275ae8c6e27Sflorian 		else cfg_parser->cfg->log_servfail = (strcmp($2, "yes")==0);
1276ae8c6e27Sflorian 		free($2);
1277ae8c6e27Sflorian 	}
1278ae8c6e27Sflorian 	;
127954cc57acSflorian server_log_destaddr: VAR_LOG_DESTADDR STRING_ARG
128054cc57acSflorian 	{
128154cc57acSflorian 		OUTYY(("P(server_log_destaddr:%s)\n", $2));
128254cc57acSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
128354cc57acSflorian 			yyerror("expected yes or no.");
128454cc57acSflorian 		else cfg_parser->cfg->log_destaddr = (strcmp($2, "yes")==0);
128554cc57acSflorian 		free($2);
128654cc57acSflorian 	}
128754cc57acSflorian 	;
1288ae8c6e27Sflorian server_log_local_actions: VAR_LOG_LOCAL_ACTIONS STRING_ARG
1289ae8c6e27Sflorian 	{
1290ae8c6e27Sflorian 		OUTYY(("P(server_log_local_actions:%s)\n", $2));
1291ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1292ae8c6e27Sflorian 			yyerror("expected yes or no.");
1293ae8c6e27Sflorian 		else cfg_parser->cfg->log_local_actions = (strcmp($2, "yes")==0);
1294ae8c6e27Sflorian 		free($2);
1295ae8c6e27Sflorian 	}
1296ae8c6e27Sflorian 	;
1297ae8c6e27Sflorian server_chroot: VAR_CHROOT STRING_ARG
1298ae8c6e27Sflorian 	{
1299ae8c6e27Sflorian 		OUTYY(("P(server_chroot:%s)\n", $2));
1300ae8c6e27Sflorian 		free(cfg_parser->cfg->chrootdir);
1301ae8c6e27Sflorian 		cfg_parser->cfg->chrootdir = $2;
1302ae8c6e27Sflorian 	}
1303ae8c6e27Sflorian 	;
1304ae8c6e27Sflorian server_username: VAR_USERNAME STRING_ARG
1305ae8c6e27Sflorian 	{
1306ae8c6e27Sflorian 		OUTYY(("P(server_username:%s)\n", $2));
1307ae8c6e27Sflorian 		free(cfg_parser->cfg->username);
1308ae8c6e27Sflorian 		cfg_parser->cfg->username = $2;
1309ae8c6e27Sflorian 	}
1310ae8c6e27Sflorian 	;
1311ae8c6e27Sflorian server_directory: VAR_DIRECTORY STRING_ARG
1312ae8c6e27Sflorian 	{
1313ae8c6e27Sflorian 		OUTYY(("P(server_directory:%s)\n", $2));
1314ae8c6e27Sflorian 		free(cfg_parser->cfg->directory);
1315ae8c6e27Sflorian 		cfg_parser->cfg->directory = $2;
1316ae8c6e27Sflorian 		/* change there right away for includes relative to this */
1317ae8c6e27Sflorian 		if($2[0]) {
1318ae8c6e27Sflorian 			char* d;
1319ae8c6e27Sflorian #ifdef UB_ON_WINDOWS
1320ae8c6e27Sflorian 			w_config_adjust_directory(cfg_parser->cfg);
1321ae8c6e27Sflorian #endif
1322ae8c6e27Sflorian 			d = cfg_parser->cfg->directory;
1323ae8c6e27Sflorian 			/* adjust directory if we have already chroot,
1324ae8c6e27Sflorian 			 * like, we reread after sighup */
1325ae8c6e27Sflorian 			if(cfg_parser->chroot && cfg_parser->chroot[0] &&
1326ae8c6e27Sflorian 				strncmp(d, cfg_parser->chroot, strlen(
1327ae8c6e27Sflorian 				cfg_parser->chroot)) == 0)
1328ae8c6e27Sflorian 				d += strlen(cfg_parser->chroot);
1329ae8c6e27Sflorian 			if(d[0]) {
1330ae8c6e27Sflorian 				if(chdir(d))
1331ae8c6e27Sflorian 				log_err("cannot chdir to directory: %s (%s)",
1332ae8c6e27Sflorian 					d, strerror(errno));
1333ae8c6e27Sflorian 			}
1334ae8c6e27Sflorian 		}
1335ae8c6e27Sflorian 	}
1336ae8c6e27Sflorian 	;
1337ae8c6e27Sflorian server_logfile: VAR_LOGFILE STRING_ARG
1338ae8c6e27Sflorian 	{
1339ae8c6e27Sflorian 		OUTYY(("P(server_logfile:%s)\n", $2));
1340ae8c6e27Sflorian 		free(cfg_parser->cfg->logfile);
1341ae8c6e27Sflorian 		cfg_parser->cfg->logfile = $2;
1342ae8c6e27Sflorian 		cfg_parser->cfg->use_syslog = 0;
1343ae8c6e27Sflorian 	}
1344ae8c6e27Sflorian 	;
1345ae8c6e27Sflorian server_pidfile: VAR_PIDFILE STRING_ARG
1346ae8c6e27Sflorian 	{
1347ae8c6e27Sflorian 		OUTYY(("P(server_pidfile:%s)\n", $2));
1348ae8c6e27Sflorian 		free(cfg_parser->cfg->pidfile);
1349ae8c6e27Sflorian 		cfg_parser->cfg->pidfile = $2;
1350ae8c6e27Sflorian 	}
1351ae8c6e27Sflorian 	;
1352ae8c6e27Sflorian server_root_hints: VAR_ROOT_HINTS STRING_ARG
1353ae8c6e27Sflorian 	{
1354ae8c6e27Sflorian 		OUTYY(("P(server_root_hints:%s)\n", $2));
1355ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->root_hints, $2))
1356ae8c6e27Sflorian 			yyerror("out of memory");
1357ae8c6e27Sflorian 	}
1358ae8c6e27Sflorian 	;
1359ae8c6e27Sflorian server_dlv_anchor_file: VAR_DLV_ANCHOR_FILE STRING_ARG
1360ae8c6e27Sflorian 	{
1361ae8c6e27Sflorian 		OUTYY(("P(server_dlv_anchor_file:%s)\n", $2));
1362f4f0f0ceSflorian 		log_warn("option dlv-anchor-file ignored: DLV is decommissioned");
1363f4f0f0ceSflorian 		free($2);
1364ae8c6e27Sflorian 	}
1365ae8c6e27Sflorian 	;
1366ae8c6e27Sflorian server_dlv_anchor: VAR_DLV_ANCHOR STRING_ARG
1367ae8c6e27Sflorian 	{
1368ae8c6e27Sflorian 		OUTYY(("P(server_dlv_anchor:%s)\n", $2));
1369f4f0f0ceSflorian 		log_warn("option dlv-anchor ignored: DLV is decommissioned");
1370f4f0f0ceSflorian 		free($2);
1371ae8c6e27Sflorian 	}
1372ae8c6e27Sflorian 	;
1373ae8c6e27Sflorian server_auto_trust_anchor_file: VAR_AUTO_TRUST_ANCHOR_FILE STRING_ARG
1374ae8c6e27Sflorian 	{
1375ae8c6e27Sflorian 		OUTYY(("P(server_auto_trust_anchor_file:%s)\n", $2));
1376ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->
1377ae8c6e27Sflorian 			auto_trust_anchor_file_list, $2))
1378ae8c6e27Sflorian 			yyerror("out of memory");
1379ae8c6e27Sflorian 	}
1380ae8c6e27Sflorian 	;
1381ae8c6e27Sflorian server_trust_anchor_file: VAR_TRUST_ANCHOR_FILE STRING_ARG
1382ae8c6e27Sflorian 	{
1383ae8c6e27Sflorian 		OUTYY(("P(server_trust_anchor_file:%s)\n", $2));
1384ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->
1385ae8c6e27Sflorian 			trust_anchor_file_list, $2))
1386ae8c6e27Sflorian 			yyerror("out of memory");
1387ae8c6e27Sflorian 	}
1388ae8c6e27Sflorian 	;
1389ae8c6e27Sflorian server_trusted_keys_file: VAR_TRUSTED_KEYS_FILE STRING_ARG
1390ae8c6e27Sflorian 	{
1391ae8c6e27Sflorian 		OUTYY(("P(server_trusted_keys_file:%s)\n", $2));
1392ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->
1393ae8c6e27Sflorian 			trusted_keys_file_list, $2))
1394ae8c6e27Sflorian 			yyerror("out of memory");
1395ae8c6e27Sflorian 	}
1396ae8c6e27Sflorian 	;
1397ae8c6e27Sflorian server_trust_anchor: VAR_TRUST_ANCHOR STRING_ARG
1398ae8c6e27Sflorian 	{
1399ae8c6e27Sflorian 		OUTYY(("P(server_trust_anchor:%s)\n", $2));
1400ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->trust_anchor_list, $2))
1401ae8c6e27Sflorian 			yyerror("out of memory");
1402ae8c6e27Sflorian 	}
1403ae8c6e27Sflorian 	;
1404ae8c6e27Sflorian server_trust_anchor_signaling: VAR_TRUST_ANCHOR_SIGNALING STRING_ARG
1405ae8c6e27Sflorian 	{
1406ae8c6e27Sflorian 		OUTYY(("P(server_trust_anchor_signaling:%s)\n", $2));
1407ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1408ae8c6e27Sflorian 			yyerror("expected yes or no.");
1409ae8c6e27Sflorian 		else
1410ae8c6e27Sflorian 			cfg_parser->cfg->trust_anchor_signaling =
1411ae8c6e27Sflorian 				(strcmp($2, "yes")==0);
1412ae8c6e27Sflorian 		free($2);
1413ae8c6e27Sflorian 	}
1414ae8c6e27Sflorian 	;
1415ae8c6e27Sflorian server_root_key_sentinel: VAR_ROOT_KEY_SENTINEL STRING_ARG
1416ae8c6e27Sflorian 	{
1417ae8c6e27Sflorian 		OUTYY(("P(server_root_key_sentinel:%s)\n", $2));
1418ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1419ae8c6e27Sflorian 			yyerror("expected yes or no.");
1420ae8c6e27Sflorian 		else
1421ae8c6e27Sflorian 			cfg_parser->cfg->root_key_sentinel =
1422ae8c6e27Sflorian 				(strcmp($2, "yes")==0);
1423ae8c6e27Sflorian 		free($2);
1424ae8c6e27Sflorian 	}
1425ae8c6e27Sflorian 	;
1426ae8c6e27Sflorian server_domain_insecure: VAR_DOMAIN_INSECURE STRING_ARG
1427ae8c6e27Sflorian 	{
1428ae8c6e27Sflorian 		OUTYY(("P(server_domain_insecure:%s)\n", $2));
1429ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->domain_insecure, $2))
1430ae8c6e27Sflorian 			yyerror("out of memory");
1431ae8c6e27Sflorian 	}
1432ae8c6e27Sflorian 	;
1433ae8c6e27Sflorian server_hide_identity: VAR_HIDE_IDENTITY STRING_ARG
1434ae8c6e27Sflorian 	{
1435ae8c6e27Sflorian 		OUTYY(("P(server_hide_identity:%s)\n", $2));
1436ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1437ae8c6e27Sflorian 			yyerror("expected yes or no.");
1438ae8c6e27Sflorian 		else cfg_parser->cfg->hide_identity = (strcmp($2, "yes")==0);
1439ae8c6e27Sflorian 		free($2);
1440ae8c6e27Sflorian 	}
1441ae8c6e27Sflorian 	;
1442ae8c6e27Sflorian server_hide_version: VAR_HIDE_VERSION STRING_ARG
1443ae8c6e27Sflorian 	{
1444ae8c6e27Sflorian 		OUTYY(("P(server_hide_version:%s)\n", $2));
1445ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1446ae8c6e27Sflorian 			yyerror("expected yes or no.");
1447ae8c6e27Sflorian 		else cfg_parser->cfg->hide_version = (strcmp($2, "yes")==0);
1448ae8c6e27Sflorian 		free($2);
1449ae8c6e27Sflorian 	}
1450ae8c6e27Sflorian 	;
1451ae8c6e27Sflorian server_hide_trustanchor: VAR_HIDE_TRUSTANCHOR STRING_ARG
1452ae8c6e27Sflorian 	{
1453ae8c6e27Sflorian 		OUTYY(("P(server_hide_trustanchor:%s)\n", $2));
1454ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1455ae8c6e27Sflorian 			yyerror("expected yes or no.");
1456ae8c6e27Sflorian 		else cfg_parser->cfg->hide_trustanchor = (strcmp($2, "yes")==0);
1457ae8c6e27Sflorian 		free($2);
1458ae8c6e27Sflorian 	}
1459ae8c6e27Sflorian 	;
1460411c5950Sflorian server_hide_http_user_agent: VAR_HIDE_HTTP_USER_AGENT STRING_ARG
1461411c5950Sflorian 	{
1462411c5950Sflorian 		OUTYY(("P(server_hide_user_agent:%s)\n", $2));
1463411c5950Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1464411c5950Sflorian 			yyerror("expected yes or no.");
1465411c5950Sflorian 		else cfg_parser->cfg->hide_http_user_agent = (strcmp($2, "yes")==0);
1466411c5950Sflorian 		free($2);
1467411c5950Sflorian 	}
1468411c5950Sflorian 	;
1469ae8c6e27Sflorian server_identity: VAR_IDENTITY STRING_ARG
1470ae8c6e27Sflorian 	{
1471ae8c6e27Sflorian 		OUTYY(("P(server_identity:%s)\n", $2));
1472ae8c6e27Sflorian 		free(cfg_parser->cfg->identity);
1473ae8c6e27Sflorian 		cfg_parser->cfg->identity = $2;
1474ae8c6e27Sflorian 	}
1475ae8c6e27Sflorian 	;
1476ae8c6e27Sflorian server_version: VAR_VERSION STRING_ARG
1477ae8c6e27Sflorian 	{
1478ae8c6e27Sflorian 		OUTYY(("P(server_version:%s)\n", $2));
1479ae8c6e27Sflorian 		free(cfg_parser->cfg->version);
1480ae8c6e27Sflorian 		cfg_parser->cfg->version = $2;
1481ae8c6e27Sflorian 	}
1482ae8c6e27Sflorian 	;
1483411c5950Sflorian server_http_user_agent: VAR_HTTP_USER_AGENT STRING_ARG
1484411c5950Sflorian 	{
1485411c5950Sflorian 		OUTYY(("P(server_http_user_agent:%s)\n", $2));
1486411c5950Sflorian 		free(cfg_parser->cfg->http_user_agent);
1487411c5950Sflorian 		cfg_parser->cfg->http_user_agent = $2;
1488411c5950Sflorian 	}
1489411c5950Sflorian 	;
1490a8eaceedSflorian server_nsid: VAR_NSID STRING_ARG
1491a8eaceedSflorian 	{
1492a8eaceedSflorian 		OUTYY(("P(server_nsid:%s)\n", $2));
1493a8eaceedSflorian 		free(cfg_parser->cfg->nsid_cfg_str);
1494a8eaceedSflorian 		cfg_parser->cfg->nsid_cfg_str = $2;
1495a8eaceedSflorian 		free(cfg_parser->cfg->nsid);
1496a8eaceedSflorian 		cfg_parser->cfg->nsid = NULL;
1497a8eaceedSflorian 		cfg_parser->cfg->nsid_len = 0;
1498a8eaceedSflorian 		if (*$2 == 0)
1499a8eaceedSflorian 			; /* pass; empty string is not setting nsid */
1500a8eaceedSflorian 		else if (!(cfg_parser->cfg->nsid = cfg_parse_nsid(
1501a8eaceedSflorian 					$2, &cfg_parser->cfg->nsid_len)))
1502a8eaceedSflorian 			yyerror("the NSID must be either a hex string or an "
1503a8eaceedSflorian 			    "ascii character string prepended with ascii_.");
1504a8eaceedSflorian 	}
1505a8eaceedSflorian 	;
1506ae8c6e27Sflorian server_so_rcvbuf: VAR_SO_RCVBUF STRING_ARG
1507ae8c6e27Sflorian 	{
1508ae8c6e27Sflorian 		OUTYY(("P(server_so_rcvbuf:%s)\n", $2));
1509ae8c6e27Sflorian 		if(!cfg_parse_memsize($2, &cfg_parser->cfg->so_rcvbuf))
1510ae8c6e27Sflorian 			yyerror("buffer size expected");
1511ae8c6e27Sflorian 		free($2);
1512ae8c6e27Sflorian 	}
1513ae8c6e27Sflorian 	;
1514ae8c6e27Sflorian server_so_sndbuf: VAR_SO_SNDBUF STRING_ARG
1515ae8c6e27Sflorian 	{
1516ae8c6e27Sflorian 		OUTYY(("P(server_so_sndbuf:%s)\n", $2));
1517ae8c6e27Sflorian 		if(!cfg_parse_memsize($2, &cfg_parser->cfg->so_sndbuf))
1518ae8c6e27Sflorian 			yyerror("buffer size expected");
1519ae8c6e27Sflorian 		free($2);
1520ae8c6e27Sflorian 	}
1521ae8c6e27Sflorian 	;
1522ae8c6e27Sflorian server_so_reuseport: VAR_SO_REUSEPORT STRING_ARG
1523ae8c6e27Sflorian 	{
1524ae8c6e27Sflorian 		OUTYY(("P(server_so_reuseport:%s)\n", $2));
1525ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1526ae8c6e27Sflorian 			yyerror("expected yes or no.");
1527ae8c6e27Sflorian 		else cfg_parser->cfg->so_reuseport =
1528ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1529ae8c6e27Sflorian 		free($2);
1530ae8c6e27Sflorian 	}
1531ae8c6e27Sflorian 	;
1532ae8c6e27Sflorian server_ip_transparent: VAR_IP_TRANSPARENT STRING_ARG
1533ae8c6e27Sflorian 	{
1534ae8c6e27Sflorian 		OUTYY(("P(server_ip_transparent:%s)\n", $2));
1535ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1536ae8c6e27Sflorian 			yyerror("expected yes or no.");
1537ae8c6e27Sflorian 		else cfg_parser->cfg->ip_transparent =
1538ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1539ae8c6e27Sflorian 		free($2);
1540ae8c6e27Sflorian 	}
1541ae8c6e27Sflorian 	;
1542ae8c6e27Sflorian server_ip_freebind: VAR_IP_FREEBIND STRING_ARG
1543ae8c6e27Sflorian 	{
1544ae8c6e27Sflorian 		OUTYY(("P(server_ip_freebind:%s)\n", $2));
1545ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1546ae8c6e27Sflorian 			yyerror("expected yes or no.");
1547ae8c6e27Sflorian 		else cfg_parser->cfg->ip_freebind =
1548ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1549ae8c6e27Sflorian 		free($2);
1550ae8c6e27Sflorian 	}
1551ae8c6e27Sflorian 	;
1552e47fef9eSflorian server_ip_dscp: VAR_IP_DSCP STRING_ARG
1553e47fef9eSflorian 	{
1554e47fef9eSflorian 		OUTYY(("P(server_ip_dscp:%s)\n", $2));
1555e47fef9eSflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
1556e47fef9eSflorian 			yyerror("number expected");
1557e47fef9eSflorian 		else if (atoi($2) > 63)
1558e47fef9eSflorian 			yyerror("value too large (max 63)");
1559e47fef9eSflorian 		else if (atoi($2) < 0)
1560e47fef9eSflorian 			yyerror("value too small (min 0)");
1561e47fef9eSflorian 		else
1562e47fef9eSflorian 			cfg_parser->cfg->ip_dscp = atoi($2);
1563e47fef9eSflorian 		free($2);
1564e47fef9eSflorian 	}
1565e47fef9eSflorian 	;
1566e97c6e54Ssthen server_stream_wait_size: VAR_STREAM_WAIT_SIZE STRING_ARG
1567e97c6e54Ssthen 	{
1568e97c6e54Ssthen 		OUTYY(("P(server_stream_wait_size:%s)\n", $2));
1569e97c6e54Ssthen 		if(!cfg_parse_memsize($2, &cfg_parser->cfg->stream_wait_size))
1570e97c6e54Ssthen 			yyerror("memory size expected");
1571e97c6e54Ssthen 		free($2);
1572e97c6e54Ssthen 	}
1573e97c6e54Ssthen 	;
1574ae8c6e27Sflorian server_edns_buffer_size: VAR_EDNS_BUFFER_SIZE STRING_ARG
1575ae8c6e27Sflorian 	{
1576ae8c6e27Sflorian 		OUTYY(("P(server_edns_buffer_size:%s)\n", $2));
1577ae8c6e27Sflorian 		if(atoi($2) == 0)
1578ae8c6e27Sflorian 			yyerror("number expected");
1579ae8c6e27Sflorian 		else if (atoi($2) < 12)
1580ae8c6e27Sflorian 			yyerror("edns buffer size too small");
1581ae8c6e27Sflorian 		else if (atoi($2) > 65535)
1582ae8c6e27Sflorian 			cfg_parser->cfg->edns_buffer_size = 65535;
1583ae8c6e27Sflorian 		else cfg_parser->cfg->edns_buffer_size = atoi($2);
1584ae8c6e27Sflorian 		free($2);
1585ae8c6e27Sflorian 	}
1586ae8c6e27Sflorian 	;
1587ae8c6e27Sflorian server_msg_buffer_size: VAR_MSG_BUFFER_SIZE STRING_ARG
1588ae8c6e27Sflorian 	{
1589ae8c6e27Sflorian 		OUTYY(("P(server_msg_buffer_size:%s)\n", $2));
1590ae8c6e27Sflorian 		if(atoi($2) == 0)
1591ae8c6e27Sflorian 			yyerror("number expected");
1592ae8c6e27Sflorian 		else if (atoi($2) < 4096)
1593ae8c6e27Sflorian 			yyerror("message buffer size too small (use 4096)");
1594ae8c6e27Sflorian 		else cfg_parser->cfg->msg_buffer_size = atoi($2);
1595ae8c6e27Sflorian 		free($2);
1596ae8c6e27Sflorian 	}
1597ae8c6e27Sflorian 	;
1598ae8c6e27Sflorian server_msg_cache_size: VAR_MSG_CACHE_SIZE STRING_ARG
1599ae8c6e27Sflorian 	{
1600ae8c6e27Sflorian 		OUTYY(("P(server_msg_cache_size:%s)\n", $2));
1601ae8c6e27Sflorian 		if(!cfg_parse_memsize($2, &cfg_parser->cfg->msg_cache_size))
1602ae8c6e27Sflorian 			yyerror("memory size expected");
1603ae8c6e27Sflorian 		free($2);
1604ae8c6e27Sflorian 	}
1605ae8c6e27Sflorian 	;
1606ae8c6e27Sflorian server_msg_cache_slabs: VAR_MSG_CACHE_SLABS STRING_ARG
1607ae8c6e27Sflorian 	{
1608ae8c6e27Sflorian 		OUTYY(("P(server_msg_cache_slabs:%s)\n", $2));
1609a1a7ba80Sflorian 		if(atoi($2) == 0) {
1610ae8c6e27Sflorian 			yyerror("number expected");
1611a1a7ba80Sflorian 		} else {
1612ae8c6e27Sflorian 			cfg_parser->cfg->msg_cache_slabs = atoi($2);
1613ae8c6e27Sflorian 			if(!is_pow2(cfg_parser->cfg->msg_cache_slabs))
1614ae8c6e27Sflorian 				yyerror("must be a power of 2");
1615ae8c6e27Sflorian 		}
1616ae8c6e27Sflorian 		free($2);
1617ae8c6e27Sflorian 	}
1618ae8c6e27Sflorian 	;
1619ae8c6e27Sflorian server_num_queries_per_thread: VAR_NUM_QUERIES_PER_THREAD STRING_ARG
1620ae8c6e27Sflorian 	{
1621ae8c6e27Sflorian 		OUTYY(("P(server_num_queries_per_thread:%s)\n", $2));
1622ae8c6e27Sflorian 		if(atoi($2) == 0)
1623ae8c6e27Sflorian 			yyerror("number expected");
1624ae8c6e27Sflorian 		else cfg_parser->cfg->num_queries_per_thread = atoi($2);
1625ae8c6e27Sflorian 		free($2);
1626ae8c6e27Sflorian 	}
1627ae8c6e27Sflorian 	;
1628ae8c6e27Sflorian server_jostle_timeout: VAR_JOSTLE_TIMEOUT STRING_ARG
1629ae8c6e27Sflorian 	{
1630ae8c6e27Sflorian 		OUTYY(("P(server_jostle_timeout:%s)\n", $2));
1631ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
1632ae8c6e27Sflorian 			yyerror("number expected");
1633ae8c6e27Sflorian 		else cfg_parser->cfg->jostle_time = atoi($2);
1634ae8c6e27Sflorian 		free($2);
1635ae8c6e27Sflorian 	}
1636ae8c6e27Sflorian 	;
1637ae8c6e27Sflorian server_delay_close: VAR_DELAY_CLOSE STRING_ARG
1638ae8c6e27Sflorian 	{
1639ae8c6e27Sflorian 		OUTYY(("P(server_delay_close:%s)\n", $2));
1640ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
1641ae8c6e27Sflorian 			yyerror("number expected");
1642ae8c6e27Sflorian 		else cfg_parser->cfg->delay_close = atoi($2);
1643ae8c6e27Sflorian 		free($2);
1644ae8c6e27Sflorian 	}
1645ae8c6e27Sflorian 	;
1646853e076fSflorian server_udp_connect: VAR_UDP_CONNECT STRING_ARG
1647853e076fSflorian 	{
1648853e076fSflorian 		OUTYY(("P(server_udp_connect:%s)\n", $2));
1649853e076fSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1650853e076fSflorian 			yyerror("expected yes or no.");
1651853e076fSflorian 		else cfg_parser->cfg->udp_connect = (strcmp($2, "yes")==0);
1652853e076fSflorian 		free($2);
1653853e076fSflorian 	}
1654853e076fSflorian 	;
1655ae8c6e27Sflorian server_unblock_lan_zones: VAR_UNBLOCK_LAN_ZONES STRING_ARG
1656ae8c6e27Sflorian 	{
1657ae8c6e27Sflorian 		OUTYY(("P(server_unblock_lan_zones:%s)\n", $2));
1658ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1659ae8c6e27Sflorian 			yyerror("expected yes or no.");
1660ae8c6e27Sflorian 		else cfg_parser->cfg->unblock_lan_zones =
1661ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1662ae8c6e27Sflorian 		free($2);
1663ae8c6e27Sflorian 	}
1664ae8c6e27Sflorian 	;
1665ae8c6e27Sflorian server_insecure_lan_zones: VAR_INSECURE_LAN_ZONES STRING_ARG
1666ae8c6e27Sflorian 	{
1667ae8c6e27Sflorian 		OUTYY(("P(server_insecure_lan_zones:%s)\n", $2));
1668ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1669ae8c6e27Sflorian 			yyerror("expected yes or no.");
1670ae8c6e27Sflorian 		else cfg_parser->cfg->insecure_lan_zones =
1671ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1672ae8c6e27Sflorian 		free($2);
1673ae8c6e27Sflorian 	}
1674ae8c6e27Sflorian 	;
1675ae8c6e27Sflorian server_rrset_cache_size: VAR_RRSET_CACHE_SIZE STRING_ARG
1676ae8c6e27Sflorian 	{
1677ae8c6e27Sflorian 		OUTYY(("P(server_rrset_cache_size:%s)\n", $2));
1678ae8c6e27Sflorian 		if(!cfg_parse_memsize($2, &cfg_parser->cfg->rrset_cache_size))
1679ae8c6e27Sflorian 			yyerror("memory size expected");
1680ae8c6e27Sflorian 		free($2);
1681ae8c6e27Sflorian 	}
1682ae8c6e27Sflorian 	;
1683ae8c6e27Sflorian server_rrset_cache_slabs: VAR_RRSET_CACHE_SLABS STRING_ARG
1684ae8c6e27Sflorian 	{
1685ae8c6e27Sflorian 		OUTYY(("P(server_rrset_cache_slabs:%s)\n", $2));
1686a1a7ba80Sflorian 		if(atoi($2) == 0) {
1687ae8c6e27Sflorian 			yyerror("number expected");
1688a1a7ba80Sflorian 		} else {
1689ae8c6e27Sflorian 			cfg_parser->cfg->rrset_cache_slabs = atoi($2);
1690ae8c6e27Sflorian 			if(!is_pow2(cfg_parser->cfg->rrset_cache_slabs))
1691ae8c6e27Sflorian 				yyerror("must be a power of 2");
1692ae8c6e27Sflorian 		}
1693ae8c6e27Sflorian 		free($2);
1694ae8c6e27Sflorian 	}
1695ae8c6e27Sflorian 	;
1696ae8c6e27Sflorian server_infra_host_ttl: VAR_INFRA_HOST_TTL STRING_ARG
1697ae8c6e27Sflorian 	{
1698ae8c6e27Sflorian 		OUTYY(("P(server_infra_host_ttl:%s)\n", $2));
1699ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
1700ae8c6e27Sflorian 			yyerror("number expected");
1701ae8c6e27Sflorian 		else cfg_parser->cfg->host_ttl = atoi($2);
1702ae8c6e27Sflorian 		free($2);
1703ae8c6e27Sflorian 	}
1704ae8c6e27Sflorian 	;
1705ae8c6e27Sflorian server_infra_lame_ttl: VAR_INFRA_LAME_TTL STRING_ARG
1706ae8c6e27Sflorian 	{
1707ae8c6e27Sflorian 		OUTYY(("P(server_infra_lame_ttl:%s)\n", $2));
1708ae8c6e27Sflorian 		verbose(VERB_DETAIL, "ignored infra-lame-ttl: %s (option "
1709ae8c6e27Sflorian 			"removed, use infra-host-ttl)", $2);
1710ae8c6e27Sflorian 		free($2);
1711ae8c6e27Sflorian 	}
1712ae8c6e27Sflorian 	;
1713ae8c6e27Sflorian server_infra_cache_numhosts: VAR_INFRA_CACHE_NUMHOSTS STRING_ARG
1714ae8c6e27Sflorian 	{
1715ae8c6e27Sflorian 		OUTYY(("P(server_infra_cache_numhosts:%s)\n", $2));
1716ae8c6e27Sflorian 		if(atoi($2) == 0)
1717ae8c6e27Sflorian 			yyerror("number expected");
1718ae8c6e27Sflorian 		else cfg_parser->cfg->infra_cache_numhosts = atoi($2);
1719ae8c6e27Sflorian 		free($2);
1720ae8c6e27Sflorian 	}
1721ae8c6e27Sflorian 	;
1722ae8c6e27Sflorian server_infra_cache_lame_size: VAR_INFRA_CACHE_LAME_SIZE STRING_ARG
1723ae8c6e27Sflorian 	{
1724ae8c6e27Sflorian 		OUTYY(("P(server_infra_cache_lame_size:%s)\n", $2));
1725ae8c6e27Sflorian 		verbose(VERB_DETAIL, "ignored infra-cache-lame-size: %s "
1726ae8c6e27Sflorian 			"(option removed, use infra-cache-numhosts)", $2);
1727ae8c6e27Sflorian 		free($2);
1728ae8c6e27Sflorian 	}
1729ae8c6e27Sflorian 	;
1730ae8c6e27Sflorian server_infra_cache_slabs: VAR_INFRA_CACHE_SLABS STRING_ARG
1731ae8c6e27Sflorian 	{
1732ae8c6e27Sflorian 		OUTYY(("P(server_infra_cache_slabs:%s)\n", $2));
1733a1a7ba80Sflorian 		if(atoi($2) == 0) {
1734ae8c6e27Sflorian 			yyerror("number expected");
1735a1a7ba80Sflorian 		} else {
1736ae8c6e27Sflorian 			cfg_parser->cfg->infra_cache_slabs = atoi($2);
1737ae8c6e27Sflorian 			if(!is_pow2(cfg_parser->cfg->infra_cache_slabs))
1738ae8c6e27Sflorian 				yyerror("must be a power of 2");
1739ae8c6e27Sflorian 		}
1740ae8c6e27Sflorian 		free($2);
1741ae8c6e27Sflorian 	}
1742ae8c6e27Sflorian 	;
1743ae8c6e27Sflorian server_infra_cache_min_rtt: VAR_INFRA_CACHE_MIN_RTT STRING_ARG
1744ae8c6e27Sflorian 	{
1745ae8c6e27Sflorian 		OUTYY(("P(server_infra_cache_min_rtt:%s)\n", $2));
1746ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
1747ae8c6e27Sflorian 			yyerror("number expected");
1748ae8c6e27Sflorian 		else cfg_parser->cfg->infra_cache_min_rtt = atoi($2);
1749ae8c6e27Sflorian 		free($2);
1750ae8c6e27Sflorian 	}
1751ae8c6e27Sflorian 	;
17526d08cb1bSflorian server_infra_cache_max_rtt: VAR_INFRA_CACHE_MAX_RTT STRING_ARG
17536d08cb1bSflorian 	{
17546d08cb1bSflorian 		OUTYY(("P(server_infra_cache_max_rtt:%s)\n", $2));
17556d08cb1bSflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
17566d08cb1bSflorian 			yyerror("number expected");
17576d08cb1bSflorian 		else cfg_parser->cfg->infra_cache_max_rtt = atoi($2);
17586d08cb1bSflorian 		free($2);
17596d08cb1bSflorian 	}
17606d08cb1bSflorian 	;
1761853e076fSflorian server_infra_keep_probing: VAR_INFRA_KEEP_PROBING STRING_ARG
1762853e076fSflorian 	{
1763853e076fSflorian 		OUTYY(("P(server_infra_keep_probing:%s)\n", $2));
1764853e076fSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1765853e076fSflorian 			yyerror("expected yes or no.");
1766853e076fSflorian 		else cfg_parser->cfg->infra_keep_probing =
1767853e076fSflorian 			(strcmp($2, "yes")==0);
1768853e076fSflorian 		free($2);
1769853e076fSflorian 	}
1770853e076fSflorian 	;
1771ae8c6e27Sflorian server_target_fetch_policy: VAR_TARGET_FETCH_POLICY STRING_ARG
1772ae8c6e27Sflorian 	{
1773ae8c6e27Sflorian 		OUTYY(("P(server_target_fetch_policy:%s)\n", $2));
1774ae8c6e27Sflorian 		free(cfg_parser->cfg->target_fetch_policy);
1775ae8c6e27Sflorian 		cfg_parser->cfg->target_fetch_policy = $2;
1776ae8c6e27Sflorian 	}
1777ae8c6e27Sflorian 	;
1778ae8c6e27Sflorian server_harden_short_bufsize: VAR_HARDEN_SHORT_BUFSIZE STRING_ARG
1779ae8c6e27Sflorian 	{
1780ae8c6e27Sflorian 		OUTYY(("P(server_harden_short_bufsize:%s)\n", $2));
1781ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1782ae8c6e27Sflorian 			yyerror("expected yes or no.");
1783ae8c6e27Sflorian 		else cfg_parser->cfg->harden_short_bufsize =
1784ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1785ae8c6e27Sflorian 		free($2);
1786ae8c6e27Sflorian 	}
1787ae8c6e27Sflorian 	;
1788ae8c6e27Sflorian server_harden_large_queries: VAR_HARDEN_LARGE_QUERIES STRING_ARG
1789ae8c6e27Sflorian 	{
1790ae8c6e27Sflorian 		OUTYY(("P(server_harden_large_queries:%s)\n", $2));
1791ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1792ae8c6e27Sflorian 			yyerror("expected yes or no.");
1793ae8c6e27Sflorian 		else cfg_parser->cfg->harden_large_queries =
1794ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1795ae8c6e27Sflorian 		free($2);
1796ae8c6e27Sflorian 	}
1797ae8c6e27Sflorian 	;
1798ae8c6e27Sflorian server_harden_glue: VAR_HARDEN_GLUE STRING_ARG
1799ae8c6e27Sflorian 	{
1800ae8c6e27Sflorian 		OUTYY(("P(server_harden_glue:%s)\n", $2));
1801ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1802ae8c6e27Sflorian 			yyerror("expected yes or no.");
1803ae8c6e27Sflorian 		else cfg_parser->cfg->harden_glue =
1804ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1805ae8c6e27Sflorian 		free($2);
1806ae8c6e27Sflorian 	}
1807ae8c6e27Sflorian 	;
1808ae8c6e27Sflorian server_harden_dnssec_stripped: VAR_HARDEN_DNSSEC_STRIPPED STRING_ARG
1809ae8c6e27Sflorian 	{
1810ae8c6e27Sflorian 		OUTYY(("P(server_harden_dnssec_stripped:%s)\n", $2));
1811ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1812ae8c6e27Sflorian 			yyerror("expected yes or no.");
1813ae8c6e27Sflorian 		else cfg_parser->cfg->harden_dnssec_stripped =
1814ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1815ae8c6e27Sflorian 		free($2);
1816ae8c6e27Sflorian 	}
1817ae8c6e27Sflorian 	;
1818ae8c6e27Sflorian server_harden_below_nxdomain: VAR_HARDEN_BELOW_NXDOMAIN STRING_ARG
1819ae8c6e27Sflorian 	{
1820ae8c6e27Sflorian 		OUTYY(("P(server_harden_below_nxdomain:%s)\n", $2));
1821ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1822ae8c6e27Sflorian 			yyerror("expected yes or no.");
1823ae8c6e27Sflorian 		else cfg_parser->cfg->harden_below_nxdomain =
1824ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1825ae8c6e27Sflorian 		free($2);
1826ae8c6e27Sflorian 	}
1827ae8c6e27Sflorian 	;
1828ae8c6e27Sflorian server_harden_referral_path: VAR_HARDEN_REFERRAL_PATH STRING_ARG
1829ae8c6e27Sflorian 	{
1830ae8c6e27Sflorian 		OUTYY(("P(server_harden_referral_path:%s)\n", $2));
1831ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1832ae8c6e27Sflorian 			yyerror("expected yes or no.");
1833ae8c6e27Sflorian 		else cfg_parser->cfg->harden_referral_path =
1834ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1835ae8c6e27Sflorian 		free($2);
1836ae8c6e27Sflorian 	}
1837ae8c6e27Sflorian 	;
1838ae8c6e27Sflorian server_harden_algo_downgrade: VAR_HARDEN_ALGO_DOWNGRADE STRING_ARG
1839ae8c6e27Sflorian 	{
1840ae8c6e27Sflorian 		OUTYY(("P(server_harden_algo_downgrade:%s)\n", $2));
1841ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1842ae8c6e27Sflorian 			yyerror("expected yes or no.");
1843ae8c6e27Sflorian 		else cfg_parser->cfg->harden_algo_downgrade =
1844ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1845ae8c6e27Sflorian 		free($2);
1846ae8c6e27Sflorian 	}
1847ae8c6e27Sflorian 	;
1848d500c338Sflorian server_harden_unknown_additional: VAR_HARDEN_UNKNOWN_ADDITIONAL STRING_ARG
1849d500c338Sflorian 	{
1850d500c338Sflorian 		OUTYY(("P(server_harden_unknown_additional:%s)\n", $2));
1851d500c338Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1852d500c338Sflorian 			yyerror("expected yes or no.");
1853d500c338Sflorian 		else cfg_parser->cfg->harden_unknown_additional =
1854d500c338Sflorian 			(strcmp($2, "yes")==0);
1855d500c338Sflorian 		free($2);
1856d500c338Sflorian 	}
1857d500c338Sflorian 	;
1858ae8c6e27Sflorian server_use_caps_for_id: VAR_USE_CAPS_FOR_ID STRING_ARG
1859ae8c6e27Sflorian 	{
1860ae8c6e27Sflorian 		OUTYY(("P(server_use_caps_for_id:%s)\n", $2));
1861ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1862ae8c6e27Sflorian 			yyerror("expected yes or no.");
1863ae8c6e27Sflorian 		else cfg_parser->cfg->use_caps_bits_for_id =
1864ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1865ae8c6e27Sflorian 		free($2);
1866ae8c6e27Sflorian 	}
1867ae8c6e27Sflorian 	;
1868ae8c6e27Sflorian server_caps_whitelist: VAR_CAPS_WHITELIST STRING_ARG
1869ae8c6e27Sflorian 	{
1870ae8c6e27Sflorian 		OUTYY(("P(server_caps_whitelist:%s)\n", $2));
1871ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->caps_whitelist, $2))
1872ae8c6e27Sflorian 			yyerror("out of memory");
1873ae8c6e27Sflorian 	}
1874ae8c6e27Sflorian 	;
1875ae8c6e27Sflorian server_private_address: VAR_PRIVATE_ADDRESS STRING_ARG
1876ae8c6e27Sflorian 	{
1877ae8c6e27Sflorian 		OUTYY(("P(server_private_address:%s)\n", $2));
1878ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->private_address, $2))
1879ae8c6e27Sflorian 			yyerror("out of memory");
1880ae8c6e27Sflorian 	}
1881ae8c6e27Sflorian 	;
1882ae8c6e27Sflorian server_private_domain: VAR_PRIVATE_DOMAIN STRING_ARG
1883ae8c6e27Sflorian 	{
1884ae8c6e27Sflorian 		OUTYY(("P(server_private_domain:%s)\n", $2));
1885ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->private_domain, $2))
1886ae8c6e27Sflorian 			yyerror("out of memory");
1887ae8c6e27Sflorian 	}
1888ae8c6e27Sflorian 	;
1889ae8c6e27Sflorian server_prefetch: VAR_PREFETCH STRING_ARG
1890ae8c6e27Sflorian 	{
1891ae8c6e27Sflorian 		OUTYY(("P(server_prefetch:%s)\n", $2));
1892ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1893ae8c6e27Sflorian 			yyerror("expected yes or no.");
1894ae8c6e27Sflorian 		else cfg_parser->cfg->prefetch = (strcmp($2, "yes")==0);
1895ae8c6e27Sflorian 		free($2);
1896ae8c6e27Sflorian 	}
1897ae8c6e27Sflorian 	;
1898ae8c6e27Sflorian server_prefetch_key: VAR_PREFETCH_KEY STRING_ARG
1899ae8c6e27Sflorian 	{
1900ae8c6e27Sflorian 		OUTYY(("P(server_prefetch_key:%s)\n", $2));
1901ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1902ae8c6e27Sflorian 			yyerror("expected yes or no.");
1903ae8c6e27Sflorian 		else cfg_parser->cfg->prefetch_key = (strcmp($2, "yes")==0);
1904ae8c6e27Sflorian 		free($2);
1905ae8c6e27Sflorian 	}
1906ae8c6e27Sflorian 	;
1907ae8c6e27Sflorian server_deny_any: VAR_DENY_ANY STRING_ARG
1908ae8c6e27Sflorian 	{
1909ae8c6e27Sflorian 		OUTYY(("P(server_deny_any:%s)\n", $2));
1910ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1911ae8c6e27Sflorian 			yyerror("expected yes or no.");
1912ae8c6e27Sflorian 		else cfg_parser->cfg->deny_any = (strcmp($2, "yes")==0);
1913ae8c6e27Sflorian 		free($2);
1914ae8c6e27Sflorian 	}
1915ae8c6e27Sflorian 	;
1916ae8c6e27Sflorian server_unwanted_reply_threshold: VAR_UNWANTED_REPLY_THRESHOLD STRING_ARG
1917ae8c6e27Sflorian 	{
1918ae8c6e27Sflorian 		OUTYY(("P(server_unwanted_reply_threshold:%s)\n", $2));
1919ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
1920ae8c6e27Sflorian 			yyerror("number expected");
1921ae8c6e27Sflorian 		else cfg_parser->cfg->unwanted_threshold = atoi($2);
1922ae8c6e27Sflorian 		free($2);
1923ae8c6e27Sflorian 	}
1924ae8c6e27Sflorian 	;
1925ae8c6e27Sflorian server_do_not_query_address: VAR_DO_NOT_QUERY_ADDRESS STRING_ARG
1926ae8c6e27Sflorian 	{
1927ae8c6e27Sflorian 		OUTYY(("P(server_do_not_query_address:%s)\n", $2));
1928ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->donotqueryaddrs, $2))
1929ae8c6e27Sflorian 			yyerror("out of memory");
1930ae8c6e27Sflorian 	}
1931ae8c6e27Sflorian 	;
1932ae8c6e27Sflorian server_do_not_query_localhost: VAR_DO_NOT_QUERY_LOCALHOST STRING_ARG
1933ae8c6e27Sflorian 	{
1934ae8c6e27Sflorian 		OUTYY(("P(server_do_not_query_localhost:%s)\n", $2));
1935ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1936ae8c6e27Sflorian 			yyerror("expected yes or no.");
1937ae8c6e27Sflorian 		else cfg_parser->cfg->donotquery_localhost =
1938ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
1939ae8c6e27Sflorian 		free($2);
1940ae8c6e27Sflorian 	}
1941ae8c6e27Sflorian 	;
1942ae8c6e27Sflorian server_access_control: VAR_ACCESS_CONTROL STRING_ARG STRING_ARG
1943ae8c6e27Sflorian 	{
1944ae8c6e27Sflorian 		OUTYY(("P(server_access_control:%s %s)\n", $2, $3));
19455c45b740Sflorian 		validate_acl_action($3);
1946ae8c6e27Sflorian 		if(!cfg_str2list_insert(&cfg_parser->cfg->acls, $2, $3))
1947ae8c6e27Sflorian 			fatal_exit("out of memory adding acl");
1948ae8c6e27Sflorian 	}
19495c45b740Sflorian 	;
19505c45b740Sflorian server_interface_action: VAR_INTERFACE_ACTION STRING_ARG STRING_ARG
19515c45b740Sflorian 	{
19525c45b740Sflorian 		OUTYY(("P(server_interface_action:%s %s)\n", $2, $3));
19535c45b740Sflorian 		validate_acl_action($3);
19545c45b740Sflorian 		if(!cfg_str2list_insert(
19555c45b740Sflorian 			&cfg_parser->cfg->interface_actions, $2, $3))
19565c45b740Sflorian 			fatal_exit("out of memory adding acl");
1957ae8c6e27Sflorian 	}
1958ae8c6e27Sflorian 	;
1959ae8c6e27Sflorian server_module_conf: VAR_MODULE_CONF STRING_ARG
1960ae8c6e27Sflorian 	{
1961ae8c6e27Sflorian 		OUTYY(("P(server_module_conf:%s)\n", $2));
1962ae8c6e27Sflorian 		free(cfg_parser->cfg->module_conf);
1963ae8c6e27Sflorian 		cfg_parser->cfg->module_conf = $2;
1964ae8c6e27Sflorian 	}
1965ae8c6e27Sflorian 	;
1966ae8c6e27Sflorian server_val_override_date: VAR_VAL_OVERRIDE_DATE STRING_ARG
1967ae8c6e27Sflorian 	{
1968ae8c6e27Sflorian 		OUTYY(("P(server_val_override_date:%s)\n", $2));
1969ae8c6e27Sflorian 		if(*$2 == '\0' || strcmp($2, "0") == 0) {
1970ae8c6e27Sflorian 			cfg_parser->cfg->val_date_override = 0;
1971ae8c6e27Sflorian 		} else if(strlen($2) == 14) {
1972ae8c6e27Sflorian 			cfg_parser->cfg->val_date_override =
1973ae8c6e27Sflorian 				cfg_convert_timeval($2);
1974ae8c6e27Sflorian 			if(!cfg_parser->cfg->val_date_override)
1975ae8c6e27Sflorian 				yyerror("bad date/time specification");
1976ae8c6e27Sflorian 		} else {
1977ae8c6e27Sflorian 			if(atoi($2) == 0)
1978ae8c6e27Sflorian 				yyerror("number expected");
1979ae8c6e27Sflorian 			cfg_parser->cfg->val_date_override = atoi($2);
1980ae8c6e27Sflorian 		}
1981ae8c6e27Sflorian 		free($2);
1982ae8c6e27Sflorian 	}
1983ae8c6e27Sflorian 	;
1984ae8c6e27Sflorian server_val_sig_skew_min: VAR_VAL_SIG_SKEW_MIN STRING_ARG
1985ae8c6e27Sflorian 	{
1986ae8c6e27Sflorian 		OUTYY(("P(server_val_sig_skew_min:%s)\n", $2));
1987ae8c6e27Sflorian 		if(*$2 == '\0' || strcmp($2, "0") == 0) {
1988ae8c6e27Sflorian 			cfg_parser->cfg->val_sig_skew_min = 0;
1989ae8c6e27Sflorian 		} else {
1990ae8c6e27Sflorian 			cfg_parser->cfg->val_sig_skew_min = atoi($2);
1991ae8c6e27Sflorian 			if(!cfg_parser->cfg->val_sig_skew_min)
1992ae8c6e27Sflorian 				yyerror("number expected");
1993ae8c6e27Sflorian 		}
1994ae8c6e27Sflorian 		free($2);
1995ae8c6e27Sflorian 	}
1996ae8c6e27Sflorian 	;
1997ae8c6e27Sflorian server_val_sig_skew_max: VAR_VAL_SIG_SKEW_MAX STRING_ARG
1998ae8c6e27Sflorian 	{
1999ae8c6e27Sflorian 		OUTYY(("P(server_val_sig_skew_max:%s)\n", $2));
2000ae8c6e27Sflorian 		if(*$2 == '\0' || strcmp($2, "0") == 0) {
2001ae8c6e27Sflorian 			cfg_parser->cfg->val_sig_skew_max = 0;
2002ae8c6e27Sflorian 		} else {
2003ae8c6e27Sflorian 			cfg_parser->cfg->val_sig_skew_max = atoi($2);
2004ae8c6e27Sflorian 			if(!cfg_parser->cfg->val_sig_skew_max)
2005ae8c6e27Sflorian 				yyerror("number expected");
2006ae8c6e27Sflorian 		}
2007ae8c6e27Sflorian 		free($2);
2008ae8c6e27Sflorian 	}
2009ae8c6e27Sflorian 	;
2010411c5950Sflorian server_val_max_restart: VAR_VAL_MAX_RESTART STRING_ARG
2011411c5950Sflorian 	{
2012411c5950Sflorian 		OUTYY(("P(server_val_max_restart:%s)\n", $2));
2013411c5950Sflorian 		if(*$2 == '\0' || strcmp($2, "0") == 0) {
2014411c5950Sflorian 			cfg_parser->cfg->val_max_restart = 0;
2015411c5950Sflorian 		} else {
2016411c5950Sflorian 			cfg_parser->cfg->val_max_restart = atoi($2);
2017411c5950Sflorian 			if(!cfg_parser->cfg->val_max_restart)
2018411c5950Sflorian 				yyerror("number expected");
2019411c5950Sflorian 		}
2020411c5950Sflorian 		free($2);
2021411c5950Sflorian 	}
2022411c5950Sflorian 	;
2023ae8c6e27Sflorian server_cache_max_ttl: VAR_CACHE_MAX_TTL STRING_ARG
2024ae8c6e27Sflorian 	{
2025ae8c6e27Sflorian 		OUTYY(("P(server_cache_max_ttl:%s)\n", $2));
2026ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2027ae8c6e27Sflorian 			yyerror("number expected");
2028ae8c6e27Sflorian 		else cfg_parser->cfg->max_ttl = atoi($2);
2029ae8c6e27Sflorian 		free($2);
2030ae8c6e27Sflorian 	}
2031ae8c6e27Sflorian 	;
2032ae8c6e27Sflorian server_cache_max_negative_ttl: VAR_CACHE_MAX_NEGATIVE_TTL STRING_ARG
2033ae8c6e27Sflorian 	{
2034ae8c6e27Sflorian 		OUTYY(("P(server_cache_max_negative_ttl:%s)\n", $2));
2035ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2036ae8c6e27Sflorian 			yyerror("number expected");
2037ae8c6e27Sflorian 		else cfg_parser->cfg->max_negative_ttl = atoi($2);
2038ae8c6e27Sflorian 		free($2);
2039ae8c6e27Sflorian 	}
2040ae8c6e27Sflorian 	;
2041096314feSflorian server_cache_min_negative_ttl: VAR_CACHE_MIN_NEGATIVE_TTL STRING_ARG
2042096314feSflorian 	{
2043096314feSflorian 		OUTYY(("P(server_cache_min_negative_ttl:%s)\n", $2));
2044096314feSflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2045096314feSflorian 			yyerror("number expected");
2046096314feSflorian 		else cfg_parser->cfg->min_negative_ttl = atoi($2);
2047096314feSflorian 		free($2);
2048096314feSflorian 	}
2049096314feSflorian 	;
2050ae8c6e27Sflorian server_cache_min_ttl: VAR_CACHE_MIN_TTL STRING_ARG
2051ae8c6e27Sflorian 	{
2052ae8c6e27Sflorian 		OUTYY(("P(server_cache_min_ttl:%s)\n", $2));
2053ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2054ae8c6e27Sflorian 			yyerror("number expected");
2055ae8c6e27Sflorian 		else cfg_parser->cfg->min_ttl = atoi($2);
2056ae8c6e27Sflorian 		free($2);
2057ae8c6e27Sflorian 	}
2058ae8c6e27Sflorian 	;
2059ae8c6e27Sflorian server_bogus_ttl: VAR_BOGUS_TTL STRING_ARG
2060ae8c6e27Sflorian 	{
2061ae8c6e27Sflorian 		OUTYY(("P(server_bogus_ttl:%s)\n", $2));
2062ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2063ae8c6e27Sflorian 			yyerror("number expected");
2064ae8c6e27Sflorian 		else cfg_parser->cfg->bogus_ttl = atoi($2);
2065ae8c6e27Sflorian 		free($2);
2066ae8c6e27Sflorian 	}
2067ae8c6e27Sflorian 	;
2068ae8c6e27Sflorian server_val_clean_additional: VAR_VAL_CLEAN_ADDITIONAL STRING_ARG
2069ae8c6e27Sflorian 	{
2070ae8c6e27Sflorian 		OUTYY(("P(server_val_clean_additional:%s)\n", $2));
2071ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2072ae8c6e27Sflorian 			yyerror("expected yes or no.");
2073ae8c6e27Sflorian 		else cfg_parser->cfg->val_clean_additional =
2074ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
2075ae8c6e27Sflorian 		free($2);
2076ae8c6e27Sflorian 	}
2077ae8c6e27Sflorian 	;
2078ae8c6e27Sflorian server_val_permissive_mode: VAR_VAL_PERMISSIVE_MODE STRING_ARG
2079ae8c6e27Sflorian 	{
2080ae8c6e27Sflorian 		OUTYY(("P(server_val_permissive_mode:%s)\n", $2));
2081ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2082ae8c6e27Sflorian 			yyerror("expected yes or no.");
2083ae8c6e27Sflorian 		else cfg_parser->cfg->val_permissive_mode =
2084ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
2085ae8c6e27Sflorian 		free($2);
2086ae8c6e27Sflorian 	}
2087ae8c6e27Sflorian 	;
2088ae8c6e27Sflorian server_aggressive_nsec: VAR_AGGRESSIVE_NSEC STRING_ARG
2089ae8c6e27Sflorian 	{
2090ae8c6e27Sflorian 		OUTYY(("P(server_aggressive_nsec:%s)\n", $2));
2091ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2092ae8c6e27Sflorian 			yyerror("expected yes or no.");
2093ae8c6e27Sflorian 		else
2094ae8c6e27Sflorian 			cfg_parser->cfg->aggressive_nsec =
2095ae8c6e27Sflorian 				(strcmp($2, "yes")==0);
2096ae8c6e27Sflorian 		free($2);
2097ae8c6e27Sflorian 	}
2098ae8c6e27Sflorian 	;
2099ae8c6e27Sflorian server_ignore_cd_flag: VAR_IGNORE_CD_FLAG STRING_ARG
2100ae8c6e27Sflorian 	{
2101ae8c6e27Sflorian 		OUTYY(("P(server_ignore_cd_flag:%s)\n", $2));
2102ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2103ae8c6e27Sflorian 			yyerror("expected yes or no.");
2104ae8c6e27Sflorian 		else cfg_parser->cfg->ignore_cd = (strcmp($2, "yes")==0);
2105ae8c6e27Sflorian 		free($2);
2106ae8c6e27Sflorian 	}
2107ae8c6e27Sflorian 	;
210854cc57acSflorian server_disable_edns_do: VAR_DISABLE_EDNS_DO STRING_ARG
210954cc57acSflorian 	{
211054cc57acSflorian 		OUTYY(("P(server_disable_edns_do:%s)\n", $2));
211154cc57acSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
211254cc57acSflorian 			yyerror("expected yes or no.");
211354cc57acSflorian 		else cfg_parser->cfg->disable_edns_do = (strcmp($2, "yes")==0);
211454cc57acSflorian 		free($2);
211554cc57acSflorian 	}
211654cc57acSflorian 	;
2117ae8c6e27Sflorian server_serve_expired: VAR_SERVE_EXPIRED STRING_ARG
2118ae8c6e27Sflorian 	{
2119ae8c6e27Sflorian 		OUTYY(("P(server_serve_expired:%s)\n", $2));
2120ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2121ae8c6e27Sflorian 			yyerror("expected yes or no.");
2122ae8c6e27Sflorian 		else cfg_parser->cfg->serve_expired = (strcmp($2, "yes")==0);
2123ae8c6e27Sflorian 		free($2);
2124ae8c6e27Sflorian 	}
2125ae8c6e27Sflorian 	;
2126ae8c6e27Sflorian server_serve_expired_ttl: VAR_SERVE_EXPIRED_TTL STRING_ARG
2127ae8c6e27Sflorian 	{
2128ae8c6e27Sflorian 		OUTYY(("P(server_serve_expired_ttl:%s)\n", $2));
2129ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2130ae8c6e27Sflorian 			yyerror("number expected");
2131ae8c6e27Sflorian 		else cfg_parser->cfg->serve_expired_ttl = atoi($2);
2132ae8c6e27Sflorian 		free($2);
2133ae8c6e27Sflorian 	}
2134ae8c6e27Sflorian 	;
2135ae8c6e27Sflorian server_serve_expired_ttl_reset: VAR_SERVE_EXPIRED_TTL_RESET STRING_ARG
2136ae8c6e27Sflorian 	{
2137ae8c6e27Sflorian 		OUTYY(("P(server_serve_expired_ttl_reset:%s)\n", $2));
2138ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2139ae8c6e27Sflorian 			yyerror("expected yes or no.");
2140ae8c6e27Sflorian 		else cfg_parser->cfg->serve_expired_ttl_reset = (strcmp($2, "yes")==0);
2141ae8c6e27Sflorian 		free($2);
2142ae8c6e27Sflorian 	}
2143ae8c6e27Sflorian 	;
2144d32eb43cSflorian server_serve_expired_reply_ttl: VAR_SERVE_EXPIRED_REPLY_TTL STRING_ARG
2145d32eb43cSflorian 	{
2146d32eb43cSflorian 		OUTYY(("P(server_serve_expired_reply_ttl:%s)\n", $2));
2147d32eb43cSflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2148d32eb43cSflorian 			yyerror("number expected");
2149d32eb43cSflorian 		else cfg_parser->cfg->serve_expired_reply_ttl = atoi($2);
2150d32eb43cSflorian 		free($2);
2151d32eb43cSflorian 	}
2152d32eb43cSflorian 	;
2153d32eb43cSflorian server_serve_expired_client_timeout: VAR_SERVE_EXPIRED_CLIENT_TIMEOUT STRING_ARG
2154d32eb43cSflorian 	{
2155d32eb43cSflorian 		OUTYY(("P(server_serve_expired_client_timeout:%s)\n", $2));
2156d32eb43cSflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2157d32eb43cSflorian 			yyerror("number expected");
2158d32eb43cSflorian 		else cfg_parser->cfg->serve_expired_client_timeout = atoi($2);
2159d32eb43cSflorian 		free($2);
2160d32eb43cSflorian 	}
2161d32eb43cSflorian 	;
21627a05b9dfSflorian server_ede_serve_expired: VAR_EDE_SERVE_EXPIRED STRING_ARG
21637a05b9dfSflorian 	{
21647a05b9dfSflorian 		OUTYY(("P(server_ede_serve_expired:%s)\n", $2));
21657a05b9dfSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
21667a05b9dfSflorian 			yyerror("expected yes or no.");
21677a05b9dfSflorian 		else cfg_parser->cfg->ede_serve_expired = (strcmp($2, "yes")==0);
21687a05b9dfSflorian 		free($2);
21697a05b9dfSflorian 	}
21707a05b9dfSflorian 	;
2171a8eaceedSflorian server_serve_original_ttl: VAR_SERVE_ORIGINAL_TTL STRING_ARG
2172a8eaceedSflorian 	{
2173a8eaceedSflorian 		OUTYY(("P(server_serve_original_ttl:%s)\n", $2));
2174a8eaceedSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2175a8eaceedSflorian 			yyerror("expected yes or no.");
2176a8eaceedSflorian 		else cfg_parser->cfg->serve_original_ttl = (strcmp($2, "yes")==0);
2177a8eaceedSflorian 		free($2);
2178a8eaceedSflorian 	}
2179a8eaceedSflorian 	;
2180ae8c6e27Sflorian server_fake_dsa: VAR_FAKE_DSA STRING_ARG
2181ae8c6e27Sflorian 	{
2182ae8c6e27Sflorian 		OUTYY(("P(server_fake_dsa:%s)\n", $2));
2183ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2184ae8c6e27Sflorian 			yyerror("expected yes or no.");
2185d32eb43cSflorian #if defined(HAVE_SSL) || defined(HAVE_NETTLE)
2186ae8c6e27Sflorian 		else fake_dsa = (strcmp($2, "yes")==0);
2187ae8c6e27Sflorian 		if(fake_dsa)
2188ae8c6e27Sflorian 			log_warn("test option fake_dsa is enabled");
2189ae8c6e27Sflorian #endif
2190ae8c6e27Sflorian 		free($2);
2191ae8c6e27Sflorian 	}
2192ae8c6e27Sflorian 	;
2193ae8c6e27Sflorian server_fake_sha1: VAR_FAKE_SHA1 STRING_ARG
2194ae8c6e27Sflorian 	{
2195ae8c6e27Sflorian 		OUTYY(("P(server_fake_sha1:%s)\n", $2));
2196ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2197ae8c6e27Sflorian 			yyerror("expected yes or no.");
2198d32eb43cSflorian #if defined(HAVE_SSL) || defined(HAVE_NETTLE)
2199ae8c6e27Sflorian 		else fake_sha1 = (strcmp($2, "yes")==0);
2200ae8c6e27Sflorian 		if(fake_sha1)
2201ae8c6e27Sflorian 			log_warn("test option fake_sha1 is enabled");
2202ae8c6e27Sflorian #endif
2203ae8c6e27Sflorian 		free($2);
2204ae8c6e27Sflorian 	}
2205ae8c6e27Sflorian 	;
2206ae8c6e27Sflorian server_val_log_level: VAR_VAL_LOG_LEVEL STRING_ARG
2207ae8c6e27Sflorian 	{
2208ae8c6e27Sflorian 		OUTYY(("P(server_val_log_level:%s)\n", $2));
2209ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2210ae8c6e27Sflorian 			yyerror("number expected");
2211ae8c6e27Sflorian 		else cfg_parser->cfg->val_log_level = atoi($2);
2212ae8c6e27Sflorian 		free($2);
2213ae8c6e27Sflorian 	}
2214ae8c6e27Sflorian 	;
2215ae8c6e27Sflorian server_val_nsec3_keysize_iterations: VAR_VAL_NSEC3_KEYSIZE_ITERATIONS STRING_ARG
2216ae8c6e27Sflorian 	{
2217ae8c6e27Sflorian 		OUTYY(("P(server_val_nsec3_keysize_iterations:%s)\n", $2));
2218ae8c6e27Sflorian 		free(cfg_parser->cfg->val_nsec3_key_iterations);
2219ae8c6e27Sflorian 		cfg_parser->cfg->val_nsec3_key_iterations = $2;
2220ae8c6e27Sflorian 	}
2221ae8c6e27Sflorian 	;
2222411c5950Sflorian server_zonemd_permissive_mode: VAR_ZONEMD_PERMISSIVE_MODE STRING_ARG
2223411c5950Sflorian 	{
2224411c5950Sflorian 		OUTYY(("P(server_zonemd_permissive_mode:%s)\n", $2));
2225411c5950Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2226411c5950Sflorian 			yyerror("expected yes or no.");
2227411c5950Sflorian 		else	cfg_parser->cfg->zonemd_permissive_mode = (strcmp($2, "yes")==0);
2228411c5950Sflorian 		free($2);
2229411c5950Sflorian 	}
2230411c5950Sflorian 	;
2231ae8c6e27Sflorian server_add_holddown: VAR_ADD_HOLDDOWN STRING_ARG
2232ae8c6e27Sflorian 	{
2233ae8c6e27Sflorian 		OUTYY(("P(server_add_holddown:%s)\n", $2));
2234ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2235ae8c6e27Sflorian 			yyerror("number expected");
2236ae8c6e27Sflorian 		else cfg_parser->cfg->add_holddown = atoi($2);
2237ae8c6e27Sflorian 		free($2);
2238ae8c6e27Sflorian 	}
2239ae8c6e27Sflorian 	;
2240ae8c6e27Sflorian server_del_holddown: VAR_DEL_HOLDDOWN STRING_ARG
2241ae8c6e27Sflorian 	{
2242ae8c6e27Sflorian 		OUTYY(("P(server_del_holddown:%s)\n", $2));
2243ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2244ae8c6e27Sflorian 			yyerror("number expected");
2245ae8c6e27Sflorian 		else cfg_parser->cfg->del_holddown = atoi($2);
2246ae8c6e27Sflorian 		free($2);
2247ae8c6e27Sflorian 	}
2248ae8c6e27Sflorian 	;
2249ae8c6e27Sflorian server_keep_missing: VAR_KEEP_MISSING STRING_ARG
2250ae8c6e27Sflorian 	{
2251ae8c6e27Sflorian 		OUTYY(("P(server_keep_missing:%s)\n", $2));
2252ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2253ae8c6e27Sflorian 			yyerror("number expected");
2254ae8c6e27Sflorian 		else cfg_parser->cfg->keep_missing = atoi($2);
2255ae8c6e27Sflorian 		free($2);
2256ae8c6e27Sflorian 	}
2257ae8c6e27Sflorian 	;
2258ae8c6e27Sflorian server_permit_small_holddown: VAR_PERMIT_SMALL_HOLDDOWN STRING_ARG
2259ae8c6e27Sflorian 	{
2260ae8c6e27Sflorian 		OUTYY(("P(server_permit_small_holddown:%s)\n", $2));
2261ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2262ae8c6e27Sflorian 			yyerror("expected yes or no.");
2263ae8c6e27Sflorian 		else cfg_parser->cfg->permit_small_holddown =
2264ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
2265ae8c6e27Sflorian 		free($2);
2266ae8c6e27Sflorian 	}
2267d500c338Sflorian 	;
2268ae8c6e27Sflorian server_key_cache_size: VAR_KEY_CACHE_SIZE STRING_ARG
2269ae8c6e27Sflorian 	{
2270ae8c6e27Sflorian 		OUTYY(("P(server_key_cache_size:%s)\n", $2));
2271ae8c6e27Sflorian 		if(!cfg_parse_memsize($2, &cfg_parser->cfg->key_cache_size))
2272ae8c6e27Sflorian 			yyerror("memory size expected");
2273ae8c6e27Sflorian 		free($2);
2274ae8c6e27Sflorian 	}
2275ae8c6e27Sflorian 	;
2276ae8c6e27Sflorian server_key_cache_slabs: VAR_KEY_CACHE_SLABS STRING_ARG
2277ae8c6e27Sflorian 	{
2278ae8c6e27Sflorian 		OUTYY(("P(server_key_cache_slabs:%s)\n", $2));
2279a1a7ba80Sflorian 		if(atoi($2) == 0) {
2280ae8c6e27Sflorian 			yyerror("number expected");
2281a1a7ba80Sflorian 		} else {
2282ae8c6e27Sflorian 			cfg_parser->cfg->key_cache_slabs = atoi($2);
2283ae8c6e27Sflorian 			if(!is_pow2(cfg_parser->cfg->key_cache_slabs))
2284ae8c6e27Sflorian 				yyerror("must be a power of 2");
2285ae8c6e27Sflorian 		}
2286ae8c6e27Sflorian 		free($2);
2287ae8c6e27Sflorian 	}
2288ae8c6e27Sflorian 	;
2289ae8c6e27Sflorian server_neg_cache_size: VAR_NEG_CACHE_SIZE STRING_ARG
2290ae8c6e27Sflorian 	{
2291ae8c6e27Sflorian 		OUTYY(("P(server_neg_cache_size:%s)\n", $2));
2292ae8c6e27Sflorian 		if(!cfg_parse_memsize($2, &cfg_parser->cfg->neg_cache_size))
2293ae8c6e27Sflorian 			yyerror("memory size expected");
2294ae8c6e27Sflorian 		free($2);
2295ae8c6e27Sflorian 	}
2296ae8c6e27Sflorian 	;
2297ae8c6e27Sflorian server_local_zone: VAR_LOCAL_ZONE STRING_ARG STRING_ARG
2298ae8c6e27Sflorian 	{
2299ae8c6e27Sflorian 		OUTYY(("P(server_local_zone:%s %s)\n", $2, $3));
2300ae8c6e27Sflorian 		if(strcmp($3, "static")!=0 && strcmp($3, "deny")!=0 &&
2301ae8c6e27Sflorian 		   strcmp($3, "refuse")!=0 && strcmp($3, "redirect")!=0 &&
2302ae8c6e27Sflorian 		   strcmp($3, "transparent")!=0 && strcmp($3, "nodefault")!=0
2303ae8c6e27Sflorian 		   && strcmp($3, "typetransparent")!=0
2304ae8c6e27Sflorian 		   && strcmp($3, "always_transparent")!=0
2305d500c338Sflorian 		   && strcmp($3, "block_a")!=0
2306ae8c6e27Sflorian 		   && strcmp($3, "always_refuse")!=0
2307ae8c6e27Sflorian 		   && strcmp($3, "always_nxdomain")!=0
2308a8eaceedSflorian 		   && strcmp($3, "always_nodata")!=0
2309a8eaceedSflorian 		   && strcmp($3, "always_deny")!=0
2310a8eaceedSflorian 		   && strcmp($3, "always_null")!=0
2311ae8c6e27Sflorian 		   && strcmp($3, "noview")!=0
2312988ebc2dSflorian 		   && strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0
2313da8c8390Sflorian 		   && strcmp($3, "inform_redirect") != 0
2314da8c8390Sflorian 		   && strcmp($3, "ipset") != 0) {
2315ae8c6e27Sflorian 			yyerror("local-zone type: expected static, deny, "
2316ae8c6e27Sflorian 				"refuse, redirect, transparent, "
2317ae8c6e27Sflorian 				"typetransparent, inform, inform_deny, "
2318d500c338Sflorian 				"inform_redirect, always_transparent, block_a,"
2319a8eaceedSflorian 				"always_refuse, always_nxdomain, "
2320a8eaceedSflorian 				"always_nodata, always_deny, always_null, "
2321a8eaceedSflorian 				"noview, nodefault or ipset");
2322e97c6e54Ssthen 			free($2);
2323e97c6e54Ssthen 			free($3);
2324e97c6e54Ssthen 		} else if(strcmp($3, "nodefault")==0) {
2325ae8c6e27Sflorian 			if(!cfg_strlist_insert(&cfg_parser->cfg->
2326ae8c6e27Sflorian 				local_zones_nodefault, $2))
2327ae8c6e27Sflorian 				fatal_exit("out of memory adding local-zone");
2328ae8c6e27Sflorian 			free($3);
2329da8c8390Sflorian #ifdef USE_IPSET
2330da8c8390Sflorian 		} else if(strcmp($3, "ipset")==0) {
23317a05b9dfSflorian 			size_t len = strlen($2);
23327a05b9dfSflorian 			/* Make sure to add the trailing dot.
23337a05b9dfSflorian 			 * These are str compared to domain names. */
23347a05b9dfSflorian 			if($2[len-1] != '.') {
23357a05b9dfSflorian 				if(!($2 = realloc($2, len+2))) {
23367a05b9dfSflorian 					fatal_exit("out of memory adding local-zone");
23377a05b9dfSflorian 				}
23387a05b9dfSflorian 				$2[len] = '.';
23397a05b9dfSflorian 				$2[len+1] = 0;
23407a05b9dfSflorian 			}
2341da8c8390Sflorian 			if(!cfg_strlist_insert(&cfg_parser->cfg->
2342da8c8390Sflorian 				local_zones_ipset, $2))
2343da8c8390Sflorian 				fatal_exit("out of memory adding local-zone");
2344da8c8390Sflorian 			free($3);
2345da8c8390Sflorian #endif
2346ae8c6e27Sflorian 		} else {
2347ae8c6e27Sflorian 			if(!cfg_str2list_insert(&cfg_parser->cfg->local_zones,
2348ae8c6e27Sflorian 				$2, $3))
2349ae8c6e27Sflorian 				fatal_exit("out of memory adding local-zone");
2350ae8c6e27Sflorian 		}
2351ae8c6e27Sflorian 	}
2352ae8c6e27Sflorian 	;
2353ae8c6e27Sflorian server_local_data: VAR_LOCAL_DATA STRING_ARG
2354ae8c6e27Sflorian 	{
2355ae8c6e27Sflorian 		OUTYY(("P(server_local_data:%s)\n", $2));
2356ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->local_data, $2))
2357ae8c6e27Sflorian 			fatal_exit("out of memory adding local-data");
2358ae8c6e27Sflorian 	}
2359ae8c6e27Sflorian 	;
2360ae8c6e27Sflorian server_local_data_ptr: VAR_LOCAL_DATA_PTR STRING_ARG
2361ae8c6e27Sflorian 	{
2362ae8c6e27Sflorian 		char* ptr;
2363ae8c6e27Sflorian 		OUTYY(("P(server_local_data_ptr:%s)\n", $2));
2364ae8c6e27Sflorian 		ptr = cfg_ptr_reverse($2);
2365ae8c6e27Sflorian 		free($2);
2366ae8c6e27Sflorian 		if(ptr) {
2367ae8c6e27Sflorian 			if(!cfg_strlist_insert(&cfg_parser->cfg->
2368ae8c6e27Sflorian 				local_data, ptr))
2369ae8c6e27Sflorian 				fatal_exit("out of memory adding local-data");
2370ae8c6e27Sflorian 		} else {
2371ae8c6e27Sflorian 			yyerror("local-data-ptr could not be reversed");
2372ae8c6e27Sflorian 		}
2373ae8c6e27Sflorian 	}
2374ae8c6e27Sflorian 	;
2375ae8c6e27Sflorian server_minimal_responses: VAR_MINIMAL_RESPONSES STRING_ARG
2376ae8c6e27Sflorian 	{
2377ae8c6e27Sflorian 		OUTYY(("P(server_minimal_responses:%s)\n", $2));
2378ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2379ae8c6e27Sflorian 			yyerror("expected yes or no.");
2380ae8c6e27Sflorian 		else cfg_parser->cfg->minimal_responses =
2381ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
2382ae8c6e27Sflorian 		free($2);
2383ae8c6e27Sflorian 	}
2384ae8c6e27Sflorian 	;
2385ae8c6e27Sflorian server_rrset_roundrobin: VAR_RRSET_ROUNDROBIN STRING_ARG
2386ae8c6e27Sflorian 	{
2387ae8c6e27Sflorian 		OUTYY(("P(server_rrset_roundrobin:%s)\n", $2));
2388ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2389ae8c6e27Sflorian 			yyerror("expected yes or no.");
2390ae8c6e27Sflorian 		else cfg_parser->cfg->rrset_roundrobin =
2391ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
2392ae8c6e27Sflorian 		free($2);
2393ae8c6e27Sflorian 	}
2394ae8c6e27Sflorian 	;
2395ae8c6e27Sflorian server_unknown_server_time_limit: VAR_UNKNOWN_SERVER_TIME_LIMIT STRING_ARG
2396ae8c6e27Sflorian 	{
2397ae8c6e27Sflorian 		OUTYY(("P(server_unknown_server_time_limit:%s)\n", $2));
2398ae8c6e27Sflorian 		cfg_parser->cfg->unknown_server_time_limit = atoi($2);
2399ae8c6e27Sflorian 		free($2);
2400ae8c6e27Sflorian 	}
2401ae8c6e27Sflorian 	;
2402096314feSflorian server_discard_timeout: VAR_DISCARD_TIMEOUT STRING_ARG
2403096314feSflorian 	{
2404096314feSflorian 		OUTYY(("P(server_discard_timeout:%s)\n", $2));
2405096314feSflorian 		cfg_parser->cfg->discard_timeout = atoi($2);
2406096314feSflorian 		free($2);
2407096314feSflorian 	}
2408096314feSflorian 	;
2409096314feSflorian server_wait_limit: VAR_WAIT_LIMIT STRING_ARG
2410096314feSflorian 	{
2411096314feSflorian 		OUTYY(("P(server_wait_limit:%s)\n", $2));
2412096314feSflorian 		cfg_parser->cfg->wait_limit = atoi($2);
2413096314feSflorian 		free($2);
2414096314feSflorian 	}
2415096314feSflorian 	;
2416096314feSflorian server_wait_limit_cookie: VAR_WAIT_LIMIT_COOKIE STRING_ARG
2417096314feSflorian 	{
2418096314feSflorian 		OUTYY(("P(server_wait_limit_cookie:%s)\n", $2));
2419096314feSflorian 		cfg_parser->cfg->wait_limit_cookie = atoi($2);
2420096314feSflorian 		free($2);
2421096314feSflorian 	}
2422096314feSflorian 	;
2423096314feSflorian server_wait_limit_netblock: VAR_WAIT_LIMIT_NETBLOCK STRING_ARG STRING_ARG
2424096314feSflorian 	{
2425096314feSflorian 		OUTYY(("P(server_wait_limit_netblock:%s %s)\n", $2, $3));
2426096314feSflorian 		if(atoi($3) == 0 && strcmp($3, "0") != 0) {
2427096314feSflorian 			yyerror("number expected");
2428096314feSflorian 			free($2);
2429096314feSflorian 			free($3);
2430096314feSflorian 		} else {
2431096314feSflorian 			if(!cfg_str2list_insert(&cfg_parser->cfg->
2432096314feSflorian 				wait_limit_netblock, $2, $3))
2433096314feSflorian 				fatal_exit("out of memory adding "
2434096314feSflorian 					"wait-limit-netblock");
2435096314feSflorian 		}
2436096314feSflorian 	}
2437096314feSflorian 	;
2438096314feSflorian server_wait_limit_cookie_netblock: VAR_WAIT_LIMIT_COOKIE_NETBLOCK STRING_ARG STRING_ARG
2439096314feSflorian 	{
2440096314feSflorian 		OUTYY(("P(server_wait_limit_cookie_netblock:%s %s)\n", $2, $3));
2441096314feSflorian 		if(atoi($3) == 0 && strcmp($3, "0") != 0) {
2442096314feSflorian 			yyerror("number expected");
2443096314feSflorian 			free($2);
2444096314feSflorian 			free($3);
2445096314feSflorian 		} else {
2446096314feSflorian 			if(!cfg_str2list_insert(&cfg_parser->cfg->
2447096314feSflorian 				wait_limit_cookie_netblock, $2, $3))
2448096314feSflorian 				fatal_exit("out of memory adding "
2449096314feSflorian 					"wait-limit-cookie-netblock");
2450096314feSflorian 		}
2451096314feSflorian 	}
2452096314feSflorian 	;
2453ae8c6e27Sflorian server_max_udp_size: VAR_MAX_UDP_SIZE STRING_ARG
2454ae8c6e27Sflorian 	{
2455ae8c6e27Sflorian 		OUTYY(("P(server_max_udp_size:%s)\n", $2));
2456ae8c6e27Sflorian 		cfg_parser->cfg->max_udp_size = atoi($2);
2457ae8c6e27Sflorian 		free($2);
2458ae8c6e27Sflorian 	}
2459ae8c6e27Sflorian 	;
2460ae8c6e27Sflorian server_dns64_prefix: VAR_DNS64_PREFIX STRING_ARG
2461ae8c6e27Sflorian 	{
2462ae8c6e27Sflorian 		OUTYY(("P(dns64_prefix:%s)\n", $2));
2463ae8c6e27Sflorian 		free(cfg_parser->cfg->dns64_prefix);
2464ae8c6e27Sflorian 		cfg_parser->cfg->dns64_prefix = $2;
2465ae8c6e27Sflorian 	}
2466ae8c6e27Sflorian 	;
2467ae8c6e27Sflorian server_dns64_synthall: VAR_DNS64_SYNTHALL STRING_ARG
2468ae8c6e27Sflorian 	{
2469ae8c6e27Sflorian 		OUTYY(("P(server_dns64_synthall:%s)\n", $2));
2470ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2471ae8c6e27Sflorian 			yyerror("expected yes or no.");
2472ae8c6e27Sflorian 		else cfg_parser->cfg->dns64_synthall = (strcmp($2, "yes")==0);
2473ae8c6e27Sflorian 		free($2);
2474ae8c6e27Sflorian 	}
2475ae8c6e27Sflorian 	;
2476ae8c6e27Sflorian server_dns64_ignore_aaaa: VAR_DNS64_IGNORE_AAAA STRING_ARG
2477ae8c6e27Sflorian 	{
2478ae8c6e27Sflorian 		OUTYY(("P(dns64_ignore_aaaa:%s)\n", $2));
2479ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->dns64_ignore_aaaa,
2480ae8c6e27Sflorian 			$2))
2481ae8c6e27Sflorian 			fatal_exit("out of memory adding dns64-ignore-aaaa");
2482ae8c6e27Sflorian 	}
2483ae8c6e27Sflorian 	;
2484d500c338Sflorian server_nat64_prefix: VAR_NAT64_PREFIX STRING_ARG
2485d500c338Sflorian 	{
2486d500c338Sflorian 		OUTYY(("P(nat64_prefix:%s)\n", $2));
2487d500c338Sflorian 		free(cfg_parser->cfg->nat64_prefix);
2488d500c338Sflorian 		cfg_parser->cfg->nat64_prefix = $2;
2489d500c338Sflorian 	}
2490d500c338Sflorian 	;
2491ae8c6e27Sflorian server_define_tag: VAR_DEFINE_TAG STRING_ARG
2492ae8c6e27Sflorian 	{
2493ae8c6e27Sflorian 		char* p, *s = $2;
2494ae8c6e27Sflorian 		OUTYY(("P(server_define_tag:%s)\n", $2));
2495ae8c6e27Sflorian 		while((p=strsep(&s, " \t\n")) != NULL) {
2496ae8c6e27Sflorian 			if(*p) {
2497ae8c6e27Sflorian 				if(!config_add_tag(cfg_parser->cfg, p))
2498ae8c6e27Sflorian 					yyerror("could not define-tag, "
2499ae8c6e27Sflorian 						"out of memory");
2500ae8c6e27Sflorian 			}
2501ae8c6e27Sflorian 		}
2502ae8c6e27Sflorian 		free($2);
2503ae8c6e27Sflorian 	}
2504ae8c6e27Sflorian 	;
2505ae8c6e27Sflorian server_local_zone_tag: VAR_LOCAL_ZONE_TAG STRING_ARG STRING_ARG
2506ae8c6e27Sflorian 	{
2507ae8c6e27Sflorian 		size_t len = 0;
2508ae8c6e27Sflorian 		uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3,
2509ae8c6e27Sflorian 			&len);
2510ae8c6e27Sflorian 		free($3);
2511ae8c6e27Sflorian 		OUTYY(("P(server_local_zone_tag:%s)\n", $2));
2512e97c6e54Ssthen 		if(!bitlist) {
2513ae8c6e27Sflorian 			yyerror("could not parse tags, (define-tag them first)");
2514e97c6e54Ssthen 			free($2);
2515e97c6e54Ssthen 		}
2516ae8c6e27Sflorian 		if(bitlist) {
2517ae8c6e27Sflorian 			if(!cfg_strbytelist_insert(
2518ae8c6e27Sflorian 				&cfg_parser->cfg->local_zone_tags,
2519ae8c6e27Sflorian 				$2, bitlist, len)) {
2520ae8c6e27Sflorian 				yyerror("out of memory");
2521ae8c6e27Sflorian 				free($2);
2522ae8c6e27Sflorian 			}
2523ae8c6e27Sflorian 		}
2524ae8c6e27Sflorian 	}
2525ae8c6e27Sflorian 	;
2526ae8c6e27Sflorian server_access_control_tag: VAR_ACCESS_CONTROL_TAG STRING_ARG STRING_ARG
2527ae8c6e27Sflorian 	{
2528ae8c6e27Sflorian 		size_t len = 0;
2529ae8c6e27Sflorian 		uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3,
2530ae8c6e27Sflorian 			&len);
2531ae8c6e27Sflorian 		free($3);
2532ae8c6e27Sflorian 		OUTYY(("P(server_access_control_tag:%s)\n", $2));
2533e97c6e54Ssthen 		if(!bitlist) {
2534ae8c6e27Sflorian 			yyerror("could not parse tags, (define-tag them first)");
2535e97c6e54Ssthen 			free($2);
2536e97c6e54Ssthen 		}
2537ae8c6e27Sflorian 		if(bitlist) {
2538ae8c6e27Sflorian 			if(!cfg_strbytelist_insert(
2539ae8c6e27Sflorian 				&cfg_parser->cfg->acl_tags,
2540ae8c6e27Sflorian 				$2, bitlist, len)) {
2541ae8c6e27Sflorian 				yyerror("out of memory");
2542ae8c6e27Sflorian 				free($2);
2543ae8c6e27Sflorian 			}
2544ae8c6e27Sflorian 		}
2545ae8c6e27Sflorian 	}
2546ae8c6e27Sflorian 	;
2547ae8c6e27Sflorian server_access_control_tag_action: VAR_ACCESS_CONTROL_TAG_ACTION STRING_ARG STRING_ARG STRING_ARG
2548ae8c6e27Sflorian 	{
2549ae8c6e27Sflorian 		OUTYY(("P(server_access_control_tag_action:%s %s %s)\n", $2, $3, $4));
2550ae8c6e27Sflorian 		if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_actions,
2551ae8c6e27Sflorian 			$2, $3, $4)) {
2552ae8c6e27Sflorian 			yyerror("out of memory");
2553ae8c6e27Sflorian 			free($2);
2554ae8c6e27Sflorian 			free($3);
2555ae8c6e27Sflorian 			free($4);
2556ae8c6e27Sflorian 		}
2557ae8c6e27Sflorian 	}
2558ae8c6e27Sflorian 	;
2559ae8c6e27Sflorian server_access_control_tag_data: VAR_ACCESS_CONTROL_TAG_DATA STRING_ARG STRING_ARG STRING_ARG
2560ae8c6e27Sflorian 	{
2561ae8c6e27Sflorian 		OUTYY(("P(server_access_control_tag_data:%s %s %s)\n", $2, $3, $4));
2562ae8c6e27Sflorian 		if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_datas,
2563ae8c6e27Sflorian 			$2, $3, $4)) {
2564ae8c6e27Sflorian 			yyerror("out of memory");
2565ae8c6e27Sflorian 			free($2);
2566ae8c6e27Sflorian 			free($3);
2567ae8c6e27Sflorian 			free($4);
2568ae8c6e27Sflorian 		}
2569ae8c6e27Sflorian 	}
2570ae8c6e27Sflorian 	;
2571ae8c6e27Sflorian server_local_zone_override: VAR_LOCAL_ZONE_OVERRIDE STRING_ARG STRING_ARG STRING_ARG
2572ae8c6e27Sflorian 	{
2573ae8c6e27Sflorian 		OUTYY(("P(server_local_zone_override:%s %s %s)\n", $2, $3, $4));
2574ae8c6e27Sflorian 		if(!cfg_str3list_insert(&cfg_parser->cfg->local_zone_overrides,
2575ae8c6e27Sflorian 			$2, $3, $4)) {
2576ae8c6e27Sflorian 			yyerror("out of memory");
2577ae8c6e27Sflorian 			free($2);
2578ae8c6e27Sflorian 			free($3);
2579ae8c6e27Sflorian 			free($4);
2580ae8c6e27Sflorian 		}
2581ae8c6e27Sflorian 	}
2582ae8c6e27Sflorian 	;
2583ae8c6e27Sflorian server_access_control_view: VAR_ACCESS_CONTROL_VIEW STRING_ARG STRING_ARG
2584ae8c6e27Sflorian 	{
2585ae8c6e27Sflorian 		OUTYY(("P(server_access_control_view:%s %s)\n", $2, $3));
2586ae8c6e27Sflorian 		if(!cfg_str2list_insert(&cfg_parser->cfg->acl_view,
2587ae8c6e27Sflorian 			$2, $3)) {
2588ae8c6e27Sflorian 			yyerror("out of memory");
2589ae8c6e27Sflorian 		}
2590ae8c6e27Sflorian 	}
2591ae8c6e27Sflorian 	;
25925c45b740Sflorian server_interface_tag: VAR_INTERFACE_TAG STRING_ARG STRING_ARG
25935c45b740Sflorian 	{
25945c45b740Sflorian 		size_t len = 0;
25955c45b740Sflorian 		uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3,
25965c45b740Sflorian 			&len);
25975c45b740Sflorian 		free($3);
25985c45b740Sflorian 		OUTYY(("P(server_interface_tag:%s)\n", $2));
25995c45b740Sflorian 		if(!bitlist) {
26005c45b740Sflorian 			yyerror("could not parse tags, (define-tag them first)");
26015c45b740Sflorian 			free($2);
26025c45b740Sflorian 		}
26035c45b740Sflorian 		if(bitlist) {
26045c45b740Sflorian 			if(!cfg_strbytelist_insert(
26055c45b740Sflorian 				&cfg_parser->cfg->interface_tags,
26065c45b740Sflorian 				$2, bitlist, len)) {
26075c45b740Sflorian 				yyerror("out of memory");
26085c45b740Sflorian 				free($2);
26095c45b740Sflorian 			}
26105c45b740Sflorian 		}
26115c45b740Sflorian 	}
26125c45b740Sflorian 	;
26135c45b740Sflorian server_interface_tag_action: VAR_INTERFACE_TAG_ACTION STRING_ARG STRING_ARG STRING_ARG
26145c45b740Sflorian 	{
26155c45b740Sflorian 		OUTYY(("P(server_interface_tag_action:%s %s %s)\n", $2, $3, $4));
26165c45b740Sflorian 		if(!cfg_str3list_insert(&cfg_parser->cfg->interface_tag_actions,
26175c45b740Sflorian 			$2, $3, $4)) {
26185c45b740Sflorian 			yyerror("out of memory");
26195c45b740Sflorian 			free($2);
26205c45b740Sflorian 			free($3);
26215c45b740Sflorian 			free($4);
26225c45b740Sflorian 		}
26235c45b740Sflorian 	}
26245c45b740Sflorian 	;
26255c45b740Sflorian server_interface_tag_data: VAR_INTERFACE_TAG_DATA STRING_ARG STRING_ARG STRING_ARG
26265c45b740Sflorian 	{
26275c45b740Sflorian 		OUTYY(("P(server_interface_tag_data:%s %s %s)\n", $2, $3, $4));
26285c45b740Sflorian 		if(!cfg_str3list_insert(&cfg_parser->cfg->interface_tag_datas,
26295c45b740Sflorian 			$2, $3, $4)) {
26305c45b740Sflorian 			yyerror("out of memory");
26315c45b740Sflorian 			free($2);
26325c45b740Sflorian 			free($3);
26335c45b740Sflorian 			free($4);
26345c45b740Sflorian 		}
26355c45b740Sflorian 	}
26365c45b740Sflorian 	;
26375c45b740Sflorian server_interface_view: VAR_INTERFACE_VIEW STRING_ARG STRING_ARG
26385c45b740Sflorian 	{
26395c45b740Sflorian 		OUTYY(("P(server_interface_view:%s %s)\n", $2, $3));
26405c45b740Sflorian 		if(!cfg_str2list_insert(&cfg_parser->cfg->interface_view,
26415c45b740Sflorian 			$2, $3)) {
26425c45b740Sflorian 			yyerror("out of memory");
26435c45b740Sflorian 		}
26445c45b740Sflorian 	}
26455c45b740Sflorian 	;
2646ae8c6e27Sflorian server_response_ip_tag: VAR_RESPONSE_IP_TAG STRING_ARG STRING_ARG
2647ae8c6e27Sflorian 	{
2648ae8c6e27Sflorian 		size_t len = 0;
2649ae8c6e27Sflorian 		uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3,
2650ae8c6e27Sflorian 			&len);
2651ae8c6e27Sflorian 		free($3);
2652ae8c6e27Sflorian 		OUTYY(("P(response_ip_tag:%s)\n", $2));
2653e97c6e54Ssthen 		if(!bitlist) {
2654ae8c6e27Sflorian 			yyerror("could not parse tags, (define-tag them first)");
2655e97c6e54Ssthen 			free($2);
2656e97c6e54Ssthen 		}
2657ae8c6e27Sflorian 		if(bitlist) {
2658ae8c6e27Sflorian 			if(!cfg_strbytelist_insert(
2659ae8c6e27Sflorian 				&cfg_parser->cfg->respip_tags,
2660ae8c6e27Sflorian 				$2, bitlist, len)) {
2661ae8c6e27Sflorian 				yyerror("out of memory");
2662ae8c6e27Sflorian 				free($2);
2663ae8c6e27Sflorian 			}
2664ae8c6e27Sflorian 		}
2665ae8c6e27Sflorian 	}
2666ae8c6e27Sflorian 	;
2667ae8c6e27Sflorian server_ip_ratelimit: VAR_IP_RATELIMIT STRING_ARG
2668ae8c6e27Sflorian 	{
2669ae8c6e27Sflorian 		OUTYY(("P(server_ip_ratelimit:%s)\n", $2));
2670ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2671ae8c6e27Sflorian 			yyerror("number expected");
2672ae8c6e27Sflorian 		else cfg_parser->cfg->ip_ratelimit = atoi($2);
2673ae8c6e27Sflorian 		free($2);
2674ae8c6e27Sflorian 	}
2675ae8c6e27Sflorian 	;
2676d500c338Sflorian server_ip_ratelimit_cookie: VAR_IP_RATELIMIT_COOKIE STRING_ARG
2677d500c338Sflorian 	{
2678d500c338Sflorian 		OUTYY(("P(server_ip_ratelimit_cookie:%s)\n", $2));
2679d500c338Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2680d500c338Sflorian 			yyerror("number expected");
2681d500c338Sflorian 		else cfg_parser->cfg->ip_ratelimit_cookie = atoi($2);
2682d500c338Sflorian 		free($2);
2683d500c338Sflorian 	}
2684d500c338Sflorian 	;
2685ae8c6e27Sflorian server_ratelimit: VAR_RATELIMIT STRING_ARG
2686ae8c6e27Sflorian 	{
2687ae8c6e27Sflorian 		OUTYY(("P(server_ratelimit:%s)\n", $2));
2688ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2689ae8c6e27Sflorian 			yyerror("number expected");
2690ae8c6e27Sflorian 		else cfg_parser->cfg->ratelimit = atoi($2);
2691ae8c6e27Sflorian 		free($2);
2692ae8c6e27Sflorian 	}
2693ae8c6e27Sflorian 	;
2694ae8c6e27Sflorian server_ip_ratelimit_size: VAR_IP_RATELIMIT_SIZE STRING_ARG
2695ae8c6e27Sflorian 	{
2696ae8c6e27Sflorian 		OUTYY(("P(server_ip_ratelimit_size:%s)\n", $2));
2697ae8c6e27Sflorian 		if(!cfg_parse_memsize($2, &cfg_parser->cfg->ip_ratelimit_size))
2698ae8c6e27Sflorian 			yyerror("memory size expected");
2699ae8c6e27Sflorian 		free($2);
2700ae8c6e27Sflorian 	}
2701ae8c6e27Sflorian 	;
2702ae8c6e27Sflorian server_ratelimit_size: VAR_RATELIMIT_SIZE STRING_ARG
2703ae8c6e27Sflorian 	{
2704ae8c6e27Sflorian 		OUTYY(("P(server_ratelimit_size:%s)\n", $2));
2705ae8c6e27Sflorian 		if(!cfg_parse_memsize($2, &cfg_parser->cfg->ratelimit_size))
2706ae8c6e27Sflorian 			yyerror("memory size expected");
2707ae8c6e27Sflorian 		free($2);
2708ae8c6e27Sflorian 	}
2709ae8c6e27Sflorian 	;
2710ae8c6e27Sflorian server_ip_ratelimit_slabs: VAR_IP_RATELIMIT_SLABS STRING_ARG
2711ae8c6e27Sflorian 	{
2712ae8c6e27Sflorian 		OUTYY(("P(server_ip_ratelimit_slabs:%s)\n", $2));
2713a1a7ba80Sflorian 		if(atoi($2) == 0) {
2714ae8c6e27Sflorian 			yyerror("number expected");
2715a1a7ba80Sflorian 		} else {
2716ae8c6e27Sflorian 			cfg_parser->cfg->ip_ratelimit_slabs = atoi($2);
2717ae8c6e27Sflorian 			if(!is_pow2(cfg_parser->cfg->ip_ratelimit_slabs))
2718ae8c6e27Sflorian 				yyerror("must be a power of 2");
2719ae8c6e27Sflorian 		}
2720ae8c6e27Sflorian 		free($2);
2721ae8c6e27Sflorian 	}
2722ae8c6e27Sflorian 	;
2723ae8c6e27Sflorian server_ratelimit_slabs: VAR_RATELIMIT_SLABS STRING_ARG
2724ae8c6e27Sflorian 	{
2725ae8c6e27Sflorian 		OUTYY(("P(server_ratelimit_slabs:%s)\n", $2));
2726a1a7ba80Sflorian 		if(atoi($2) == 0) {
2727ae8c6e27Sflorian 			yyerror("number expected");
2728a1a7ba80Sflorian 		} else {
2729ae8c6e27Sflorian 			cfg_parser->cfg->ratelimit_slabs = atoi($2);
2730ae8c6e27Sflorian 			if(!is_pow2(cfg_parser->cfg->ratelimit_slabs))
2731ae8c6e27Sflorian 				yyerror("must be a power of 2");
2732ae8c6e27Sflorian 		}
2733ae8c6e27Sflorian 		free($2);
2734ae8c6e27Sflorian 	}
2735ae8c6e27Sflorian 	;
2736ae8c6e27Sflorian server_ratelimit_for_domain: VAR_RATELIMIT_FOR_DOMAIN STRING_ARG STRING_ARG
2737ae8c6e27Sflorian 	{
2738ae8c6e27Sflorian 		OUTYY(("P(server_ratelimit_for_domain:%s %s)\n", $2, $3));
2739ae8c6e27Sflorian 		if(atoi($3) == 0 && strcmp($3, "0") != 0) {
2740ae8c6e27Sflorian 			yyerror("number expected");
2741e97c6e54Ssthen 			free($2);
2742e97c6e54Ssthen 			free($3);
2743ae8c6e27Sflorian 		} else {
2744ae8c6e27Sflorian 			if(!cfg_str2list_insert(&cfg_parser->cfg->
2745ae8c6e27Sflorian 				ratelimit_for_domain, $2, $3))
2746ae8c6e27Sflorian 				fatal_exit("out of memory adding "
2747ae8c6e27Sflorian 					"ratelimit-for-domain");
2748ae8c6e27Sflorian 		}
2749ae8c6e27Sflorian 	}
2750ae8c6e27Sflorian 	;
2751ae8c6e27Sflorian server_ratelimit_below_domain: VAR_RATELIMIT_BELOW_DOMAIN STRING_ARG STRING_ARG
2752ae8c6e27Sflorian 	{
2753ae8c6e27Sflorian 		OUTYY(("P(server_ratelimit_below_domain:%s %s)\n", $2, $3));
2754ae8c6e27Sflorian 		if(atoi($3) == 0 && strcmp($3, "0") != 0) {
2755ae8c6e27Sflorian 			yyerror("number expected");
2756e97c6e54Ssthen 			free($2);
2757e97c6e54Ssthen 			free($3);
2758ae8c6e27Sflorian 		} else {
2759ae8c6e27Sflorian 			if(!cfg_str2list_insert(&cfg_parser->cfg->
2760ae8c6e27Sflorian 				ratelimit_below_domain, $2, $3))
2761ae8c6e27Sflorian 				fatal_exit("out of memory adding "
2762ae8c6e27Sflorian 					"ratelimit-below-domain");
2763ae8c6e27Sflorian 		}
2764ae8c6e27Sflorian 	}
2765ae8c6e27Sflorian 	;
2766ae8c6e27Sflorian server_ip_ratelimit_factor: VAR_IP_RATELIMIT_FACTOR STRING_ARG
2767ae8c6e27Sflorian 	{
2768ae8c6e27Sflorian 		OUTYY(("P(server_ip_ratelimit_factor:%s)\n", $2));
2769ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2770ae8c6e27Sflorian 			yyerror("number expected");
2771ae8c6e27Sflorian 		else cfg_parser->cfg->ip_ratelimit_factor = atoi($2);
2772ae8c6e27Sflorian 		free($2);
2773ae8c6e27Sflorian 	}
2774ae8c6e27Sflorian 	;
2775ae8c6e27Sflorian server_ratelimit_factor: VAR_RATELIMIT_FACTOR STRING_ARG
2776ae8c6e27Sflorian 	{
2777ae8c6e27Sflorian 		OUTYY(("P(server_ratelimit_factor:%s)\n", $2));
2778ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2779ae8c6e27Sflorian 			yyerror("number expected");
2780ae8c6e27Sflorian 		else cfg_parser->cfg->ratelimit_factor = atoi($2);
2781ae8c6e27Sflorian 		free($2);
2782ae8c6e27Sflorian 	}
2783ae8c6e27Sflorian 	;
2784a1a7ba80Sflorian server_ip_ratelimit_backoff: VAR_IP_RATELIMIT_BACKOFF STRING_ARG
2785a1a7ba80Sflorian 	{
2786a1a7ba80Sflorian 		OUTYY(("P(server_ip_ratelimit_backoff:%s)\n", $2));
2787a1a7ba80Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2788a1a7ba80Sflorian 			yyerror("expected yes or no.");
2789a1a7ba80Sflorian 		else cfg_parser->cfg->ip_ratelimit_backoff =
2790a1a7ba80Sflorian 			(strcmp($2, "yes")==0);
2791a1a7ba80Sflorian 		free($2);
2792a1a7ba80Sflorian 	}
2793a1a7ba80Sflorian 	;
2794a1a7ba80Sflorian server_ratelimit_backoff: VAR_RATELIMIT_BACKOFF STRING_ARG
2795a1a7ba80Sflorian 	{
2796a1a7ba80Sflorian 		OUTYY(("P(server_ratelimit_backoff:%s)\n", $2));
2797a1a7ba80Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2798a1a7ba80Sflorian 			yyerror("expected yes or no.");
2799a1a7ba80Sflorian 		else cfg_parser->cfg->ratelimit_backoff =
2800a1a7ba80Sflorian 			(strcmp($2, "yes")==0);
2801a1a7ba80Sflorian 		free($2);
2802a1a7ba80Sflorian 	}
2803a1a7ba80Sflorian 	;
2804a1a7ba80Sflorian server_outbound_msg_retry: VAR_OUTBOUND_MSG_RETRY STRING_ARG
2805a1a7ba80Sflorian 	{
2806a1a7ba80Sflorian 		OUTYY(("P(server_outbound_msg_retry:%s)\n", $2));
2807a1a7ba80Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2808a1a7ba80Sflorian 			yyerror("number expected");
2809a1a7ba80Sflorian 		else cfg_parser->cfg->outbound_msg_retry = atoi($2);
2810a1a7ba80Sflorian 		free($2);
2811a1a7ba80Sflorian 	}
2812a1a7ba80Sflorian 	;
2813d500c338Sflorian server_max_sent_count: VAR_MAX_SENT_COUNT STRING_ARG
2814d500c338Sflorian 	{
2815d500c338Sflorian 		OUTYY(("P(server_max_sent_count:%s)\n", $2));
2816d500c338Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2817d500c338Sflorian 			yyerror("number expected");
2818d500c338Sflorian 		else cfg_parser->cfg->max_sent_count = atoi($2);
2819d500c338Sflorian 		free($2);
2820d500c338Sflorian 	}
2821d500c338Sflorian 	;
2822d500c338Sflorian server_max_query_restarts: VAR_MAX_QUERY_RESTARTS STRING_ARG
2823d500c338Sflorian 	{
2824d500c338Sflorian 		OUTYY(("P(server_max_query_restarts:%s)\n", $2));
2825d500c338Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2826d500c338Sflorian 			yyerror("number expected");
2827d500c338Sflorian 		else cfg_parser->cfg->max_query_restarts = atoi($2);
2828d500c338Sflorian 		free($2);
2829d500c338Sflorian 	}
2830d500c338Sflorian 	;
2831ae8c6e27Sflorian server_low_rtt: VAR_LOW_RTT STRING_ARG
2832ae8c6e27Sflorian 	{
2833ae8c6e27Sflorian 		OUTYY(("P(low-rtt option is deprecated, use fast-server-num instead)\n"));
2834ae8c6e27Sflorian 		free($2);
2835ae8c6e27Sflorian 	}
2836ae8c6e27Sflorian 	;
2837ae8c6e27Sflorian server_fast_server_num: VAR_FAST_SERVER_NUM STRING_ARG
2838ae8c6e27Sflorian 	{
2839ae8c6e27Sflorian 		OUTYY(("P(server_fast_server_num:%s)\n", $2));
2840ae8c6e27Sflorian 		if(atoi($2) <= 0)
2841ae8c6e27Sflorian 			yyerror("number expected");
2842ae8c6e27Sflorian 		else cfg_parser->cfg->fast_server_num = atoi($2);
2843ae8c6e27Sflorian 		free($2);
2844ae8c6e27Sflorian 	}
2845ae8c6e27Sflorian 	;
2846ae8c6e27Sflorian server_fast_server_permil: VAR_FAST_SERVER_PERMIL STRING_ARG
2847ae8c6e27Sflorian 	{
2848ae8c6e27Sflorian 		OUTYY(("P(server_fast_server_permil:%s)\n", $2));
2849ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2850ae8c6e27Sflorian 			yyerror("number expected");
2851ae8c6e27Sflorian 		else cfg_parser->cfg->fast_server_permil = atoi($2);
2852ae8c6e27Sflorian 		free($2);
2853ae8c6e27Sflorian 	}
2854ae8c6e27Sflorian 	;
2855ae8c6e27Sflorian server_qname_minimisation: VAR_QNAME_MINIMISATION STRING_ARG
2856ae8c6e27Sflorian 	{
2857ae8c6e27Sflorian 		OUTYY(("P(server_qname_minimisation:%s)\n", $2));
2858ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2859ae8c6e27Sflorian 			yyerror("expected yes or no.");
2860ae8c6e27Sflorian 		else cfg_parser->cfg->qname_minimisation =
2861ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
2862ae8c6e27Sflorian 		free($2);
2863ae8c6e27Sflorian 	}
2864ae8c6e27Sflorian 	;
2865ae8c6e27Sflorian server_qname_minimisation_strict: VAR_QNAME_MINIMISATION_STRICT STRING_ARG
2866ae8c6e27Sflorian 	{
2867ae8c6e27Sflorian 		OUTYY(("P(server_qname_minimisation_strict:%s)\n", $2));
2868ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2869ae8c6e27Sflorian 			yyerror("expected yes or no.");
2870ae8c6e27Sflorian 		else cfg_parser->cfg->qname_minimisation_strict =
2871ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
2872ae8c6e27Sflorian 		free($2);
2873ae8c6e27Sflorian 	}
2874ae8c6e27Sflorian 	;
2875a8eaceedSflorian server_pad_responses: VAR_PAD_RESPONSES STRING_ARG
2876a8eaceedSflorian 	{
2877a8eaceedSflorian 		OUTYY(("P(server_pad_responses:%s)\n", $2));
2878a8eaceedSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2879a8eaceedSflorian 			yyerror("expected yes or no.");
2880a8eaceedSflorian 		else cfg_parser->cfg->pad_responses =
2881a8eaceedSflorian 			(strcmp($2, "yes")==0);
2882a8eaceedSflorian 		free($2);
2883a8eaceedSflorian 	}
2884a8eaceedSflorian 	;
2885a8eaceedSflorian server_pad_responses_block_size: VAR_PAD_RESPONSES_BLOCK_SIZE STRING_ARG
2886a8eaceedSflorian 	{
2887a8eaceedSflorian 		OUTYY(("P(server_pad_responses_block_size:%s)\n", $2));
2888a8eaceedSflorian 		if(atoi($2) == 0)
2889a8eaceedSflorian 			yyerror("number expected");
2890a8eaceedSflorian 		else cfg_parser->cfg->pad_responses_block_size = atoi($2);
2891a8eaceedSflorian 		free($2);
2892a8eaceedSflorian 	}
2893a8eaceedSflorian 	;
2894a8eaceedSflorian server_pad_queries: VAR_PAD_QUERIES STRING_ARG
2895a8eaceedSflorian 	{
2896a8eaceedSflorian 		OUTYY(("P(server_pad_queries:%s)\n", $2));
2897a8eaceedSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2898a8eaceedSflorian 			yyerror("expected yes or no.");
2899a8eaceedSflorian 		else cfg_parser->cfg->pad_queries =
2900a8eaceedSflorian 			(strcmp($2, "yes")==0);
2901a8eaceedSflorian 		free($2);
2902a8eaceedSflorian 	}
2903a8eaceedSflorian 	;
2904a8eaceedSflorian server_pad_queries_block_size: VAR_PAD_QUERIES_BLOCK_SIZE STRING_ARG
2905a8eaceedSflorian 	{
2906a8eaceedSflorian 		OUTYY(("P(server_pad_queries_block_size:%s)\n", $2));
2907a8eaceedSflorian 		if(atoi($2) == 0)
2908a8eaceedSflorian 			yyerror("number expected");
2909a8eaceedSflorian 		else cfg_parser->cfg->pad_queries_block_size = atoi($2);
2910a8eaceedSflorian 		free($2);
2911a8eaceedSflorian 	}
2912a8eaceedSflorian 	;
2913ae8c6e27Sflorian server_ipsecmod_enabled: VAR_IPSECMOD_ENABLED STRING_ARG
2914ae8c6e27Sflorian 	{
2915ae8c6e27Sflorian 	#ifdef USE_IPSECMOD
2916ae8c6e27Sflorian 		OUTYY(("P(server_ipsecmod_enabled:%s)\n", $2));
2917ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2918ae8c6e27Sflorian 			yyerror("expected yes or no.");
2919ae8c6e27Sflorian 		else cfg_parser->cfg->ipsecmod_enabled = (strcmp($2, "yes")==0);
2920ae8c6e27Sflorian 	#else
2921ae8c6e27Sflorian 		OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2922ae8c6e27Sflorian 	#endif
2923e97c6e54Ssthen 		free($2);
2924ae8c6e27Sflorian 	}
2925ae8c6e27Sflorian 	;
2926ae8c6e27Sflorian server_ipsecmod_ignore_bogus: VAR_IPSECMOD_IGNORE_BOGUS STRING_ARG
2927ae8c6e27Sflorian 	{
2928ae8c6e27Sflorian 	#ifdef USE_IPSECMOD
2929ae8c6e27Sflorian 		OUTYY(("P(server_ipsecmod_ignore_bogus:%s)\n", $2));
2930ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2931ae8c6e27Sflorian 			yyerror("expected yes or no.");
2932ae8c6e27Sflorian 		else cfg_parser->cfg->ipsecmod_ignore_bogus = (strcmp($2, "yes")==0);
2933ae8c6e27Sflorian 	#else
2934ae8c6e27Sflorian 		OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2935ae8c6e27Sflorian 	#endif
2936e97c6e54Ssthen 		free($2);
2937ae8c6e27Sflorian 	}
2938ae8c6e27Sflorian 	;
2939ae8c6e27Sflorian server_ipsecmod_hook: VAR_IPSECMOD_HOOK STRING_ARG
2940ae8c6e27Sflorian 	{
2941ae8c6e27Sflorian 	#ifdef USE_IPSECMOD
2942ae8c6e27Sflorian 		OUTYY(("P(server_ipsecmod_hook:%s)\n", $2));
2943ae8c6e27Sflorian 		free(cfg_parser->cfg->ipsecmod_hook);
2944ae8c6e27Sflorian 		cfg_parser->cfg->ipsecmod_hook = $2;
2945ae8c6e27Sflorian 	#else
2946ae8c6e27Sflorian 		OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2947e97c6e54Ssthen 		free($2);
2948ae8c6e27Sflorian 	#endif
2949ae8c6e27Sflorian 	}
2950ae8c6e27Sflorian 	;
2951ae8c6e27Sflorian server_ipsecmod_max_ttl: VAR_IPSECMOD_MAX_TTL STRING_ARG
2952ae8c6e27Sflorian 	{
2953ae8c6e27Sflorian 	#ifdef USE_IPSECMOD
2954ae8c6e27Sflorian 		OUTYY(("P(server_ipsecmod_max_ttl:%s)\n", $2));
2955ae8c6e27Sflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
2956ae8c6e27Sflorian 			yyerror("number expected");
2957ae8c6e27Sflorian 		else cfg_parser->cfg->ipsecmod_max_ttl = atoi($2);
2958ae8c6e27Sflorian 		free($2);
2959ae8c6e27Sflorian 	#else
2960ae8c6e27Sflorian 		OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2961e97c6e54Ssthen 		free($2);
2962ae8c6e27Sflorian 	#endif
2963ae8c6e27Sflorian 	}
2964ae8c6e27Sflorian 	;
2965ae8c6e27Sflorian server_ipsecmod_whitelist: VAR_IPSECMOD_WHITELIST STRING_ARG
2966ae8c6e27Sflorian 	{
2967ae8c6e27Sflorian 	#ifdef USE_IPSECMOD
2968ae8c6e27Sflorian 		OUTYY(("P(server_ipsecmod_whitelist:%s)\n", $2));
2969ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->ipsecmod_whitelist, $2))
2970ae8c6e27Sflorian 			yyerror("out of memory");
2971ae8c6e27Sflorian 	#else
2972ae8c6e27Sflorian 		OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2973e97c6e54Ssthen 		free($2);
2974ae8c6e27Sflorian 	#endif
2975ae8c6e27Sflorian 	}
2976ae8c6e27Sflorian 	;
2977ae8c6e27Sflorian server_ipsecmod_strict: VAR_IPSECMOD_STRICT STRING_ARG
2978ae8c6e27Sflorian 	{
2979ae8c6e27Sflorian 	#ifdef USE_IPSECMOD
2980ae8c6e27Sflorian 		OUTYY(("P(server_ipsecmod_strict:%s)\n", $2));
2981ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2982ae8c6e27Sflorian 			yyerror("expected yes or no.");
2983ae8c6e27Sflorian 		else cfg_parser->cfg->ipsecmod_strict = (strcmp($2, "yes")==0);
2984ae8c6e27Sflorian 		free($2);
2985ae8c6e27Sflorian 	#else
2986ae8c6e27Sflorian 		OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2987e97c6e54Ssthen 		free($2);
2988ae8c6e27Sflorian 	#endif
2989ae8c6e27Sflorian 	}
2990ae8c6e27Sflorian 	;
2991853e076fSflorian server_edns_client_string: VAR_EDNS_CLIENT_STRING STRING_ARG STRING_ARG
2992f4f0f0ceSflorian 	{
2993853e076fSflorian 		OUTYY(("P(server_edns_client_string:%s %s)\n", $2, $3));
2994f4f0f0ceSflorian 		if(!cfg_str2list_insert(
2995853e076fSflorian 			&cfg_parser->cfg->edns_client_strings, $2, $3))
2996f4f0f0ceSflorian 			fatal_exit("out of memory adding "
2997853e076fSflorian 				"edns-client-string");
2998f4f0f0ceSflorian 	}
2999f4f0f0ceSflorian 	;
3000853e076fSflorian server_edns_client_string_opcode: VAR_EDNS_CLIENT_STRING_OPCODE STRING_ARG
3001f4f0f0ceSflorian 	{
3002853e076fSflorian 		OUTYY(("P(edns_client_string_opcode:%s)\n", $2));
3003f4f0f0ceSflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
3004f4f0f0ceSflorian 			yyerror("option code expected");
3005f4f0f0ceSflorian 		else if(atoi($2) > 65535 || atoi($2) < 0)
3006f4f0f0ceSflorian 			yyerror("option code must be in interval [0, 65535]");
3007853e076fSflorian 		else cfg_parser->cfg->edns_client_string_opcode = atoi($2);
3008853e076fSflorian 		free($2);
30097a05b9dfSflorian 	}
30107a05b9dfSflorian 	;
30117a05b9dfSflorian server_ede: VAR_EDE STRING_ARG
30127a05b9dfSflorian 	{
30137a05b9dfSflorian 		OUTYY(("P(server_ede:%s)\n", $2));
30147a05b9dfSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
30157a05b9dfSflorian 			yyerror("expected yes or no.");
30167a05b9dfSflorian 		else cfg_parser->cfg->ede = (strcmp($2, "yes")==0);
30177a05b9dfSflorian 		free($2);
3018f4f0f0ceSflorian 	}
3019f4f0f0ceSflorian 	;
30205c45b740Sflorian server_proxy_protocol_port: VAR_PROXY_PROTOCOL_PORT STRING_ARG
30215c45b740Sflorian 	{
30225c45b740Sflorian 		OUTYY(("P(server_proxy_protocol_port:%s)\n", $2));
30235c45b740Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->proxy_protocol_port, $2))
30245c45b740Sflorian 			yyerror("out of memory");
30255c45b740Sflorian 	}
30265c45b740Sflorian 	;
3027ae8c6e27Sflorian stub_name: VAR_NAME STRING_ARG
3028ae8c6e27Sflorian 	{
3029ae8c6e27Sflorian 		OUTYY(("P(name:%s)\n", $2));
3030ae8c6e27Sflorian 		if(cfg_parser->cfg->stubs->name)
3031ae8c6e27Sflorian 			yyerror("stub name override, there must be one name "
3032ae8c6e27Sflorian 				"for one stub-zone");
3033ae8c6e27Sflorian 		free(cfg_parser->cfg->stubs->name);
3034ae8c6e27Sflorian 		cfg_parser->cfg->stubs->name = $2;
3035ae8c6e27Sflorian 	}
3036ae8c6e27Sflorian 	;
3037ae8c6e27Sflorian stub_host: VAR_STUB_HOST STRING_ARG
3038ae8c6e27Sflorian 	{
3039ae8c6e27Sflorian 		OUTYY(("P(stub-host:%s)\n", $2));
3040ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->hosts, $2))
3041ae8c6e27Sflorian 			yyerror("out of memory");
3042ae8c6e27Sflorian 	}
3043ae8c6e27Sflorian 	;
3044ae8c6e27Sflorian stub_addr: VAR_STUB_ADDR STRING_ARG
3045ae8c6e27Sflorian 	{
3046ae8c6e27Sflorian 		OUTYY(("P(stub-addr:%s)\n", $2));
3047ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->addrs, $2))
3048ae8c6e27Sflorian 			yyerror("out of memory");
3049ae8c6e27Sflorian 	}
3050ae8c6e27Sflorian 	;
3051ae8c6e27Sflorian stub_first: VAR_STUB_FIRST STRING_ARG
3052ae8c6e27Sflorian 	{
3053ae8c6e27Sflorian 		OUTYY(("P(stub-first:%s)\n", $2));
3054ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3055ae8c6e27Sflorian 			yyerror("expected yes or no.");
3056ae8c6e27Sflorian 		else cfg_parser->cfg->stubs->isfirst=(strcmp($2, "yes")==0);
3057ae8c6e27Sflorian 		free($2);
3058ae8c6e27Sflorian 	}
3059ae8c6e27Sflorian 	;
3060ae8c6e27Sflorian stub_no_cache: VAR_STUB_NO_CACHE STRING_ARG
3061ae8c6e27Sflorian 	{
3062ae8c6e27Sflorian 		OUTYY(("P(stub-no-cache:%s)\n", $2));
3063ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3064ae8c6e27Sflorian 			yyerror("expected yes or no.");
3065ae8c6e27Sflorian 		else cfg_parser->cfg->stubs->no_cache=(strcmp($2, "yes")==0);
3066ae8c6e27Sflorian 		free($2);
3067ae8c6e27Sflorian 	}
3068ae8c6e27Sflorian 	;
3069ae8c6e27Sflorian stub_ssl_upstream: VAR_STUB_SSL_UPSTREAM STRING_ARG
3070ae8c6e27Sflorian 	{
3071ae8c6e27Sflorian 		OUTYY(("P(stub-ssl-upstream:%s)\n", $2));
3072ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3073ae8c6e27Sflorian 			yyerror("expected yes or no.");
3074ae8c6e27Sflorian 		else cfg_parser->cfg->stubs->ssl_upstream =
3075ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3076ae8c6e27Sflorian 		free($2);
3077ae8c6e27Sflorian 	}
3078ae8c6e27Sflorian 	;
3079a1a7ba80Sflorian stub_tcp_upstream: VAR_STUB_TCP_UPSTREAM STRING_ARG
3080a1a7ba80Sflorian         {
3081a1a7ba80Sflorian                 OUTYY(("P(stub-tcp-upstream:%s)\n", $2));
3082a1a7ba80Sflorian                 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3083a1a7ba80Sflorian                         yyerror("expected yes or no.");
3084a1a7ba80Sflorian                 else cfg_parser->cfg->stubs->tcp_upstream =
3085a1a7ba80Sflorian                         (strcmp($2, "yes")==0);
3086a1a7ba80Sflorian                 free($2);
3087a1a7ba80Sflorian         }
3088a1a7ba80Sflorian         ;
3089ae8c6e27Sflorian stub_prime: VAR_STUB_PRIME STRING_ARG
3090ae8c6e27Sflorian 	{
3091ae8c6e27Sflorian 		OUTYY(("P(stub-prime:%s)\n", $2));
3092ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3093ae8c6e27Sflorian 			yyerror("expected yes or no.");
3094ae8c6e27Sflorian 		else cfg_parser->cfg->stubs->isprime =
3095ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3096ae8c6e27Sflorian 		free($2);
3097ae8c6e27Sflorian 	}
3098ae8c6e27Sflorian 	;
3099ae8c6e27Sflorian forward_name: VAR_NAME STRING_ARG
3100ae8c6e27Sflorian 	{
3101ae8c6e27Sflorian 		OUTYY(("P(name:%s)\n", $2));
3102ae8c6e27Sflorian 		if(cfg_parser->cfg->forwards->name)
3103ae8c6e27Sflorian 			yyerror("forward name override, there must be one "
3104ae8c6e27Sflorian 				"name for one forward-zone");
3105ae8c6e27Sflorian 		free(cfg_parser->cfg->forwards->name);
3106ae8c6e27Sflorian 		cfg_parser->cfg->forwards->name = $2;
3107ae8c6e27Sflorian 	}
3108ae8c6e27Sflorian 	;
3109ae8c6e27Sflorian forward_host: VAR_FORWARD_HOST STRING_ARG
3110ae8c6e27Sflorian 	{
3111ae8c6e27Sflorian 		OUTYY(("P(forward-host:%s)\n", $2));
3112ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->hosts, $2))
3113ae8c6e27Sflorian 			yyerror("out of memory");
3114ae8c6e27Sflorian 	}
3115ae8c6e27Sflorian 	;
3116ae8c6e27Sflorian forward_addr: VAR_FORWARD_ADDR STRING_ARG
3117ae8c6e27Sflorian 	{
3118ae8c6e27Sflorian 		OUTYY(("P(forward-addr:%s)\n", $2));
3119ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->addrs, $2))
3120ae8c6e27Sflorian 			yyerror("out of memory");
3121ae8c6e27Sflorian 	}
3122ae8c6e27Sflorian 	;
3123ae8c6e27Sflorian forward_first: VAR_FORWARD_FIRST STRING_ARG
3124ae8c6e27Sflorian 	{
3125ae8c6e27Sflorian 		OUTYY(("P(forward-first:%s)\n", $2));
3126ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3127ae8c6e27Sflorian 			yyerror("expected yes or no.");
3128ae8c6e27Sflorian 		else cfg_parser->cfg->forwards->isfirst=(strcmp($2, "yes")==0);
3129ae8c6e27Sflorian 		free($2);
3130ae8c6e27Sflorian 	}
3131ae8c6e27Sflorian 	;
3132ae8c6e27Sflorian forward_no_cache: VAR_FORWARD_NO_CACHE STRING_ARG
3133ae8c6e27Sflorian 	{
3134ae8c6e27Sflorian 		OUTYY(("P(forward-no-cache:%s)\n", $2));
3135ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3136ae8c6e27Sflorian 			yyerror("expected yes or no.");
3137ae8c6e27Sflorian 		else cfg_parser->cfg->forwards->no_cache=(strcmp($2, "yes")==0);
3138ae8c6e27Sflorian 		free($2);
3139ae8c6e27Sflorian 	}
3140ae8c6e27Sflorian 	;
3141ae8c6e27Sflorian forward_ssl_upstream: VAR_FORWARD_SSL_UPSTREAM STRING_ARG
3142ae8c6e27Sflorian 	{
3143ae8c6e27Sflorian 		OUTYY(("P(forward-ssl-upstream:%s)\n", $2));
3144ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3145ae8c6e27Sflorian 			yyerror("expected yes or no.");
3146ae8c6e27Sflorian 		else cfg_parser->cfg->forwards->ssl_upstream =
3147ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3148ae8c6e27Sflorian 		free($2);
3149ae8c6e27Sflorian 	}
3150ae8c6e27Sflorian 	;
3151a1a7ba80Sflorian forward_tcp_upstream: VAR_FORWARD_TCP_UPSTREAM STRING_ARG
3152a1a7ba80Sflorian         {
3153a1a7ba80Sflorian                 OUTYY(("P(forward-tcp-upstream:%s)\n", $2));
3154a1a7ba80Sflorian                 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3155a1a7ba80Sflorian                         yyerror("expected yes or no.");
3156a1a7ba80Sflorian                 else cfg_parser->cfg->forwards->tcp_upstream =
3157a1a7ba80Sflorian                         (strcmp($2, "yes")==0);
3158a1a7ba80Sflorian                 free($2);
3159a1a7ba80Sflorian         }
3160a1a7ba80Sflorian         ;
3161ae8c6e27Sflorian auth_name: VAR_NAME STRING_ARG
3162ae8c6e27Sflorian 	{
3163ae8c6e27Sflorian 		OUTYY(("P(name:%s)\n", $2));
3164ae8c6e27Sflorian 		if(cfg_parser->cfg->auths->name)
3165ae8c6e27Sflorian 			yyerror("auth name override, there must be one name "
3166ae8c6e27Sflorian 				"for one auth-zone");
3167ae8c6e27Sflorian 		free(cfg_parser->cfg->auths->name);
3168ae8c6e27Sflorian 		cfg_parser->cfg->auths->name = $2;
3169ae8c6e27Sflorian 	}
3170ae8c6e27Sflorian 	;
3171ae8c6e27Sflorian auth_zonefile: VAR_ZONEFILE STRING_ARG
3172ae8c6e27Sflorian 	{
3173ae8c6e27Sflorian 		OUTYY(("P(zonefile:%s)\n", $2));
3174ae8c6e27Sflorian 		free(cfg_parser->cfg->auths->zonefile);
3175ae8c6e27Sflorian 		cfg_parser->cfg->auths->zonefile = $2;
3176ae8c6e27Sflorian 	}
3177ae8c6e27Sflorian 	;
3178ae8c6e27Sflorian auth_master: VAR_MASTER STRING_ARG
3179ae8c6e27Sflorian 	{
3180ae8c6e27Sflorian 		OUTYY(("P(master:%s)\n", $2));
3181ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->auths->masters, $2))
3182ae8c6e27Sflorian 			yyerror("out of memory");
3183ae8c6e27Sflorian 	}
3184ae8c6e27Sflorian 	;
3185ae8c6e27Sflorian auth_url: VAR_URL STRING_ARG
3186ae8c6e27Sflorian 	{
3187ae8c6e27Sflorian 		OUTYY(("P(url:%s)\n", $2));
3188ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->auths->urls, $2))
3189ae8c6e27Sflorian 			yyerror("out of memory");
3190ae8c6e27Sflorian 	}
3191ae8c6e27Sflorian 	;
3192ae8c6e27Sflorian auth_allow_notify: VAR_ALLOW_NOTIFY STRING_ARG
3193ae8c6e27Sflorian 	{
3194ae8c6e27Sflorian 		OUTYY(("P(allow-notify:%s)\n", $2));
3195ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->auths->allow_notify,
3196ae8c6e27Sflorian 			$2))
3197ae8c6e27Sflorian 			yyerror("out of memory");
3198ae8c6e27Sflorian 	}
3199ae8c6e27Sflorian 	;
3200411c5950Sflorian auth_zonemd_check: VAR_ZONEMD_CHECK STRING_ARG
3201411c5950Sflorian 	{
3202411c5950Sflorian 		OUTYY(("P(zonemd-check:%s)\n", $2));
3203411c5950Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3204411c5950Sflorian 			yyerror("expected yes or no.");
3205411c5950Sflorian 		else cfg_parser->cfg->auths->zonemd_check =
3206411c5950Sflorian 			(strcmp($2, "yes")==0);
3207411c5950Sflorian 		free($2);
3208411c5950Sflorian 	}
3209411c5950Sflorian 	;
3210411c5950Sflorian auth_zonemd_reject_absence: VAR_ZONEMD_REJECT_ABSENCE STRING_ARG
3211411c5950Sflorian 	{
3212411c5950Sflorian 		OUTYY(("P(zonemd-reject-absence:%s)\n", $2));
3213411c5950Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3214411c5950Sflorian 			yyerror("expected yes or no.");
3215411c5950Sflorian 		else cfg_parser->cfg->auths->zonemd_reject_absence =
3216411c5950Sflorian 			(strcmp($2, "yes")==0);
3217411c5950Sflorian 		free($2);
3218411c5950Sflorian 	}
3219411c5950Sflorian 	;
3220ae8c6e27Sflorian auth_for_downstream: VAR_FOR_DOWNSTREAM STRING_ARG
3221ae8c6e27Sflorian 	{
3222ae8c6e27Sflorian 		OUTYY(("P(for-downstream:%s)\n", $2));
3223ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3224ae8c6e27Sflorian 			yyerror("expected yes or no.");
3225ae8c6e27Sflorian 		else cfg_parser->cfg->auths->for_downstream =
3226ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3227ae8c6e27Sflorian 		free($2);
3228ae8c6e27Sflorian 	}
3229ae8c6e27Sflorian 	;
3230ae8c6e27Sflorian auth_for_upstream: VAR_FOR_UPSTREAM STRING_ARG
3231ae8c6e27Sflorian 	{
3232ae8c6e27Sflorian 		OUTYY(("P(for-upstream:%s)\n", $2));
3233ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3234ae8c6e27Sflorian 			yyerror("expected yes or no.");
3235ae8c6e27Sflorian 		else cfg_parser->cfg->auths->for_upstream =
3236ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3237ae8c6e27Sflorian 		free($2);
3238ae8c6e27Sflorian 	}
3239ae8c6e27Sflorian 	;
3240ae8c6e27Sflorian auth_fallback_enabled: VAR_FALLBACK_ENABLED STRING_ARG
3241ae8c6e27Sflorian 	{
3242ae8c6e27Sflorian 		OUTYY(("P(fallback-enabled:%s)\n", $2));
3243ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3244ae8c6e27Sflorian 			yyerror("expected yes or no.");
3245ae8c6e27Sflorian 		else cfg_parser->cfg->auths->fallback_enabled =
3246ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3247ae8c6e27Sflorian 		free($2);
3248ae8c6e27Sflorian 	}
3249ae8c6e27Sflorian 	;
3250ae8c6e27Sflorian view_name: VAR_NAME STRING_ARG
3251ae8c6e27Sflorian 	{
3252ae8c6e27Sflorian 		OUTYY(("P(name:%s)\n", $2));
3253ae8c6e27Sflorian 		if(cfg_parser->cfg->views->name)
3254ae8c6e27Sflorian 			yyerror("view name override, there must be one "
3255ae8c6e27Sflorian 				"name for one view");
3256ae8c6e27Sflorian 		free(cfg_parser->cfg->views->name);
3257ae8c6e27Sflorian 		cfg_parser->cfg->views->name = $2;
3258ae8c6e27Sflorian 	}
3259ae8c6e27Sflorian 	;
3260ae8c6e27Sflorian view_local_zone: VAR_LOCAL_ZONE STRING_ARG STRING_ARG
3261ae8c6e27Sflorian 	{
3262ae8c6e27Sflorian 		OUTYY(("P(view_local_zone:%s %s)\n", $2, $3));
3263ae8c6e27Sflorian 		if(strcmp($3, "static")!=0 && strcmp($3, "deny")!=0 &&
3264ae8c6e27Sflorian 		   strcmp($3, "refuse")!=0 && strcmp($3, "redirect")!=0 &&
3265ae8c6e27Sflorian 		   strcmp($3, "transparent")!=0 && strcmp($3, "nodefault")!=0
3266ae8c6e27Sflorian 		   && strcmp($3, "typetransparent")!=0
3267ae8c6e27Sflorian 		   && strcmp($3, "always_transparent")!=0
3268ae8c6e27Sflorian 		   && strcmp($3, "always_refuse")!=0
3269ae8c6e27Sflorian 		   && strcmp($3, "always_nxdomain")!=0
3270411c5950Sflorian 		   && strcmp($3, "always_nodata")!=0
3271411c5950Sflorian 		   && strcmp($3, "always_deny")!=0
3272411c5950Sflorian 		   && strcmp($3, "always_null")!=0
3273ae8c6e27Sflorian 		   && strcmp($3, "noview")!=0
3274411c5950Sflorian 		   && strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0
3275411c5950Sflorian 		   && strcmp($3, "inform_redirect") != 0
3276411c5950Sflorian 		   && strcmp($3, "ipset") != 0) {
3277ae8c6e27Sflorian 			yyerror("local-zone type: expected static, deny, "
3278ae8c6e27Sflorian 				"refuse, redirect, transparent, "
3279ae8c6e27Sflorian 				"typetransparent, inform, inform_deny, "
3280411c5950Sflorian 				"inform_redirect, always_transparent, "
3281411c5950Sflorian 				"always_refuse, always_nxdomain, "
3282411c5950Sflorian 				"always_nodata, always_deny, always_null, "
3283411c5950Sflorian 				"noview, nodefault or ipset");
3284e97c6e54Ssthen 			free($2);
3285e97c6e54Ssthen 			free($3);
3286e97c6e54Ssthen 		} else if(strcmp($3, "nodefault")==0) {
3287ae8c6e27Sflorian 			if(!cfg_strlist_insert(&cfg_parser->cfg->views->
3288ae8c6e27Sflorian 				local_zones_nodefault, $2))
3289ae8c6e27Sflorian 				fatal_exit("out of memory adding local-zone");
3290ae8c6e27Sflorian 			free($3);
3291da8c8390Sflorian #ifdef USE_IPSET
3292da8c8390Sflorian 		} else if(strcmp($3, "ipset")==0) {
32937a05b9dfSflorian 			size_t len = strlen($2);
32947a05b9dfSflorian 			/* Make sure to add the trailing dot.
32957a05b9dfSflorian 			 * These are str compared to domain names. */
32967a05b9dfSflorian 			if($2[len-1] != '.') {
32977a05b9dfSflorian 				if(!($2 = realloc($2, len+2))) {
32987a05b9dfSflorian 					fatal_exit("out of memory adding local-zone");
32997a05b9dfSflorian 				}
33007a05b9dfSflorian 				$2[len] = '.';
33017a05b9dfSflorian 				$2[len+1] = 0;
33027a05b9dfSflorian 			}
3303da8c8390Sflorian 			if(!cfg_strlist_insert(&cfg_parser->cfg->views->
3304da8c8390Sflorian 				local_zones_ipset, $2))
3305da8c8390Sflorian 				fatal_exit("out of memory adding local-zone");
3306da8c8390Sflorian 			free($3);
3307da8c8390Sflorian #endif
3308ae8c6e27Sflorian 		} else {
3309ae8c6e27Sflorian 			if(!cfg_str2list_insert(
3310ae8c6e27Sflorian 				&cfg_parser->cfg->views->local_zones,
3311ae8c6e27Sflorian 				$2, $3))
3312ae8c6e27Sflorian 				fatal_exit("out of memory adding local-zone");
3313ae8c6e27Sflorian 		}
3314ae8c6e27Sflorian 	}
3315ae8c6e27Sflorian 	;
3316ae8c6e27Sflorian view_response_ip: VAR_RESPONSE_IP STRING_ARG STRING_ARG
3317ae8c6e27Sflorian 	{
3318ae8c6e27Sflorian 		OUTYY(("P(view_response_ip:%s %s)\n", $2, $3));
3319ae8c6e27Sflorian 		validate_respip_action($3);
3320ae8c6e27Sflorian 		if(!cfg_str2list_insert(
3321ae8c6e27Sflorian 			&cfg_parser->cfg->views->respip_actions, $2, $3))
3322ae8c6e27Sflorian 			fatal_exit("out of memory adding per-view "
3323ae8c6e27Sflorian 				"response-ip action");
3324ae8c6e27Sflorian 	}
3325ae8c6e27Sflorian 	;
3326ae8c6e27Sflorian view_response_ip_data: VAR_RESPONSE_IP_DATA STRING_ARG STRING_ARG
3327ae8c6e27Sflorian 	{
3328ae8c6e27Sflorian 		OUTYY(("P(view_response_ip_data:%s)\n", $2));
3329ae8c6e27Sflorian 		if(!cfg_str2list_insert(
3330ae8c6e27Sflorian 			&cfg_parser->cfg->views->respip_data, $2, $3))
3331ae8c6e27Sflorian 			fatal_exit("out of memory adding response-ip-data");
3332ae8c6e27Sflorian 	}
3333ae8c6e27Sflorian 	;
3334ae8c6e27Sflorian view_local_data: VAR_LOCAL_DATA STRING_ARG
3335ae8c6e27Sflorian 	{
3336ae8c6e27Sflorian 		OUTYY(("P(view_local_data:%s)\n", $2));
3337ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->views->local_data, $2)) {
3338ae8c6e27Sflorian 			fatal_exit("out of memory adding local-data");
3339ae8c6e27Sflorian 		}
3340ae8c6e27Sflorian 	}
3341ae8c6e27Sflorian 	;
3342ae8c6e27Sflorian view_local_data_ptr: VAR_LOCAL_DATA_PTR STRING_ARG
3343ae8c6e27Sflorian 	{
3344ae8c6e27Sflorian 		char* ptr;
3345ae8c6e27Sflorian 		OUTYY(("P(view_local_data_ptr:%s)\n", $2));
3346ae8c6e27Sflorian 		ptr = cfg_ptr_reverse($2);
3347ae8c6e27Sflorian 		free($2);
3348ae8c6e27Sflorian 		if(ptr) {
3349ae8c6e27Sflorian 			if(!cfg_strlist_insert(&cfg_parser->cfg->views->
3350ae8c6e27Sflorian 				local_data, ptr))
3351ae8c6e27Sflorian 				fatal_exit("out of memory adding local-data");
3352ae8c6e27Sflorian 		} else {
3353ae8c6e27Sflorian 			yyerror("local-data-ptr could not be reversed");
3354ae8c6e27Sflorian 		}
3355ae8c6e27Sflorian 	}
3356ae8c6e27Sflorian 	;
3357ae8c6e27Sflorian view_first: VAR_VIEW_FIRST STRING_ARG
3358ae8c6e27Sflorian 	{
3359ae8c6e27Sflorian 		OUTYY(("P(view-first:%s)\n", $2));
3360ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3361ae8c6e27Sflorian 			yyerror("expected yes or no.");
3362ae8c6e27Sflorian 		else cfg_parser->cfg->views->isfirst=(strcmp($2, "yes")==0);
3363ae8c6e27Sflorian 		free($2);
3364ae8c6e27Sflorian 	}
3365ae8c6e27Sflorian 	;
3366ae8c6e27Sflorian rcstart: VAR_REMOTE_CONTROL
3367ae8c6e27Sflorian 	{
3368ae8c6e27Sflorian 		OUTYY(("\nP(remote-control:)\n"));
33695c45b740Sflorian 		cfg_parser->started_toplevel = 1;
3370ae8c6e27Sflorian 	}
3371ae8c6e27Sflorian 	;
3372ae8c6e27Sflorian contents_rc: contents_rc content_rc
3373ae8c6e27Sflorian 	| ;
3374ae8c6e27Sflorian content_rc: rc_control_enable | rc_control_interface | rc_control_port |
3375ae8c6e27Sflorian 	rc_server_key_file | rc_server_cert_file | rc_control_key_file |
3376ae8c6e27Sflorian 	rc_control_cert_file | rc_control_use_cert
3377ae8c6e27Sflorian 	;
3378ae8c6e27Sflorian rc_control_enable: VAR_CONTROL_ENABLE STRING_ARG
3379ae8c6e27Sflorian 	{
3380ae8c6e27Sflorian 		OUTYY(("P(control_enable:%s)\n", $2));
3381ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3382ae8c6e27Sflorian 			yyerror("expected yes or no.");
3383ae8c6e27Sflorian 		else cfg_parser->cfg->remote_control_enable =
3384ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3385ae8c6e27Sflorian 		free($2);
3386ae8c6e27Sflorian 	}
3387ae8c6e27Sflorian 	;
3388ae8c6e27Sflorian rc_control_port: VAR_CONTROL_PORT STRING_ARG
3389ae8c6e27Sflorian 	{
3390ae8c6e27Sflorian 		OUTYY(("P(control_port:%s)\n", $2));
3391ae8c6e27Sflorian 		if(atoi($2) == 0)
3392ae8c6e27Sflorian 			yyerror("control port number expected");
3393ae8c6e27Sflorian 		else cfg_parser->cfg->control_port = atoi($2);
3394ae8c6e27Sflorian 		free($2);
3395ae8c6e27Sflorian 	}
3396ae8c6e27Sflorian 	;
3397ae8c6e27Sflorian rc_control_interface: VAR_CONTROL_INTERFACE STRING_ARG
3398ae8c6e27Sflorian 	{
3399ae8c6e27Sflorian 		OUTYY(("P(control_interface:%s)\n", $2));
3400ae8c6e27Sflorian 		if(!cfg_strlist_append(&cfg_parser->cfg->control_ifs, $2))
3401ae8c6e27Sflorian 			yyerror("out of memory");
3402ae8c6e27Sflorian 	}
3403ae8c6e27Sflorian 	;
3404ae8c6e27Sflorian rc_control_use_cert: VAR_CONTROL_USE_CERT STRING_ARG
3405ae8c6e27Sflorian 	{
3406ae8c6e27Sflorian 		OUTYY(("P(control_use_cert:%s)\n", $2));
3407ae8c6e27Sflorian 		cfg_parser->cfg->control_use_cert = (strcmp($2, "yes")==0);
3408ae8c6e27Sflorian 		free($2);
3409ae8c6e27Sflorian 	}
3410ae8c6e27Sflorian 	;
3411ae8c6e27Sflorian rc_server_key_file: VAR_SERVER_KEY_FILE STRING_ARG
3412ae8c6e27Sflorian 	{
3413ae8c6e27Sflorian 		OUTYY(("P(rc_server_key_file:%s)\n", $2));
3414ae8c6e27Sflorian 		free(cfg_parser->cfg->server_key_file);
3415ae8c6e27Sflorian 		cfg_parser->cfg->server_key_file = $2;
3416ae8c6e27Sflorian 	}
3417ae8c6e27Sflorian 	;
3418ae8c6e27Sflorian rc_server_cert_file: VAR_SERVER_CERT_FILE STRING_ARG
3419ae8c6e27Sflorian 	{
3420ae8c6e27Sflorian 		OUTYY(("P(rc_server_cert_file:%s)\n", $2));
3421ae8c6e27Sflorian 		free(cfg_parser->cfg->server_cert_file);
3422ae8c6e27Sflorian 		cfg_parser->cfg->server_cert_file = $2;
3423ae8c6e27Sflorian 	}
3424ae8c6e27Sflorian 	;
3425ae8c6e27Sflorian rc_control_key_file: VAR_CONTROL_KEY_FILE STRING_ARG
3426ae8c6e27Sflorian 	{
3427ae8c6e27Sflorian 		OUTYY(("P(rc_control_key_file:%s)\n", $2));
3428ae8c6e27Sflorian 		free(cfg_parser->cfg->control_key_file);
3429ae8c6e27Sflorian 		cfg_parser->cfg->control_key_file = $2;
3430ae8c6e27Sflorian 	}
3431ae8c6e27Sflorian 	;
3432ae8c6e27Sflorian rc_control_cert_file: VAR_CONTROL_CERT_FILE STRING_ARG
3433ae8c6e27Sflorian 	{
3434ae8c6e27Sflorian 		OUTYY(("P(rc_control_cert_file:%s)\n", $2));
3435ae8c6e27Sflorian 		free(cfg_parser->cfg->control_cert_file);
3436ae8c6e27Sflorian 		cfg_parser->cfg->control_cert_file = $2;
3437ae8c6e27Sflorian 	}
3438ae8c6e27Sflorian 	;
3439ae8c6e27Sflorian dtstart: VAR_DNSTAP
3440ae8c6e27Sflorian 	{
3441ae8c6e27Sflorian 		OUTYY(("\nP(dnstap:)\n"));
34425c45b740Sflorian 		cfg_parser->started_toplevel = 1;
3443ae8c6e27Sflorian 	}
3444ae8c6e27Sflorian 	;
3445ae8c6e27Sflorian contents_dt: contents_dt content_dt
3446ae8c6e27Sflorian 	| ;
3447e47fef9eSflorian content_dt: dt_dnstap_enable | dt_dnstap_socket_path | dt_dnstap_bidirectional |
3448e47fef9eSflorian 	dt_dnstap_ip | dt_dnstap_tls | dt_dnstap_tls_server_name |
3449e47fef9eSflorian 	dt_dnstap_tls_cert_bundle |
3450e47fef9eSflorian 	dt_dnstap_tls_client_key_file | dt_dnstap_tls_client_cert_file |
3451ae8c6e27Sflorian 	dt_dnstap_send_identity | dt_dnstap_send_version |
3452ae8c6e27Sflorian 	dt_dnstap_identity | dt_dnstap_version |
3453ae8c6e27Sflorian 	dt_dnstap_log_resolver_query_messages |
3454ae8c6e27Sflorian 	dt_dnstap_log_resolver_response_messages |
3455ae8c6e27Sflorian 	dt_dnstap_log_client_query_messages |
3456ae8c6e27Sflorian 	dt_dnstap_log_client_response_messages |
3457ae8c6e27Sflorian 	dt_dnstap_log_forwarder_query_messages |
3458*7037e34cSflorian 	dt_dnstap_log_forwarder_response_messages |
3459*7037e34cSflorian 	dt_dnstap_sample_rate
3460ae8c6e27Sflorian 	;
3461ae8c6e27Sflorian dt_dnstap_enable: VAR_DNSTAP_ENABLE STRING_ARG
3462ae8c6e27Sflorian 	{
3463ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_enable:%s)\n", $2));
3464ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3465ae8c6e27Sflorian 			yyerror("expected yes or no.");
3466ae8c6e27Sflorian 		else cfg_parser->cfg->dnstap = (strcmp($2, "yes")==0);
3467e97c6e54Ssthen 		free($2);
3468ae8c6e27Sflorian 	}
3469ae8c6e27Sflorian 	;
3470e47fef9eSflorian dt_dnstap_bidirectional: VAR_DNSTAP_BIDIRECTIONAL STRING_ARG
3471e47fef9eSflorian 	{
3472e47fef9eSflorian 		OUTYY(("P(dt_dnstap_bidirectional:%s)\n", $2));
3473e47fef9eSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3474e47fef9eSflorian 			yyerror("expected yes or no.");
3475e47fef9eSflorian 		else cfg_parser->cfg->dnstap_bidirectional =
3476e47fef9eSflorian 			(strcmp($2, "yes")==0);
3477e47fef9eSflorian 		free($2);
3478e47fef9eSflorian 	}
3479e47fef9eSflorian 	;
3480ae8c6e27Sflorian dt_dnstap_socket_path: VAR_DNSTAP_SOCKET_PATH STRING_ARG
3481ae8c6e27Sflorian 	{
3482ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_socket_path:%s)\n", $2));
3483ae8c6e27Sflorian 		free(cfg_parser->cfg->dnstap_socket_path);
3484ae8c6e27Sflorian 		cfg_parser->cfg->dnstap_socket_path = $2;
3485ae8c6e27Sflorian 	}
3486ae8c6e27Sflorian 	;
3487e47fef9eSflorian dt_dnstap_ip: VAR_DNSTAP_IP STRING_ARG
3488e47fef9eSflorian 	{
3489e47fef9eSflorian 		OUTYY(("P(dt_dnstap_ip:%s)\n", $2));
3490e47fef9eSflorian 		free(cfg_parser->cfg->dnstap_ip);
3491e47fef9eSflorian 		cfg_parser->cfg->dnstap_ip = $2;
3492e47fef9eSflorian 	}
3493e47fef9eSflorian 	;
3494e47fef9eSflorian dt_dnstap_tls: VAR_DNSTAP_TLS STRING_ARG
3495e47fef9eSflorian 	{
3496e47fef9eSflorian 		OUTYY(("P(dt_dnstap_tls:%s)\n", $2));
3497e47fef9eSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3498e47fef9eSflorian 			yyerror("expected yes or no.");
3499e47fef9eSflorian 		else cfg_parser->cfg->dnstap_tls = (strcmp($2, "yes")==0);
3500e47fef9eSflorian 		free($2);
3501e47fef9eSflorian 	}
3502e47fef9eSflorian 	;
3503e47fef9eSflorian dt_dnstap_tls_server_name: VAR_DNSTAP_TLS_SERVER_NAME STRING_ARG
3504e47fef9eSflorian 	{
3505e47fef9eSflorian 		OUTYY(("P(dt_dnstap_tls_server_name:%s)\n", $2));
3506e47fef9eSflorian 		free(cfg_parser->cfg->dnstap_tls_server_name);
3507e47fef9eSflorian 		cfg_parser->cfg->dnstap_tls_server_name = $2;
3508e47fef9eSflorian 	}
3509e47fef9eSflorian 	;
3510e47fef9eSflorian dt_dnstap_tls_cert_bundle: VAR_DNSTAP_TLS_CERT_BUNDLE STRING_ARG
3511e47fef9eSflorian 	{
3512e47fef9eSflorian 		OUTYY(("P(dt_dnstap_tls_cert_bundle:%s)\n", $2));
3513e47fef9eSflorian 		free(cfg_parser->cfg->dnstap_tls_cert_bundle);
3514e47fef9eSflorian 		cfg_parser->cfg->dnstap_tls_cert_bundle = $2;
3515e47fef9eSflorian 	}
3516e47fef9eSflorian 	;
3517e47fef9eSflorian dt_dnstap_tls_client_key_file: VAR_DNSTAP_TLS_CLIENT_KEY_FILE STRING_ARG
3518e47fef9eSflorian 	{
3519e47fef9eSflorian 		OUTYY(("P(dt_dnstap_tls_client_key_file:%s)\n", $2));
3520e47fef9eSflorian 		free(cfg_parser->cfg->dnstap_tls_client_key_file);
3521e47fef9eSflorian 		cfg_parser->cfg->dnstap_tls_client_key_file = $2;
3522e47fef9eSflorian 	}
3523e47fef9eSflorian 	;
3524e47fef9eSflorian dt_dnstap_tls_client_cert_file: VAR_DNSTAP_TLS_CLIENT_CERT_FILE STRING_ARG
3525e47fef9eSflorian 	{
3526e47fef9eSflorian 		OUTYY(("P(dt_dnstap_tls_client_cert_file:%s)\n", $2));
3527e47fef9eSflorian 		free(cfg_parser->cfg->dnstap_tls_client_cert_file);
3528e47fef9eSflorian 		cfg_parser->cfg->dnstap_tls_client_cert_file = $2;
3529e47fef9eSflorian 	}
3530e47fef9eSflorian 	;
3531ae8c6e27Sflorian dt_dnstap_send_identity: VAR_DNSTAP_SEND_IDENTITY STRING_ARG
3532ae8c6e27Sflorian 	{
3533ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_send_identity:%s)\n", $2));
3534ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3535ae8c6e27Sflorian 			yyerror("expected yes or no.");
3536ae8c6e27Sflorian 		else cfg_parser->cfg->dnstap_send_identity = (strcmp($2, "yes")==0);
3537e97c6e54Ssthen 		free($2);
3538ae8c6e27Sflorian 	}
3539ae8c6e27Sflorian 	;
3540ae8c6e27Sflorian dt_dnstap_send_version: VAR_DNSTAP_SEND_VERSION STRING_ARG
3541ae8c6e27Sflorian 	{
3542ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_send_version:%s)\n", $2));
3543ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3544ae8c6e27Sflorian 			yyerror("expected yes or no.");
3545ae8c6e27Sflorian 		else cfg_parser->cfg->dnstap_send_version = (strcmp($2, "yes")==0);
3546e97c6e54Ssthen 		free($2);
3547ae8c6e27Sflorian 	}
3548ae8c6e27Sflorian 	;
3549ae8c6e27Sflorian dt_dnstap_identity: VAR_DNSTAP_IDENTITY STRING_ARG
3550ae8c6e27Sflorian 	{
3551ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_identity:%s)\n", $2));
3552ae8c6e27Sflorian 		free(cfg_parser->cfg->dnstap_identity);
3553ae8c6e27Sflorian 		cfg_parser->cfg->dnstap_identity = $2;
3554ae8c6e27Sflorian 	}
3555ae8c6e27Sflorian 	;
3556ae8c6e27Sflorian dt_dnstap_version: VAR_DNSTAP_VERSION STRING_ARG
3557ae8c6e27Sflorian 	{
3558ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_version:%s)\n", $2));
3559ae8c6e27Sflorian 		free(cfg_parser->cfg->dnstap_version);
3560ae8c6e27Sflorian 		cfg_parser->cfg->dnstap_version = $2;
3561ae8c6e27Sflorian 	}
3562ae8c6e27Sflorian 	;
3563ae8c6e27Sflorian dt_dnstap_log_resolver_query_messages: VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES STRING_ARG
3564ae8c6e27Sflorian 	{
3565ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_log_resolver_query_messages:%s)\n", $2));
3566ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3567ae8c6e27Sflorian 			yyerror("expected yes or no.");
3568ae8c6e27Sflorian 		else cfg_parser->cfg->dnstap_log_resolver_query_messages =
3569ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3570e97c6e54Ssthen 		free($2);
3571ae8c6e27Sflorian 	}
3572ae8c6e27Sflorian 	;
3573ae8c6e27Sflorian dt_dnstap_log_resolver_response_messages: VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES STRING_ARG
3574ae8c6e27Sflorian 	{
3575ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_log_resolver_response_messages:%s)\n", $2));
3576ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3577ae8c6e27Sflorian 			yyerror("expected yes or no.");
3578ae8c6e27Sflorian 		else cfg_parser->cfg->dnstap_log_resolver_response_messages =
3579ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3580e97c6e54Ssthen 		free($2);
3581ae8c6e27Sflorian 	}
3582ae8c6e27Sflorian 	;
3583ae8c6e27Sflorian dt_dnstap_log_client_query_messages: VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES STRING_ARG
3584ae8c6e27Sflorian 	{
3585ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_log_client_query_messages:%s)\n", $2));
3586ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3587ae8c6e27Sflorian 			yyerror("expected yes or no.");
3588ae8c6e27Sflorian 		else cfg_parser->cfg->dnstap_log_client_query_messages =
3589ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3590e97c6e54Ssthen 		free($2);
3591ae8c6e27Sflorian 	}
3592ae8c6e27Sflorian 	;
3593ae8c6e27Sflorian dt_dnstap_log_client_response_messages: VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES STRING_ARG
3594ae8c6e27Sflorian 	{
3595ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_log_client_response_messages:%s)\n", $2));
3596ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3597ae8c6e27Sflorian 			yyerror("expected yes or no.");
3598ae8c6e27Sflorian 		else cfg_parser->cfg->dnstap_log_client_response_messages =
3599ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3600e97c6e54Ssthen 		free($2);
3601ae8c6e27Sflorian 	}
3602ae8c6e27Sflorian 	;
3603ae8c6e27Sflorian dt_dnstap_log_forwarder_query_messages: VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES STRING_ARG
3604ae8c6e27Sflorian 	{
3605ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_log_forwarder_query_messages:%s)\n", $2));
3606ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3607ae8c6e27Sflorian 			yyerror("expected yes or no.");
3608ae8c6e27Sflorian 		else cfg_parser->cfg->dnstap_log_forwarder_query_messages =
3609ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3610e97c6e54Ssthen 		free($2);
3611ae8c6e27Sflorian 	}
3612ae8c6e27Sflorian 	;
3613ae8c6e27Sflorian dt_dnstap_log_forwarder_response_messages: VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES STRING_ARG
3614ae8c6e27Sflorian 	{
3615ae8c6e27Sflorian 		OUTYY(("P(dt_dnstap_log_forwarder_response_messages:%s)\n", $2));
3616ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3617ae8c6e27Sflorian 			yyerror("expected yes or no.");
3618ae8c6e27Sflorian 		else cfg_parser->cfg->dnstap_log_forwarder_response_messages =
3619ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3620e97c6e54Ssthen 		free($2);
3621ae8c6e27Sflorian 	}
3622ae8c6e27Sflorian 	;
3623*7037e34cSflorian dt_dnstap_sample_rate: VAR_DNSTAP_SAMPLE_RATE STRING_ARG
3624*7037e34cSflorian 	{
3625*7037e34cSflorian 		OUTYY(("P(dt_dnstap_sample_rate:%s)\n", $2));
3626*7037e34cSflorian 		if(atoi($2) == 0 && strcmp($2, "0") != 0)
3627*7037e34cSflorian 			yyerror("number expected");
3628*7037e34cSflorian 		else if(atoi($2) < 0)
3629*7037e34cSflorian 			yyerror("dnstap sample rate too small");
3630*7037e34cSflorian 		else	cfg_parser->cfg->dnstap_sample_rate = atoi($2);
3631*7037e34cSflorian 		free($2);
3632*7037e34cSflorian 	}
3633*7037e34cSflorian 	;
3634ae8c6e27Sflorian pythonstart: VAR_PYTHON
3635ae8c6e27Sflorian 	{
3636ae8c6e27Sflorian 		OUTYY(("\nP(python:)\n"));
36375c45b740Sflorian 		cfg_parser->started_toplevel = 1;
3638ae8c6e27Sflorian 	}
3639ae8c6e27Sflorian 	;
3640ae8c6e27Sflorian contents_py: contents_py content_py
3641ae8c6e27Sflorian 	| ;
3642ae8c6e27Sflorian content_py: py_script
3643ae8c6e27Sflorian 	;
3644ae8c6e27Sflorian py_script: VAR_PYTHON_SCRIPT STRING_ARG
3645ae8c6e27Sflorian 	{
3646ae8c6e27Sflorian 		OUTYY(("P(python-script:%s)\n", $2));
3647da8c8390Sflorian 		if(!cfg_strlist_append_ex(&cfg_parser->cfg->python_script, $2))
3648da8c8390Sflorian 			yyerror("out of memory");
3649ae8c6e27Sflorian 	}
3650d500c338Sflorian 	;
3651e47fef9eSflorian dynlibstart: VAR_DYNLIB
3652e47fef9eSflorian 	{
3653e47fef9eSflorian 		OUTYY(("\nP(dynlib:)\n"));
36545c45b740Sflorian 		cfg_parser->started_toplevel = 1;
3655e47fef9eSflorian 	}
3656e47fef9eSflorian 	;
3657e47fef9eSflorian contents_dl: contents_dl content_dl
3658e47fef9eSflorian 	| ;
3659e47fef9eSflorian content_dl: dl_file
3660e47fef9eSflorian 	;
3661e47fef9eSflorian dl_file: VAR_DYNLIB_FILE STRING_ARG
3662e47fef9eSflorian 	{
3663e47fef9eSflorian 		OUTYY(("P(dynlib-file:%s)\n", $2));
3664e47fef9eSflorian 		if(!cfg_strlist_append_ex(&cfg_parser->cfg->dynlib_file, $2))
3665e47fef9eSflorian 			yyerror("out of memory");
3666e47fef9eSflorian 	}
3667d500c338Sflorian 	;
3668ae8c6e27Sflorian server_disable_dnssec_lame_check: VAR_DISABLE_DNSSEC_LAME_CHECK STRING_ARG
3669ae8c6e27Sflorian 	{
3670ae8c6e27Sflorian 		OUTYY(("P(disable_dnssec_lame_check:%s)\n", $2));
3671ae8c6e27Sflorian 		if (strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3672ae8c6e27Sflorian 			yyerror("expected yes or no.");
3673ae8c6e27Sflorian 		else cfg_parser->cfg->disable_dnssec_lame_check =
3674ae8c6e27Sflorian 			(strcmp($2, "yes")==0);
3675ae8c6e27Sflorian 		free($2);
3676ae8c6e27Sflorian 	}
3677ae8c6e27Sflorian 	;
3678ae8c6e27Sflorian server_log_identity: VAR_LOG_IDENTITY STRING_ARG
3679ae8c6e27Sflorian 	{
3680ae8c6e27Sflorian 		OUTYY(("P(server_log_identity:%s)\n", $2));
3681ae8c6e27Sflorian 		free(cfg_parser->cfg->log_identity);
3682ae8c6e27Sflorian 		cfg_parser->cfg->log_identity = $2;
3683ae8c6e27Sflorian 	}
3684ae8c6e27Sflorian 	;
3685ae8c6e27Sflorian server_response_ip: VAR_RESPONSE_IP STRING_ARG STRING_ARG
3686ae8c6e27Sflorian 	{
3687ae8c6e27Sflorian 		OUTYY(("P(server_response_ip:%s %s)\n", $2, $3));
3688ae8c6e27Sflorian 		validate_respip_action($3);
3689ae8c6e27Sflorian 		if(!cfg_str2list_insert(&cfg_parser->cfg->respip_actions,
3690ae8c6e27Sflorian 			$2, $3))
3691ae8c6e27Sflorian 			fatal_exit("out of memory adding response-ip");
3692ae8c6e27Sflorian 	}
3693ae8c6e27Sflorian 	;
3694ae8c6e27Sflorian server_response_ip_data: VAR_RESPONSE_IP_DATA STRING_ARG STRING_ARG
3695ae8c6e27Sflorian 	{
3696ae8c6e27Sflorian 		OUTYY(("P(server_response_ip_data:%s)\n", $2));
3697ae8c6e27Sflorian 		if(!cfg_str2list_insert(&cfg_parser->cfg->respip_data,
3698ae8c6e27Sflorian 			$2, $3))
3699ae8c6e27Sflorian 			fatal_exit("out of memory adding response-ip-data");
3700ae8c6e27Sflorian 	}
3701ae8c6e27Sflorian 	;
3702ae8c6e27Sflorian dnscstart: VAR_DNSCRYPT
3703ae8c6e27Sflorian 	{
3704ae8c6e27Sflorian 		OUTYY(("\nP(dnscrypt:)\n"));
37055c45b740Sflorian 		cfg_parser->started_toplevel = 1;
3706ae8c6e27Sflorian 	}
3707ae8c6e27Sflorian 	;
3708ae8c6e27Sflorian contents_dnsc: contents_dnsc content_dnsc
3709ae8c6e27Sflorian 	| ;
3710ae8c6e27Sflorian content_dnsc:
3711ae8c6e27Sflorian 	dnsc_dnscrypt_enable | dnsc_dnscrypt_port | dnsc_dnscrypt_provider |
3712ae8c6e27Sflorian 	dnsc_dnscrypt_secret_key | dnsc_dnscrypt_provider_cert |
3713ae8c6e27Sflorian 	dnsc_dnscrypt_provider_cert_rotated |
3714ae8c6e27Sflorian 	dnsc_dnscrypt_shared_secret_cache_size |
3715ae8c6e27Sflorian 	dnsc_dnscrypt_shared_secret_cache_slabs |
3716ae8c6e27Sflorian 	dnsc_dnscrypt_nonce_cache_size |
3717ae8c6e27Sflorian 	dnsc_dnscrypt_nonce_cache_slabs
3718ae8c6e27Sflorian 	;
3719ae8c6e27Sflorian dnsc_dnscrypt_enable: VAR_DNSCRYPT_ENABLE STRING_ARG
3720ae8c6e27Sflorian 	{
3721ae8c6e27Sflorian 		OUTYY(("P(dnsc_dnscrypt_enable:%s)\n", $2));
3722ae8c6e27Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3723ae8c6e27Sflorian 			yyerror("expected yes or no.");
3724ae8c6e27Sflorian 		else cfg_parser->cfg->dnscrypt = (strcmp($2, "yes")==0);
3725ae8c6e27Sflorian 		free($2);
3726ae8c6e27Sflorian 	}
3727ae8c6e27Sflorian 	;
3728ae8c6e27Sflorian dnsc_dnscrypt_port: VAR_DNSCRYPT_PORT STRING_ARG
3729ae8c6e27Sflorian 	{
3730ae8c6e27Sflorian 		OUTYY(("P(dnsc_dnscrypt_port:%s)\n", $2));
3731ae8c6e27Sflorian 		if(atoi($2) == 0)
3732ae8c6e27Sflorian 			yyerror("port number expected");
3733ae8c6e27Sflorian 		else cfg_parser->cfg->dnscrypt_port = atoi($2);
3734ae8c6e27Sflorian 		free($2);
3735ae8c6e27Sflorian 	}
3736ae8c6e27Sflorian 	;
3737ae8c6e27Sflorian dnsc_dnscrypt_provider: VAR_DNSCRYPT_PROVIDER STRING_ARG
3738ae8c6e27Sflorian 	{
3739ae8c6e27Sflorian 		OUTYY(("P(dnsc_dnscrypt_provider:%s)\n", $2));
3740ae8c6e27Sflorian 		free(cfg_parser->cfg->dnscrypt_provider);
3741ae8c6e27Sflorian 		cfg_parser->cfg->dnscrypt_provider = $2;
3742ae8c6e27Sflorian 	}
3743ae8c6e27Sflorian 	;
3744ae8c6e27Sflorian dnsc_dnscrypt_provider_cert: VAR_DNSCRYPT_PROVIDER_CERT STRING_ARG
3745ae8c6e27Sflorian 	{
3746ae8c6e27Sflorian 		OUTYY(("P(dnsc_dnscrypt_provider_cert:%s)\n", $2));
3747ae8c6e27Sflorian 		if(cfg_strlist_find(cfg_parser->cfg->dnscrypt_provider_cert, $2))
3748ae8c6e27Sflorian 			log_warn("dnscrypt-provider-cert %s is a duplicate", $2);
3749ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_provider_cert, $2))
3750ae8c6e27Sflorian 			fatal_exit("out of memory adding dnscrypt-provider-cert");
3751ae8c6e27Sflorian 	}
3752ae8c6e27Sflorian 	;
3753ae8c6e27Sflorian dnsc_dnscrypt_provider_cert_rotated: VAR_DNSCRYPT_PROVIDER_CERT_ROTATED STRING_ARG
3754ae8c6e27Sflorian 	{
3755ae8c6e27Sflorian 		OUTYY(("P(dnsc_dnscrypt_provider_cert_rotated:%s)\n", $2));
3756ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_provider_cert_rotated, $2))
3757ae8c6e27Sflorian 			fatal_exit("out of memory adding dnscrypt-provider-cert-rotated");
3758ae8c6e27Sflorian 	}
3759ae8c6e27Sflorian 	;
3760ae8c6e27Sflorian dnsc_dnscrypt_secret_key: VAR_DNSCRYPT_SECRET_KEY STRING_ARG
3761ae8c6e27Sflorian 	{
3762ae8c6e27Sflorian 		OUTYY(("P(dnsc_dnscrypt_secret_key:%s)\n", $2));
3763ae8c6e27Sflorian 		if(cfg_strlist_find(cfg_parser->cfg->dnscrypt_secret_key, $2))
3764ae8c6e27Sflorian 			log_warn("dnscrypt-secret-key: %s is a duplicate", $2);
3765ae8c6e27Sflorian 		if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_secret_key, $2))
3766ae8c6e27Sflorian 			fatal_exit("out of memory adding dnscrypt-secret-key");
3767ae8c6e27Sflorian 	}
3768ae8c6e27Sflorian 	;
3769ae8c6e27Sflorian dnsc_dnscrypt_shared_secret_cache_size: VAR_DNSCRYPT_SHARED_SECRET_CACHE_SIZE STRING_ARG
3770ae8c6e27Sflorian   {
3771ae8c6e27Sflorian 	OUTYY(("P(dnscrypt_shared_secret_cache_size:%s)\n", $2));
3772ae8c6e27Sflorian 	if(!cfg_parse_memsize($2, &cfg_parser->cfg->dnscrypt_shared_secret_cache_size))
3773ae8c6e27Sflorian 		yyerror("memory size expected");
3774ae8c6e27Sflorian 	free($2);
3775ae8c6e27Sflorian   }
3776ae8c6e27Sflorian   ;
3777ae8c6e27Sflorian dnsc_dnscrypt_shared_secret_cache_slabs: VAR_DNSCRYPT_SHARED_SECRET_CACHE_SLABS STRING_ARG
3778ae8c6e27Sflorian   {
3779ae8c6e27Sflorian 	OUTYY(("P(dnscrypt_shared_secret_cache_slabs:%s)\n", $2));
3780a1a7ba80Sflorian 	if(atoi($2) == 0) {
3781ae8c6e27Sflorian 		yyerror("number expected");
3782a1a7ba80Sflorian 	} else {
3783ae8c6e27Sflorian 		cfg_parser->cfg->dnscrypt_shared_secret_cache_slabs = atoi($2);
3784ae8c6e27Sflorian 		if(!is_pow2(cfg_parser->cfg->dnscrypt_shared_secret_cache_slabs))
3785ae8c6e27Sflorian 			yyerror("must be a power of 2");
3786ae8c6e27Sflorian 	}
3787ae8c6e27Sflorian 	free($2);
3788ae8c6e27Sflorian   }
3789ae8c6e27Sflorian   ;
3790ae8c6e27Sflorian dnsc_dnscrypt_nonce_cache_size: VAR_DNSCRYPT_NONCE_CACHE_SIZE STRING_ARG
3791ae8c6e27Sflorian   {
3792ae8c6e27Sflorian 	OUTYY(("P(dnscrypt_nonce_cache_size:%s)\n", $2));
3793ae8c6e27Sflorian 	if(!cfg_parse_memsize($2, &cfg_parser->cfg->dnscrypt_nonce_cache_size))
3794ae8c6e27Sflorian 		yyerror("memory size expected");
3795ae8c6e27Sflorian 	free($2);
3796ae8c6e27Sflorian   }
3797ae8c6e27Sflorian   ;
3798ae8c6e27Sflorian dnsc_dnscrypt_nonce_cache_slabs: VAR_DNSCRYPT_NONCE_CACHE_SLABS STRING_ARG
3799ae8c6e27Sflorian   {
3800ae8c6e27Sflorian 	OUTYY(("P(dnscrypt_nonce_cache_slabs:%s)\n", $2));
3801a1a7ba80Sflorian 	if(atoi($2) == 0) {
3802ae8c6e27Sflorian 		yyerror("number expected");
3803a1a7ba80Sflorian 	} else {
3804ae8c6e27Sflorian 		cfg_parser->cfg->dnscrypt_nonce_cache_slabs = atoi($2);
3805ae8c6e27Sflorian 		if(!is_pow2(cfg_parser->cfg->dnscrypt_nonce_cache_slabs))
3806ae8c6e27Sflorian 			yyerror("must be a power of 2");
3807ae8c6e27Sflorian 	}
3808ae8c6e27Sflorian 	free($2);
3809ae8c6e27Sflorian   }
3810ae8c6e27Sflorian   ;
3811ae8c6e27Sflorian cachedbstart: VAR_CACHEDB
3812ae8c6e27Sflorian 	{
3813ae8c6e27Sflorian 		OUTYY(("\nP(cachedb:)\n"));
38145c45b740Sflorian 		cfg_parser->started_toplevel = 1;
3815ae8c6e27Sflorian 	}
3816ae8c6e27Sflorian 	;
3817ae8c6e27Sflorian contents_cachedb: contents_cachedb content_cachedb
3818ae8c6e27Sflorian 	| ;
3819ae8c6e27Sflorian content_cachedb: cachedb_backend_name | cachedb_secret_seed |
3820e47fef9eSflorian 	redis_server_host | redis_server_port | redis_timeout |
382154cc57acSflorian 	redis_expire_records | redis_server_path | redis_server_password |
3822096314feSflorian 	cachedb_no_store | redis_logical_db | cachedb_check_when_serve_expired
3823ae8c6e27Sflorian 	;
3824ae8c6e27Sflorian cachedb_backend_name: VAR_CACHEDB_BACKEND STRING_ARG
3825ae8c6e27Sflorian 	{
3826ae8c6e27Sflorian 	#ifdef USE_CACHEDB
3827ae8c6e27Sflorian 		OUTYY(("P(backend:%s)\n", $2));
3828ae8c6e27Sflorian 		free(cfg_parser->cfg->cachedb_backend);
3829ae8c6e27Sflorian 		cfg_parser->cfg->cachedb_backend = $2;
3830ae8c6e27Sflorian 	#else
3831ae8c6e27Sflorian 		OUTYY(("P(Compiled without cachedb, ignoring)\n"));
3832e97c6e54Ssthen 		free($2);
3833ae8c6e27Sflorian 	#endif
3834ae8c6e27Sflorian 	}
3835ae8c6e27Sflorian 	;
3836ae8c6e27Sflorian cachedb_secret_seed: VAR_CACHEDB_SECRETSEED STRING_ARG
3837ae8c6e27Sflorian 	{
3838ae8c6e27Sflorian 	#ifdef USE_CACHEDB
3839ae8c6e27Sflorian 		OUTYY(("P(secret-seed:%s)\n", $2));
3840ae8c6e27Sflorian 		free(cfg_parser->cfg->cachedb_secret);
3841ae8c6e27Sflorian 		cfg_parser->cfg->cachedb_secret = $2;
3842ae8c6e27Sflorian 	#else
3843ae8c6e27Sflorian 		OUTYY(("P(Compiled without cachedb, ignoring)\n"));
3844ae8c6e27Sflorian 		free($2);
3845ae8c6e27Sflorian 	#endif
3846ae8c6e27Sflorian 	}
3847ae8c6e27Sflorian 	;
384854cc57acSflorian cachedb_no_store: VAR_CACHEDB_NO_STORE STRING_ARG
384954cc57acSflorian 	{
385054cc57acSflorian 	#ifdef USE_CACHEDB
385154cc57acSflorian 		OUTYY(("P(cachedb_no_store:%s)\n", $2));
385254cc57acSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
385354cc57acSflorian 			yyerror("expected yes or no.");
385454cc57acSflorian 		else cfg_parser->cfg->cachedb_no_store = (strcmp($2, "yes")==0);
385554cc57acSflorian 	#else
385654cc57acSflorian 		OUTYY(("P(Compiled without cachedb, ignoring)\n"));
385754cc57acSflorian 	#endif
385854cc57acSflorian 		free($2);
385954cc57acSflorian 	}
386054cc57acSflorian 	;
3861096314feSflorian cachedb_check_when_serve_expired: VAR_CACHEDB_CHECK_WHEN_SERVE_EXPIRED STRING_ARG
3862096314feSflorian 	{
3863096314feSflorian 	#ifdef USE_CACHEDB
3864096314feSflorian 		OUTYY(("P(cachedb_check_when_serve_expired:%s)\n", $2));
3865096314feSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3866096314feSflorian 			yyerror("expected yes or no.");
3867096314feSflorian 		else cfg_parser->cfg->cachedb_check_when_serve_expired = (strcmp($2, "yes")==0);
3868096314feSflorian 	#else
3869096314feSflorian 		OUTYY(("P(Compiled without cachedb, ignoring)\n"));
3870096314feSflorian 	#endif
3871096314feSflorian 		free($2);
3872096314feSflorian 	}
3873096314feSflorian 	;
3874ae8c6e27Sflorian redis_server_host: VAR_CACHEDB_REDISHOST STRING_ARG
3875ae8c6e27Sflorian 	{
3876ae8c6e27Sflorian 	#if defined(USE_CACHEDB) && defined(USE_REDIS)
3877ae8c6e27Sflorian 		OUTYY(("P(redis_server_host:%s)\n", $2));
3878ae8c6e27Sflorian 		free(cfg_parser->cfg->redis_server_host);
3879ae8c6e27Sflorian 		cfg_parser->cfg->redis_server_host = $2;
3880ae8c6e27Sflorian 	#else
3881ae8c6e27Sflorian 		OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
3882ae8c6e27Sflorian 		free($2);
3883ae8c6e27Sflorian 	#endif
3884ae8c6e27Sflorian 	}
3885ae8c6e27Sflorian 	;
3886ae8c6e27Sflorian redis_server_port: VAR_CACHEDB_REDISPORT STRING_ARG
3887ae8c6e27Sflorian 	{
3888ae8c6e27Sflorian 	#if defined(USE_CACHEDB) && defined(USE_REDIS)
3889ae8c6e27Sflorian 		int port;
3890ae8c6e27Sflorian 		OUTYY(("P(redis_server_port:%s)\n", $2));
3891ae8c6e27Sflorian 		port = atoi($2);
3892ae8c6e27Sflorian 		if(port == 0 || port < 0 || port > 65535)
3893ae8c6e27Sflorian 			yyerror("valid redis server port number expected");
3894ae8c6e27Sflorian 		else cfg_parser->cfg->redis_server_port = port;
3895ae8c6e27Sflorian 	#else
3896ae8c6e27Sflorian 		OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
3897ae8c6e27Sflorian 	#endif
3898ae8c6e27Sflorian 		free($2);
3899ae8c6e27Sflorian 	}
3900ae8c6e27Sflorian 	;
3901d500c338Sflorian redis_server_path: VAR_CACHEDB_REDISPATH STRING_ARG
3902d500c338Sflorian 	{
3903d500c338Sflorian 	#if defined(USE_CACHEDB) && defined(USE_REDIS)
3904d500c338Sflorian 		OUTYY(("P(redis_server_path:%s)\n", $2));
3905d500c338Sflorian 		free(cfg_parser->cfg->redis_server_path);
3906d500c338Sflorian 		cfg_parser->cfg->redis_server_path = $2;
3907d500c338Sflorian 	#else
3908d500c338Sflorian 		OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
3909d500c338Sflorian 		free($2);
3910d500c338Sflorian 	#endif
3911d500c338Sflorian 	}
3912d500c338Sflorian 	;
3913d500c338Sflorian redis_server_password: VAR_CACHEDB_REDISPASSWORD STRING_ARG
3914d500c338Sflorian 	{
3915d500c338Sflorian 	#if defined(USE_CACHEDB) && defined(USE_REDIS)
3916d500c338Sflorian 		OUTYY(("P(redis_server_password:%s)\n", $2));
3917d500c338Sflorian 		free(cfg_parser->cfg->redis_server_password);
3918d500c338Sflorian 		cfg_parser->cfg->redis_server_password = $2;
3919d500c338Sflorian 	#else
3920d500c338Sflorian 		OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
3921d500c338Sflorian 		free($2);
3922d500c338Sflorian 	#endif
3923d500c338Sflorian 	}
3924d500c338Sflorian 	;
3925ae8c6e27Sflorian redis_timeout: VAR_CACHEDB_REDISTIMEOUT STRING_ARG
3926ae8c6e27Sflorian 	{
3927ae8c6e27Sflorian 	#if defined(USE_CACHEDB) && defined(USE_REDIS)
3928ae8c6e27Sflorian 		OUTYY(("P(redis_timeout:%s)\n", $2));
3929ae8c6e27Sflorian 		if(atoi($2) == 0)
3930ae8c6e27Sflorian 			yyerror("redis timeout value expected");
3931ae8c6e27Sflorian 		else cfg_parser->cfg->redis_timeout = atoi($2);
3932ae8c6e27Sflorian 	#else
3933ae8c6e27Sflorian 		OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
3934ae8c6e27Sflorian 	#endif
3935ae8c6e27Sflorian 		free($2);
3936ae8c6e27Sflorian 	}
3937ae8c6e27Sflorian 	;
3938e47fef9eSflorian redis_expire_records: VAR_CACHEDB_REDISEXPIRERECORDS STRING_ARG
3939e47fef9eSflorian 	{
3940e47fef9eSflorian 	#if defined(USE_CACHEDB) && defined(USE_REDIS)
3941e47fef9eSflorian 		OUTYY(("P(redis_expire_records:%s)\n", $2));
3942e47fef9eSflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3943e47fef9eSflorian 			yyerror("expected yes or no.");
3944e47fef9eSflorian 		else cfg_parser->cfg->redis_expire_records = (strcmp($2, "yes")==0);
3945e47fef9eSflorian 	#else
3946e47fef9eSflorian 		OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
3947e47fef9eSflorian 	#endif
3948e47fef9eSflorian 		free($2);
3949e47fef9eSflorian 	}
3950e47fef9eSflorian 	;
395154cc57acSflorian redis_logical_db: VAR_CACHEDB_REDISLOGICALDB STRING_ARG
395254cc57acSflorian 	{
395354cc57acSflorian 	#if defined(USE_CACHEDB) && defined(USE_REDIS)
395454cc57acSflorian 		int db;
395554cc57acSflorian 		OUTYY(("P(redis_logical_db:%s)\n", $2));
395654cc57acSflorian 		db = atoi($2);
395754cc57acSflorian 		if((db == 0 && strcmp($2, "0") != 0) || db < 0)
395854cc57acSflorian 			yyerror("valid redis logical database index expected");
395954cc57acSflorian 		else cfg_parser->cfg->redis_logical_db = db;
396054cc57acSflorian 	#else
396154cc57acSflorian 		OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
396254cc57acSflorian 	#endif
396354cc57acSflorian 		free($2);
396454cc57acSflorian 	}
396554cc57acSflorian 	;
3966ae8c6e27Sflorian server_tcp_connection_limit: VAR_TCP_CONNECTION_LIMIT STRING_ARG STRING_ARG
3967ae8c6e27Sflorian 	{
3968ae8c6e27Sflorian 		OUTYY(("P(server_tcp_connection_limit:%s %s)\n", $2, $3));
3969ae8c6e27Sflorian 		if (atoi($3) < 0)
3970ae8c6e27Sflorian 			yyerror("positive number expected");
3971ae8c6e27Sflorian 		else {
3972ae8c6e27Sflorian 			if(!cfg_str2list_insert(&cfg_parser->cfg->tcp_connection_limits, $2, $3))
3973ae8c6e27Sflorian 				fatal_exit("out of memory adding tcp connection limit");
3974ae8c6e27Sflorian 		}
3975ae8c6e27Sflorian 	}
3976ae8c6e27Sflorian 	;
3977d500c338Sflorian server_answer_cookie: VAR_ANSWER_COOKIE STRING_ARG
3978d500c338Sflorian 	{
3979d500c338Sflorian 		OUTYY(("P(server_answer_cookie:%s)\n", $2));
3980d500c338Sflorian 		if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
3981d500c338Sflorian 			yyerror("expected yes or no.");
3982d500c338Sflorian 		else cfg_parser->cfg->do_answer_cookie = (strcmp($2, "yes")==0);
3983d500c338Sflorian 		free($2);
3984d500c338Sflorian 	}
3985d500c338Sflorian 	;
3986d500c338Sflorian server_cookie_secret: VAR_COOKIE_SECRET STRING_ARG
3987d500c338Sflorian 	{
3988d500c338Sflorian 		uint8_t secret[32];
3989d500c338Sflorian 		size_t secret_len = sizeof(secret);
3990d500c338Sflorian 
3991d500c338Sflorian 		OUTYY(("P(server_cookie_secret:%s)\n", $2));
3992d500c338Sflorian 		if(sldns_str2wire_hex_buf($2, secret, &secret_len)
3993d500c338Sflorian 		|| (secret_len != 16))
3994d500c338Sflorian 			yyerror("expected 128 bit hex string");
3995d500c338Sflorian 		else {
3996d500c338Sflorian 			cfg_parser->cfg->cookie_secret_len = secret_len;
3997d500c338Sflorian 			memcpy(cfg_parser->cfg->cookie_secret, secret, sizeof(secret));
3998d500c338Sflorian 		}
3999d500c338Sflorian 		free($2);
4000d500c338Sflorian 	}
4001d500c338Sflorian 	;
4002*7037e34cSflorian server_cookie_secret_file: VAR_COOKIE_SECRET_FILE STRING_ARG
4003*7037e34cSflorian 	{
4004*7037e34cSflorian 		OUTYY(("P(cookie_secret_file:%s)\n", $2));
4005*7037e34cSflorian 		free(cfg_parser->cfg->cookie_secret_file);
4006*7037e34cSflorian 		cfg_parser->cfg->cookie_secret_file = $2;
4007*7037e34cSflorian 	}
4008*7037e34cSflorian 	;
4009da8c8390Sflorian 	ipsetstart: VAR_IPSET
4010da8c8390Sflorian 		{
4011da8c8390Sflorian 			OUTYY(("\nP(ipset:)\n"));
40125c45b740Sflorian 			cfg_parser->started_toplevel = 1;
4013da8c8390Sflorian 		}
4014da8c8390Sflorian 		;
4015da8c8390Sflorian 	contents_ipset: contents_ipset content_ipset
4016da8c8390Sflorian 		| ;
4017da8c8390Sflorian 	content_ipset: ipset_name_v4 | ipset_name_v6
4018da8c8390Sflorian 		;
4019da8c8390Sflorian 	ipset_name_v4: VAR_IPSET_NAME_V4 STRING_ARG
4020da8c8390Sflorian 		{
4021da8c8390Sflorian 		#ifdef USE_IPSET
4022da8c8390Sflorian 			OUTYY(("P(name-v4:%s)\n", $2));
4023da8c8390Sflorian 			if(cfg_parser->cfg->ipset_name_v4)
4024da8c8390Sflorian 				yyerror("ipset name v4 override, there must be one "
4025da8c8390Sflorian 					"name for ip v4");
4026da8c8390Sflorian 			free(cfg_parser->cfg->ipset_name_v4);
4027da8c8390Sflorian 			cfg_parser->cfg->ipset_name_v4 = $2;
4028da8c8390Sflorian 		#else
4029da8c8390Sflorian 			OUTYY(("P(Compiled without ipset, ignoring)\n"));
4030da8c8390Sflorian 			free($2);
4031da8c8390Sflorian 		#endif
4032da8c8390Sflorian 		}
4033da8c8390Sflorian 	;
4034da8c8390Sflorian 	ipset_name_v6: VAR_IPSET_NAME_V6 STRING_ARG
4035da8c8390Sflorian 	{
4036da8c8390Sflorian 		#ifdef USE_IPSET
4037da8c8390Sflorian 			OUTYY(("P(name-v6:%s)\n", $2));
4038da8c8390Sflorian 			if(cfg_parser->cfg->ipset_name_v6)
4039da8c8390Sflorian 				yyerror("ipset name v6 override, there must be one "
4040da8c8390Sflorian 					"name for ip v6");
4041da8c8390Sflorian 			free(cfg_parser->cfg->ipset_name_v6);
4042da8c8390Sflorian 			cfg_parser->cfg->ipset_name_v6 = $2;
4043da8c8390Sflorian 		#else
4044da8c8390Sflorian 			OUTYY(("P(Compiled without ipset, ignoring)\n"));
4045da8c8390Sflorian 			free($2);
4046da8c8390Sflorian 		#endif
4047da8c8390Sflorian 		}
4048da8c8390Sflorian 	;
4049ae8c6e27Sflorian %%
4050ae8c6e27Sflorian 
4051ae8c6e27Sflorian /* parse helper routines could be here */
4052ae8c6e27Sflorian static void
4053ae8c6e27Sflorian validate_respip_action(const char* action)
4054ae8c6e27Sflorian {
4055ae8c6e27Sflorian 	if(strcmp(action, "deny")!=0 &&
4056ae8c6e27Sflorian 		strcmp(action, "redirect")!=0 &&
4057ae8c6e27Sflorian 		strcmp(action, "inform")!=0 &&
4058ae8c6e27Sflorian 		strcmp(action, "inform_deny")!=0 &&
4059ae8c6e27Sflorian 		strcmp(action, "always_transparent")!=0 &&
4060ae8c6e27Sflorian 		strcmp(action, "always_refuse")!=0 &&
4061ae8c6e27Sflorian 		strcmp(action, "always_nxdomain")!=0)
4062ae8c6e27Sflorian 	{
4063ae8c6e27Sflorian 		yyerror("response-ip action: expected deny, redirect, "
4064ae8c6e27Sflorian 			"inform, inform_deny, always_transparent, "
4065ae8c6e27Sflorian 			"always_refuse or always_nxdomain");
4066ae8c6e27Sflorian 	}
4067ae8c6e27Sflorian }
4068da8c8390Sflorian 
40695c45b740Sflorian static void
40705c45b740Sflorian validate_acl_action(const char* action)
40715c45b740Sflorian {
40725c45b740Sflorian 	if(strcmp(action, "deny")!=0 &&
40735c45b740Sflorian 		strcmp(action, "refuse")!=0 &&
40745c45b740Sflorian 		strcmp(action, "deny_non_local")!=0 &&
40755c45b740Sflorian 		strcmp(action, "refuse_non_local")!=0 &&
40765c45b740Sflorian 		strcmp(action, "allow_setrd")!=0 &&
40775c45b740Sflorian 		strcmp(action, "allow")!=0 &&
4078d500c338Sflorian 		strcmp(action, "allow_snoop")!=0 &&
4079d500c338Sflorian 		strcmp(action, "allow_cookie")!=0)
40805c45b740Sflorian 	{
40815c45b740Sflorian 		yyerror("expected deny, refuse, deny_non_local, "
4082d500c338Sflorian 			"refuse_non_local, allow, allow_setrd, "
4083d500c338Sflorian 			"allow_snoop or allow_cookie as access control action");
40845c45b740Sflorian 	}
40855c45b740Sflorian }
4086