2 * configparser.y -- yacc grammar for unbound configuration files
4 * Copyright (c) 2001-2006, NLnet Labs. All rights reserved.
6 * Copyright (c) 2007, NLnet Labs. All rights reserved.
8 * This software is open source.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
21 * Neither the name of the NLNET LABS nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
31 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 #include "util/configyyrename.h"
48 #include "util/config_file.h"
49 #include "util/net_help.h"
52 void ub_c_error(const char *message);
54 static void validate_respip_action(const char* action);
56 /* these need to be global, otherwise they cannot be used inside yacc */
57 extern struct config_parser_state* cfg_parser;
60 #define OUTYY(s) printf s /* used ONLY when debugging */
70 %token SPACE LETTER NEWLINE COMMENT COLON ANY ZONESTR
71 %token <str> STRING_ARG
72 %token VAR_SERVER VAR_VERBOSITY VAR_NUM_THREADS VAR_PORT
73 %token VAR_OUTGOING_RANGE VAR_INTERFACE
74 %token VAR_DO_IP4 VAR_DO_IP6 VAR_PREFER_IP6 VAR_DO_UDP VAR_DO_TCP
75 %token VAR_TCP_MSS VAR_OUTGOING_TCP_MSS VAR_TCP_IDLE_TIMEOUT
76 %token VAR_EDNS_TCP_KEEPALIVE VAR_EDNS_TCP_KEEPALIVE_TIMEOUT
77 %token VAR_CHROOT VAR_USERNAME VAR_DIRECTORY VAR_LOGFILE VAR_PIDFILE
78 %token VAR_MSG_CACHE_SIZE VAR_MSG_CACHE_SLABS VAR_NUM_QUERIES_PER_THREAD
79 %token VAR_RRSET_CACHE_SIZE VAR_RRSET_CACHE_SLABS VAR_OUTGOING_NUM_TCP
80 %token VAR_INFRA_HOST_TTL VAR_INFRA_LAME_TTL VAR_INFRA_CACHE_SLABS
81 %token VAR_INFRA_CACHE_NUMHOSTS VAR_INFRA_CACHE_LAME_SIZE VAR_NAME
82 %token VAR_STUB_ZONE VAR_STUB_HOST VAR_STUB_ADDR VAR_TARGET_FETCH_POLICY
83 %token VAR_HARDEN_SHORT_BUFSIZE VAR_HARDEN_LARGE_QUERIES
84 %token VAR_FORWARD_ZONE VAR_FORWARD_HOST VAR_FORWARD_ADDR
85 %token VAR_DO_NOT_QUERY_ADDRESS VAR_HIDE_IDENTITY VAR_HIDE_VERSION
86 %token VAR_IDENTITY VAR_VERSION VAR_HARDEN_GLUE VAR_MODULE_CONF
87 %token VAR_TRUST_ANCHOR_FILE VAR_TRUST_ANCHOR VAR_VAL_OVERRIDE_DATE
88 %token VAR_BOGUS_TTL VAR_VAL_CLEAN_ADDITIONAL VAR_VAL_PERMISSIVE_MODE
89 %token VAR_INCOMING_NUM_TCP VAR_MSG_BUFFER_SIZE VAR_KEY_CACHE_SIZE
90 %token VAR_KEY_CACHE_SLABS VAR_TRUSTED_KEYS_FILE
91 %token VAR_VAL_NSEC3_KEYSIZE_ITERATIONS VAR_USE_SYSLOG
92 %token VAR_OUTGOING_INTERFACE VAR_ROOT_HINTS VAR_DO_NOT_QUERY_LOCALHOST
93 %token VAR_CACHE_MAX_TTL VAR_HARDEN_DNSSEC_STRIPPED VAR_ACCESS_CONTROL
94 %token VAR_LOCAL_ZONE VAR_LOCAL_DATA VAR_INTERFACE_AUTOMATIC
95 %token VAR_STATISTICS_INTERVAL VAR_DO_DAEMONIZE VAR_USE_CAPS_FOR_ID
96 %token VAR_STATISTICS_CUMULATIVE VAR_OUTGOING_PORT_PERMIT
97 %token VAR_OUTGOING_PORT_AVOID VAR_DLV_ANCHOR_FILE VAR_DLV_ANCHOR
98 %token VAR_NEG_CACHE_SIZE VAR_HARDEN_REFERRAL_PATH VAR_PRIVATE_ADDRESS
99 %token VAR_PRIVATE_DOMAIN VAR_REMOTE_CONTROL VAR_CONTROL_ENABLE
100 %token VAR_CONTROL_INTERFACE VAR_CONTROL_PORT VAR_SERVER_KEY_FILE
101 %token VAR_SERVER_CERT_FILE VAR_CONTROL_KEY_FILE VAR_CONTROL_CERT_FILE
102 %token VAR_CONTROL_USE_CERT
103 %token VAR_EXTENDED_STATISTICS VAR_LOCAL_DATA_PTR VAR_JOSTLE_TIMEOUT
104 %token VAR_STUB_PRIME VAR_UNWANTED_REPLY_THRESHOLD VAR_LOG_TIME_ASCII
105 %token VAR_DOMAIN_INSECURE VAR_PYTHON VAR_PYTHON_SCRIPT VAR_VAL_SIG_SKEW_MIN
106 %token VAR_VAL_SIG_SKEW_MAX VAR_CACHE_MIN_TTL VAR_VAL_LOG_LEVEL
107 %token VAR_AUTO_TRUST_ANCHOR_FILE VAR_KEEP_MISSING VAR_ADD_HOLDDOWN
108 %token VAR_DEL_HOLDDOWN VAR_SO_RCVBUF VAR_EDNS_BUFFER_SIZE VAR_PREFETCH
109 %token VAR_PREFETCH_KEY VAR_SO_SNDBUF VAR_SO_REUSEPORT VAR_HARDEN_BELOW_NXDOMAIN
110 %token VAR_IGNORE_CD_FLAG VAR_LOG_QUERIES VAR_LOG_REPLIES VAR_LOG_LOCAL_ACTIONS
111 %token VAR_TCP_UPSTREAM VAR_SSL_UPSTREAM
112 %token VAR_SSL_SERVICE_KEY VAR_SSL_SERVICE_PEM VAR_SSL_PORT VAR_FORWARD_FIRST
113 %token VAR_STUB_SSL_UPSTREAM VAR_FORWARD_SSL_UPSTREAM VAR_TLS_CERT_BUNDLE
114 %token VAR_STUB_FIRST VAR_MINIMAL_RESPONSES VAR_RRSET_ROUNDROBIN
115 %token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE
116 %token VAR_UNBLOCK_LAN_ZONES VAR_INSECURE_LAN_ZONES
117 %token VAR_INFRA_CACHE_MIN_RTT
118 %token VAR_DNS64_PREFIX VAR_DNS64_SYNTHALL VAR_DNS64_IGNORE_AAAA
119 %token VAR_DNSTAP VAR_DNSTAP_ENABLE VAR_DNSTAP_SOCKET_PATH
120 %token VAR_DNSTAP_SEND_IDENTITY VAR_DNSTAP_SEND_VERSION
121 %token VAR_DNSTAP_IDENTITY VAR_DNSTAP_VERSION
122 %token VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES
123 %token VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES
124 %token VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES
125 %token VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES
126 %token VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES
127 %token VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES
128 %token VAR_RESPONSE_IP_TAG VAR_RESPONSE_IP VAR_RESPONSE_IP_DATA
129 %token VAR_HARDEN_ALGO_DOWNGRADE VAR_IP_TRANSPARENT
130 %token VAR_DISABLE_DNSSEC_LAME_CHECK
131 %token VAR_IP_RATELIMIT VAR_IP_RATELIMIT_SLABS VAR_IP_RATELIMIT_SIZE
132 %token VAR_RATELIMIT VAR_RATELIMIT_SLABS VAR_RATELIMIT_SIZE
133 %token VAR_RATELIMIT_FOR_DOMAIN VAR_RATELIMIT_BELOW_DOMAIN
134 %token VAR_IP_RATELIMIT_FACTOR VAR_RATELIMIT_FACTOR
135 %token VAR_SEND_CLIENT_SUBNET VAR_CLIENT_SUBNET_ZONE
136 %token VAR_CLIENT_SUBNET_ALWAYS_FORWARD VAR_CLIENT_SUBNET_OPCODE
137 %token VAR_MAX_CLIENT_SUBNET_IPV4 VAR_MAX_CLIENT_SUBNET_IPV6
138 %token VAR_MIN_CLIENT_SUBNET_IPV4 VAR_MIN_CLIENT_SUBNET_IPV6
139 %token VAR_MAX_ECS_TREE_SIZE_IPV4 VAR_MAX_ECS_TREE_SIZE_IPV6
140 %token VAR_CAPS_WHITELIST VAR_CACHE_MAX_NEGATIVE_TTL VAR_PERMIT_SMALL_HOLDDOWN
141 %token VAR_QNAME_MINIMISATION VAR_QNAME_MINIMISATION_STRICT VAR_IP_FREEBIND
142 %token VAR_DEFINE_TAG VAR_LOCAL_ZONE_TAG VAR_ACCESS_CONTROL_TAG
143 %token VAR_LOCAL_ZONE_OVERRIDE VAR_ACCESS_CONTROL_TAG_ACTION
144 %token VAR_ACCESS_CONTROL_TAG_DATA VAR_VIEW VAR_ACCESS_CONTROL_VIEW
145 %token VAR_VIEW_FIRST VAR_SERVE_EXPIRED VAR_SERVE_EXPIRED_TTL
146 %token VAR_SERVE_EXPIRED_TTL_RESET VAR_FAKE_DSA VAR_FAKE_SHA1
147 %token VAR_LOG_IDENTITY VAR_HIDE_TRUSTANCHOR VAR_TRUST_ANCHOR_SIGNALING
148 %token VAR_AGGRESSIVE_NSEC VAR_USE_SYSTEMD VAR_SHM_ENABLE VAR_SHM_KEY
149 %token VAR_ROOT_KEY_SENTINEL
150 %token VAR_DNSCRYPT VAR_DNSCRYPT_ENABLE VAR_DNSCRYPT_PORT VAR_DNSCRYPT_PROVIDER
151 %token VAR_DNSCRYPT_SECRET_KEY VAR_DNSCRYPT_PROVIDER_CERT
152 %token VAR_DNSCRYPT_PROVIDER_CERT_ROTATED
153 %token VAR_DNSCRYPT_SHARED_SECRET_CACHE_SIZE
154 %token VAR_DNSCRYPT_SHARED_SECRET_CACHE_SLABS
155 %token VAR_DNSCRYPT_NONCE_CACHE_SIZE
156 %token VAR_DNSCRYPT_NONCE_CACHE_SLABS
157 %token VAR_IPSECMOD_ENABLED VAR_IPSECMOD_HOOK VAR_IPSECMOD_IGNORE_BOGUS
158 %token VAR_IPSECMOD_MAX_TTL VAR_IPSECMOD_WHITELIST VAR_IPSECMOD_STRICT
159 %token VAR_CACHEDB VAR_CACHEDB_BACKEND VAR_CACHEDB_SECRETSEED
160 %token VAR_CACHEDB_REDISHOST VAR_CACHEDB_REDISPORT VAR_CACHEDB_REDISTIMEOUT
161 %token VAR_UDP_UPSTREAM_WITHOUT_DOWNSTREAM VAR_FOR_UPSTREAM
162 %token VAR_AUTH_ZONE VAR_ZONEFILE VAR_MASTER VAR_URL VAR_FOR_DOWNSTREAM
163 %token VAR_FALLBACK_ENABLED VAR_TLS_ADDITIONAL_PORT VAR_LOW_RTT VAR_LOW_RTT_PERMIL
164 %token VAR_FAST_SERVER_PERMIL VAR_FAST_SERVER_NUM
165 %token VAR_ALLOW_NOTIFY VAR_TLS_WIN_CERT VAR_TCP_CONNECTION_LIMIT
166 %token VAR_FORWARD_NO_CACHE VAR_STUB_NO_CACHE VAR_LOG_SERVFAIL VAR_DENY_ANY
167 %token VAR_UNKNOWN_SERVER_TIME_LIMIT VAR_LOG_TAG_QUERYREPLY
168 %token VAR_STREAM_WAIT_SIZE VAR_TLS_CIPHERS VAR_TLS_CIPHERSUITES
169 %token VAR_TLS_SESSION_TICKET_KEYS
172 toplevelvars: /* empty */ | toplevelvars toplevelvar ;
173 toplevelvar: serverstart contents_server | stubstart contents_stub |
174 forwardstart contents_forward | pythonstart contents_py |
175 rcstart contents_rc | dtstart contents_dt | viewstart contents_view |
176 dnscstart contents_dnsc | cachedbstart contents_cachedb |
177 authstart contents_auth
180 /* server: declaration */
181 serverstart: VAR_SERVER
183 OUTYY(("\nP(server:)\n"));
186 contents_server: contents_server content_server
188 content_server: server_num_threads | server_verbosity | server_port |
189 server_outgoing_range | server_do_ip4 |
190 server_do_ip6 | server_prefer_ip6 |
191 server_do_udp | server_do_tcp |
192 server_tcp_mss | server_outgoing_tcp_mss | server_tcp_idle_timeout |
193 server_tcp_keepalive | server_tcp_keepalive_timeout |
194 server_interface | server_chroot | server_username |
195 server_directory | server_logfile | server_pidfile |
196 server_msg_cache_size | server_msg_cache_slabs |
197 server_num_queries_per_thread | server_rrset_cache_size |
198 server_rrset_cache_slabs | server_outgoing_num_tcp |
199 server_infra_host_ttl | server_infra_lame_ttl |
200 server_infra_cache_slabs | server_infra_cache_numhosts |
201 server_infra_cache_lame_size | server_target_fetch_policy |
202 server_harden_short_bufsize | server_harden_large_queries |
203 server_do_not_query_address | server_hide_identity |
204 server_hide_version | server_identity | server_version |
205 server_harden_glue | server_module_conf | server_trust_anchor_file |
206 server_trust_anchor | server_val_override_date | server_bogus_ttl |
207 server_val_clean_additional | server_val_permissive_mode |
208 server_incoming_num_tcp | server_msg_buffer_size |
209 server_key_cache_size | server_key_cache_slabs |
210 server_trusted_keys_file | server_val_nsec3_keysize_iterations |
211 server_use_syslog | server_outgoing_interface | server_root_hints |
212 server_do_not_query_localhost | server_cache_max_ttl |
213 server_harden_dnssec_stripped | server_access_control |
214 server_local_zone | server_local_data | server_interface_automatic |
215 server_statistics_interval | server_do_daemonize |
216 server_use_caps_for_id | server_statistics_cumulative |
217 server_outgoing_port_permit | server_outgoing_port_avoid |
218 server_dlv_anchor_file | server_dlv_anchor | server_neg_cache_size |
219 server_harden_referral_path | server_private_address |
220 server_private_domain | server_extended_statistics |
221 server_local_data_ptr | server_jostle_timeout |
222 server_unwanted_reply_threshold | server_log_time_ascii |
223 server_domain_insecure | server_val_sig_skew_min |
224 server_val_sig_skew_max | server_cache_min_ttl | server_val_log_level |
225 server_auto_trust_anchor_file | server_add_holddown |
226 server_del_holddown | server_keep_missing | server_so_rcvbuf |
227 server_edns_buffer_size | server_prefetch | server_prefetch_key |
228 server_so_sndbuf | server_harden_below_nxdomain | server_ignore_cd_flag |
229 server_log_queries | server_log_replies | server_tcp_upstream | server_ssl_upstream |
230 server_log_local_actions |
231 server_ssl_service_key | server_ssl_service_pem | server_ssl_port |
232 server_minimal_responses | server_rrset_roundrobin | server_max_udp_size |
233 server_so_reuseport | server_delay_close |
234 server_unblock_lan_zones | server_insecure_lan_zones |
235 server_dns64_prefix | server_dns64_synthall | server_dns64_ignore_aaaa |
236 server_infra_cache_min_rtt | server_harden_algo_downgrade |
237 server_ip_transparent | server_ip_ratelimit | server_ratelimit |
238 server_ip_ratelimit_slabs | server_ratelimit_slabs |
239 server_ip_ratelimit_size | server_ratelimit_size |
240 server_ratelimit_for_domain |
241 server_ratelimit_below_domain | server_ratelimit_factor |
242 server_ip_ratelimit_factor | server_send_client_subnet |
243 server_client_subnet_zone | server_client_subnet_always_forward |
244 server_client_subnet_opcode |
245 server_max_client_subnet_ipv4 | server_max_client_subnet_ipv6 |
246 server_min_client_subnet_ipv4 | server_min_client_subnet_ipv6 |
247 server_max_ecs_tree_size_ipv4 | server_max_ecs_tree_size_ipv6 |
248 server_caps_whitelist | server_cache_max_negative_ttl |
249 server_permit_small_holddown | server_qname_minimisation |
250 server_ip_freebind | server_define_tag | server_local_zone_tag |
251 server_disable_dnssec_lame_check | server_access_control_tag |
252 server_local_zone_override | server_access_control_tag_action |
253 server_access_control_tag_data | server_access_control_view |
254 server_qname_minimisation_strict | server_serve_expired |
255 server_serve_expired_ttl | server_serve_expired_ttl_reset |
256 server_fake_dsa | server_log_identity | server_use_systemd |
257 server_response_ip_tag | server_response_ip | server_response_ip_data |
258 server_shm_enable | server_shm_key | server_fake_sha1 |
259 server_hide_trustanchor | server_trust_anchor_signaling |
260 server_root_key_sentinel |
261 server_ipsecmod_enabled | server_ipsecmod_hook |
262 server_ipsecmod_ignore_bogus | server_ipsecmod_max_ttl |
263 server_ipsecmod_whitelist | server_ipsecmod_strict |
264 server_udp_upstream_without_downstream | server_aggressive_nsec |
265 server_tls_cert_bundle | server_tls_additional_port | server_low_rtt |
266 server_fast_server_permil | server_fast_server_num | server_tls_win_cert |
267 server_tcp_connection_limit | server_log_servfail | server_deny_any |
268 server_unknown_server_time_limit | server_log_tag_queryreply |
269 server_stream_wait_size | server_tls_ciphers |
270 server_tls_ciphersuites | server_tls_session_ticket_keys
272 stubstart: VAR_STUB_ZONE
274 struct config_stub* s;
275 OUTYY(("\nP(stub_zone:)\n"));
276 s = (struct config_stub*)calloc(1, sizeof(struct config_stub));
278 s->next = cfg_parser->cfg->stubs;
279 cfg_parser->cfg->stubs = s;
281 yyerror("out of memory");
284 contents_stub: contents_stub content_stub
286 content_stub: stub_name | stub_host | stub_addr | stub_prime | stub_first |
287 stub_no_cache | stub_ssl_upstream
289 forwardstart: VAR_FORWARD_ZONE
291 struct config_stub* s;
292 OUTYY(("\nP(forward_zone:)\n"));
293 s = (struct config_stub*)calloc(1, sizeof(struct config_stub));
295 s->next = cfg_parser->cfg->forwards;
296 cfg_parser->cfg->forwards = s;
298 yyerror("out of memory");
301 contents_forward: contents_forward content_forward
303 content_forward: forward_name | forward_host | forward_addr | forward_first |
304 forward_no_cache | forward_ssl_upstream
308 struct config_view* s;
309 OUTYY(("\nP(view:)\n"));
310 s = (struct config_view*)calloc(1, sizeof(struct config_view));
312 s->next = cfg_parser->cfg->views;
313 if(s->next && !s->next->name)
314 yyerror("view without name");
315 cfg_parser->cfg->views = s;
317 yyerror("out of memory");
320 contents_view: contents_view content_view
322 content_view: view_name | view_local_zone | view_local_data | view_first |
323 view_response_ip | view_response_ip_data | view_local_data_ptr
325 authstart: VAR_AUTH_ZONE
327 struct config_auth* s;
328 OUTYY(("\nP(auth_zone:)\n"));
329 s = (struct config_auth*)calloc(1, sizeof(struct config_auth));
331 s->next = cfg_parser->cfg->auths;
332 cfg_parser->cfg->auths = s;
333 /* defaults for auth zone */
334 s->for_downstream = 1;
336 s->fallback_enabled = 0;
338 yyerror("out of memory");
341 contents_auth: contents_auth content_auth
343 content_auth: auth_name | auth_zonefile | auth_master | auth_url |
344 auth_for_downstream | auth_for_upstream | auth_fallback_enabled |
347 server_num_threads: VAR_NUM_THREADS STRING_ARG
349 OUTYY(("P(server_num_threads:%s)\n", $2));
350 if(atoi($2) == 0 && strcmp($2, "0") != 0)
351 yyerror("number expected");
352 else cfg_parser->cfg->num_threads = atoi($2);
356 server_verbosity: VAR_VERBOSITY STRING_ARG
358 OUTYY(("P(server_verbosity:%s)\n", $2));
359 if(atoi($2) == 0 && strcmp($2, "0") != 0)
360 yyerror("number expected");
361 else cfg_parser->cfg->verbosity = atoi($2);
365 server_statistics_interval: VAR_STATISTICS_INTERVAL STRING_ARG
367 OUTYY(("P(server_statistics_interval:%s)\n", $2));
368 if(strcmp($2, "") == 0 || strcmp($2, "0") == 0)
369 cfg_parser->cfg->stat_interval = 0;
370 else if(atoi($2) == 0)
371 yyerror("number expected");
372 else cfg_parser->cfg->stat_interval = atoi($2);
376 server_statistics_cumulative: VAR_STATISTICS_CUMULATIVE STRING_ARG
378 OUTYY(("P(server_statistics_cumulative:%s)\n", $2));
379 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
380 yyerror("expected yes or no.");
381 else cfg_parser->cfg->stat_cumulative = (strcmp($2, "yes")==0);
385 server_extended_statistics: VAR_EXTENDED_STATISTICS STRING_ARG
387 OUTYY(("P(server_extended_statistics:%s)\n", $2));
388 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
389 yyerror("expected yes or no.");
390 else cfg_parser->cfg->stat_extended = (strcmp($2, "yes")==0);
394 server_shm_enable: VAR_SHM_ENABLE STRING_ARG
396 OUTYY(("P(server_shm_enable:%s)\n", $2));
397 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
398 yyerror("expected yes or no.");
399 else cfg_parser->cfg->shm_enable = (strcmp($2, "yes")==0);
403 server_shm_key: VAR_SHM_KEY STRING_ARG
405 OUTYY(("P(server_shm_key:%s)\n", $2));
406 if(strcmp($2, "") == 0 || strcmp($2, "0") == 0)
407 cfg_parser->cfg->shm_key = 0;
408 else if(atoi($2) == 0)
409 yyerror("number expected");
410 else cfg_parser->cfg->shm_key = atoi($2);
414 server_port: VAR_PORT STRING_ARG
416 OUTYY(("P(server_port:%s)\n", $2));
418 yyerror("port number expected");
419 else cfg_parser->cfg->port = atoi($2);
423 server_send_client_subnet: VAR_SEND_CLIENT_SUBNET STRING_ARG
426 OUTYY(("P(server_send_client_subnet:%s)\n", $2));
427 if(!cfg_strlist_insert(&cfg_parser->cfg->client_subnet, $2))
428 fatal_exit("out of memory adding client-subnet");
430 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
434 server_client_subnet_zone: VAR_CLIENT_SUBNET_ZONE STRING_ARG
437 OUTYY(("P(server_client_subnet_zone:%s)\n", $2));
438 if(!cfg_strlist_insert(&cfg_parser->cfg->client_subnet_zone,
440 fatal_exit("out of memory adding client-subnet-zone");
442 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
446 server_client_subnet_always_forward:
447 VAR_CLIENT_SUBNET_ALWAYS_FORWARD STRING_ARG
450 OUTYY(("P(server_client_subnet_always_forward:%s)\n", $2));
451 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
452 yyerror("expected yes or no.");
454 cfg_parser->cfg->client_subnet_always_forward =
455 (strcmp($2, "yes")==0);
457 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
462 server_client_subnet_opcode: VAR_CLIENT_SUBNET_OPCODE STRING_ARG
465 OUTYY(("P(client_subnet_opcode:%s)\n", $2));
466 OUTYY(("P(Deprecated option, ignoring)\n"));
468 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
473 server_max_client_subnet_ipv4: VAR_MAX_CLIENT_SUBNET_IPV4 STRING_ARG
476 OUTYY(("P(max_client_subnet_ipv4:%s)\n", $2));
477 if(atoi($2) == 0 && strcmp($2, "0") != 0)
478 yyerror("IPv4 subnet length expected");
479 else if (atoi($2) > 32)
480 cfg_parser->cfg->max_client_subnet_ipv4 = 32;
481 else if (atoi($2) < 0)
482 cfg_parser->cfg->max_client_subnet_ipv4 = 0;
483 else cfg_parser->cfg->max_client_subnet_ipv4 = (uint8_t)atoi($2);
485 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
490 server_max_client_subnet_ipv6: VAR_MAX_CLIENT_SUBNET_IPV6 STRING_ARG
493 OUTYY(("P(max_client_subnet_ipv6:%s)\n", $2));
494 if(atoi($2) == 0 && strcmp($2, "0") != 0)
495 yyerror("Ipv6 subnet length expected");
496 else if (atoi($2) > 128)
497 cfg_parser->cfg->max_client_subnet_ipv6 = 128;
498 else if (atoi($2) < 0)
499 cfg_parser->cfg->max_client_subnet_ipv6 = 0;
500 else cfg_parser->cfg->max_client_subnet_ipv6 = (uint8_t)atoi($2);
502 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
507 server_min_client_subnet_ipv4: VAR_MIN_CLIENT_SUBNET_IPV4 STRING_ARG
510 OUTYY(("P(min_client_subnet_ipv4:%s)\n", $2));
511 if(atoi($2) == 0 && strcmp($2, "0") != 0)
512 yyerror("IPv4 subnet length expected");
513 else if (atoi($2) > 32)
514 cfg_parser->cfg->min_client_subnet_ipv4 = 32;
515 else if (atoi($2) < 0)
516 cfg_parser->cfg->min_client_subnet_ipv4 = 0;
517 else cfg_parser->cfg->min_client_subnet_ipv4 = (uint8_t)atoi($2);
519 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
524 server_min_client_subnet_ipv6: VAR_MIN_CLIENT_SUBNET_IPV6 STRING_ARG
527 OUTYY(("P(min_client_subnet_ipv6:%s)\n", $2));
528 if(atoi($2) == 0 && strcmp($2, "0") != 0)
529 yyerror("Ipv6 subnet length expected");
530 else if (atoi($2) > 128)
531 cfg_parser->cfg->min_client_subnet_ipv6 = 128;
532 else if (atoi($2) < 0)
533 cfg_parser->cfg->min_client_subnet_ipv6 = 0;
534 else cfg_parser->cfg->min_client_subnet_ipv6 = (uint8_t)atoi($2);
536 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
541 server_max_ecs_tree_size_ipv4: VAR_MAX_ECS_TREE_SIZE_IPV4 STRING_ARG
544 OUTYY(("P(max_ecs_tree_size_ipv4:%s)\n", $2));
545 if(atoi($2) == 0 && strcmp($2, "0") != 0)
546 yyerror("IPv4 ECS tree size expected");
547 else if (atoi($2) < 0)
548 cfg_parser->cfg->max_ecs_tree_size_ipv4 = 0;
549 else cfg_parser->cfg->max_ecs_tree_size_ipv4 = (uint32_t)atoi($2);
551 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
556 server_max_ecs_tree_size_ipv6: VAR_MAX_ECS_TREE_SIZE_IPV6 STRING_ARG
559 OUTYY(("P(max_ecs_tree_size_ipv6:%s)\n", $2));
560 if(atoi($2) == 0 && strcmp($2, "0") != 0)
561 yyerror("IPv6 ECS tree size expected");
562 else if (atoi($2) < 0)
563 cfg_parser->cfg->max_ecs_tree_size_ipv6 = 0;
564 else cfg_parser->cfg->max_ecs_tree_size_ipv6 = (uint32_t)atoi($2);
566 OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
571 server_interface: VAR_INTERFACE STRING_ARG
573 OUTYY(("P(server_interface:%s)\n", $2));
574 if(cfg_parser->cfg->num_ifs == 0)
575 cfg_parser->cfg->ifs = calloc(1, sizeof(char*));
576 else cfg_parser->cfg->ifs = realloc(cfg_parser->cfg->ifs,
577 (cfg_parser->cfg->num_ifs+1)*sizeof(char*));
578 if(!cfg_parser->cfg->ifs)
579 yyerror("out of memory");
581 cfg_parser->cfg->ifs[cfg_parser->cfg->num_ifs++] = $2;
584 server_outgoing_interface: VAR_OUTGOING_INTERFACE STRING_ARG
586 OUTYY(("P(server_outgoing_interface:%s)\n", $2));
587 if(cfg_parser->cfg->num_out_ifs == 0)
588 cfg_parser->cfg->out_ifs = calloc(1, sizeof(char*));
589 else cfg_parser->cfg->out_ifs = realloc(
590 cfg_parser->cfg->out_ifs,
591 (cfg_parser->cfg->num_out_ifs+1)*sizeof(char*));
592 if(!cfg_parser->cfg->out_ifs)
593 yyerror("out of memory");
595 cfg_parser->cfg->out_ifs[
596 cfg_parser->cfg->num_out_ifs++] = $2;
599 server_outgoing_range: VAR_OUTGOING_RANGE STRING_ARG
601 OUTYY(("P(server_outgoing_range:%s)\n", $2));
603 yyerror("number expected");
604 else cfg_parser->cfg->outgoing_num_ports = atoi($2);
608 server_outgoing_port_permit: VAR_OUTGOING_PORT_PERMIT STRING_ARG
610 OUTYY(("P(server_outgoing_port_permit:%s)\n", $2));
611 if(!cfg_mark_ports($2, 1,
612 cfg_parser->cfg->outgoing_avail_ports, 65536))
613 yyerror("port number or range (\"low-high\") expected");
617 server_outgoing_port_avoid: VAR_OUTGOING_PORT_AVOID STRING_ARG
619 OUTYY(("P(server_outgoing_port_avoid:%s)\n", $2));
620 if(!cfg_mark_ports($2, 0,
621 cfg_parser->cfg->outgoing_avail_ports, 65536))
622 yyerror("port number or range (\"low-high\") expected");
626 server_outgoing_num_tcp: VAR_OUTGOING_NUM_TCP STRING_ARG
628 OUTYY(("P(server_outgoing_num_tcp:%s)\n", $2));
629 if(atoi($2) == 0 && strcmp($2, "0") != 0)
630 yyerror("number expected");
631 else cfg_parser->cfg->outgoing_num_tcp = atoi($2);
635 server_incoming_num_tcp: VAR_INCOMING_NUM_TCP STRING_ARG
637 OUTYY(("P(server_incoming_num_tcp:%s)\n", $2));
638 if(atoi($2) == 0 && strcmp($2, "0") != 0)
639 yyerror("number expected");
640 else cfg_parser->cfg->incoming_num_tcp = atoi($2);
644 server_interface_automatic: VAR_INTERFACE_AUTOMATIC STRING_ARG
646 OUTYY(("P(server_interface_automatic:%s)\n", $2));
647 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
648 yyerror("expected yes or no.");
649 else cfg_parser->cfg->if_automatic = (strcmp($2, "yes")==0);
653 server_do_ip4: VAR_DO_IP4 STRING_ARG
655 OUTYY(("P(server_do_ip4:%s)\n", $2));
656 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
657 yyerror("expected yes or no.");
658 else cfg_parser->cfg->do_ip4 = (strcmp($2, "yes")==0);
662 server_do_ip6: VAR_DO_IP6 STRING_ARG
664 OUTYY(("P(server_do_ip6:%s)\n", $2));
665 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
666 yyerror("expected yes or no.");
667 else cfg_parser->cfg->do_ip6 = (strcmp($2, "yes")==0);
671 server_do_udp: VAR_DO_UDP STRING_ARG
673 OUTYY(("P(server_do_udp:%s)\n", $2));
674 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
675 yyerror("expected yes or no.");
676 else cfg_parser->cfg->do_udp = (strcmp($2, "yes")==0);
680 server_do_tcp: VAR_DO_TCP STRING_ARG
682 OUTYY(("P(server_do_tcp:%s)\n", $2));
683 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
684 yyerror("expected yes or no.");
685 else cfg_parser->cfg->do_tcp = (strcmp($2, "yes")==0);
689 server_prefer_ip6: VAR_PREFER_IP6 STRING_ARG
691 OUTYY(("P(server_prefer_ip6:%s)\n", $2));
692 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
693 yyerror("expected yes or no.");
694 else cfg_parser->cfg->prefer_ip6 = (strcmp($2, "yes")==0);
698 server_tcp_mss: VAR_TCP_MSS STRING_ARG
700 OUTYY(("P(server_tcp_mss:%s)\n", $2));
701 if(atoi($2) == 0 && strcmp($2, "0") != 0)
702 yyerror("number expected");
703 else cfg_parser->cfg->tcp_mss = atoi($2);
707 server_outgoing_tcp_mss: VAR_OUTGOING_TCP_MSS STRING_ARG
709 OUTYY(("P(server_outgoing_tcp_mss:%s)\n", $2));
710 if(atoi($2) == 0 && strcmp($2, "0") != 0)
711 yyerror("number expected");
712 else cfg_parser->cfg->outgoing_tcp_mss = atoi($2);
716 server_tcp_idle_timeout: VAR_TCP_IDLE_TIMEOUT STRING_ARG
718 OUTYY(("P(server_tcp_idle_timeout:%s)\n", $2));
719 if(atoi($2) == 0 && strcmp($2, "0") != 0)
720 yyerror("number expected");
721 else if (atoi($2) > 120000)
722 cfg_parser->cfg->tcp_idle_timeout = 120000;
723 else if (atoi($2) < 1)
724 cfg_parser->cfg->tcp_idle_timeout = 1;
725 else cfg_parser->cfg->tcp_idle_timeout = atoi($2);
729 server_tcp_keepalive: VAR_EDNS_TCP_KEEPALIVE STRING_ARG
731 OUTYY(("P(server_tcp_keepalive:%s)\n", $2));
732 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
733 yyerror("expected yes or no.");
734 else cfg_parser->cfg->do_tcp_keepalive = (strcmp($2, "yes")==0);
738 server_tcp_keepalive_timeout: VAR_EDNS_TCP_KEEPALIVE_TIMEOUT STRING_ARG
740 OUTYY(("P(server_tcp_keepalive_timeout:%s)\n", $2));
741 if(atoi($2) == 0 && strcmp($2, "0") != 0)
742 yyerror("number expected");
743 else if (atoi($2) > 6553500)
744 cfg_parser->cfg->tcp_keepalive_timeout = 6553500;
745 else if (atoi($2) < 1)
746 cfg_parser->cfg->tcp_keepalive_timeout = 0;
747 else cfg_parser->cfg->tcp_keepalive_timeout = atoi($2);
751 server_tcp_upstream: VAR_TCP_UPSTREAM STRING_ARG
753 OUTYY(("P(server_tcp_upstream:%s)\n", $2));
754 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
755 yyerror("expected yes or no.");
756 else cfg_parser->cfg->tcp_upstream = (strcmp($2, "yes")==0);
760 server_udp_upstream_without_downstream: VAR_UDP_UPSTREAM_WITHOUT_DOWNSTREAM STRING_ARG
762 OUTYY(("P(server_udp_upstream_without_downstream:%s)\n", $2));
763 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
764 yyerror("expected yes or no.");
765 else cfg_parser->cfg->udp_upstream_without_downstream = (strcmp($2, "yes")==0);
769 server_ssl_upstream: VAR_SSL_UPSTREAM STRING_ARG
771 OUTYY(("P(server_ssl_upstream:%s)\n", $2));
772 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
773 yyerror("expected yes or no.");
774 else cfg_parser->cfg->ssl_upstream = (strcmp($2, "yes")==0);
778 server_ssl_service_key: VAR_SSL_SERVICE_KEY STRING_ARG
780 OUTYY(("P(server_ssl_service_key:%s)\n", $2));
781 free(cfg_parser->cfg->ssl_service_key);
782 cfg_parser->cfg->ssl_service_key = $2;
785 server_ssl_service_pem: VAR_SSL_SERVICE_PEM STRING_ARG
787 OUTYY(("P(server_ssl_service_pem:%s)\n", $2));
788 free(cfg_parser->cfg->ssl_service_pem);
789 cfg_parser->cfg->ssl_service_pem = $2;
792 server_ssl_port: VAR_SSL_PORT STRING_ARG
794 OUTYY(("P(server_ssl_port:%s)\n", $2));
796 yyerror("port number expected");
797 else cfg_parser->cfg->ssl_port = atoi($2);
801 server_tls_cert_bundle: VAR_TLS_CERT_BUNDLE STRING_ARG
803 OUTYY(("P(server_tls_cert_bundle:%s)\n", $2));
804 free(cfg_parser->cfg->tls_cert_bundle);
805 cfg_parser->cfg->tls_cert_bundle = $2;
808 server_tls_win_cert: VAR_TLS_WIN_CERT STRING_ARG
810 OUTYY(("P(server_tls_win_cert:%s)\n", $2));
811 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
812 yyerror("expected yes or no.");
813 else cfg_parser->cfg->tls_win_cert = (strcmp($2, "yes")==0);
817 server_tls_additional_port: VAR_TLS_ADDITIONAL_PORT STRING_ARG
819 OUTYY(("P(server_tls_additional_port:%s)\n", $2));
820 if(!cfg_strlist_insert(&cfg_parser->cfg->tls_additional_port,
822 yyerror("out of memory");
825 server_tls_ciphers: VAR_TLS_CIPHERS STRING_ARG
827 OUTYY(("P(server_tls_ciphers:%s)\n", $2));
828 free(cfg_parser->cfg->tls_ciphers);
829 cfg_parser->cfg->tls_ciphers = $2;
832 server_tls_ciphersuites: VAR_TLS_CIPHERSUITES STRING_ARG
834 OUTYY(("P(server_tls_ciphersuites:%s)\n", $2));
835 free(cfg_parser->cfg->tls_ciphersuites);
836 cfg_parser->cfg->tls_ciphersuites = $2;
839 server_tls_session_ticket_keys: VAR_TLS_SESSION_TICKET_KEYS STRING_ARG
841 OUTYY(("P(server_tls_session_ticket_keys:%s)\n", $2));
842 if(!cfg_strlist_append(&cfg_parser->cfg->tls_session_ticket_keys,
844 yyerror("out of memory");
847 server_use_systemd: VAR_USE_SYSTEMD STRING_ARG
849 OUTYY(("P(server_use_systemd:%s)\n", $2));
850 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
851 yyerror("expected yes or no.");
852 else cfg_parser->cfg->use_systemd = (strcmp($2, "yes")==0);
856 server_do_daemonize: VAR_DO_DAEMONIZE STRING_ARG
858 OUTYY(("P(server_do_daemonize:%s)\n", $2));
859 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
860 yyerror("expected yes or no.");
861 else cfg_parser->cfg->do_daemonize = (strcmp($2, "yes")==0);
865 server_use_syslog: VAR_USE_SYSLOG STRING_ARG
867 OUTYY(("P(server_use_syslog:%s)\n", $2));
868 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
869 yyerror("expected yes or no.");
870 else cfg_parser->cfg->use_syslog = (strcmp($2, "yes")==0);
871 #if !defined(HAVE_SYSLOG_H) && !defined(UB_ON_WINDOWS)
872 if(strcmp($2, "yes") == 0)
873 yyerror("no syslog services are available. "
874 "(reconfigure and compile to add)");
879 server_log_time_ascii: VAR_LOG_TIME_ASCII STRING_ARG
881 OUTYY(("P(server_log_time_ascii:%s)\n", $2));
882 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
883 yyerror("expected yes or no.");
884 else cfg_parser->cfg->log_time_ascii = (strcmp($2, "yes")==0);
888 server_log_queries: VAR_LOG_QUERIES STRING_ARG
890 OUTYY(("P(server_log_queries:%s)\n", $2));
891 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
892 yyerror("expected yes or no.");
893 else cfg_parser->cfg->log_queries = (strcmp($2, "yes")==0);
897 server_log_replies: VAR_LOG_REPLIES STRING_ARG
899 OUTYY(("P(server_log_replies:%s)\n", $2));
900 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
901 yyerror("expected yes or no.");
902 else cfg_parser->cfg->log_replies = (strcmp($2, "yes")==0);
906 server_log_tag_queryreply: VAR_LOG_TAG_QUERYREPLY STRING_ARG
908 OUTYY(("P(server_log_tag_queryreply:%s)\n", $2));
909 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
910 yyerror("expected yes or no.");
911 else cfg_parser->cfg->log_tag_queryreply = (strcmp($2, "yes")==0);
915 server_log_servfail: VAR_LOG_SERVFAIL STRING_ARG
917 OUTYY(("P(server_log_servfail:%s)\n", $2));
918 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
919 yyerror("expected yes or no.");
920 else cfg_parser->cfg->log_servfail = (strcmp($2, "yes")==0);
924 server_log_local_actions: VAR_LOG_LOCAL_ACTIONS STRING_ARG
926 OUTYY(("P(server_log_local_actions:%s)\n", $2));
927 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
928 yyerror("expected yes or no.");
929 else cfg_parser->cfg->log_local_actions = (strcmp($2, "yes")==0);
933 server_chroot: VAR_CHROOT STRING_ARG
935 OUTYY(("P(server_chroot:%s)\n", $2));
936 free(cfg_parser->cfg->chrootdir);
937 cfg_parser->cfg->chrootdir = $2;
940 server_username: VAR_USERNAME STRING_ARG
942 OUTYY(("P(server_username:%s)\n", $2));
943 free(cfg_parser->cfg->username);
944 cfg_parser->cfg->username = $2;
947 server_directory: VAR_DIRECTORY STRING_ARG
949 OUTYY(("P(server_directory:%s)\n", $2));
950 free(cfg_parser->cfg->directory);
951 cfg_parser->cfg->directory = $2;
952 /* change there right away for includes relative to this */
956 w_config_adjust_directory(cfg_parser->cfg);
958 d = cfg_parser->cfg->directory;
959 /* adjust directory if we have already chroot,
960 * like, we reread after sighup */
961 if(cfg_parser->chroot && cfg_parser->chroot[0] &&
962 strncmp(d, cfg_parser->chroot, strlen(
963 cfg_parser->chroot)) == 0)
964 d += strlen(cfg_parser->chroot);
967 log_err("cannot chdir to directory: %s (%s)",
973 server_logfile: VAR_LOGFILE STRING_ARG
975 OUTYY(("P(server_logfile:%s)\n", $2));
976 free(cfg_parser->cfg->logfile);
977 cfg_parser->cfg->logfile = $2;
978 cfg_parser->cfg->use_syslog = 0;
981 server_pidfile: VAR_PIDFILE STRING_ARG
983 OUTYY(("P(server_pidfile:%s)\n", $2));
984 free(cfg_parser->cfg->pidfile);
985 cfg_parser->cfg->pidfile = $2;
988 server_root_hints: VAR_ROOT_HINTS STRING_ARG
990 OUTYY(("P(server_root_hints:%s)\n", $2));
991 if(!cfg_strlist_insert(&cfg_parser->cfg->root_hints, $2))
992 yyerror("out of memory");
995 server_dlv_anchor_file: VAR_DLV_ANCHOR_FILE STRING_ARG
997 OUTYY(("P(server_dlv_anchor_file:%s)\n", $2));
998 free(cfg_parser->cfg->dlv_anchor_file);
999 cfg_parser->cfg->dlv_anchor_file = $2;
1002 server_dlv_anchor: VAR_DLV_ANCHOR STRING_ARG
1004 OUTYY(("P(server_dlv_anchor:%s)\n", $2));
1005 if(!cfg_strlist_insert(&cfg_parser->cfg->dlv_anchor_list, $2))
1006 yyerror("out of memory");
1009 server_auto_trust_anchor_file: VAR_AUTO_TRUST_ANCHOR_FILE STRING_ARG
1011 OUTYY(("P(server_auto_trust_anchor_file:%s)\n", $2));
1012 if(!cfg_strlist_insert(&cfg_parser->cfg->
1013 auto_trust_anchor_file_list, $2))
1014 yyerror("out of memory");
1017 server_trust_anchor_file: VAR_TRUST_ANCHOR_FILE STRING_ARG
1019 OUTYY(("P(server_trust_anchor_file:%s)\n", $2));
1020 if(!cfg_strlist_insert(&cfg_parser->cfg->
1021 trust_anchor_file_list, $2))
1022 yyerror("out of memory");
1025 server_trusted_keys_file: VAR_TRUSTED_KEYS_FILE STRING_ARG
1027 OUTYY(("P(server_trusted_keys_file:%s)\n", $2));
1028 if(!cfg_strlist_insert(&cfg_parser->cfg->
1029 trusted_keys_file_list, $2))
1030 yyerror("out of memory");
1033 server_trust_anchor: VAR_TRUST_ANCHOR STRING_ARG
1035 OUTYY(("P(server_trust_anchor:%s)\n", $2));
1036 if(!cfg_strlist_insert(&cfg_parser->cfg->trust_anchor_list, $2))
1037 yyerror("out of memory");
1040 server_trust_anchor_signaling: VAR_TRUST_ANCHOR_SIGNALING STRING_ARG
1042 OUTYY(("P(server_trust_anchor_signaling:%s)\n", $2));
1043 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1044 yyerror("expected yes or no.");
1046 cfg_parser->cfg->trust_anchor_signaling =
1047 (strcmp($2, "yes")==0);
1051 server_root_key_sentinel: VAR_ROOT_KEY_SENTINEL STRING_ARG
1053 OUTYY(("P(server_root_key_sentinel:%s)\n", $2));
1054 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1055 yyerror("expected yes or no.");
1057 cfg_parser->cfg->root_key_sentinel =
1058 (strcmp($2, "yes")==0);
1062 server_domain_insecure: VAR_DOMAIN_INSECURE STRING_ARG
1064 OUTYY(("P(server_domain_insecure:%s)\n", $2));
1065 if(!cfg_strlist_insert(&cfg_parser->cfg->domain_insecure, $2))
1066 yyerror("out of memory");
1069 server_hide_identity: VAR_HIDE_IDENTITY STRING_ARG
1071 OUTYY(("P(server_hide_identity:%s)\n", $2));
1072 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1073 yyerror("expected yes or no.");
1074 else cfg_parser->cfg->hide_identity = (strcmp($2, "yes")==0);
1078 server_hide_version: VAR_HIDE_VERSION STRING_ARG
1080 OUTYY(("P(server_hide_version:%s)\n", $2));
1081 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1082 yyerror("expected yes or no.");
1083 else cfg_parser->cfg->hide_version = (strcmp($2, "yes")==0);
1087 server_hide_trustanchor: VAR_HIDE_TRUSTANCHOR STRING_ARG
1089 OUTYY(("P(server_hide_trustanchor:%s)\n", $2));
1090 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1091 yyerror("expected yes or no.");
1092 else cfg_parser->cfg->hide_trustanchor = (strcmp($2, "yes")==0);
1096 server_identity: VAR_IDENTITY STRING_ARG
1098 OUTYY(("P(server_identity:%s)\n", $2));
1099 free(cfg_parser->cfg->identity);
1100 cfg_parser->cfg->identity = $2;
1103 server_version: VAR_VERSION STRING_ARG
1105 OUTYY(("P(server_version:%s)\n", $2));
1106 free(cfg_parser->cfg->version);
1107 cfg_parser->cfg->version = $2;
1110 server_so_rcvbuf: VAR_SO_RCVBUF STRING_ARG
1112 OUTYY(("P(server_so_rcvbuf:%s)\n", $2));
1113 if(!cfg_parse_memsize($2, &cfg_parser->cfg->so_rcvbuf))
1114 yyerror("buffer size expected");
1118 server_so_sndbuf: VAR_SO_SNDBUF STRING_ARG
1120 OUTYY(("P(server_so_sndbuf:%s)\n", $2));
1121 if(!cfg_parse_memsize($2, &cfg_parser->cfg->so_sndbuf))
1122 yyerror("buffer size expected");
1126 server_so_reuseport: VAR_SO_REUSEPORT STRING_ARG
1128 OUTYY(("P(server_so_reuseport:%s)\n", $2));
1129 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1130 yyerror("expected yes or no.");
1131 else cfg_parser->cfg->so_reuseport =
1132 (strcmp($2, "yes")==0);
1136 server_ip_transparent: VAR_IP_TRANSPARENT STRING_ARG
1138 OUTYY(("P(server_ip_transparent:%s)\n", $2));
1139 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1140 yyerror("expected yes or no.");
1141 else cfg_parser->cfg->ip_transparent =
1142 (strcmp($2, "yes")==0);
1146 server_ip_freebind: VAR_IP_FREEBIND STRING_ARG
1148 OUTYY(("P(server_ip_freebind:%s)\n", $2));
1149 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1150 yyerror("expected yes or no.");
1151 else cfg_parser->cfg->ip_freebind =
1152 (strcmp($2, "yes")==0);
1156 server_stream_wait_size: VAR_STREAM_WAIT_SIZE STRING_ARG
1158 OUTYY(("P(server_stream_wait_size:%s)\n", $2));
1159 if(!cfg_parse_memsize($2, &cfg_parser->cfg->stream_wait_size))
1160 yyerror("memory size expected");
1164 server_edns_buffer_size: VAR_EDNS_BUFFER_SIZE STRING_ARG
1166 OUTYY(("P(server_edns_buffer_size:%s)\n", $2));
1168 yyerror("number expected");
1169 else if (atoi($2) < 12)
1170 yyerror("edns buffer size too small");
1171 else if (atoi($2) > 65535)
1172 cfg_parser->cfg->edns_buffer_size = 65535;
1173 else cfg_parser->cfg->edns_buffer_size = atoi($2);
1177 server_msg_buffer_size: VAR_MSG_BUFFER_SIZE STRING_ARG
1179 OUTYY(("P(server_msg_buffer_size:%s)\n", $2));
1181 yyerror("number expected");
1182 else if (atoi($2) < 4096)
1183 yyerror("message buffer size too small (use 4096)");
1184 else cfg_parser->cfg->msg_buffer_size = atoi($2);
1188 server_msg_cache_size: VAR_MSG_CACHE_SIZE STRING_ARG
1190 OUTYY(("P(server_msg_cache_size:%s)\n", $2));
1191 if(!cfg_parse_memsize($2, &cfg_parser->cfg->msg_cache_size))
1192 yyerror("memory size expected");
1196 server_msg_cache_slabs: VAR_MSG_CACHE_SLABS STRING_ARG
1198 OUTYY(("P(server_msg_cache_slabs:%s)\n", $2));
1200 yyerror("number expected");
1202 cfg_parser->cfg->msg_cache_slabs = atoi($2);
1203 if(!is_pow2(cfg_parser->cfg->msg_cache_slabs))
1204 yyerror("must be a power of 2");
1209 server_num_queries_per_thread: VAR_NUM_QUERIES_PER_THREAD STRING_ARG
1211 OUTYY(("P(server_num_queries_per_thread:%s)\n", $2));
1213 yyerror("number expected");
1214 else cfg_parser->cfg->num_queries_per_thread = atoi($2);
1218 server_jostle_timeout: VAR_JOSTLE_TIMEOUT STRING_ARG
1220 OUTYY(("P(server_jostle_timeout:%s)\n", $2));
1221 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1222 yyerror("number expected");
1223 else cfg_parser->cfg->jostle_time = atoi($2);
1227 server_delay_close: VAR_DELAY_CLOSE STRING_ARG
1229 OUTYY(("P(server_delay_close:%s)\n", $2));
1230 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1231 yyerror("number expected");
1232 else cfg_parser->cfg->delay_close = atoi($2);
1236 server_unblock_lan_zones: VAR_UNBLOCK_LAN_ZONES STRING_ARG
1238 OUTYY(("P(server_unblock_lan_zones:%s)\n", $2));
1239 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1240 yyerror("expected yes or no.");
1241 else cfg_parser->cfg->unblock_lan_zones =
1242 (strcmp($2, "yes")==0);
1246 server_insecure_lan_zones: VAR_INSECURE_LAN_ZONES STRING_ARG
1248 OUTYY(("P(server_insecure_lan_zones:%s)\n", $2));
1249 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1250 yyerror("expected yes or no.");
1251 else cfg_parser->cfg->insecure_lan_zones =
1252 (strcmp($2, "yes")==0);
1256 server_rrset_cache_size: VAR_RRSET_CACHE_SIZE STRING_ARG
1258 OUTYY(("P(server_rrset_cache_size:%s)\n", $2));
1259 if(!cfg_parse_memsize($2, &cfg_parser->cfg->rrset_cache_size))
1260 yyerror("memory size expected");
1264 server_rrset_cache_slabs: VAR_RRSET_CACHE_SLABS STRING_ARG
1266 OUTYY(("P(server_rrset_cache_slabs:%s)\n", $2));
1268 yyerror("number expected");
1270 cfg_parser->cfg->rrset_cache_slabs = atoi($2);
1271 if(!is_pow2(cfg_parser->cfg->rrset_cache_slabs))
1272 yyerror("must be a power of 2");
1277 server_infra_host_ttl: VAR_INFRA_HOST_TTL STRING_ARG
1279 OUTYY(("P(server_infra_host_ttl:%s)\n", $2));
1280 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1281 yyerror("number expected");
1282 else cfg_parser->cfg->host_ttl = atoi($2);
1286 server_infra_lame_ttl: VAR_INFRA_LAME_TTL STRING_ARG
1288 OUTYY(("P(server_infra_lame_ttl:%s)\n", $2));
1289 verbose(VERB_DETAIL, "ignored infra-lame-ttl: %s (option "
1290 "removed, use infra-host-ttl)", $2);
1294 server_infra_cache_numhosts: VAR_INFRA_CACHE_NUMHOSTS STRING_ARG
1296 OUTYY(("P(server_infra_cache_numhosts:%s)\n", $2));
1298 yyerror("number expected");
1299 else cfg_parser->cfg->infra_cache_numhosts = atoi($2);
1303 server_infra_cache_lame_size: VAR_INFRA_CACHE_LAME_SIZE STRING_ARG
1305 OUTYY(("P(server_infra_cache_lame_size:%s)\n", $2));
1306 verbose(VERB_DETAIL, "ignored infra-cache-lame-size: %s "
1307 "(option removed, use infra-cache-numhosts)", $2);
1311 server_infra_cache_slabs: VAR_INFRA_CACHE_SLABS STRING_ARG
1313 OUTYY(("P(server_infra_cache_slabs:%s)\n", $2));
1315 yyerror("number expected");
1317 cfg_parser->cfg->infra_cache_slabs = atoi($2);
1318 if(!is_pow2(cfg_parser->cfg->infra_cache_slabs))
1319 yyerror("must be a power of 2");
1324 server_infra_cache_min_rtt: VAR_INFRA_CACHE_MIN_RTT STRING_ARG
1326 OUTYY(("P(server_infra_cache_min_rtt:%s)\n", $2));
1327 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1328 yyerror("number expected");
1329 else cfg_parser->cfg->infra_cache_min_rtt = atoi($2);
1333 server_target_fetch_policy: VAR_TARGET_FETCH_POLICY STRING_ARG
1335 OUTYY(("P(server_target_fetch_policy:%s)\n", $2));
1336 free(cfg_parser->cfg->target_fetch_policy);
1337 cfg_parser->cfg->target_fetch_policy = $2;
1340 server_harden_short_bufsize: VAR_HARDEN_SHORT_BUFSIZE STRING_ARG
1342 OUTYY(("P(server_harden_short_bufsize:%s)\n", $2));
1343 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1344 yyerror("expected yes or no.");
1345 else cfg_parser->cfg->harden_short_bufsize =
1346 (strcmp($2, "yes")==0);
1350 server_harden_large_queries: VAR_HARDEN_LARGE_QUERIES STRING_ARG
1352 OUTYY(("P(server_harden_large_queries:%s)\n", $2));
1353 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1354 yyerror("expected yes or no.");
1355 else cfg_parser->cfg->harden_large_queries =
1356 (strcmp($2, "yes")==0);
1360 server_harden_glue: VAR_HARDEN_GLUE STRING_ARG
1362 OUTYY(("P(server_harden_glue:%s)\n", $2));
1363 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1364 yyerror("expected yes or no.");
1365 else cfg_parser->cfg->harden_glue =
1366 (strcmp($2, "yes")==0);
1370 server_harden_dnssec_stripped: VAR_HARDEN_DNSSEC_STRIPPED STRING_ARG
1372 OUTYY(("P(server_harden_dnssec_stripped:%s)\n", $2));
1373 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1374 yyerror("expected yes or no.");
1375 else cfg_parser->cfg->harden_dnssec_stripped =
1376 (strcmp($2, "yes")==0);
1380 server_harden_below_nxdomain: VAR_HARDEN_BELOW_NXDOMAIN STRING_ARG
1382 OUTYY(("P(server_harden_below_nxdomain:%s)\n", $2));
1383 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1384 yyerror("expected yes or no.");
1385 else cfg_parser->cfg->harden_below_nxdomain =
1386 (strcmp($2, "yes")==0);
1390 server_harden_referral_path: VAR_HARDEN_REFERRAL_PATH STRING_ARG
1392 OUTYY(("P(server_harden_referral_path:%s)\n", $2));
1393 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1394 yyerror("expected yes or no.");
1395 else cfg_parser->cfg->harden_referral_path =
1396 (strcmp($2, "yes")==0);
1400 server_harden_algo_downgrade: VAR_HARDEN_ALGO_DOWNGRADE STRING_ARG
1402 OUTYY(("P(server_harden_algo_downgrade:%s)\n", $2));
1403 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1404 yyerror("expected yes or no.");
1405 else cfg_parser->cfg->harden_algo_downgrade =
1406 (strcmp($2, "yes")==0);
1410 server_use_caps_for_id: VAR_USE_CAPS_FOR_ID STRING_ARG
1412 OUTYY(("P(server_use_caps_for_id:%s)\n", $2));
1413 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1414 yyerror("expected yes or no.");
1415 else cfg_parser->cfg->use_caps_bits_for_id =
1416 (strcmp($2, "yes")==0);
1420 server_caps_whitelist: VAR_CAPS_WHITELIST STRING_ARG
1422 OUTYY(("P(server_caps_whitelist:%s)\n", $2));
1423 if(!cfg_strlist_insert(&cfg_parser->cfg->caps_whitelist, $2))
1424 yyerror("out of memory");
1427 server_private_address: VAR_PRIVATE_ADDRESS STRING_ARG
1429 OUTYY(("P(server_private_address:%s)\n", $2));
1430 if(!cfg_strlist_insert(&cfg_parser->cfg->private_address, $2))
1431 yyerror("out of memory");
1434 server_private_domain: VAR_PRIVATE_DOMAIN STRING_ARG
1436 OUTYY(("P(server_private_domain:%s)\n", $2));
1437 if(!cfg_strlist_insert(&cfg_parser->cfg->private_domain, $2))
1438 yyerror("out of memory");
1441 server_prefetch: VAR_PREFETCH STRING_ARG
1443 OUTYY(("P(server_prefetch:%s)\n", $2));
1444 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1445 yyerror("expected yes or no.");
1446 else cfg_parser->cfg->prefetch = (strcmp($2, "yes")==0);
1450 server_prefetch_key: VAR_PREFETCH_KEY STRING_ARG
1452 OUTYY(("P(server_prefetch_key:%s)\n", $2));
1453 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1454 yyerror("expected yes or no.");
1455 else cfg_parser->cfg->prefetch_key = (strcmp($2, "yes")==0);
1459 server_deny_any: VAR_DENY_ANY STRING_ARG
1461 OUTYY(("P(server_deny_any:%s)\n", $2));
1462 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1463 yyerror("expected yes or no.");
1464 else cfg_parser->cfg->deny_any = (strcmp($2, "yes")==0);
1468 server_unwanted_reply_threshold: VAR_UNWANTED_REPLY_THRESHOLD STRING_ARG
1470 OUTYY(("P(server_unwanted_reply_threshold:%s)\n", $2));
1471 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1472 yyerror("number expected");
1473 else cfg_parser->cfg->unwanted_threshold = atoi($2);
1477 server_do_not_query_address: VAR_DO_NOT_QUERY_ADDRESS STRING_ARG
1479 OUTYY(("P(server_do_not_query_address:%s)\n", $2));
1480 if(!cfg_strlist_insert(&cfg_parser->cfg->donotqueryaddrs, $2))
1481 yyerror("out of memory");
1484 server_do_not_query_localhost: VAR_DO_NOT_QUERY_LOCALHOST STRING_ARG
1486 OUTYY(("P(server_do_not_query_localhost:%s)\n", $2));
1487 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1488 yyerror("expected yes or no.");
1489 else cfg_parser->cfg->donotquery_localhost =
1490 (strcmp($2, "yes")==0);
1494 server_access_control: VAR_ACCESS_CONTROL STRING_ARG STRING_ARG
1496 OUTYY(("P(server_access_control:%s %s)\n", $2, $3));
1497 if(strcmp($3, "deny")!=0 && strcmp($3, "refuse")!=0 &&
1498 strcmp($3, "deny_non_local")!=0 &&
1499 strcmp($3, "refuse_non_local")!=0 &&
1500 strcmp($3, "allow_setrd")!=0 &&
1501 strcmp($3, "allow")!=0 &&
1502 strcmp($3, "allow_snoop")!=0) {
1503 yyerror("expected deny, refuse, deny_non_local, "
1504 "refuse_non_local, allow, allow_setrd or "
1505 "allow_snoop in access control action");
1509 if(!cfg_str2list_insert(&cfg_parser->cfg->acls, $2, $3))
1510 fatal_exit("out of memory adding acl");
1514 server_module_conf: VAR_MODULE_CONF STRING_ARG
1516 OUTYY(("P(server_module_conf:%s)\n", $2));
1517 free(cfg_parser->cfg->module_conf);
1518 cfg_parser->cfg->module_conf = $2;
1521 server_val_override_date: VAR_VAL_OVERRIDE_DATE STRING_ARG
1523 OUTYY(("P(server_val_override_date:%s)\n", $2));
1524 if(*$2 == '\0' || strcmp($2, "0") == 0) {
1525 cfg_parser->cfg->val_date_override = 0;
1526 } else if(strlen($2) == 14) {
1527 cfg_parser->cfg->val_date_override =
1528 cfg_convert_timeval($2);
1529 if(!cfg_parser->cfg->val_date_override)
1530 yyerror("bad date/time specification");
1533 yyerror("number expected");
1534 cfg_parser->cfg->val_date_override = atoi($2);
1539 server_val_sig_skew_min: VAR_VAL_SIG_SKEW_MIN STRING_ARG
1541 OUTYY(("P(server_val_sig_skew_min:%s)\n", $2));
1542 if(*$2 == '\0' || strcmp($2, "0") == 0) {
1543 cfg_parser->cfg->val_sig_skew_min = 0;
1545 cfg_parser->cfg->val_sig_skew_min = atoi($2);
1546 if(!cfg_parser->cfg->val_sig_skew_min)
1547 yyerror("number expected");
1552 server_val_sig_skew_max: VAR_VAL_SIG_SKEW_MAX STRING_ARG
1554 OUTYY(("P(server_val_sig_skew_max:%s)\n", $2));
1555 if(*$2 == '\0' || strcmp($2, "0") == 0) {
1556 cfg_parser->cfg->val_sig_skew_max = 0;
1558 cfg_parser->cfg->val_sig_skew_max = atoi($2);
1559 if(!cfg_parser->cfg->val_sig_skew_max)
1560 yyerror("number expected");
1565 server_cache_max_ttl: VAR_CACHE_MAX_TTL STRING_ARG
1567 OUTYY(("P(server_cache_max_ttl:%s)\n", $2));
1568 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1569 yyerror("number expected");
1570 else cfg_parser->cfg->max_ttl = atoi($2);
1574 server_cache_max_negative_ttl: VAR_CACHE_MAX_NEGATIVE_TTL STRING_ARG
1576 OUTYY(("P(server_cache_max_negative_ttl:%s)\n", $2));
1577 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1578 yyerror("number expected");
1579 else cfg_parser->cfg->max_negative_ttl = atoi($2);
1583 server_cache_min_ttl: VAR_CACHE_MIN_TTL STRING_ARG
1585 OUTYY(("P(server_cache_min_ttl:%s)\n", $2));
1586 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1587 yyerror("number expected");
1588 else cfg_parser->cfg->min_ttl = atoi($2);
1592 server_bogus_ttl: VAR_BOGUS_TTL STRING_ARG
1594 OUTYY(("P(server_bogus_ttl:%s)\n", $2));
1595 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1596 yyerror("number expected");
1597 else cfg_parser->cfg->bogus_ttl = atoi($2);
1601 server_val_clean_additional: VAR_VAL_CLEAN_ADDITIONAL STRING_ARG
1603 OUTYY(("P(server_val_clean_additional:%s)\n", $2));
1604 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1605 yyerror("expected yes or no.");
1606 else cfg_parser->cfg->val_clean_additional =
1607 (strcmp($2, "yes")==0);
1611 server_val_permissive_mode: VAR_VAL_PERMISSIVE_MODE STRING_ARG
1613 OUTYY(("P(server_val_permissive_mode:%s)\n", $2));
1614 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1615 yyerror("expected yes or no.");
1616 else cfg_parser->cfg->val_permissive_mode =
1617 (strcmp($2, "yes")==0);
1621 server_aggressive_nsec: VAR_AGGRESSIVE_NSEC STRING_ARG
1623 OUTYY(("P(server_aggressive_nsec:%s)\n", $2));
1624 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1625 yyerror("expected yes or no.");
1627 cfg_parser->cfg->aggressive_nsec =
1628 (strcmp($2, "yes")==0);
1632 server_ignore_cd_flag: VAR_IGNORE_CD_FLAG STRING_ARG
1634 OUTYY(("P(server_ignore_cd_flag:%s)\n", $2));
1635 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1636 yyerror("expected yes or no.");
1637 else cfg_parser->cfg->ignore_cd = (strcmp($2, "yes")==0);
1641 server_serve_expired: VAR_SERVE_EXPIRED STRING_ARG
1643 OUTYY(("P(server_serve_expired:%s)\n", $2));
1644 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1645 yyerror("expected yes or no.");
1646 else cfg_parser->cfg->serve_expired = (strcmp($2, "yes")==0);
1650 server_serve_expired_ttl: VAR_SERVE_EXPIRED_TTL STRING_ARG
1652 OUTYY(("P(server_serve_expired_ttl:%s)\n", $2));
1653 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1654 yyerror("number expected");
1655 else cfg_parser->cfg->serve_expired_ttl = atoi($2);
1659 server_serve_expired_ttl_reset: VAR_SERVE_EXPIRED_TTL_RESET STRING_ARG
1661 OUTYY(("P(server_serve_expired_ttl_reset:%s)\n", $2));
1662 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1663 yyerror("expected yes or no.");
1664 else cfg_parser->cfg->serve_expired_ttl_reset = (strcmp($2, "yes")==0);
1668 server_fake_dsa: VAR_FAKE_DSA STRING_ARG
1670 OUTYY(("P(server_fake_dsa:%s)\n", $2));
1671 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1672 yyerror("expected yes or no.");
1674 else fake_dsa = (strcmp($2, "yes")==0);
1676 log_warn("test option fake_dsa is enabled");
1681 server_fake_sha1: VAR_FAKE_SHA1 STRING_ARG
1683 OUTYY(("P(server_fake_sha1:%s)\n", $2));
1684 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1685 yyerror("expected yes or no.");
1687 else fake_sha1 = (strcmp($2, "yes")==0);
1689 log_warn("test option fake_sha1 is enabled");
1694 server_val_log_level: VAR_VAL_LOG_LEVEL STRING_ARG
1696 OUTYY(("P(server_val_log_level:%s)\n", $2));
1697 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1698 yyerror("number expected");
1699 else cfg_parser->cfg->val_log_level = atoi($2);
1703 server_val_nsec3_keysize_iterations: VAR_VAL_NSEC3_KEYSIZE_ITERATIONS STRING_ARG
1705 OUTYY(("P(server_val_nsec3_keysize_iterations:%s)\n", $2));
1706 free(cfg_parser->cfg->val_nsec3_key_iterations);
1707 cfg_parser->cfg->val_nsec3_key_iterations = $2;
1710 server_add_holddown: VAR_ADD_HOLDDOWN STRING_ARG
1712 OUTYY(("P(server_add_holddown:%s)\n", $2));
1713 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1714 yyerror("number expected");
1715 else cfg_parser->cfg->add_holddown = atoi($2);
1719 server_del_holddown: VAR_DEL_HOLDDOWN STRING_ARG
1721 OUTYY(("P(server_del_holddown:%s)\n", $2));
1722 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1723 yyerror("number expected");
1724 else cfg_parser->cfg->del_holddown = atoi($2);
1728 server_keep_missing: VAR_KEEP_MISSING STRING_ARG
1730 OUTYY(("P(server_keep_missing:%s)\n", $2));
1731 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1732 yyerror("number expected");
1733 else cfg_parser->cfg->keep_missing = atoi($2);
1737 server_permit_small_holddown: VAR_PERMIT_SMALL_HOLDDOWN STRING_ARG
1739 OUTYY(("P(server_permit_small_holddown:%s)\n", $2));
1740 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1741 yyerror("expected yes or no.");
1742 else cfg_parser->cfg->permit_small_holddown =
1743 (strcmp($2, "yes")==0);
1746 server_key_cache_size: VAR_KEY_CACHE_SIZE STRING_ARG
1748 OUTYY(("P(server_key_cache_size:%s)\n", $2));
1749 if(!cfg_parse_memsize($2, &cfg_parser->cfg->key_cache_size))
1750 yyerror("memory size expected");
1754 server_key_cache_slabs: VAR_KEY_CACHE_SLABS STRING_ARG
1756 OUTYY(("P(server_key_cache_slabs:%s)\n", $2));
1758 yyerror("number expected");
1760 cfg_parser->cfg->key_cache_slabs = atoi($2);
1761 if(!is_pow2(cfg_parser->cfg->key_cache_slabs))
1762 yyerror("must be a power of 2");
1767 server_neg_cache_size: VAR_NEG_CACHE_SIZE STRING_ARG
1769 OUTYY(("P(server_neg_cache_size:%s)\n", $2));
1770 if(!cfg_parse_memsize($2, &cfg_parser->cfg->neg_cache_size))
1771 yyerror("memory size expected");
1775 server_local_zone: VAR_LOCAL_ZONE STRING_ARG STRING_ARG
1777 OUTYY(("P(server_local_zone:%s %s)\n", $2, $3));
1778 if(strcmp($3, "static")!=0 && strcmp($3, "deny")!=0 &&
1779 strcmp($3, "refuse")!=0 && strcmp($3, "redirect")!=0 &&
1780 strcmp($3, "transparent")!=0 && strcmp($3, "nodefault")!=0
1781 && strcmp($3, "typetransparent")!=0
1782 && strcmp($3, "always_transparent")!=0
1783 && strcmp($3, "always_refuse")!=0
1784 && strcmp($3, "always_nxdomain")!=0
1785 && strcmp($3, "noview")!=0
1786 && strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0
1787 && strcmp($3, "inform_redirect") != 0) {
1788 yyerror("local-zone type: expected static, deny, "
1789 "refuse, redirect, transparent, "
1790 "typetransparent, inform, inform_deny, "
1791 "inform_redirect, always_transparent, "
1792 "always_refuse, always_nxdomain, noview "
1796 } else if(strcmp($3, "nodefault")==0) {
1797 if(!cfg_strlist_insert(&cfg_parser->cfg->
1798 local_zones_nodefault, $2))
1799 fatal_exit("out of memory adding local-zone");
1802 if(!cfg_str2list_insert(&cfg_parser->cfg->local_zones,
1804 fatal_exit("out of memory adding local-zone");
1808 server_local_data: VAR_LOCAL_DATA STRING_ARG
1810 OUTYY(("P(server_local_data:%s)\n", $2));
1811 if(!cfg_strlist_insert(&cfg_parser->cfg->local_data, $2))
1812 fatal_exit("out of memory adding local-data");
1815 server_local_data_ptr: VAR_LOCAL_DATA_PTR STRING_ARG
1818 OUTYY(("P(server_local_data_ptr:%s)\n", $2));
1819 ptr = cfg_ptr_reverse($2);
1822 if(!cfg_strlist_insert(&cfg_parser->cfg->
1824 fatal_exit("out of memory adding local-data");
1826 yyerror("local-data-ptr could not be reversed");
1830 server_minimal_responses: VAR_MINIMAL_RESPONSES STRING_ARG
1832 OUTYY(("P(server_minimal_responses:%s)\n", $2));
1833 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1834 yyerror("expected yes or no.");
1835 else cfg_parser->cfg->minimal_responses =
1836 (strcmp($2, "yes")==0);
1840 server_rrset_roundrobin: VAR_RRSET_ROUNDROBIN STRING_ARG
1842 OUTYY(("P(server_rrset_roundrobin:%s)\n", $2));
1843 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1844 yyerror("expected yes or no.");
1845 else cfg_parser->cfg->rrset_roundrobin =
1846 (strcmp($2, "yes")==0);
1850 server_unknown_server_time_limit: VAR_UNKNOWN_SERVER_TIME_LIMIT STRING_ARG
1852 OUTYY(("P(server_unknown_server_time_limit:%s)\n", $2));
1853 cfg_parser->cfg->unknown_server_time_limit = atoi($2);
1857 server_max_udp_size: VAR_MAX_UDP_SIZE STRING_ARG
1859 OUTYY(("P(server_max_udp_size:%s)\n", $2));
1860 cfg_parser->cfg->max_udp_size = atoi($2);
1864 server_dns64_prefix: VAR_DNS64_PREFIX STRING_ARG
1866 OUTYY(("P(dns64_prefix:%s)\n", $2));
1867 free(cfg_parser->cfg->dns64_prefix);
1868 cfg_parser->cfg->dns64_prefix = $2;
1871 server_dns64_synthall: VAR_DNS64_SYNTHALL STRING_ARG
1873 OUTYY(("P(server_dns64_synthall:%s)\n", $2));
1874 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1875 yyerror("expected yes or no.");
1876 else cfg_parser->cfg->dns64_synthall = (strcmp($2, "yes")==0);
1880 server_dns64_ignore_aaaa: VAR_DNS64_IGNORE_AAAA STRING_ARG
1882 OUTYY(("P(dns64_ignore_aaaa:%s)\n", $2));
1883 if(!cfg_strlist_insert(&cfg_parser->cfg->dns64_ignore_aaaa,
1885 fatal_exit("out of memory adding dns64-ignore-aaaa");
1888 server_define_tag: VAR_DEFINE_TAG STRING_ARG
1891 OUTYY(("P(server_define_tag:%s)\n", $2));
1892 while((p=strsep(&s, " \t\n")) != NULL) {
1894 if(!config_add_tag(cfg_parser->cfg, p))
1895 yyerror("could not define-tag, "
1902 server_local_zone_tag: VAR_LOCAL_ZONE_TAG STRING_ARG STRING_ARG
1905 uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3,
1908 OUTYY(("P(server_local_zone_tag:%s)\n", $2));
1910 yyerror("could not parse tags, (define-tag them first)");
1914 if(!cfg_strbytelist_insert(
1915 &cfg_parser->cfg->local_zone_tags,
1916 $2, bitlist, len)) {
1917 yyerror("out of memory");
1923 server_access_control_tag: VAR_ACCESS_CONTROL_TAG STRING_ARG STRING_ARG
1926 uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3,
1929 OUTYY(("P(server_access_control_tag:%s)\n", $2));
1931 yyerror("could not parse tags, (define-tag them first)");
1935 if(!cfg_strbytelist_insert(
1936 &cfg_parser->cfg->acl_tags,
1937 $2, bitlist, len)) {
1938 yyerror("out of memory");
1944 server_access_control_tag_action: VAR_ACCESS_CONTROL_TAG_ACTION STRING_ARG STRING_ARG STRING_ARG
1946 OUTYY(("P(server_access_control_tag_action:%s %s %s)\n", $2, $3, $4));
1947 if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_actions,
1949 yyerror("out of memory");
1956 server_access_control_tag_data: VAR_ACCESS_CONTROL_TAG_DATA STRING_ARG STRING_ARG STRING_ARG
1958 OUTYY(("P(server_access_control_tag_data:%s %s %s)\n", $2, $3, $4));
1959 if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_datas,
1961 yyerror("out of memory");
1968 server_local_zone_override: VAR_LOCAL_ZONE_OVERRIDE STRING_ARG STRING_ARG STRING_ARG
1970 OUTYY(("P(server_local_zone_override:%s %s %s)\n", $2, $3, $4));
1971 if(!cfg_str3list_insert(&cfg_parser->cfg->local_zone_overrides,
1973 yyerror("out of memory");
1980 server_access_control_view: VAR_ACCESS_CONTROL_VIEW STRING_ARG STRING_ARG
1982 OUTYY(("P(server_access_control_view:%s %s)\n", $2, $3));
1983 if(!cfg_str2list_insert(&cfg_parser->cfg->acl_view,
1985 yyerror("out of memory");
1989 server_response_ip_tag: VAR_RESPONSE_IP_TAG STRING_ARG STRING_ARG
1992 uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3,
1995 OUTYY(("P(response_ip_tag:%s)\n", $2));
1997 yyerror("could not parse tags, (define-tag them first)");
2001 if(!cfg_strbytelist_insert(
2002 &cfg_parser->cfg->respip_tags,
2003 $2, bitlist, len)) {
2004 yyerror("out of memory");
2010 server_ip_ratelimit: VAR_IP_RATELIMIT STRING_ARG
2012 OUTYY(("P(server_ip_ratelimit:%s)\n", $2));
2013 if(atoi($2) == 0 && strcmp($2, "0") != 0)
2014 yyerror("number expected");
2015 else cfg_parser->cfg->ip_ratelimit = atoi($2);
2020 server_ratelimit: VAR_RATELIMIT STRING_ARG
2022 OUTYY(("P(server_ratelimit:%s)\n", $2));
2023 if(atoi($2) == 0 && strcmp($2, "0") != 0)
2024 yyerror("number expected");
2025 else cfg_parser->cfg->ratelimit = atoi($2);
2029 server_ip_ratelimit_size: VAR_IP_RATELIMIT_SIZE STRING_ARG
2031 OUTYY(("P(server_ip_ratelimit_size:%s)\n", $2));
2032 if(!cfg_parse_memsize($2, &cfg_parser->cfg->ip_ratelimit_size))
2033 yyerror("memory size expected");
2037 server_ratelimit_size: VAR_RATELIMIT_SIZE STRING_ARG
2039 OUTYY(("P(server_ratelimit_size:%s)\n", $2));
2040 if(!cfg_parse_memsize($2, &cfg_parser->cfg->ratelimit_size))
2041 yyerror("memory size expected");
2045 server_ip_ratelimit_slabs: VAR_IP_RATELIMIT_SLABS STRING_ARG
2047 OUTYY(("P(server_ip_ratelimit_slabs:%s)\n", $2));
2049 yyerror("number expected");
2051 cfg_parser->cfg->ip_ratelimit_slabs = atoi($2);
2052 if(!is_pow2(cfg_parser->cfg->ip_ratelimit_slabs))
2053 yyerror("must be a power of 2");
2058 server_ratelimit_slabs: VAR_RATELIMIT_SLABS STRING_ARG
2060 OUTYY(("P(server_ratelimit_slabs:%s)\n", $2));
2062 yyerror("number expected");
2064 cfg_parser->cfg->ratelimit_slabs = atoi($2);
2065 if(!is_pow2(cfg_parser->cfg->ratelimit_slabs))
2066 yyerror("must be a power of 2");
2071 server_ratelimit_for_domain: VAR_RATELIMIT_FOR_DOMAIN STRING_ARG STRING_ARG
2073 OUTYY(("P(server_ratelimit_for_domain:%s %s)\n", $2, $3));
2074 if(atoi($3) == 0 && strcmp($3, "0") != 0) {
2075 yyerror("number expected");
2079 if(!cfg_str2list_insert(&cfg_parser->cfg->
2080 ratelimit_for_domain, $2, $3))
2081 fatal_exit("out of memory adding "
2082 "ratelimit-for-domain");
2086 server_ratelimit_below_domain: VAR_RATELIMIT_BELOW_DOMAIN STRING_ARG STRING_ARG
2088 OUTYY(("P(server_ratelimit_below_domain:%s %s)\n", $2, $3));
2089 if(atoi($3) == 0 && strcmp($3, "0") != 0) {
2090 yyerror("number expected");
2094 if(!cfg_str2list_insert(&cfg_parser->cfg->
2095 ratelimit_below_domain, $2, $3))
2096 fatal_exit("out of memory adding "
2097 "ratelimit-below-domain");
2101 server_ip_ratelimit_factor: VAR_IP_RATELIMIT_FACTOR STRING_ARG
2103 OUTYY(("P(server_ip_ratelimit_factor:%s)\n", $2));
2104 if(atoi($2) == 0 && strcmp($2, "0") != 0)
2105 yyerror("number expected");
2106 else cfg_parser->cfg->ip_ratelimit_factor = atoi($2);
2110 server_ratelimit_factor: VAR_RATELIMIT_FACTOR STRING_ARG
2112 OUTYY(("P(server_ratelimit_factor:%s)\n", $2));
2113 if(atoi($2) == 0 && strcmp($2, "0") != 0)
2114 yyerror("number expected");
2115 else cfg_parser->cfg->ratelimit_factor = atoi($2);
2119 server_low_rtt: VAR_LOW_RTT STRING_ARG
2121 OUTYY(("P(low-rtt option is deprecated, use fast-server-num instead)\n"));
2125 server_fast_server_num: VAR_FAST_SERVER_NUM STRING_ARG
2127 OUTYY(("P(server_fast_server_num:%s)\n", $2));
2129 yyerror("number expected");
2130 else cfg_parser->cfg->fast_server_num = atoi($2);
2134 server_fast_server_permil: VAR_FAST_SERVER_PERMIL STRING_ARG
2136 OUTYY(("P(server_fast_server_permil:%s)\n", $2));
2137 if(atoi($2) == 0 && strcmp($2, "0") != 0)
2138 yyerror("number expected");
2139 else cfg_parser->cfg->fast_server_permil = atoi($2);
2143 server_qname_minimisation: VAR_QNAME_MINIMISATION STRING_ARG
2145 OUTYY(("P(server_qname_minimisation:%s)\n", $2));
2146 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2147 yyerror("expected yes or no.");
2148 else cfg_parser->cfg->qname_minimisation =
2149 (strcmp($2, "yes")==0);
2153 server_qname_minimisation_strict: VAR_QNAME_MINIMISATION_STRICT STRING_ARG
2155 OUTYY(("P(server_qname_minimisation_strict:%s)\n", $2));
2156 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2157 yyerror("expected yes or no.");
2158 else cfg_parser->cfg->qname_minimisation_strict =
2159 (strcmp($2, "yes")==0);
2163 server_ipsecmod_enabled: VAR_IPSECMOD_ENABLED STRING_ARG
2166 OUTYY(("P(server_ipsecmod_enabled:%s)\n", $2));
2167 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2168 yyerror("expected yes or no.");
2169 else cfg_parser->cfg->ipsecmod_enabled = (strcmp($2, "yes")==0);
2171 OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2176 server_ipsecmod_ignore_bogus: VAR_IPSECMOD_IGNORE_BOGUS STRING_ARG
2179 OUTYY(("P(server_ipsecmod_ignore_bogus:%s)\n", $2));
2180 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2181 yyerror("expected yes or no.");
2182 else cfg_parser->cfg->ipsecmod_ignore_bogus = (strcmp($2, "yes")==0);
2184 OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2189 server_ipsecmod_hook: VAR_IPSECMOD_HOOK STRING_ARG
2192 OUTYY(("P(server_ipsecmod_hook:%s)\n", $2));
2193 free(cfg_parser->cfg->ipsecmod_hook);
2194 cfg_parser->cfg->ipsecmod_hook = $2;
2196 OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2201 server_ipsecmod_max_ttl: VAR_IPSECMOD_MAX_TTL STRING_ARG
2204 OUTYY(("P(server_ipsecmod_max_ttl:%s)\n", $2));
2205 if(atoi($2) == 0 && strcmp($2, "0") != 0)
2206 yyerror("number expected");
2207 else cfg_parser->cfg->ipsecmod_max_ttl = atoi($2);
2210 OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2215 server_ipsecmod_whitelist: VAR_IPSECMOD_WHITELIST STRING_ARG
2218 OUTYY(("P(server_ipsecmod_whitelist:%s)\n", $2));
2219 if(!cfg_strlist_insert(&cfg_parser->cfg->ipsecmod_whitelist, $2))
2220 yyerror("out of memory");
2222 OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2227 server_ipsecmod_strict: VAR_IPSECMOD_STRICT STRING_ARG
2230 OUTYY(("P(server_ipsecmod_strict:%s)\n", $2));
2231 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2232 yyerror("expected yes or no.");
2233 else cfg_parser->cfg->ipsecmod_strict = (strcmp($2, "yes")==0);
2236 OUTYY(("P(Compiled without IPsec module, ignoring)\n"));
2241 stub_name: VAR_NAME STRING_ARG
2243 OUTYY(("P(name:%s)\n", $2));
2244 if(cfg_parser->cfg->stubs->name)
2245 yyerror("stub name override, there must be one name "
2246 "for one stub-zone");
2247 free(cfg_parser->cfg->stubs->name);
2248 cfg_parser->cfg->stubs->name = $2;
2251 stub_host: VAR_STUB_HOST STRING_ARG
2253 OUTYY(("P(stub-host:%s)\n", $2));
2254 if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->hosts, $2))
2255 yyerror("out of memory");
2258 stub_addr: VAR_STUB_ADDR STRING_ARG
2260 OUTYY(("P(stub-addr:%s)\n", $2));
2261 if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->addrs, $2))
2262 yyerror("out of memory");
2265 stub_first: VAR_STUB_FIRST STRING_ARG
2267 OUTYY(("P(stub-first:%s)\n", $2));
2268 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2269 yyerror("expected yes or no.");
2270 else cfg_parser->cfg->stubs->isfirst=(strcmp($2, "yes")==0);
2274 stub_no_cache: VAR_STUB_NO_CACHE STRING_ARG
2276 OUTYY(("P(stub-no-cache:%s)\n", $2));
2277 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2278 yyerror("expected yes or no.");
2279 else cfg_parser->cfg->stubs->no_cache=(strcmp($2, "yes")==0);
2283 stub_ssl_upstream: VAR_STUB_SSL_UPSTREAM STRING_ARG
2285 OUTYY(("P(stub-ssl-upstream:%s)\n", $2));
2286 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2287 yyerror("expected yes or no.");
2288 else cfg_parser->cfg->stubs->ssl_upstream =
2289 (strcmp($2, "yes")==0);
2293 stub_prime: VAR_STUB_PRIME STRING_ARG
2295 OUTYY(("P(stub-prime:%s)\n", $2));
2296 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2297 yyerror("expected yes or no.");
2298 else cfg_parser->cfg->stubs->isprime =
2299 (strcmp($2, "yes")==0);
2303 forward_name: VAR_NAME STRING_ARG
2305 OUTYY(("P(name:%s)\n", $2));
2306 if(cfg_parser->cfg->forwards->name)
2307 yyerror("forward name override, there must be one "
2308 "name for one forward-zone");
2309 free(cfg_parser->cfg->forwards->name);
2310 cfg_parser->cfg->forwards->name = $2;
2313 forward_host: VAR_FORWARD_HOST STRING_ARG
2315 OUTYY(("P(forward-host:%s)\n", $2));
2316 if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->hosts, $2))
2317 yyerror("out of memory");
2320 forward_addr: VAR_FORWARD_ADDR STRING_ARG
2322 OUTYY(("P(forward-addr:%s)\n", $2));
2323 if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->addrs, $2))
2324 yyerror("out of memory");
2327 forward_first: VAR_FORWARD_FIRST STRING_ARG
2329 OUTYY(("P(forward-first:%s)\n", $2));
2330 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2331 yyerror("expected yes or no.");
2332 else cfg_parser->cfg->forwards->isfirst=(strcmp($2, "yes")==0);
2336 forward_no_cache: VAR_FORWARD_NO_CACHE STRING_ARG
2338 OUTYY(("P(forward-no-cache:%s)\n", $2));
2339 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2340 yyerror("expected yes or no.");
2341 else cfg_parser->cfg->forwards->no_cache=(strcmp($2, "yes")==0);
2345 forward_ssl_upstream: VAR_FORWARD_SSL_UPSTREAM STRING_ARG
2347 OUTYY(("P(forward-ssl-upstream:%s)\n", $2));
2348 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2349 yyerror("expected yes or no.");
2350 else cfg_parser->cfg->forwards->ssl_upstream =
2351 (strcmp($2, "yes")==0);
2355 auth_name: VAR_NAME STRING_ARG
2357 OUTYY(("P(name:%s)\n", $2));
2358 if(cfg_parser->cfg->auths->name)
2359 yyerror("auth name override, there must be one name "
2360 "for one auth-zone");
2361 free(cfg_parser->cfg->auths->name);
2362 cfg_parser->cfg->auths->name = $2;
2365 auth_zonefile: VAR_ZONEFILE STRING_ARG
2367 OUTYY(("P(zonefile:%s)\n", $2));
2368 free(cfg_parser->cfg->auths->zonefile);
2369 cfg_parser->cfg->auths->zonefile = $2;
2372 auth_master: VAR_MASTER STRING_ARG
2374 OUTYY(("P(master:%s)\n", $2));
2375 if(!cfg_strlist_insert(&cfg_parser->cfg->auths->masters, $2))
2376 yyerror("out of memory");
2379 auth_url: VAR_URL STRING_ARG
2381 OUTYY(("P(url:%s)\n", $2));
2382 if(!cfg_strlist_insert(&cfg_parser->cfg->auths->urls, $2))
2383 yyerror("out of memory");
2386 auth_allow_notify: VAR_ALLOW_NOTIFY STRING_ARG
2388 OUTYY(("P(allow-notify:%s)\n", $2));
2389 if(!cfg_strlist_insert(&cfg_parser->cfg->auths->allow_notify,
2391 yyerror("out of memory");
2394 auth_for_downstream: VAR_FOR_DOWNSTREAM STRING_ARG
2396 OUTYY(("P(for-downstream:%s)\n", $2));
2397 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2398 yyerror("expected yes or no.");
2399 else cfg_parser->cfg->auths->for_downstream =
2400 (strcmp($2, "yes")==0);
2404 auth_for_upstream: VAR_FOR_UPSTREAM STRING_ARG
2406 OUTYY(("P(for-upstream:%s)\n", $2));
2407 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2408 yyerror("expected yes or no.");
2409 else cfg_parser->cfg->auths->for_upstream =
2410 (strcmp($2, "yes")==0);
2414 auth_fallback_enabled: VAR_FALLBACK_ENABLED STRING_ARG
2416 OUTYY(("P(fallback-enabled:%s)\n", $2));
2417 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2418 yyerror("expected yes or no.");
2419 else cfg_parser->cfg->auths->fallback_enabled =
2420 (strcmp($2, "yes")==0);
2424 view_name: VAR_NAME STRING_ARG
2426 OUTYY(("P(name:%s)\n", $2));
2427 if(cfg_parser->cfg->views->name)
2428 yyerror("view name override, there must be one "
2429 "name for one view");
2430 free(cfg_parser->cfg->views->name);
2431 cfg_parser->cfg->views->name = $2;
2434 view_local_zone: VAR_LOCAL_ZONE STRING_ARG STRING_ARG
2436 OUTYY(("P(view_local_zone:%s %s)\n", $2, $3));
2437 if(strcmp($3, "static")!=0 && strcmp($3, "deny")!=0 &&
2438 strcmp($3, "refuse")!=0 && strcmp($3, "redirect")!=0 &&
2439 strcmp($3, "transparent")!=0 && strcmp($3, "nodefault")!=0
2440 && strcmp($3, "typetransparent")!=0
2441 && strcmp($3, "always_transparent")!=0
2442 && strcmp($3, "always_refuse")!=0
2443 && strcmp($3, "always_nxdomain")!=0
2444 && strcmp($3, "noview")!=0
2445 && strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0) {
2446 yyerror("local-zone type: expected static, deny, "
2447 "refuse, redirect, transparent, "
2448 "typetransparent, inform, inform_deny, "
2449 "always_transparent, always_refuse, "
2450 "always_nxdomain, noview or nodefault");
2453 } else if(strcmp($3, "nodefault")==0) {
2454 if(!cfg_strlist_insert(&cfg_parser->cfg->views->
2455 local_zones_nodefault, $2))
2456 fatal_exit("out of memory adding local-zone");
2459 if(!cfg_str2list_insert(
2460 &cfg_parser->cfg->views->local_zones,
2462 fatal_exit("out of memory adding local-zone");
2466 view_response_ip: VAR_RESPONSE_IP STRING_ARG STRING_ARG
2468 OUTYY(("P(view_response_ip:%s %s)\n", $2, $3));
2469 validate_respip_action($3);
2470 if(!cfg_str2list_insert(
2471 &cfg_parser->cfg->views->respip_actions, $2, $3))
2472 fatal_exit("out of memory adding per-view "
2473 "response-ip action");
2476 view_response_ip_data: VAR_RESPONSE_IP_DATA STRING_ARG STRING_ARG
2478 OUTYY(("P(view_response_ip_data:%s)\n", $2));
2479 if(!cfg_str2list_insert(
2480 &cfg_parser->cfg->views->respip_data, $2, $3))
2481 fatal_exit("out of memory adding response-ip-data");
2484 view_local_data: VAR_LOCAL_DATA STRING_ARG
2486 OUTYY(("P(view_local_data:%s)\n", $2));
2487 if(!cfg_strlist_insert(&cfg_parser->cfg->views->local_data, $2)) {
2488 fatal_exit("out of memory adding local-data");
2492 view_local_data_ptr: VAR_LOCAL_DATA_PTR STRING_ARG
2495 OUTYY(("P(view_local_data_ptr:%s)\n", $2));
2496 ptr = cfg_ptr_reverse($2);
2499 if(!cfg_strlist_insert(&cfg_parser->cfg->views->
2501 fatal_exit("out of memory adding local-data");
2503 yyerror("local-data-ptr could not be reversed");
2507 view_first: VAR_VIEW_FIRST STRING_ARG
2509 OUTYY(("P(view-first:%s)\n", $2));
2510 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2511 yyerror("expected yes or no.");
2512 else cfg_parser->cfg->views->isfirst=(strcmp($2, "yes")==0);
2516 rcstart: VAR_REMOTE_CONTROL
2518 OUTYY(("\nP(remote-control:)\n"));
2521 contents_rc: contents_rc content_rc
2523 content_rc: rc_control_enable | rc_control_interface | rc_control_port |
2524 rc_server_key_file | rc_server_cert_file | rc_control_key_file |
2525 rc_control_cert_file | rc_control_use_cert
2527 rc_control_enable: VAR_CONTROL_ENABLE STRING_ARG
2529 OUTYY(("P(control_enable:%s)\n", $2));
2530 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2531 yyerror("expected yes or no.");
2532 else cfg_parser->cfg->remote_control_enable =
2533 (strcmp($2, "yes")==0);
2537 rc_control_port: VAR_CONTROL_PORT STRING_ARG
2539 OUTYY(("P(control_port:%s)\n", $2));
2541 yyerror("control port number expected");
2542 else cfg_parser->cfg->control_port = atoi($2);
2546 rc_control_interface: VAR_CONTROL_INTERFACE STRING_ARG
2548 OUTYY(("P(control_interface:%s)\n", $2));
2549 if(!cfg_strlist_append(&cfg_parser->cfg->control_ifs, $2))
2550 yyerror("out of memory");
2553 rc_control_use_cert: VAR_CONTROL_USE_CERT STRING_ARG
2555 OUTYY(("P(control_use_cert:%s)\n", $2));
2556 cfg_parser->cfg->control_use_cert = (strcmp($2, "yes")==0);
2560 rc_server_key_file: VAR_SERVER_KEY_FILE STRING_ARG
2562 OUTYY(("P(rc_server_key_file:%s)\n", $2));
2563 free(cfg_parser->cfg->server_key_file);
2564 cfg_parser->cfg->server_key_file = $2;
2567 rc_server_cert_file: VAR_SERVER_CERT_FILE STRING_ARG
2569 OUTYY(("P(rc_server_cert_file:%s)\n", $2));
2570 free(cfg_parser->cfg->server_cert_file);
2571 cfg_parser->cfg->server_cert_file = $2;
2574 rc_control_key_file: VAR_CONTROL_KEY_FILE STRING_ARG
2576 OUTYY(("P(rc_control_key_file:%s)\n", $2));
2577 free(cfg_parser->cfg->control_key_file);
2578 cfg_parser->cfg->control_key_file = $2;
2581 rc_control_cert_file: VAR_CONTROL_CERT_FILE STRING_ARG
2583 OUTYY(("P(rc_control_cert_file:%s)\n", $2));
2584 free(cfg_parser->cfg->control_cert_file);
2585 cfg_parser->cfg->control_cert_file = $2;
2590 OUTYY(("\nP(dnstap:)\n"));
2593 contents_dt: contents_dt content_dt
2595 content_dt: dt_dnstap_enable | dt_dnstap_socket_path |
2596 dt_dnstap_send_identity | dt_dnstap_send_version |
2597 dt_dnstap_identity | dt_dnstap_version |
2598 dt_dnstap_log_resolver_query_messages |
2599 dt_dnstap_log_resolver_response_messages |
2600 dt_dnstap_log_client_query_messages |
2601 dt_dnstap_log_client_response_messages |
2602 dt_dnstap_log_forwarder_query_messages |
2603 dt_dnstap_log_forwarder_response_messages
2605 dt_dnstap_enable: VAR_DNSTAP_ENABLE STRING_ARG
2607 OUTYY(("P(dt_dnstap_enable:%s)\n", $2));
2608 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2609 yyerror("expected yes or no.");
2610 else cfg_parser->cfg->dnstap = (strcmp($2, "yes")==0);
2614 dt_dnstap_socket_path: VAR_DNSTAP_SOCKET_PATH STRING_ARG
2616 OUTYY(("P(dt_dnstap_socket_path:%s)\n", $2));
2617 free(cfg_parser->cfg->dnstap_socket_path);
2618 cfg_parser->cfg->dnstap_socket_path = $2;
2621 dt_dnstap_send_identity: VAR_DNSTAP_SEND_IDENTITY STRING_ARG
2623 OUTYY(("P(dt_dnstap_send_identity:%s)\n", $2));
2624 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2625 yyerror("expected yes or no.");
2626 else cfg_parser->cfg->dnstap_send_identity = (strcmp($2, "yes")==0);
2630 dt_dnstap_send_version: VAR_DNSTAP_SEND_VERSION STRING_ARG
2632 OUTYY(("P(dt_dnstap_send_version:%s)\n", $2));
2633 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2634 yyerror("expected yes or no.");
2635 else cfg_parser->cfg->dnstap_send_version = (strcmp($2, "yes")==0);
2639 dt_dnstap_identity: VAR_DNSTAP_IDENTITY STRING_ARG
2641 OUTYY(("P(dt_dnstap_identity:%s)\n", $2));
2642 free(cfg_parser->cfg->dnstap_identity);
2643 cfg_parser->cfg->dnstap_identity = $2;
2646 dt_dnstap_version: VAR_DNSTAP_VERSION STRING_ARG
2648 OUTYY(("P(dt_dnstap_version:%s)\n", $2));
2649 free(cfg_parser->cfg->dnstap_version);
2650 cfg_parser->cfg->dnstap_version = $2;
2653 dt_dnstap_log_resolver_query_messages: VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES STRING_ARG
2655 OUTYY(("P(dt_dnstap_log_resolver_query_messages:%s)\n", $2));
2656 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2657 yyerror("expected yes or no.");
2658 else cfg_parser->cfg->dnstap_log_resolver_query_messages =
2659 (strcmp($2, "yes")==0);
2663 dt_dnstap_log_resolver_response_messages: VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES STRING_ARG
2665 OUTYY(("P(dt_dnstap_log_resolver_response_messages:%s)\n", $2));
2666 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2667 yyerror("expected yes or no.");
2668 else cfg_parser->cfg->dnstap_log_resolver_response_messages =
2669 (strcmp($2, "yes")==0);
2673 dt_dnstap_log_client_query_messages: VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES STRING_ARG
2675 OUTYY(("P(dt_dnstap_log_client_query_messages:%s)\n", $2));
2676 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2677 yyerror("expected yes or no.");
2678 else cfg_parser->cfg->dnstap_log_client_query_messages =
2679 (strcmp($2, "yes")==0);
2683 dt_dnstap_log_client_response_messages: VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES STRING_ARG
2685 OUTYY(("P(dt_dnstap_log_client_response_messages:%s)\n", $2));
2686 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2687 yyerror("expected yes or no.");
2688 else cfg_parser->cfg->dnstap_log_client_response_messages =
2689 (strcmp($2, "yes")==0);
2693 dt_dnstap_log_forwarder_query_messages: VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES STRING_ARG
2695 OUTYY(("P(dt_dnstap_log_forwarder_query_messages:%s)\n", $2));
2696 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2697 yyerror("expected yes or no.");
2698 else cfg_parser->cfg->dnstap_log_forwarder_query_messages =
2699 (strcmp($2, "yes")==0);
2703 dt_dnstap_log_forwarder_response_messages: VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES STRING_ARG
2705 OUTYY(("P(dt_dnstap_log_forwarder_response_messages:%s)\n", $2));
2706 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2707 yyerror("expected yes or no.");
2708 else cfg_parser->cfg->dnstap_log_forwarder_response_messages =
2709 (strcmp($2, "yes")==0);
2713 pythonstart: VAR_PYTHON
2715 OUTYY(("\nP(python:)\n"));
2718 contents_py: contents_py content_py
2720 content_py: py_script
2722 py_script: VAR_PYTHON_SCRIPT STRING_ARG
2724 OUTYY(("P(python-script:%s)\n", $2));
2725 free(cfg_parser->cfg->python_script);
2726 cfg_parser->cfg->python_script = $2;
2728 server_disable_dnssec_lame_check: VAR_DISABLE_DNSSEC_LAME_CHECK STRING_ARG
2730 OUTYY(("P(disable_dnssec_lame_check:%s)\n", $2));
2731 if (strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2732 yyerror("expected yes or no.");
2733 else cfg_parser->cfg->disable_dnssec_lame_check =
2734 (strcmp($2, "yes")==0);
2738 server_log_identity: VAR_LOG_IDENTITY STRING_ARG
2740 OUTYY(("P(server_log_identity:%s)\n", $2));
2741 free(cfg_parser->cfg->log_identity);
2742 cfg_parser->cfg->log_identity = $2;
2745 server_response_ip: VAR_RESPONSE_IP STRING_ARG STRING_ARG
2747 OUTYY(("P(server_response_ip:%s %s)\n", $2, $3));
2748 validate_respip_action($3);
2749 if(!cfg_str2list_insert(&cfg_parser->cfg->respip_actions,
2751 fatal_exit("out of memory adding response-ip");
2754 server_response_ip_data: VAR_RESPONSE_IP_DATA STRING_ARG STRING_ARG
2756 OUTYY(("P(server_response_ip_data:%s)\n", $2));
2757 if(!cfg_str2list_insert(&cfg_parser->cfg->respip_data,
2759 fatal_exit("out of memory adding response-ip-data");
2762 dnscstart: VAR_DNSCRYPT
2764 OUTYY(("\nP(dnscrypt:)\n"));
2767 contents_dnsc: contents_dnsc content_dnsc
2770 dnsc_dnscrypt_enable | dnsc_dnscrypt_port | dnsc_dnscrypt_provider |
2771 dnsc_dnscrypt_secret_key | dnsc_dnscrypt_provider_cert |
2772 dnsc_dnscrypt_provider_cert_rotated |
2773 dnsc_dnscrypt_shared_secret_cache_size |
2774 dnsc_dnscrypt_shared_secret_cache_slabs |
2775 dnsc_dnscrypt_nonce_cache_size |
2776 dnsc_dnscrypt_nonce_cache_slabs
2778 dnsc_dnscrypt_enable: VAR_DNSCRYPT_ENABLE STRING_ARG
2780 OUTYY(("P(dnsc_dnscrypt_enable:%s)\n", $2));
2781 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
2782 yyerror("expected yes or no.");
2783 else cfg_parser->cfg->dnscrypt = (strcmp($2, "yes")==0);
2788 dnsc_dnscrypt_port: VAR_DNSCRYPT_PORT STRING_ARG
2790 OUTYY(("P(dnsc_dnscrypt_port:%s)\n", $2));
2792 yyerror("port number expected");
2793 else cfg_parser->cfg->dnscrypt_port = atoi($2);
2797 dnsc_dnscrypt_provider: VAR_DNSCRYPT_PROVIDER STRING_ARG
2799 OUTYY(("P(dnsc_dnscrypt_provider:%s)\n", $2));
2800 free(cfg_parser->cfg->dnscrypt_provider);
2801 cfg_parser->cfg->dnscrypt_provider = $2;
2804 dnsc_dnscrypt_provider_cert: VAR_DNSCRYPT_PROVIDER_CERT STRING_ARG
2806 OUTYY(("P(dnsc_dnscrypt_provider_cert:%s)\n", $2));
2807 if(cfg_strlist_find(cfg_parser->cfg->dnscrypt_provider_cert, $2))
2808 log_warn("dnscrypt-provider-cert %s is a duplicate", $2);
2809 if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_provider_cert, $2))
2810 fatal_exit("out of memory adding dnscrypt-provider-cert");
2813 dnsc_dnscrypt_provider_cert_rotated: VAR_DNSCRYPT_PROVIDER_CERT_ROTATED STRING_ARG
2815 OUTYY(("P(dnsc_dnscrypt_provider_cert_rotated:%s)\n", $2));
2816 if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_provider_cert_rotated, $2))
2817 fatal_exit("out of memory adding dnscrypt-provider-cert-rotated");
2820 dnsc_dnscrypt_secret_key: VAR_DNSCRYPT_SECRET_KEY STRING_ARG
2822 OUTYY(("P(dnsc_dnscrypt_secret_key:%s)\n", $2));
2823 if(cfg_strlist_find(cfg_parser->cfg->dnscrypt_secret_key, $2))
2824 log_warn("dnscrypt-secret-key: %s is a duplicate", $2);
2825 if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_secret_key, $2))
2826 fatal_exit("out of memory adding dnscrypt-secret-key");
2829 dnsc_dnscrypt_shared_secret_cache_size: VAR_DNSCRYPT_SHARED_SECRET_CACHE_SIZE STRING_ARG
2831 OUTYY(("P(dnscrypt_shared_secret_cache_size:%s)\n", $2));
2832 if(!cfg_parse_memsize($2, &cfg_parser->cfg->dnscrypt_shared_secret_cache_size))
2833 yyerror("memory size expected");
2837 dnsc_dnscrypt_shared_secret_cache_slabs: VAR_DNSCRYPT_SHARED_SECRET_CACHE_SLABS STRING_ARG
2839 OUTYY(("P(dnscrypt_shared_secret_cache_slabs:%s)\n", $2));
2841 yyerror("number expected");
2843 cfg_parser->cfg->dnscrypt_shared_secret_cache_slabs = atoi($2);
2844 if(!is_pow2(cfg_parser->cfg->dnscrypt_shared_secret_cache_slabs))
2845 yyerror("must be a power of 2");
2850 dnsc_dnscrypt_nonce_cache_size: VAR_DNSCRYPT_NONCE_CACHE_SIZE STRING_ARG
2852 OUTYY(("P(dnscrypt_nonce_cache_size:%s)\n", $2));
2853 if(!cfg_parse_memsize($2, &cfg_parser->cfg->dnscrypt_nonce_cache_size))
2854 yyerror("memory size expected");
2858 dnsc_dnscrypt_nonce_cache_slabs: VAR_DNSCRYPT_NONCE_CACHE_SLABS STRING_ARG
2860 OUTYY(("P(dnscrypt_nonce_cache_slabs:%s)\n", $2));
2862 yyerror("number expected");
2864 cfg_parser->cfg->dnscrypt_nonce_cache_slabs = atoi($2);
2865 if(!is_pow2(cfg_parser->cfg->dnscrypt_nonce_cache_slabs))
2866 yyerror("must be a power of 2");
2871 cachedbstart: VAR_CACHEDB
2873 OUTYY(("\nP(cachedb:)\n"));
2876 contents_cachedb: contents_cachedb content_cachedb
2878 content_cachedb: cachedb_backend_name | cachedb_secret_seed |
2879 redis_server_host | redis_server_port | redis_timeout
2881 cachedb_backend_name: VAR_CACHEDB_BACKEND STRING_ARG
2884 OUTYY(("P(backend:%s)\n", $2));
2885 if(cfg_parser->cfg->cachedb_backend)
2886 yyerror("cachedb backend override, there must be one "
2888 free(cfg_parser->cfg->cachedb_backend);
2889 cfg_parser->cfg->cachedb_backend = $2;
2891 OUTYY(("P(Compiled without cachedb, ignoring)\n"));
2896 cachedb_secret_seed: VAR_CACHEDB_SECRETSEED STRING_ARG
2899 OUTYY(("P(secret-seed:%s)\n", $2));
2900 if(cfg_parser->cfg->cachedb_secret)
2901 yyerror("cachedb secret-seed override, there must be "
2903 free(cfg_parser->cfg->cachedb_secret);
2904 cfg_parser->cfg->cachedb_secret = $2;
2906 OUTYY(("P(Compiled without cachedb, ignoring)\n"));
2911 redis_server_host: VAR_CACHEDB_REDISHOST STRING_ARG
2913 #if defined(USE_CACHEDB) && defined(USE_REDIS)
2914 OUTYY(("P(redis_server_host:%s)\n", $2));
2915 free(cfg_parser->cfg->redis_server_host);
2916 cfg_parser->cfg->redis_server_host = $2;
2918 OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
2923 redis_server_port: VAR_CACHEDB_REDISPORT STRING_ARG
2925 #if defined(USE_CACHEDB) && defined(USE_REDIS)
2927 OUTYY(("P(redis_server_port:%s)\n", $2));
2929 if(port == 0 || port < 0 || port > 65535)
2930 yyerror("valid redis server port number expected");
2931 else cfg_parser->cfg->redis_server_port = port;
2933 OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
2938 redis_timeout: VAR_CACHEDB_REDISTIMEOUT STRING_ARG
2940 #if defined(USE_CACHEDB) && defined(USE_REDIS)
2941 OUTYY(("P(redis_timeout:%s)\n", $2));
2943 yyerror("redis timeout value expected");
2944 else cfg_parser->cfg->redis_timeout = atoi($2);
2946 OUTYY(("P(Compiled without cachedb or redis, ignoring)\n"));
2951 server_tcp_connection_limit: VAR_TCP_CONNECTION_LIMIT STRING_ARG STRING_ARG
2953 OUTYY(("P(server_tcp_connection_limit:%s %s)\n", $2, $3));
2955 yyerror("positive number expected");
2957 if(!cfg_str2list_insert(&cfg_parser->cfg->tcp_connection_limits, $2, $3))
2958 fatal_exit("out of memory adding tcp connection limit");
2964 /* parse helper routines could be here */
2966 validate_respip_action(const char* action)
2968 if(strcmp(action, "deny")!=0 &&
2969 strcmp(action, "redirect")!=0 &&
2970 strcmp(action, "inform")!=0 &&
2971 strcmp(action, "inform_deny")!=0 &&
2972 strcmp(action, "always_transparent")!=0 &&
2973 strcmp(action, "always_refuse")!=0 &&
2974 strcmp(action, "always_nxdomain")!=0)
2976 yyerror("response-ip action: expected deny, redirect, "
2977 "inform, inform_deny, always_transparent, "
2978 "always_refuse or always_nxdomain");