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 /* these need to be global, otherwise they cannot be used inside yacc */
55 extern struct config_parser_state* cfg_parser;
58 #define OUTYY(s) printf s /* used ONLY when debugging */
68 %token SPACE LETTER NEWLINE COMMENT COLON ANY ZONESTR
69 %token <str> STRING_ARG
70 %token VAR_SERVER VAR_VERBOSITY VAR_NUM_THREADS VAR_PORT
71 %token VAR_OUTGOING_RANGE VAR_INTERFACE
72 %token VAR_DO_IP4 VAR_DO_IP6 VAR_PREFER_IP6 VAR_DO_UDP VAR_DO_TCP
73 %token VAR_TCP_MSS VAR_OUTGOING_TCP_MSS
74 %token VAR_CHROOT VAR_USERNAME VAR_DIRECTORY VAR_LOGFILE VAR_PIDFILE
75 %token VAR_MSG_CACHE_SIZE VAR_MSG_CACHE_SLABS VAR_NUM_QUERIES_PER_THREAD
76 %token VAR_RRSET_CACHE_SIZE VAR_RRSET_CACHE_SLABS VAR_OUTGOING_NUM_TCP
77 %token VAR_INFRA_HOST_TTL VAR_INFRA_LAME_TTL VAR_INFRA_CACHE_SLABS
78 %token VAR_INFRA_CACHE_NUMHOSTS VAR_INFRA_CACHE_LAME_SIZE VAR_NAME
79 %token VAR_STUB_ZONE VAR_STUB_HOST VAR_STUB_ADDR VAR_TARGET_FETCH_POLICY
80 %token VAR_HARDEN_SHORT_BUFSIZE VAR_HARDEN_LARGE_QUERIES
81 %token VAR_FORWARD_ZONE VAR_FORWARD_HOST VAR_FORWARD_ADDR
82 %token VAR_DO_NOT_QUERY_ADDRESS VAR_HIDE_IDENTITY VAR_HIDE_VERSION
83 %token VAR_IDENTITY VAR_VERSION VAR_HARDEN_GLUE VAR_MODULE_CONF
84 %token VAR_TRUST_ANCHOR_FILE VAR_TRUST_ANCHOR VAR_VAL_OVERRIDE_DATE
85 %token VAR_BOGUS_TTL VAR_VAL_CLEAN_ADDITIONAL VAR_VAL_PERMISSIVE_MODE
86 %token VAR_INCOMING_NUM_TCP VAR_MSG_BUFFER_SIZE VAR_KEY_CACHE_SIZE
87 %token VAR_KEY_CACHE_SLABS VAR_TRUSTED_KEYS_FILE
88 %token VAR_VAL_NSEC3_KEYSIZE_ITERATIONS VAR_USE_SYSLOG
89 %token VAR_OUTGOING_INTERFACE VAR_ROOT_HINTS VAR_DO_NOT_QUERY_LOCALHOST
90 %token VAR_CACHE_MAX_TTL VAR_HARDEN_DNSSEC_STRIPPED VAR_ACCESS_CONTROL
91 %token VAR_LOCAL_ZONE VAR_LOCAL_DATA VAR_INTERFACE_AUTOMATIC
92 %token VAR_STATISTICS_INTERVAL VAR_DO_DAEMONIZE VAR_USE_CAPS_FOR_ID
93 %token VAR_STATISTICS_CUMULATIVE VAR_OUTGOING_PORT_PERMIT
94 %token VAR_OUTGOING_PORT_AVOID VAR_DLV_ANCHOR_FILE VAR_DLV_ANCHOR
95 %token VAR_NEG_CACHE_SIZE VAR_HARDEN_REFERRAL_PATH VAR_PRIVATE_ADDRESS
96 %token VAR_PRIVATE_DOMAIN VAR_REMOTE_CONTROL VAR_CONTROL_ENABLE
97 %token VAR_CONTROL_INTERFACE VAR_CONTROL_PORT VAR_SERVER_KEY_FILE
98 %token VAR_SERVER_CERT_FILE VAR_CONTROL_KEY_FILE VAR_CONTROL_CERT_FILE
99 %token VAR_CONTROL_USE_CERT
100 %token VAR_EXTENDED_STATISTICS VAR_LOCAL_DATA_PTR VAR_JOSTLE_TIMEOUT
101 %token VAR_STUB_PRIME VAR_UNWANTED_REPLY_THRESHOLD VAR_LOG_TIME_ASCII
102 %token VAR_DOMAIN_INSECURE VAR_PYTHON VAR_PYTHON_SCRIPT VAR_VAL_SIG_SKEW_MIN
103 %token VAR_VAL_SIG_SKEW_MAX VAR_CACHE_MIN_TTL VAR_VAL_LOG_LEVEL
104 %token VAR_AUTO_TRUST_ANCHOR_FILE VAR_KEEP_MISSING VAR_ADD_HOLDDOWN
105 %token VAR_DEL_HOLDDOWN VAR_SO_RCVBUF VAR_EDNS_BUFFER_SIZE VAR_PREFETCH
106 %token VAR_PREFETCH_KEY VAR_SO_SNDBUF VAR_SO_REUSEPORT VAR_HARDEN_BELOW_NXDOMAIN
107 %token VAR_IGNORE_CD_FLAG VAR_LOG_QUERIES VAR_TCP_UPSTREAM VAR_SSL_UPSTREAM
108 %token VAR_SSL_SERVICE_KEY VAR_SSL_SERVICE_PEM VAR_SSL_PORT VAR_FORWARD_FIRST
109 %token VAR_STUB_SSL_UPSTREAM VAR_FORWARD_SSL_UPSTREAM
110 %token VAR_STUB_FIRST VAR_MINIMAL_RESPONSES VAR_RRSET_ROUNDROBIN
111 %token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE
112 %token VAR_UNBLOCK_LAN_ZONES VAR_INSECURE_LAN_ZONES
113 %token VAR_INFRA_CACHE_MIN_RTT
114 %token VAR_DNS64_PREFIX VAR_DNS64_SYNTHALL
115 %token VAR_DNSTAP VAR_DNSTAP_ENABLE VAR_DNSTAP_SOCKET_PATH
116 %token VAR_DNSTAP_SEND_IDENTITY VAR_DNSTAP_SEND_VERSION
117 %token VAR_DNSTAP_IDENTITY VAR_DNSTAP_VERSION
118 %token VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES
119 %token VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES
120 %token VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES
121 %token VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES
122 %token VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES
123 %token VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES
124 %token VAR_HARDEN_ALGO_DOWNGRADE VAR_IP_TRANSPARENT
125 %token VAR_DISABLE_DNSSEC_LAME_CHECK
126 %token VAR_RATELIMIT VAR_RATELIMIT_SLABS VAR_RATELIMIT_SIZE
127 %token VAR_RATELIMIT_FOR_DOMAIN VAR_RATELIMIT_BELOW_DOMAIN VAR_RATELIMIT_FACTOR
128 %token VAR_CAPS_WHITELIST VAR_CACHE_MAX_NEGATIVE_TTL VAR_PERMIT_SMALL_HOLDDOWN
129 %token VAR_QNAME_MINIMISATION VAR_QNAME_MINIMISATION_STRICT VAR_IP_FREEBIND
130 %token VAR_DEFINE_TAG VAR_LOCAL_ZONE_TAG VAR_ACCESS_CONTROL_TAG
131 %token VAR_LOCAL_ZONE_OVERRIDE VAR_ACCESS_CONTROL_TAG_ACTION
132 %token VAR_ACCESS_CONTROL_TAG_DATA VAR_VIEW VAR_ACCESS_CONTROL_VIEW
133 %token VAR_VIEW_FIRST VAR_SERVE_EXPIRED VAR_FAKE_DSA
134 %token VAR_LOG_IDENTITY
137 toplevelvars: /* empty */ | toplevelvars toplevelvar ;
138 toplevelvar: serverstart contents_server | stubstart contents_stub |
139 forwardstart contents_forward | pythonstart contents_py |
140 rcstart contents_rc | dtstart contents_dt | viewstart
144 /* server: declaration */
145 serverstart: VAR_SERVER
147 OUTYY(("\nP(server:)\n"));
150 contents_server: contents_server content_server
152 content_server: server_num_threads | server_verbosity | server_port |
153 server_outgoing_range | server_do_ip4 |
154 server_do_ip6 | server_prefer_ip6 |
155 server_do_udp | server_do_tcp |
156 server_tcp_mss | server_outgoing_tcp_mss |
157 server_interface | server_chroot | server_username |
158 server_directory | server_logfile | server_pidfile |
159 server_msg_cache_size | server_msg_cache_slabs |
160 server_num_queries_per_thread | server_rrset_cache_size |
161 server_rrset_cache_slabs | server_outgoing_num_tcp |
162 server_infra_host_ttl | server_infra_lame_ttl |
163 server_infra_cache_slabs | server_infra_cache_numhosts |
164 server_infra_cache_lame_size | server_target_fetch_policy |
165 server_harden_short_bufsize | server_harden_large_queries |
166 server_do_not_query_address | server_hide_identity |
167 server_hide_version | server_identity | server_version |
168 server_harden_glue | server_module_conf | server_trust_anchor_file |
169 server_trust_anchor | server_val_override_date | server_bogus_ttl |
170 server_val_clean_additional | server_val_permissive_mode |
171 server_incoming_num_tcp | server_msg_buffer_size |
172 server_key_cache_size | server_key_cache_slabs |
173 server_trusted_keys_file | server_val_nsec3_keysize_iterations |
174 server_use_syslog | server_outgoing_interface | server_root_hints |
175 server_do_not_query_localhost | server_cache_max_ttl |
176 server_harden_dnssec_stripped | server_access_control |
177 server_local_zone | server_local_data | server_interface_automatic |
178 server_statistics_interval | server_do_daemonize |
179 server_use_caps_for_id | server_statistics_cumulative |
180 server_outgoing_port_permit | server_outgoing_port_avoid |
181 server_dlv_anchor_file | server_dlv_anchor | server_neg_cache_size |
182 server_harden_referral_path | server_private_address |
183 server_private_domain | server_extended_statistics |
184 server_local_data_ptr | server_jostle_timeout |
185 server_unwanted_reply_threshold | server_log_time_ascii |
186 server_domain_insecure | server_val_sig_skew_min |
187 server_val_sig_skew_max | server_cache_min_ttl | server_val_log_level |
188 server_auto_trust_anchor_file | server_add_holddown |
189 server_del_holddown | server_keep_missing | server_so_rcvbuf |
190 server_edns_buffer_size | server_prefetch | server_prefetch_key |
191 server_so_sndbuf | server_harden_below_nxdomain | server_ignore_cd_flag |
192 server_log_queries | server_tcp_upstream | server_ssl_upstream |
193 server_ssl_service_key | server_ssl_service_pem | server_ssl_port |
194 server_minimal_responses | server_rrset_roundrobin | server_max_udp_size |
195 server_so_reuseport | server_delay_close |
196 server_unblock_lan_zones | server_insecure_lan_zones |
197 server_dns64_prefix | server_dns64_synthall |
198 server_infra_cache_min_rtt | server_harden_algo_downgrade |
199 server_ip_transparent | server_ratelimit | server_ratelimit_slabs |
200 server_ratelimit_size | server_ratelimit_for_domain |
201 server_ratelimit_below_domain | server_ratelimit_factor |
202 server_caps_whitelist | server_cache_max_negative_ttl |
203 server_permit_small_holddown | server_qname_minimisation |
204 server_ip_freebind | server_define_tag | server_local_zone_tag |
205 server_disable_dnssec_lame_check | server_access_control_tag |
206 server_local_zone_override | server_access_control_tag_action |
207 server_access_control_tag_data | server_access_control_view |
208 server_qname_minimisation_strict | server_serve_expired |
209 server_fake_dsa | server_log_identity
211 stubstart: VAR_STUB_ZONE
213 struct config_stub* s;
214 OUTYY(("\nP(stub_zone:)\n"));
215 s = (struct config_stub*)calloc(1, sizeof(struct config_stub));
217 s->next = cfg_parser->cfg->stubs;
218 cfg_parser->cfg->stubs = s;
220 yyerror("out of memory");
223 contents_stub: contents_stub content_stub
225 content_stub: stub_name | stub_host | stub_addr | stub_prime | stub_first |
228 forwardstart: VAR_FORWARD_ZONE
230 struct config_stub* s;
231 OUTYY(("\nP(forward_zone:)\n"));
232 s = (struct config_stub*)calloc(1, sizeof(struct config_stub));
234 s->next = cfg_parser->cfg->forwards;
235 cfg_parser->cfg->forwards = s;
237 yyerror("out of memory");
240 contents_forward: contents_forward content_forward
242 content_forward: forward_name | forward_host | forward_addr | forward_first |
247 struct config_view* s;
248 OUTYY(("\nP(view:)\n"));
249 s = (struct config_view*)calloc(1, sizeof(struct config_view));
251 s->next = cfg_parser->cfg->views;
252 if(s->next && !s->next->name)
253 yyerror("view without name");
254 cfg_parser->cfg->views = s;
256 yyerror("out of memory");
259 contents_view: contents_view content_view
261 content_view: view_name | view_local_zone | view_local_data | view_first
263 server_num_threads: VAR_NUM_THREADS STRING_ARG
265 OUTYY(("P(server_num_threads:%s)\n", $2));
266 if(atoi($2) == 0 && strcmp($2, "0") != 0)
267 yyerror("number expected");
268 else cfg_parser->cfg->num_threads = atoi($2);
272 server_verbosity: VAR_VERBOSITY STRING_ARG
274 OUTYY(("P(server_verbosity:%s)\n", $2));
275 if(atoi($2) == 0 && strcmp($2, "0") != 0)
276 yyerror("number expected");
277 else cfg_parser->cfg->verbosity = atoi($2);
281 server_statistics_interval: VAR_STATISTICS_INTERVAL STRING_ARG
283 OUTYY(("P(server_statistics_interval:%s)\n", $2));
284 if(strcmp($2, "") == 0 || strcmp($2, "0") == 0)
285 cfg_parser->cfg->stat_interval = 0;
286 else if(atoi($2) == 0)
287 yyerror("number expected");
288 else cfg_parser->cfg->stat_interval = atoi($2);
292 server_statistics_cumulative: VAR_STATISTICS_CUMULATIVE STRING_ARG
294 OUTYY(("P(server_statistics_cumulative:%s)\n", $2));
295 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
296 yyerror("expected yes or no.");
297 else cfg_parser->cfg->stat_cumulative = (strcmp($2, "yes")==0);
301 server_extended_statistics: VAR_EXTENDED_STATISTICS STRING_ARG
303 OUTYY(("P(server_extended_statistics:%s)\n", $2));
304 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
305 yyerror("expected yes or no.");
306 else cfg_parser->cfg->stat_extended = (strcmp($2, "yes")==0);
310 server_port: VAR_PORT STRING_ARG
312 OUTYY(("P(server_port:%s)\n", $2));
314 yyerror("port number expected");
315 else cfg_parser->cfg->port = atoi($2);
319 server_interface: VAR_INTERFACE STRING_ARG
321 OUTYY(("P(server_interface:%s)\n", $2));
322 if(cfg_parser->cfg->num_ifs == 0)
323 cfg_parser->cfg->ifs = calloc(1, sizeof(char*));
324 else cfg_parser->cfg->ifs = realloc(cfg_parser->cfg->ifs,
325 (cfg_parser->cfg->num_ifs+1)*sizeof(char*));
326 if(!cfg_parser->cfg->ifs)
327 yyerror("out of memory");
329 cfg_parser->cfg->ifs[cfg_parser->cfg->num_ifs++] = $2;
332 server_outgoing_interface: VAR_OUTGOING_INTERFACE STRING_ARG
334 OUTYY(("P(server_outgoing_interface:%s)\n", $2));
335 if(cfg_parser->cfg->num_out_ifs == 0)
336 cfg_parser->cfg->out_ifs = calloc(1, sizeof(char*));
337 else cfg_parser->cfg->out_ifs = realloc(
338 cfg_parser->cfg->out_ifs,
339 (cfg_parser->cfg->num_out_ifs+1)*sizeof(char*));
340 if(!cfg_parser->cfg->out_ifs)
341 yyerror("out of memory");
343 cfg_parser->cfg->out_ifs[
344 cfg_parser->cfg->num_out_ifs++] = $2;
347 server_outgoing_range: VAR_OUTGOING_RANGE STRING_ARG
349 OUTYY(("P(server_outgoing_range:%s)\n", $2));
351 yyerror("number expected");
352 else cfg_parser->cfg->outgoing_num_ports = atoi($2);
356 server_outgoing_port_permit: VAR_OUTGOING_PORT_PERMIT STRING_ARG
358 OUTYY(("P(server_outgoing_port_permit:%s)\n", $2));
359 if(!cfg_mark_ports($2, 1,
360 cfg_parser->cfg->outgoing_avail_ports, 65536))
361 yyerror("port number or range (\"low-high\") expected");
365 server_outgoing_port_avoid: VAR_OUTGOING_PORT_AVOID STRING_ARG
367 OUTYY(("P(server_outgoing_port_avoid:%s)\n", $2));
368 if(!cfg_mark_ports($2, 0,
369 cfg_parser->cfg->outgoing_avail_ports, 65536))
370 yyerror("port number or range (\"low-high\") expected");
374 server_outgoing_num_tcp: VAR_OUTGOING_NUM_TCP STRING_ARG
376 OUTYY(("P(server_outgoing_num_tcp:%s)\n", $2));
377 if(atoi($2) == 0 && strcmp($2, "0") != 0)
378 yyerror("number expected");
379 else cfg_parser->cfg->outgoing_num_tcp = atoi($2);
383 server_incoming_num_tcp: VAR_INCOMING_NUM_TCP STRING_ARG
385 OUTYY(("P(server_incoming_num_tcp:%s)\n", $2));
386 if(atoi($2) == 0 && strcmp($2, "0") != 0)
387 yyerror("number expected");
388 else cfg_parser->cfg->incoming_num_tcp = atoi($2);
392 server_interface_automatic: VAR_INTERFACE_AUTOMATIC STRING_ARG
394 OUTYY(("P(server_interface_automatic:%s)\n", $2));
395 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
396 yyerror("expected yes or no.");
397 else cfg_parser->cfg->if_automatic = (strcmp($2, "yes")==0);
401 server_do_ip4: VAR_DO_IP4 STRING_ARG
403 OUTYY(("P(server_do_ip4:%s)\n", $2));
404 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
405 yyerror("expected yes or no.");
406 else cfg_parser->cfg->do_ip4 = (strcmp($2, "yes")==0);
410 server_do_ip6: VAR_DO_IP6 STRING_ARG
412 OUTYY(("P(server_do_ip6:%s)\n", $2));
413 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
414 yyerror("expected yes or no.");
415 else cfg_parser->cfg->do_ip6 = (strcmp($2, "yes")==0);
419 server_do_udp: VAR_DO_UDP STRING_ARG
421 OUTYY(("P(server_do_udp:%s)\n", $2));
422 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
423 yyerror("expected yes or no.");
424 else cfg_parser->cfg->do_udp = (strcmp($2, "yes")==0);
428 server_do_tcp: VAR_DO_TCP STRING_ARG
430 OUTYY(("P(server_do_tcp:%s)\n", $2));
431 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
432 yyerror("expected yes or no.");
433 else cfg_parser->cfg->do_tcp = (strcmp($2, "yes")==0);
437 server_prefer_ip6: VAR_PREFER_IP6 STRING_ARG
439 OUTYY(("P(server_prefer_ip6:%s)\n", $2));
440 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
441 yyerror("expected yes or no.");
442 else cfg_parser->cfg->prefer_ip6 = (strcmp($2, "yes")==0);
446 server_tcp_mss: VAR_TCP_MSS STRING_ARG
448 OUTYY(("P(server_tcp_mss:%s)\n", $2));
449 if(atoi($2) == 0 && strcmp($2, "0") != 0)
450 yyerror("number expected");
451 else cfg_parser->cfg->tcp_mss = atoi($2);
455 server_outgoing_tcp_mss: VAR_OUTGOING_TCP_MSS STRING_ARG
457 OUTYY(("P(server_outgoing_tcp_mss:%s)\n", $2));
458 if(atoi($2) == 0 && strcmp($2, "0") != 0)
459 yyerror("number expected");
460 else cfg_parser->cfg->outgoing_tcp_mss = atoi($2);
464 server_tcp_upstream: VAR_TCP_UPSTREAM STRING_ARG
466 OUTYY(("P(server_tcp_upstream:%s)\n", $2));
467 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
468 yyerror("expected yes or no.");
469 else cfg_parser->cfg->tcp_upstream = (strcmp($2, "yes")==0);
473 server_ssl_upstream: VAR_SSL_UPSTREAM STRING_ARG
475 OUTYY(("P(server_ssl_upstream:%s)\n", $2));
476 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
477 yyerror("expected yes or no.");
478 else cfg_parser->cfg->ssl_upstream = (strcmp($2, "yes")==0);
482 server_ssl_service_key: VAR_SSL_SERVICE_KEY STRING_ARG
484 OUTYY(("P(server_ssl_service_key:%s)\n", $2));
485 free(cfg_parser->cfg->ssl_service_key);
486 cfg_parser->cfg->ssl_service_key = $2;
489 server_ssl_service_pem: VAR_SSL_SERVICE_PEM STRING_ARG
491 OUTYY(("P(server_ssl_service_pem:%s)\n", $2));
492 free(cfg_parser->cfg->ssl_service_pem);
493 cfg_parser->cfg->ssl_service_pem = $2;
496 server_ssl_port: VAR_SSL_PORT STRING_ARG
498 OUTYY(("P(server_ssl_port:%s)\n", $2));
500 yyerror("port number expected");
501 else cfg_parser->cfg->ssl_port = atoi($2);
505 server_do_daemonize: VAR_DO_DAEMONIZE STRING_ARG
507 OUTYY(("P(server_do_daemonize:%s)\n", $2));
508 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
509 yyerror("expected yes or no.");
510 else cfg_parser->cfg->do_daemonize = (strcmp($2, "yes")==0);
514 server_use_syslog: VAR_USE_SYSLOG STRING_ARG
516 OUTYY(("P(server_use_syslog:%s)\n", $2));
517 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
518 yyerror("expected yes or no.");
519 else cfg_parser->cfg->use_syslog = (strcmp($2, "yes")==0);
520 #if !defined(HAVE_SYSLOG_H) && !defined(UB_ON_WINDOWS)
521 if(strcmp($2, "yes") == 0)
522 yyerror("no syslog services are available. "
523 "(reconfigure and compile to add)");
528 server_log_time_ascii: VAR_LOG_TIME_ASCII STRING_ARG
530 OUTYY(("P(server_log_time_ascii:%s)\n", $2));
531 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
532 yyerror("expected yes or no.");
533 else cfg_parser->cfg->log_time_ascii = (strcmp($2, "yes")==0);
537 server_log_queries: VAR_LOG_QUERIES STRING_ARG
539 OUTYY(("P(server_log_queries:%s)\n", $2));
540 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
541 yyerror("expected yes or no.");
542 else cfg_parser->cfg->log_queries = (strcmp($2, "yes")==0);
546 server_chroot: VAR_CHROOT STRING_ARG
548 OUTYY(("P(server_chroot:%s)\n", $2));
549 free(cfg_parser->cfg->chrootdir);
550 cfg_parser->cfg->chrootdir = $2;
553 server_username: VAR_USERNAME STRING_ARG
555 OUTYY(("P(server_username:%s)\n", $2));
556 free(cfg_parser->cfg->username);
557 cfg_parser->cfg->username = $2;
560 server_directory: VAR_DIRECTORY STRING_ARG
562 OUTYY(("P(server_directory:%s)\n", $2));
563 free(cfg_parser->cfg->directory);
564 cfg_parser->cfg->directory = $2;
565 /* change there right away for includes relative to this */
569 w_config_adjust_directory(cfg_parser->cfg);
571 d = cfg_parser->cfg->directory;
572 /* adjust directory if we have already chroot,
573 * like, we reread after sighup */
574 if(cfg_parser->chroot && cfg_parser->chroot[0] &&
575 strncmp(d, cfg_parser->chroot, strlen(
576 cfg_parser->chroot)) == 0)
577 d += strlen(cfg_parser->chroot);
579 log_err("cannot chdir to directory: %s (%s)",
584 server_logfile: VAR_LOGFILE STRING_ARG
586 OUTYY(("P(server_logfile:%s)\n", $2));
587 free(cfg_parser->cfg->logfile);
588 cfg_parser->cfg->logfile = $2;
589 cfg_parser->cfg->use_syslog = 0;
592 server_pidfile: VAR_PIDFILE STRING_ARG
594 OUTYY(("P(server_pidfile:%s)\n", $2));
595 free(cfg_parser->cfg->pidfile);
596 cfg_parser->cfg->pidfile = $2;
599 server_root_hints: VAR_ROOT_HINTS STRING_ARG
601 OUTYY(("P(server_root_hints:%s)\n", $2));
602 if(!cfg_strlist_insert(&cfg_parser->cfg->root_hints, $2))
603 yyerror("out of memory");
606 server_dlv_anchor_file: VAR_DLV_ANCHOR_FILE STRING_ARG
608 OUTYY(("P(server_dlv_anchor_file:%s)\n", $2));
609 free(cfg_parser->cfg->dlv_anchor_file);
610 cfg_parser->cfg->dlv_anchor_file = $2;
613 server_dlv_anchor: VAR_DLV_ANCHOR STRING_ARG
615 OUTYY(("P(server_dlv_anchor:%s)\n", $2));
616 if(!cfg_strlist_insert(&cfg_parser->cfg->dlv_anchor_list, $2))
617 yyerror("out of memory");
620 server_auto_trust_anchor_file: VAR_AUTO_TRUST_ANCHOR_FILE STRING_ARG
622 OUTYY(("P(server_auto_trust_anchor_file:%s)\n", $2));
623 if(!cfg_strlist_insert(&cfg_parser->cfg->
624 auto_trust_anchor_file_list, $2))
625 yyerror("out of memory");
628 server_trust_anchor_file: VAR_TRUST_ANCHOR_FILE STRING_ARG
630 OUTYY(("P(server_trust_anchor_file:%s)\n", $2));
631 if(!cfg_strlist_insert(&cfg_parser->cfg->
632 trust_anchor_file_list, $2))
633 yyerror("out of memory");
636 server_trusted_keys_file: VAR_TRUSTED_KEYS_FILE STRING_ARG
638 OUTYY(("P(server_trusted_keys_file:%s)\n", $2));
639 if(!cfg_strlist_insert(&cfg_parser->cfg->
640 trusted_keys_file_list, $2))
641 yyerror("out of memory");
644 server_trust_anchor: VAR_TRUST_ANCHOR STRING_ARG
646 OUTYY(("P(server_trust_anchor:%s)\n", $2));
647 if(!cfg_strlist_insert(&cfg_parser->cfg->trust_anchor_list, $2))
648 yyerror("out of memory");
651 server_domain_insecure: VAR_DOMAIN_INSECURE STRING_ARG
653 OUTYY(("P(server_domain_insecure:%s)\n", $2));
654 if(!cfg_strlist_insert(&cfg_parser->cfg->domain_insecure, $2))
655 yyerror("out of memory");
658 server_hide_identity: VAR_HIDE_IDENTITY STRING_ARG
660 OUTYY(("P(server_hide_identity:%s)\n", $2));
661 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
662 yyerror("expected yes or no.");
663 else cfg_parser->cfg->hide_identity = (strcmp($2, "yes")==0);
667 server_hide_version: VAR_HIDE_VERSION STRING_ARG
669 OUTYY(("P(server_hide_version:%s)\n", $2));
670 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
671 yyerror("expected yes or no.");
672 else cfg_parser->cfg->hide_version = (strcmp($2, "yes")==0);
676 server_identity: VAR_IDENTITY STRING_ARG
678 OUTYY(("P(server_identity:%s)\n", $2));
679 free(cfg_parser->cfg->identity);
680 cfg_parser->cfg->identity = $2;
683 server_version: VAR_VERSION STRING_ARG
685 OUTYY(("P(server_version:%s)\n", $2));
686 free(cfg_parser->cfg->version);
687 cfg_parser->cfg->version = $2;
690 server_so_rcvbuf: VAR_SO_RCVBUF STRING_ARG
692 OUTYY(("P(server_so_rcvbuf:%s)\n", $2));
693 if(!cfg_parse_memsize($2, &cfg_parser->cfg->so_rcvbuf))
694 yyerror("buffer size expected");
698 server_so_sndbuf: VAR_SO_SNDBUF STRING_ARG
700 OUTYY(("P(server_so_sndbuf:%s)\n", $2));
701 if(!cfg_parse_memsize($2, &cfg_parser->cfg->so_sndbuf))
702 yyerror("buffer size expected");
706 server_so_reuseport: VAR_SO_REUSEPORT STRING_ARG
708 OUTYY(("P(server_so_reuseport:%s)\n", $2));
709 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
710 yyerror("expected yes or no.");
711 else cfg_parser->cfg->so_reuseport =
712 (strcmp($2, "yes")==0);
716 server_ip_transparent: VAR_IP_TRANSPARENT STRING_ARG
718 OUTYY(("P(server_ip_transparent:%s)\n", $2));
719 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
720 yyerror("expected yes or no.");
721 else cfg_parser->cfg->ip_transparent =
722 (strcmp($2, "yes")==0);
726 server_ip_freebind: VAR_IP_FREEBIND STRING_ARG
728 OUTYY(("P(server_ip_freebind:%s)\n", $2));
729 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
730 yyerror("expected yes or no.");
731 else cfg_parser->cfg->ip_freebind =
732 (strcmp($2, "yes")==0);
736 server_edns_buffer_size: VAR_EDNS_BUFFER_SIZE STRING_ARG
738 OUTYY(("P(server_edns_buffer_size:%s)\n", $2));
740 yyerror("number expected");
741 else if (atoi($2) < 12)
742 yyerror("edns buffer size too small");
743 else if (atoi($2) > 65535)
744 cfg_parser->cfg->edns_buffer_size = 65535;
745 else cfg_parser->cfg->edns_buffer_size = atoi($2);
749 server_msg_buffer_size: VAR_MSG_BUFFER_SIZE STRING_ARG
751 OUTYY(("P(server_msg_buffer_size:%s)\n", $2));
753 yyerror("number expected");
754 else if (atoi($2) < 4096)
755 yyerror("message buffer size too small (use 4096)");
756 else cfg_parser->cfg->msg_buffer_size = atoi($2);
760 server_msg_cache_size: VAR_MSG_CACHE_SIZE STRING_ARG
762 OUTYY(("P(server_msg_cache_size:%s)\n", $2));
763 if(!cfg_parse_memsize($2, &cfg_parser->cfg->msg_cache_size))
764 yyerror("memory size expected");
768 server_msg_cache_slabs: VAR_MSG_CACHE_SLABS STRING_ARG
770 OUTYY(("P(server_msg_cache_slabs:%s)\n", $2));
772 yyerror("number expected");
774 cfg_parser->cfg->msg_cache_slabs = atoi($2);
775 if(!is_pow2(cfg_parser->cfg->msg_cache_slabs))
776 yyerror("must be a power of 2");
781 server_num_queries_per_thread: VAR_NUM_QUERIES_PER_THREAD STRING_ARG
783 OUTYY(("P(server_num_queries_per_thread:%s)\n", $2));
785 yyerror("number expected");
786 else cfg_parser->cfg->num_queries_per_thread = atoi($2);
790 server_jostle_timeout: VAR_JOSTLE_TIMEOUT STRING_ARG
792 OUTYY(("P(server_jostle_timeout:%s)\n", $2));
793 if(atoi($2) == 0 && strcmp($2, "0") != 0)
794 yyerror("number expected");
795 else cfg_parser->cfg->jostle_time = atoi($2);
799 server_delay_close: VAR_DELAY_CLOSE STRING_ARG
801 OUTYY(("P(server_delay_close:%s)\n", $2));
802 if(atoi($2) == 0 && strcmp($2, "0") != 0)
803 yyerror("number expected");
804 else cfg_parser->cfg->delay_close = atoi($2);
808 server_unblock_lan_zones: VAR_UNBLOCK_LAN_ZONES STRING_ARG
810 OUTYY(("P(server_unblock_lan_zones:%s)\n", $2));
811 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
812 yyerror("expected yes or no.");
813 else cfg_parser->cfg->unblock_lan_zones =
814 (strcmp($2, "yes")==0);
818 server_insecure_lan_zones: VAR_INSECURE_LAN_ZONES STRING_ARG
820 OUTYY(("P(server_insecure_lan_zones:%s)\n", $2));
821 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
822 yyerror("expected yes or no.");
823 else cfg_parser->cfg->insecure_lan_zones =
824 (strcmp($2, "yes")==0);
828 server_rrset_cache_size: VAR_RRSET_CACHE_SIZE STRING_ARG
830 OUTYY(("P(server_rrset_cache_size:%s)\n", $2));
831 if(!cfg_parse_memsize($2, &cfg_parser->cfg->rrset_cache_size))
832 yyerror("memory size expected");
836 server_rrset_cache_slabs: VAR_RRSET_CACHE_SLABS STRING_ARG
838 OUTYY(("P(server_rrset_cache_slabs:%s)\n", $2));
840 yyerror("number expected");
842 cfg_parser->cfg->rrset_cache_slabs = atoi($2);
843 if(!is_pow2(cfg_parser->cfg->rrset_cache_slabs))
844 yyerror("must be a power of 2");
849 server_infra_host_ttl: VAR_INFRA_HOST_TTL STRING_ARG
851 OUTYY(("P(server_infra_host_ttl:%s)\n", $2));
852 if(atoi($2) == 0 && strcmp($2, "0") != 0)
853 yyerror("number expected");
854 else cfg_parser->cfg->host_ttl = atoi($2);
858 server_infra_lame_ttl: VAR_INFRA_LAME_TTL STRING_ARG
860 OUTYY(("P(server_infra_lame_ttl:%s)\n", $2));
861 verbose(VERB_DETAIL, "ignored infra-lame-ttl: %s (option "
862 "removed, use infra-host-ttl)", $2);
866 server_infra_cache_numhosts: VAR_INFRA_CACHE_NUMHOSTS STRING_ARG
868 OUTYY(("P(server_infra_cache_numhosts:%s)\n", $2));
870 yyerror("number expected");
871 else cfg_parser->cfg->infra_cache_numhosts = atoi($2);
875 server_infra_cache_lame_size: VAR_INFRA_CACHE_LAME_SIZE STRING_ARG
877 OUTYY(("P(server_infra_cache_lame_size:%s)\n", $2));
878 verbose(VERB_DETAIL, "ignored infra-cache-lame-size: %s "
879 "(option removed, use infra-cache-numhosts)", $2);
883 server_infra_cache_slabs: VAR_INFRA_CACHE_SLABS STRING_ARG
885 OUTYY(("P(server_infra_cache_slabs:%s)\n", $2));
887 yyerror("number expected");
889 cfg_parser->cfg->infra_cache_slabs = atoi($2);
890 if(!is_pow2(cfg_parser->cfg->infra_cache_slabs))
891 yyerror("must be a power of 2");
896 server_infra_cache_min_rtt: VAR_INFRA_CACHE_MIN_RTT STRING_ARG
898 OUTYY(("P(server_infra_cache_min_rtt:%s)\n", $2));
899 if(atoi($2) == 0 && strcmp($2, "0") != 0)
900 yyerror("number expected");
901 else cfg_parser->cfg->infra_cache_min_rtt = atoi($2);
905 server_target_fetch_policy: VAR_TARGET_FETCH_POLICY STRING_ARG
907 OUTYY(("P(server_target_fetch_policy:%s)\n", $2));
908 free(cfg_parser->cfg->target_fetch_policy);
909 cfg_parser->cfg->target_fetch_policy = $2;
912 server_harden_short_bufsize: VAR_HARDEN_SHORT_BUFSIZE STRING_ARG
914 OUTYY(("P(server_harden_short_bufsize:%s)\n", $2));
915 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
916 yyerror("expected yes or no.");
917 else cfg_parser->cfg->harden_short_bufsize =
918 (strcmp($2, "yes")==0);
922 server_harden_large_queries: VAR_HARDEN_LARGE_QUERIES STRING_ARG
924 OUTYY(("P(server_harden_large_queries:%s)\n", $2));
925 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
926 yyerror("expected yes or no.");
927 else cfg_parser->cfg->harden_large_queries =
928 (strcmp($2, "yes")==0);
932 server_harden_glue: VAR_HARDEN_GLUE STRING_ARG
934 OUTYY(("P(server_harden_glue:%s)\n", $2));
935 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
936 yyerror("expected yes or no.");
937 else cfg_parser->cfg->harden_glue =
938 (strcmp($2, "yes")==0);
942 server_harden_dnssec_stripped: VAR_HARDEN_DNSSEC_STRIPPED STRING_ARG
944 OUTYY(("P(server_harden_dnssec_stripped:%s)\n", $2));
945 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
946 yyerror("expected yes or no.");
947 else cfg_parser->cfg->harden_dnssec_stripped =
948 (strcmp($2, "yes")==0);
952 server_harden_below_nxdomain: VAR_HARDEN_BELOW_NXDOMAIN STRING_ARG
954 OUTYY(("P(server_harden_below_nxdomain:%s)\n", $2));
955 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
956 yyerror("expected yes or no.");
957 else cfg_parser->cfg->harden_below_nxdomain =
958 (strcmp($2, "yes")==0);
962 server_harden_referral_path: VAR_HARDEN_REFERRAL_PATH STRING_ARG
964 OUTYY(("P(server_harden_referral_path:%s)\n", $2));
965 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
966 yyerror("expected yes or no.");
967 else cfg_parser->cfg->harden_referral_path =
968 (strcmp($2, "yes")==0);
972 server_harden_algo_downgrade: VAR_HARDEN_ALGO_DOWNGRADE STRING_ARG
974 OUTYY(("P(server_harden_algo_downgrade:%s)\n", $2));
975 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
976 yyerror("expected yes or no.");
977 else cfg_parser->cfg->harden_algo_downgrade =
978 (strcmp($2, "yes")==0);
982 server_use_caps_for_id: VAR_USE_CAPS_FOR_ID STRING_ARG
984 OUTYY(("P(server_use_caps_for_id:%s)\n", $2));
985 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
986 yyerror("expected yes or no.");
987 else cfg_parser->cfg->use_caps_bits_for_id =
988 (strcmp($2, "yes")==0);
992 server_caps_whitelist: VAR_CAPS_WHITELIST STRING_ARG
994 OUTYY(("P(server_caps_whitelist:%s)\n", $2));
995 if(!cfg_strlist_insert(&cfg_parser->cfg->caps_whitelist, $2))
996 yyerror("out of memory");
999 server_private_address: VAR_PRIVATE_ADDRESS STRING_ARG
1001 OUTYY(("P(server_private_address:%s)\n", $2));
1002 if(!cfg_strlist_insert(&cfg_parser->cfg->private_address, $2))
1003 yyerror("out of memory");
1006 server_private_domain: VAR_PRIVATE_DOMAIN STRING_ARG
1008 OUTYY(("P(server_private_domain:%s)\n", $2));
1009 if(!cfg_strlist_insert(&cfg_parser->cfg->private_domain, $2))
1010 yyerror("out of memory");
1013 server_prefetch: VAR_PREFETCH STRING_ARG
1015 OUTYY(("P(server_prefetch:%s)\n", $2));
1016 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1017 yyerror("expected yes or no.");
1018 else cfg_parser->cfg->prefetch = (strcmp($2, "yes")==0);
1022 server_prefetch_key: VAR_PREFETCH_KEY STRING_ARG
1024 OUTYY(("P(server_prefetch_key:%s)\n", $2));
1025 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1026 yyerror("expected yes or no.");
1027 else cfg_parser->cfg->prefetch_key = (strcmp($2, "yes")==0);
1031 server_unwanted_reply_threshold: VAR_UNWANTED_REPLY_THRESHOLD STRING_ARG
1033 OUTYY(("P(server_unwanted_reply_threshold:%s)\n", $2));
1034 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1035 yyerror("number expected");
1036 else cfg_parser->cfg->unwanted_threshold = atoi($2);
1040 server_do_not_query_address: VAR_DO_NOT_QUERY_ADDRESS STRING_ARG
1042 OUTYY(("P(server_do_not_query_address:%s)\n", $2));
1043 if(!cfg_strlist_insert(&cfg_parser->cfg->donotqueryaddrs, $2))
1044 yyerror("out of memory");
1047 server_do_not_query_localhost: VAR_DO_NOT_QUERY_LOCALHOST STRING_ARG
1049 OUTYY(("P(server_do_not_query_localhost:%s)\n", $2));
1050 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1051 yyerror("expected yes or no.");
1052 else cfg_parser->cfg->donotquery_localhost =
1053 (strcmp($2, "yes")==0);
1057 server_access_control: VAR_ACCESS_CONTROL STRING_ARG STRING_ARG
1059 OUTYY(("P(server_access_control:%s %s)\n", $2, $3));
1060 if(strcmp($3, "deny")!=0 && strcmp($3, "refuse")!=0 &&
1061 strcmp($3, "deny_non_local")!=0 &&
1062 strcmp($3, "refuse_non_local")!=0 &&
1063 strcmp($3, "allow")!=0 &&
1064 strcmp($3, "allow_snoop")!=0) {
1065 yyerror("expected deny, refuse, deny_non_local, "
1066 "refuse_non_local, allow or allow_snoop "
1067 "in access control action");
1069 if(!cfg_str2list_insert(&cfg_parser->cfg->acls, $2, $3))
1070 fatal_exit("out of memory adding acl");
1074 server_module_conf: VAR_MODULE_CONF STRING_ARG
1076 OUTYY(("P(server_module_conf:%s)\n", $2));
1077 free(cfg_parser->cfg->module_conf);
1078 cfg_parser->cfg->module_conf = $2;
1081 server_val_override_date: VAR_VAL_OVERRIDE_DATE STRING_ARG
1083 OUTYY(("P(server_val_override_date:%s)\n", $2));
1084 if(*$2 == '\0' || strcmp($2, "0") == 0) {
1085 cfg_parser->cfg->val_date_override = 0;
1086 } else if(strlen($2) == 14) {
1087 cfg_parser->cfg->val_date_override =
1088 cfg_convert_timeval($2);
1089 if(!cfg_parser->cfg->val_date_override)
1090 yyerror("bad date/time specification");
1093 yyerror("number expected");
1094 cfg_parser->cfg->val_date_override = atoi($2);
1099 server_val_sig_skew_min: VAR_VAL_SIG_SKEW_MIN STRING_ARG
1101 OUTYY(("P(server_val_sig_skew_min:%s)\n", $2));
1102 if(*$2 == '\0' || strcmp($2, "0") == 0) {
1103 cfg_parser->cfg->val_sig_skew_min = 0;
1105 cfg_parser->cfg->val_sig_skew_min = atoi($2);
1106 if(!cfg_parser->cfg->val_sig_skew_min)
1107 yyerror("number expected");
1112 server_val_sig_skew_max: VAR_VAL_SIG_SKEW_MAX STRING_ARG
1114 OUTYY(("P(server_val_sig_skew_max:%s)\n", $2));
1115 if(*$2 == '\0' || strcmp($2, "0") == 0) {
1116 cfg_parser->cfg->val_sig_skew_max = 0;
1118 cfg_parser->cfg->val_sig_skew_max = atoi($2);
1119 if(!cfg_parser->cfg->val_sig_skew_max)
1120 yyerror("number expected");
1125 server_cache_max_ttl: VAR_CACHE_MAX_TTL STRING_ARG
1127 OUTYY(("P(server_cache_max_ttl:%s)\n", $2));
1128 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1129 yyerror("number expected");
1130 else cfg_parser->cfg->max_ttl = atoi($2);
1134 server_cache_max_negative_ttl: VAR_CACHE_MAX_NEGATIVE_TTL STRING_ARG
1136 OUTYY(("P(server_cache_max_negative_ttl:%s)\n", $2));
1137 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1138 yyerror("number expected");
1139 else cfg_parser->cfg->max_negative_ttl = atoi($2);
1143 server_cache_min_ttl: VAR_CACHE_MIN_TTL STRING_ARG
1145 OUTYY(("P(server_cache_min_ttl:%s)\n", $2));
1146 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1147 yyerror("number expected");
1148 else cfg_parser->cfg->min_ttl = atoi($2);
1152 server_bogus_ttl: VAR_BOGUS_TTL STRING_ARG
1154 OUTYY(("P(server_bogus_ttl:%s)\n", $2));
1155 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1156 yyerror("number expected");
1157 else cfg_parser->cfg->bogus_ttl = atoi($2);
1161 server_val_clean_additional: VAR_VAL_CLEAN_ADDITIONAL STRING_ARG
1163 OUTYY(("P(server_val_clean_additional:%s)\n", $2));
1164 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1165 yyerror("expected yes or no.");
1166 else cfg_parser->cfg->val_clean_additional =
1167 (strcmp($2, "yes")==0);
1171 server_val_permissive_mode: VAR_VAL_PERMISSIVE_MODE STRING_ARG
1173 OUTYY(("P(server_val_permissive_mode:%s)\n", $2));
1174 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1175 yyerror("expected yes or no.");
1176 else cfg_parser->cfg->val_permissive_mode =
1177 (strcmp($2, "yes")==0);
1181 server_ignore_cd_flag: VAR_IGNORE_CD_FLAG STRING_ARG
1183 OUTYY(("P(server_ignore_cd_flag:%s)\n", $2));
1184 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1185 yyerror("expected yes or no.");
1186 else cfg_parser->cfg->ignore_cd = (strcmp($2, "yes")==0);
1190 server_serve_expired: VAR_SERVE_EXPIRED STRING_ARG
1192 OUTYY(("P(server_serve_expired:%s)\n", $2));
1193 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1194 yyerror("expected yes or no.");
1195 else cfg_parser->cfg->serve_expired = (strcmp($2, "yes")==0);
1199 server_fake_dsa: VAR_FAKE_DSA STRING_ARG
1201 OUTYY(("P(server_fake_dsa:%s)\n", $2));
1202 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1203 yyerror("expected yes or no.");
1204 else fake_dsa = (strcmp($2, "yes")==0);
1206 log_warn("test option fake_dsa is enabled");
1210 server_val_log_level: VAR_VAL_LOG_LEVEL STRING_ARG
1212 OUTYY(("P(server_val_log_level:%s)\n", $2));
1213 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1214 yyerror("number expected");
1215 else cfg_parser->cfg->val_log_level = atoi($2);
1219 server_val_nsec3_keysize_iterations: VAR_VAL_NSEC3_KEYSIZE_ITERATIONS STRING_ARG
1221 OUTYY(("P(server_val_nsec3_keysize_iterations:%s)\n", $2));
1222 free(cfg_parser->cfg->val_nsec3_key_iterations);
1223 cfg_parser->cfg->val_nsec3_key_iterations = $2;
1226 server_add_holddown: VAR_ADD_HOLDDOWN STRING_ARG
1228 OUTYY(("P(server_add_holddown:%s)\n", $2));
1229 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1230 yyerror("number expected");
1231 else cfg_parser->cfg->add_holddown = atoi($2);
1235 server_del_holddown: VAR_DEL_HOLDDOWN STRING_ARG
1237 OUTYY(("P(server_del_holddown:%s)\n", $2));
1238 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1239 yyerror("number expected");
1240 else cfg_parser->cfg->del_holddown = atoi($2);
1244 server_keep_missing: VAR_KEEP_MISSING STRING_ARG
1246 OUTYY(("P(server_keep_missing:%s)\n", $2));
1247 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1248 yyerror("number expected");
1249 else cfg_parser->cfg->keep_missing = atoi($2);
1253 server_permit_small_holddown: VAR_PERMIT_SMALL_HOLDDOWN STRING_ARG
1255 OUTYY(("P(server_permit_small_holddown:%s)\n", $2));
1256 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1257 yyerror("expected yes or no.");
1258 else cfg_parser->cfg->permit_small_holddown =
1259 (strcmp($2, "yes")==0);
1262 server_key_cache_size: VAR_KEY_CACHE_SIZE STRING_ARG
1264 OUTYY(("P(server_key_cache_size:%s)\n", $2));
1265 if(!cfg_parse_memsize($2, &cfg_parser->cfg->key_cache_size))
1266 yyerror("memory size expected");
1270 server_key_cache_slabs: VAR_KEY_CACHE_SLABS STRING_ARG
1272 OUTYY(("P(server_key_cache_slabs:%s)\n", $2));
1274 yyerror("number expected");
1276 cfg_parser->cfg->key_cache_slabs = atoi($2);
1277 if(!is_pow2(cfg_parser->cfg->key_cache_slabs))
1278 yyerror("must be a power of 2");
1283 server_neg_cache_size: VAR_NEG_CACHE_SIZE STRING_ARG
1285 OUTYY(("P(server_neg_cache_size:%s)\n", $2));
1286 if(!cfg_parse_memsize($2, &cfg_parser->cfg->neg_cache_size))
1287 yyerror("memory size expected");
1291 server_local_zone: VAR_LOCAL_ZONE STRING_ARG STRING_ARG
1293 OUTYY(("P(server_local_zone:%s %s)\n", $2, $3));
1294 if(strcmp($3, "static")!=0 && strcmp($3, "deny")!=0 &&
1295 strcmp($3, "refuse")!=0 && strcmp($3, "redirect")!=0 &&
1296 strcmp($3, "transparent")!=0 && strcmp($3, "nodefault")!=0
1297 && strcmp($3, "typetransparent")!=0
1298 && strcmp($3, "always_transparent")!=0
1299 && strcmp($3, "always_refuse")!=0
1300 && strcmp($3, "always_nxdomain")!=0
1301 && strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0)
1302 yyerror("local-zone type: expected static, deny, "
1303 "refuse, redirect, transparent, "
1304 "typetransparent, inform, inform_deny, "
1305 "always_transparent, always_refuse, "
1306 "always_nxdomain or nodefault");
1307 else if(strcmp($3, "nodefault")==0) {
1308 if(!cfg_strlist_insert(&cfg_parser->cfg->
1309 local_zones_nodefault, $2))
1310 fatal_exit("out of memory adding local-zone");
1313 if(!cfg_str2list_insert(&cfg_parser->cfg->local_zones,
1315 fatal_exit("out of memory adding local-zone");
1319 server_local_data: VAR_LOCAL_DATA STRING_ARG
1321 OUTYY(("P(server_local_data:%s)\n", $2));
1322 if(!cfg_strlist_insert(&cfg_parser->cfg->local_data, $2))
1323 fatal_exit("out of memory adding local-data");
1326 server_local_data_ptr: VAR_LOCAL_DATA_PTR STRING_ARG
1329 OUTYY(("P(server_local_data_ptr:%s)\n", $2));
1330 ptr = cfg_ptr_reverse($2);
1333 if(!cfg_strlist_insert(&cfg_parser->cfg->
1335 fatal_exit("out of memory adding local-data");
1337 yyerror("local-data-ptr could not be reversed");
1341 server_minimal_responses: VAR_MINIMAL_RESPONSES STRING_ARG
1343 OUTYY(("P(server_minimal_responses:%s)\n", $2));
1344 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1345 yyerror("expected yes or no.");
1346 else cfg_parser->cfg->minimal_responses =
1347 (strcmp($2, "yes")==0);
1351 server_rrset_roundrobin: VAR_RRSET_ROUNDROBIN STRING_ARG
1353 OUTYY(("P(server_rrset_roundrobin:%s)\n", $2));
1354 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1355 yyerror("expected yes or no.");
1356 else cfg_parser->cfg->rrset_roundrobin =
1357 (strcmp($2, "yes")==0);
1361 server_max_udp_size: VAR_MAX_UDP_SIZE STRING_ARG
1363 OUTYY(("P(server_max_udp_size:%s)\n", $2));
1364 cfg_parser->cfg->max_udp_size = atoi($2);
1368 server_dns64_prefix: VAR_DNS64_PREFIX STRING_ARG
1370 OUTYY(("P(dns64_prefix:%s)\n", $2));
1371 free(cfg_parser->cfg->dns64_prefix);
1372 cfg_parser->cfg->dns64_prefix = $2;
1375 server_dns64_synthall: VAR_DNS64_SYNTHALL STRING_ARG
1377 OUTYY(("P(server_dns64_synthall:%s)\n", $2));
1378 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1379 yyerror("expected yes or no.");
1380 else cfg_parser->cfg->dns64_synthall = (strcmp($2, "yes")==0);
1384 server_define_tag: VAR_DEFINE_TAG STRING_ARG
1387 OUTYY(("P(server_define_tag:%s)\n", $2));
1388 while((p=strsep(&s, " \t\n")) != NULL) {
1390 if(!config_add_tag(cfg_parser->cfg, p))
1391 yyerror("could not define-tag, "
1398 server_local_zone_tag: VAR_LOCAL_ZONE_TAG STRING_ARG STRING_ARG
1401 uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3,
1404 OUTYY(("P(server_local_zone_tag:%s)\n", $2));
1406 yyerror("could not parse tags, (define-tag them first)");
1408 if(!cfg_strbytelist_insert(
1409 &cfg_parser->cfg->local_zone_tags,
1410 $2, bitlist, len)) {
1411 yyerror("out of memory");
1417 server_access_control_tag: VAR_ACCESS_CONTROL_TAG STRING_ARG STRING_ARG
1420 uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3,
1423 OUTYY(("P(server_access_control_tag:%s)\n", $2));
1425 yyerror("could not parse tags, (define-tag them first)");
1427 if(!cfg_strbytelist_insert(
1428 &cfg_parser->cfg->acl_tags,
1429 $2, bitlist, len)) {
1430 yyerror("out of memory");
1436 server_access_control_tag_action: VAR_ACCESS_CONTROL_TAG_ACTION STRING_ARG STRING_ARG STRING_ARG
1438 OUTYY(("P(server_access_control_tag_action:%s %s %s)\n", $2, $3, $4));
1439 if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_actions,
1441 yyerror("out of memory");
1448 server_access_control_tag_data: VAR_ACCESS_CONTROL_TAG_DATA STRING_ARG STRING_ARG STRING_ARG
1450 OUTYY(("P(server_access_control_tag_data:%s %s %s)\n", $2, $3, $4));
1451 if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_datas,
1453 yyerror("out of memory");
1460 server_local_zone_override: VAR_LOCAL_ZONE_OVERRIDE STRING_ARG STRING_ARG STRING_ARG
1462 OUTYY(("P(server_local_zone_override:%s %s %s)\n", $2, $3, $4));
1463 if(!cfg_str3list_insert(&cfg_parser->cfg->local_zone_overrides,
1465 yyerror("out of memory");
1472 server_access_control_view: VAR_ACCESS_CONTROL_VIEW STRING_ARG STRING_ARG
1474 OUTYY(("P(server_access_control_view:%s %s)\n", $2, $3));
1475 if(!cfg_str2list_insert(&cfg_parser->cfg->acl_view,
1477 yyerror("out of memory");
1483 server_ratelimit: VAR_RATELIMIT STRING_ARG
1485 OUTYY(("P(server_ratelimit:%s)\n", $2));
1486 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1487 yyerror("number expected");
1488 else cfg_parser->cfg->ratelimit = atoi($2);
1492 server_ratelimit_size: VAR_RATELIMIT_SIZE STRING_ARG
1494 OUTYY(("P(server_ratelimit_size:%s)\n", $2));
1495 if(!cfg_parse_memsize($2, &cfg_parser->cfg->ratelimit_size))
1496 yyerror("memory size expected");
1500 server_ratelimit_slabs: VAR_RATELIMIT_SLABS STRING_ARG
1502 OUTYY(("P(server_ratelimit_slabs:%s)\n", $2));
1504 yyerror("number expected");
1506 cfg_parser->cfg->ratelimit_slabs = atoi($2);
1507 if(!is_pow2(cfg_parser->cfg->ratelimit_slabs))
1508 yyerror("must be a power of 2");
1513 server_ratelimit_for_domain: VAR_RATELIMIT_FOR_DOMAIN STRING_ARG STRING_ARG
1515 OUTYY(("P(server_ratelimit_for_domain:%s %s)\n", $2, $3));
1516 if(atoi($3) == 0 && strcmp($3, "0") != 0) {
1517 yyerror("number expected");
1519 if(!cfg_str2list_insert(&cfg_parser->cfg->
1520 ratelimit_for_domain, $2, $3))
1521 fatal_exit("out of memory adding "
1522 "ratelimit-for-domain");
1526 server_ratelimit_below_domain: VAR_RATELIMIT_BELOW_DOMAIN STRING_ARG STRING_ARG
1528 OUTYY(("P(server_ratelimit_below_domain:%s %s)\n", $2, $3));
1529 if(atoi($3) == 0 && strcmp($3, "0") != 0) {
1530 yyerror("number expected");
1532 if(!cfg_str2list_insert(&cfg_parser->cfg->
1533 ratelimit_below_domain, $2, $3))
1534 fatal_exit("out of memory adding "
1535 "ratelimit-below-domain");
1539 server_ratelimit_factor: VAR_RATELIMIT_FACTOR STRING_ARG
1541 OUTYY(("P(server_ratelimit_factor:%s)\n", $2));
1542 if(atoi($2) == 0 && strcmp($2, "0") != 0)
1543 yyerror("number expected");
1544 else cfg_parser->cfg->ratelimit_factor = atoi($2);
1548 server_qname_minimisation: VAR_QNAME_MINIMISATION STRING_ARG
1550 OUTYY(("P(server_qname_minimisation:%s)\n", $2));
1551 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1552 yyerror("expected yes or no.");
1553 else cfg_parser->cfg->qname_minimisation =
1554 (strcmp($2, "yes")==0);
1558 server_qname_minimisation_strict: VAR_QNAME_MINIMISATION_STRICT STRING_ARG
1560 OUTYY(("P(server_qname_minimisation_strict:%s)\n", $2));
1561 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1562 yyerror("expected yes or no.");
1563 else cfg_parser->cfg->qname_minimisation_strict =
1564 (strcmp($2, "yes")==0);
1568 stub_name: VAR_NAME STRING_ARG
1570 OUTYY(("P(name:%s)\n", $2));
1571 if(cfg_parser->cfg->stubs->name)
1572 yyerror("stub name override, there must be one name "
1573 "for one stub-zone");
1574 free(cfg_parser->cfg->stubs->name);
1575 cfg_parser->cfg->stubs->name = $2;
1578 stub_host: VAR_STUB_HOST STRING_ARG
1580 OUTYY(("P(stub-host:%s)\n", $2));
1581 if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->hosts, $2))
1582 yyerror("out of memory");
1585 stub_addr: VAR_STUB_ADDR STRING_ARG
1587 OUTYY(("P(stub-addr:%s)\n", $2));
1588 if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->addrs, $2))
1589 yyerror("out of memory");
1592 stub_first: VAR_STUB_FIRST STRING_ARG
1594 OUTYY(("P(stub-first:%s)\n", $2));
1595 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1596 yyerror("expected yes or no.");
1597 else cfg_parser->cfg->stubs->isfirst=(strcmp($2, "yes")==0);
1601 stub_ssl_upstream: VAR_STUB_SSL_UPSTREAM STRING_ARG
1603 OUTYY(("P(stub-ssl-upstream:%s)\n", $2));
1604 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1605 yyerror("expected yes or no.");
1606 else cfg_parser->cfg->stubs->ssl_upstream =
1607 (strcmp($2, "yes")==0);
1611 stub_prime: VAR_STUB_PRIME STRING_ARG
1613 OUTYY(("P(stub-prime:%s)\n", $2));
1614 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1615 yyerror("expected yes or no.");
1616 else cfg_parser->cfg->stubs->isprime =
1617 (strcmp($2, "yes")==0);
1621 forward_name: VAR_NAME STRING_ARG
1623 OUTYY(("P(name:%s)\n", $2));
1624 if(cfg_parser->cfg->forwards->name)
1625 yyerror("forward name override, there must be one "
1626 "name for one forward-zone");
1627 free(cfg_parser->cfg->forwards->name);
1628 cfg_parser->cfg->forwards->name = $2;
1631 forward_host: VAR_FORWARD_HOST STRING_ARG
1633 OUTYY(("P(forward-host:%s)\n", $2));
1634 if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->hosts, $2))
1635 yyerror("out of memory");
1638 forward_addr: VAR_FORWARD_ADDR STRING_ARG
1640 OUTYY(("P(forward-addr:%s)\n", $2));
1641 if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->addrs, $2))
1642 yyerror("out of memory");
1645 forward_first: VAR_FORWARD_FIRST STRING_ARG
1647 OUTYY(("P(forward-first:%s)\n", $2));
1648 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1649 yyerror("expected yes or no.");
1650 else cfg_parser->cfg->forwards->isfirst=(strcmp($2, "yes")==0);
1654 forward_ssl_upstream: VAR_FORWARD_SSL_UPSTREAM STRING_ARG
1656 OUTYY(("P(forward-ssl-upstream:%s)\n", $2));
1657 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1658 yyerror("expected yes or no.");
1659 else cfg_parser->cfg->forwards->ssl_upstream =
1660 (strcmp($2, "yes")==0);
1664 view_name: VAR_NAME STRING_ARG
1666 OUTYY(("P(name:%s)\n", $2));
1667 if(cfg_parser->cfg->views->name)
1668 yyerror("view name override, there must be one "
1669 "name for one view");
1670 free(cfg_parser->cfg->views->name);
1671 cfg_parser->cfg->views->name = $2;
1674 view_local_zone: VAR_LOCAL_ZONE STRING_ARG STRING_ARG
1676 OUTYY(("P(view_local_zone:%s %s)\n", $2, $3));
1677 if(strcmp($3, "static")!=0 && strcmp($3, "deny")!=0 &&
1678 strcmp($3, "refuse")!=0 && strcmp($3, "redirect")!=0 &&
1679 strcmp($3, "transparent")!=0 && strcmp($3, "nodefault")!=0
1680 && strcmp($3, "typetransparent")!=0
1681 && strcmp($3, "always_transparent")!=0
1682 && strcmp($3, "always_refuse")!=0
1683 && strcmp($3, "always_nxdomain")!=0
1684 && strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0)
1685 yyerror("local-zone type: expected static, deny, "
1686 "refuse, redirect, transparent, "
1687 "typetransparent, inform, inform_deny, "
1688 "always_transparent, always_refuse, "
1689 "always_nxdomain or nodefault");
1690 else if(strcmp($3, "nodefault")==0) {
1691 if(!cfg_strlist_insert(&cfg_parser->cfg->views->
1692 local_zones_nodefault, $2))
1693 fatal_exit("out of memory adding local-zone");
1696 if(!cfg_str2list_insert(
1697 &cfg_parser->cfg->views->local_zones,
1699 fatal_exit("out of memory adding local-zone");
1703 view_local_data: VAR_LOCAL_DATA STRING_ARG
1705 OUTYY(("P(view_local_data:%s)\n", $2));
1706 if(!cfg_strlist_insert(&cfg_parser->cfg->views->local_data, $2)) {
1707 fatal_exit("out of memory adding local-data");
1712 view_first: VAR_VIEW_FIRST STRING_ARG
1714 OUTYY(("P(view-first:%s)\n", $2));
1715 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1716 yyerror("expected yes or no.");
1717 else cfg_parser->cfg->views->isfirst=(strcmp($2, "yes")==0);
1721 rcstart: VAR_REMOTE_CONTROL
1723 OUTYY(("\nP(remote-control:)\n"));
1726 contents_rc: contents_rc content_rc
1728 content_rc: rc_control_enable | rc_control_interface | rc_control_port |
1729 rc_server_key_file | rc_server_cert_file | rc_control_key_file |
1730 rc_control_cert_file | rc_control_use_cert
1732 rc_control_enable: VAR_CONTROL_ENABLE STRING_ARG
1734 OUTYY(("P(control_enable:%s)\n", $2));
1735 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1736 yyerror("expected yes or no.");
1737 else cfg_parser->cfg->remote_control_enable =
1738 (strcmp($2, "yes")==0);
1742 rc_control_port: VAR_CONTROL_PORT STRING_ARG
1744 OUTYY(("P(control_port:%s)\n", $2));
1746 yyerror("control port number expected");
1747 else cfg_parser->cfg->control_port = atoi($2);
1751 rc_control_interface: VAR_CONTROL_INTERFACE STRING_ARG
1753 OUTYY(("P(control_interface:%s)\n", $2));
1754 if(!cfg_strlist_insert(&cfg_parser->cfg->control_ifs, $2))
1755 yyerror("out of memory");
1758 rc_control_use_cert: VAR_CONTROL_USE_CERT STRING_ARG
1760 OUTYY(("P(control_use_cert:%s)\n", $2));
1761 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1762 yyerror("expected yes or no.");
1763 else cfg_parser->cfg->remote_control_use_cert =
1764 (strcmp($2, "yes")==0);
1768 rc_server_key_file: VAR_SERVER_KEY_FILE STRING_ARG
1770 OUTYY(("P(rc_server_key_file:%s)\n", $2));
1771 free(cfg_parser->cfg->server_key_file);
1772 cfg_parser->cfg->server_key_file = $2;
1775 rc_server_cert_file: VAR_SERVER_CERT_FILE STRING_ARG
1777 OUTYY(("P(rc_server_cert_file:%s)\n", $2));
1778 free(cfg_parser->cfg->server_cert_file);
1779 cfg_parser->cfg->server_cert_file = $2;
1782 rc_control_key_file: VAR_CONTROL_KEY_FILE STRING_ARG
1784 OUTYY(("P(rc_control_key_file:%s)\n", $2));
1785 free(cfg_parser->cfg->control_key_file);
1786 cfg_parser->cfg->control_key_file = $2;
1789 rc_control_cert_file: VAR_CONTROL_CERT_FILE STRING_ARG
1791 OUTYY(("P(rc_control_cert_file:%s)\n", $2));
1792 free(cfg_parser->cfg->control_cert_file);
1793 cfg_parser->cfg->control_cert_file = $2;
1798 OUTYY(("\nP(dnstap:)\n"));
1801 contents_dt: contents_dt content_dt
1803 content_dt: dt_dnstap_enable | dt_dnstap_socket_path |
1804 dt_dnstap_send_identity | dt_dnstap_send_version |
1805 dt_dnstap_identity | dt_dnstap_version |
1806 dt_dnstap_log_resolver_query_messages |
1807 dt_dnstap_log_resolver_response_messages |
1808 dt_dnstap_log_client_query_messages |
1809 dt_dnstap_log_client_response_messages |
1810 dt_dnstap_log_forwarder_query_messages |
1811 dt_dnstap_log_forwarder_response_messages
1813 dt_dnstap_enable: VAR_DNSTAP_ENABLE STRING_ARG
1815 OUTYY(("P(dt_dnstap_enable:%s)\n", $2));
1816 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1817 yyerror("expected yes or no.");
1818 else cfg_parser->cfg->dnstap = (strcmp($2, "yes")==0);
1821 dt_dnstap_socket_path: VAR_DNSTAP_SOCKET_PATH STRING_ARG
1823 OUTYY(("P(dt_dnstap_socket_path:%s)\n", $2));
1824 free(cfg_parser->cfg->dnstap_socket_path);
1825 cfg_parser->cfg->dnstap_socket_path = $2;
1828 dt_dnstap_send_identity: VAR_DNSTAP_SEND_IDENTITY STRING_ARG
1830 OUTYY(("P(dt_dnstap_send_identity:%s)\n", $2));
1831 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1832 yyerror("expected yes or no.");
1833 else cfg_parser->cfg->dnstap_send_identity = (strcmp($2, "yes")==0);
1836 dt_dnstap_send_version: VAR_DNSTAP_SEND_VERSION STRING_ARG
1838 OUTYY(("P(dt_dnstap_send_version:%s)\n", $2));
1839 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1840 yyerror("expected yes or no.");
1841 else cfg_parser->cfg->dnstap_send_version = (strcmp($2, "yes")==0);
1844 dt_dnstap_identity: VAR_DNSTAP_IDENTITY STRING_ARG
1846 OUTYY(("P(dt_dnstap_identity:%s)\n", $2));
1847 free(cfg_parser->cfg->dnstap_identity);
1848 cfg_parser->cfg->dnstap_identity = $2;
1851 dt_dnstap_version: VAR_DNSTAP_VERSION STRING_ARG
1853 OUTYY(("P(dt_dnstap_version:%s)\n", $2));
1854 free(cfg_parser->cfg->dnstap_version);
1855 cfg_parser->cfg->dnstap_version = $2;
1858 dt_dnstap_log_resolver_query_messages: VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES STRING_ARG
1860 OUTYY(("P(dt_dnstap_log_resolver_query_messages:%s)\n", $2));
1861 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1862 yyerror("expected yes or no.");
1863 else cfg_parser->cfg->dnstap_log_resolver_query_messages =
1864 (strcmp($2, "yes")==0);
1867 dt_dnstap_log_resolver_response_messages: VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES STRING_ARG
1869 OUTYY(("P(dt_dnstap_log_resolver_response_messages:%s)\n", $2));
1870 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1871 yyerror("expected yes or no.");
1872 else cfg_parser->cfg->dnstap_log_resolver_response_messages =
1873 (strcmp($2, "yes")==0);
1876 dt_dnstap_log_client_query_messages: VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES STRING_ARG
1878 OUTYY(("P(dt_dnstap_log_client_query_messages:%s)\n", $2));
1879 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1880 yyerror("expected yes or no.");
1881 else cfg_parser->cfg->dnstap_log_client_query_messages =
1882 (strcmp($2, "yes")==0);
1885 dt_dnstap_log_client_response_messages: VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES STRING_ARG
1887 OUTYY(("P(dt_dnstap_log_client_response_messages:%s)\n", $2));
1888 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1889 yyerror("expected yes or no.");
1890 else cfg_parser->cfg->dnstap_log_client_response_messages =
1891 (strcmp($2, "yes")==0);
1894 dt_dnstap_log_forwarder_query_messages: VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES STRING_ARG
1896 OUTYY(("P(dt_dnstap_log_forwarder_query_messages:%s)\n", $2));
1897 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1898 yyerror("expected yes or no.");
1899 else cfg_parser->cfg->dnstap_log_forwarder_query_messages =
1900 (strcmp($2, "yes")==0);
1903 dt_dnstap_log_forwarder_response_messages: VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES STRING_ARG
1905 OUTYY(("P(dt_dnstap_log_forwarder_response_messages:%s)\n", $2));
1906 if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1907 yyerror("expected yes or no.");
1908 else cfg_parser->cfg->dnstap_log_forwarder_response_messages =
1909 (strcmp($2, "yes")==0);
1912 pythonstart: VAR_PYTHON
1914 OUTYY(("\nP(python:)\n"));
1917 contents_py: contents_py content_py
1919 content_py: py_script
1921 py_script: VAR_PYTHON_SCRIPT STRING_ARG
1923 OUTYY(("P(python-script:%s)\n", $2));
1924 free(cfg_parser->cfg->python_script);
1925 cfg_parser->cfg->python_script = $2;
1927 server_disable_dnssec_lame_check: VAR_DISABLE_DNSSEC_LAME_CHECK STRING_ARG
1929 OUTYY(("P(disable_dnssec_lame_check:%s)\n", $2));
1930 if (strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
1931 yyerror("expected yes or no.");
1932 else cfg_parser->cfg->disable_dnssec_lame_check =
1933 (strcmp($2, "yes")==0);
1937 server_log_identity: VAR_LOG_IDENTITY STRING_ARG
1939 OUTYY(("P(server_log_identity:%s)\n", $2));
1940 free(cfg_parser->cfg->log_identity);
1941 cfg_parser->cfg->log_identity = $2;
1946 /* parse helper routines could be here */