summaryrefslogtreecommitdiff
path: root/sbin/unwind/libunbound/util/configparser.y
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/unwind/libunbound/util/configparser.y')
-rw-r--r--sbin/unwind/libunbound/util/configparser.y57
1 files changed, 47 insertions, 10 deletions
diff --git a/sbin/unwind/libunbound/util/configparser.y b/sbin/unwind/libunbound/util/configparser.y
index 0feeb61b168..f201e66b3d6 100644
--- a/sbin/unwind/libunbound/util/configparser.y
+++ b/sbin/unwind/libunbound/util/configparser.y
@@ -137,6 +137,7 @@ extern struct config_parser_state* cfg_parser;
%token VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES
%token VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES
%token VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES
+%token VAR_DNSTAP_SAMPLE_RATE
%token VAR_RESPONSE_IP_TAG VAR_RESPONSE_IP VAR_RESPONSE_IP_DATA
%token VAR_HARDEN_ALGO_DOWNGRADE VAR_IP_TRANSPARENT
%token VAR_IP_DSCP
@@ -204,6 +205,7 @@ extern struct config_parser_state* cfg_parser;
%token VAR_PROXY_PROTOCOL_PORT VAR_STATISTICS_INHIBIT_ZERO
%token VAR_HARDEN_UNKNOWN_ADDITIONAL VAR_DISABLE_EDNS_DO VAR_CACHEDB_NO_STORE
%token VAR_LOG_DESTADDR VAR_CACHEDB_CHECK_WHEN_SERVE_EXPIRED
+%token VAR_COOKIE_SECRET_FILE
%%
toplevelvars: /* empty */ | toplevelvars toplevelvar ;
@@ -341,7 +343,7 @@ content_server: server_num_threads | server_verbosity | server_port |
server_interface_automatic_ports | server_ede |
server_proxy_protocol_port | server_statistics_inhibit_zero |
server_harden_unknown_additional | server_disable_edns_do |
- server_log_destaddr
+ server_log_destaddr | server_cookie_secret_file
;
stubstart: VAR_STUB_ZONE
{
@@ -357,8 +359,14 @@ stubstart: VAR_STUB_ZONE
}
}
;
-contents_stub: contents_stub content_stub
- | ;
+contents_stub: content_stub contents_stub
+ |
+ {
+ /* stub end */
+ if(cfg_parser->cfg->stubs &&
+ !cfg_parser->cfg->stubs->name)
+ yyerror("stub-zone without name");
+ };
content_stub: stub_name | stub_host | stub_addr | stub_prime | stub_first |
stub_no_cache | stub_ssl_upstream | stub_tcp_upstream
;
@@ -376,8 +384,14 @@ forwardstart: VAR_FORWARD_ZONE
}
}
;
-contents_forward: contents_forward content_forward
- | ;
+contents_forward: content_forward contents_forward
+ |
+ {
+ /* forward end */
+ if(cfg_parser->cfg->forwards &&
+ !cfg_parser->cfg->forwards->name)
+ yyerror("forward-zone without name");
+ };
content_forward: forward_name | forward_host | forward_addr | forward_first |
forward_no_cache | forward_ssl_upstream | forward_tcp_upstream
;
@@ -389,16 +403,20 @@ viewstart: VAR_VIEW
s = (struct config_view*)calloc(1, sizeof(struct config_view));
if(s) {
s->next = cfg_parser->cfg->views;
- if(s->next && !s->next->name)
- yyerror("view without name");
cfg_parser->cfg->views = s;
} else {
yyerror("out of memory");
}
}
;
-contents_view: contents_view content_view
- | ;
+contents_view: content_view contents_view
+ |
+ {
+ /* view end */
+ if(cfg_parser->cfg->views &&
+ !cfg_parser->cfg->views->name)
+ yyerror("view without name");
+ };
content_view: view_name | view_local_zone | view_local_data | view_first |
view_response_ip | view_response_ip_data | view_local_data_ptr
;
@@ -3437,7 +3455,8 @@ content_dt: dt_dnstap_enable | dt_dnstap_socket_path | dt_dnstap_bidirectional |
dt_dnstap_log_client_query_messages |
dt_dnstap_log_client_response_messages |
dt_dnstap_log_forwarder_query_messages |
- dt_dnstap_log_forwarder_response_messages
+ dt_dnstap_log_forwarder_response_messages |
+ dt_dnstap_sample_rate
;
dt_dnstap_enable: VAR_DNSTAP_ENABLE STRING_ARG
{
@@ -3601,6 +3620,17 @@ dt_dnstap_log_forwarder_response_messages: VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MES
free($2);
}
;
+dt_dnstap_sample_rate: VAR_DNSTAP_SAMPLE_RATE STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_sample_rate:%s)\n", $2));
+ if(atoi($2) == 0 && strcmp($2, "0") != 0)
+ yyerror("number expected");
+ else if(atoi($2) < 0)
+ yyerror("dnstap sample rate too small");
+ else cfg_parser->cfg->dnstap_sample_rate = atoi($2);
+ free($2);
+ }
+ ;
pythonstart: VAR_PYTHON
{
OUTYY(("\nP(python:)\n"));
@@ -3969,6 +3999,13 @@ server_cookie_secret: VAR_COOKIE_SECRET STRING_ARG
free($2);
}
;
+server_cookie_secret_file: VAR_COOKIE_SECRET_FILE STRING_ARG
+ {
+ OUTYY(("P(cookie_secret_file:%s)\n", $2));
+ free(cfg_parser->cfg->cookie_secret_file);
+ cfg_parser->cfg->cookie_secret_file = $2;
+ }
+ ;
ipsetstart: VAR_IPSET
{
OUTYY(("\nP(ipset:)\n"));