1 | #include <stdlib.h> |
2 | #include <string.h> |
3 | #define YYBYACC 1 |
4 | #define YYMAJOR 1 |
5 | #define YYMINOR 9 |
6 | #define YYLEX yylex() |
7 | #define YYEMPTY -1 |
8 | #define yyclearin (yychar=(YYEMPTY)) |
9 | #define yyerrok (yyerrflag=0) |
10 | #define YYRECOVERING() (yyerrflag!=0) |
11 | #define yyparse c_parse |
12 | #define yylex c_lex |
13 | #define yyerror c_error |
14 | #define yychar c_char |
15 | #define yyval c_val |
16 | #define yylval c_lval |
17 | #define yydebug c_debug |
18 | #define yynerrs c_nerrs |
19 | #define yyerrflag c_errflag |
20 | #define yyss c_ss |
21 | #define yysslim c_sslim |
22 | #define yyssp c_ssp |
23 | #define yyvs c_vs |
24 | #define yyvsp c_vsp |
25 | #define yystacksize c_stacksize |
26 | #define yylhs c_lhs |
27 | #define yylen c_len |
28 | #define yydefred c_defred |
29 | #define yydgoto c_dgoto |
30 | #define yysindex c_sindex |
31 | #define yyrindex c_rindex |
32 | #define yygindex c_gindex |
33 | #define yytable c_table |
34 | #define yycheck c_check |
35 | #define yyname c_name |
36 | #define yyrule c_rule |
37 | #define YYPREFIX "c_" |
38 | #line 11 "/usr/src/usr.sbin/nsd/configparser.y" |
39 | #include "config.h" |
40 | |
41 | #include <assert.h> |
42 | #include <errno.h> |
43 | #include <stdio.h> |
44 | #include <string.h> |
45 | |
46 | #include "options.h" |
47 | #include "util.h" |
48 | #include "dname.h" |
49 | #include "tsig.h" |
50 | #include "rrl.h" |
51 | |
52 | int yylex(void); |
53 | |
54 | #ifdef __cplusplus |
55 | extern "C" |
56 | #endif |
57 | |
58 | |
59 | extern config_parser_state_type *cfg_parser; |
60 | |
61 | static void append_acl(struct acl_options **list, struct acl_options *acl); |
62 | static void add_to_last_acl(struct acl_options **list, char *ac); |
63 | static int parse_boolean(const char *str, int *bln); |
64 | static int parse_expire_expr(const char *str, long long *num, uint8_t *expr); |
65 | static int parse_number(const char *str, long long *num); |
66 | static int parse_range(const char *str, long long *low, long long *high); |
67 | #line 41 "/usr/src/usr.sbin/nsd/configparser.y" |
68 | #ifndef YYSTYPE_DEFINED |
69 | #define YYSTYPE_DEFINED |
70 | typedef union { |
71 | char *str; |
72 | long long llng; |
73 | int bln; |
74 | struct ip_address_option *ip; |
75 | struct range_option *range; |
76 | struct cpu_option *cpu; |
77 | } YYSTYPE; |
78 | #endif /* YYSTYPE_DEFINED */ |
79 | #line 80 "configparser.c" |
80 | #define STRING 257 |
81 | #define VAR_SERVER 258 |
82 | #define VAR_SERVER_COUNT 259 |
83 | #define VAR_IP_ADDRESS 260 |
84 | #define VAR_IP_TRANSPARENT 261 |
85 | #define VAR_IP_FREEBIND 262 |
86 | #define VAR_REUSEPORT 263 |
87 | #define VAR_SEND_BUFFER_SIZE 264 |
88 | #define VAR_RECEIVE_BUFFER_SIZE 265 |
89 | #define VAR_DEBUG_MODE 266 |
90 | #define VAR_IP4_ONLY 267 |
91 | #define VAR_IP6_ONLY 268 |
92 | #define VAR_DO_IP4 269 |
93 | #define VAR_DO_IP6 270 |
94 | #define VAR_PORT 271 |
95 | #define VAR_USE_SYSTEMD 272 |
96 | #define VAR_VERBOSITY 273 |
97 | #define VAR_USERNAME 274 |
98 | #define VAR_CHROOT 275 |
99 | #define VAR_ZONESDIR 276 |
100 | #define VAR_ZONELISTFILE 277 |
101 | #define VAR_DATABASE 278 |
102 | #define VAR_LOGFILE 279 |
103 | #define VAR_LOG_ONLY_SYSLOG 280 |
104 | #define VAR_PIDFILE 281 |
105 | #define VAR_DIFFFILE 282 |
106 | #define VAR_XFRDFILE 283 |
107 | #define VAR_XFRDIR 284 |
108 | #define VAR_HIDE_VERSION 285 |
109 | #define VAR_HIDE_IDENTITY 286 |
110 | #define VAR_VERSION 287 |
111 | #define VAR_IDENTITY 288 |
112 | #define VAR_NSID 289 |
113 | #define VAR_TCP_COUNT 290 |
114 | #define VAR_TCP_REJECT_OVERFLOW 291 |
115 | #define VAR_TCP_QUERY_COUNT 292 |
116 | #define VAR_TCP_TIMEOUT 293 |
117 | #define VAR_TCP_MSS 294 |
118 | #define VAR_OUTGOING_TCP_MSS 295 |
119 | #define VAR_IPV4_EDNS_SIZE 296 |
120 | #define VAR_IPV6_EDNS_SIZE 297 |
121 | #define VAR_STATISTICS 298 |
122 | #define VAR_XFRD_RELOAD_TIMEOUT 299 |
123 | #define VAR_LOG_TIME_ASCII 300 |
124 | #define VAR_ROUND_ROBIN 301 |
125 | #define VAR_MINIMAL_RESPONSES 302 |
126 | #define VAR_CONFINE_TO_ZONE 303 |
127 | #define VAR_REFUSE_ANY 304 |
128 | #define VAR_ZONEFILES_CHECK 305 |
129 | #define VAR_ZONEFILES_WRITE 306 |
130 | #define VAR_RRL_SIZE 307 |
131 | #define VAR_RRL_RATELIMIT 308 |
132 | #define VAR_RRL_SLIP 309 |
133 | #define VAR_RRL_IPV4_PREFIX_LENGTH 310 |
134 | #define VAR_RRL_IPV6_PREFIX_LENGTH 311 |
135 | #define VAR_RRL_WHITELIST_RATELIMIT 312 |
136 | #define VAR_TLS_SERVICE_KEY 313 |
137 | #define VAR_TLS_SERVICE_PEM 314 |
138 | #define VAR_TLS_SERVICE_OCSP 315 |
139 | #define VAR_TLS_PORT 316 |
140 | #define VAR_TLS_CERT_BUNDLE 317 |
141 | #define VAR_CPU_AFFINITY 318 |
142 | #define VAR_XFRD_CPU_AFFINITY 319 |
143 | #define VAR_SERVER_CPU_AFFINITY 320 |
144 | #define VAR_DROP_UPDATES 321 |
145 | #define VAR_DNSTAP 322 |
146 | #define VAR_DNSTAP_ENABLE 323 |
147 | #define VAR_DNSTAP_SOCKET_PATH 324 |
148 | #define VAR_DNSTAP_SEND_IDENTITY 325 |
149 | #define VAR_DNSTAP_SEND_VERSION 326 |
150 | #define VAR_DNSTAP_IDENTITY 327 |
151 | #define VAR_DNSTAP_VERSION 328 |
152 | #define VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES 329 |
153 | #define VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES 330 |
154 | #define VAR_REMOTE_CONTROL 331 |
155 | #define VAR_CONTROL_ENABLE 332 |
156 | #define VAR_CONTROL_INTERFACE 333 |
157 | #define VAR_CONTROL_PORT 334 |
158 | #define VAR_SERVER_KEY_FILE 335 |
159 | #define VAR_SERVER_CERT_FILE 336 |
160 | #define VAR_CONTROL_KEY_FILE 337 |
161 | #define VAR_CONTROL_CERT_FILE 338 |
162 | #define VAR_KEY 339 |
163 | #define VAR_ALGORITHM 340 |
164 | #define VAR_SECRET 341 |
165 | #define VAR_TLS_AUTH 342 |
166 | #define VAR_TLS_AUTH_DOMAIN_NAME 343 |
167 | #define VAR_TLS_AUTH_CLIENT_CERT 344 |
168 | #define VAR_TLS_AUTH_CLIENT_KEY 345 |
169 | #define VAR_TLS_AUTH_CLIENT_KEY_PW 346 |
170 | #define VAR_PATTERN 347 |
171 | #define VAR_NAME 348 |
172 | #define VAR_ZONEFILE 349 |
173 | #define VAR_NOTIFY 350 |
174 | #define VAR_PROVIDE_XFR 351 |
175 | #define VAR_ALLOW_QUERY 352 |
176 | #define VAR_AXFR 353 |
177 | #define VAR_UDP 354 |
178 | #define VAR_NOTIFY_RETRY 355 |
179 | #define VAR_ALLOW_NOTIFY 356 |
180 | #define VAR_REQUEST_XFR 357 |
181 | #define VAR_ALLOW_AXFR_FALLBACK 358 |
182 | #define VAR_OUTGOING_INTERFACE 359 |
183 | #define VAR_ANSWER_COOKIE 360 |
184 | #define VAR_COOKIE_SECRET 361 |
185 | #define VAR_COOKIE_SECRET_FILE 362 |
186 | #define VAR_MAX_REFRESH_TIME 363 |
187 | #define VAR_MIN_REFRESH_TIME 364 |
188 | #define VAR_MAX_RETRY_TIME 365 |
189 | #define VAR_MIN_RETRY_TIME 366 |
190 | #define VAR_MIN_EXPIRE_TIME 367 |
191 | #define VAR_MULTI_MASTER_CHECK 368 |
192 | #define VAR_SIZE_LIMIT_XFR 369 |
193 | #define VAR_ZONESTATS 370 |
194 | #define VAR_INCLUDE_PATTERN 371 |
195 | #define VAR_ZONE 372 |
196 | #define VAR_RRL_WHITELIST 373 |
197 | #define VAR_SERVERS 374 |
198 | #define VAR_BINDTODEVICE 375 |
199 | #define VAR_SETFIB 376 |
200 | #define YYERRCODE 256 |
201 | const short c_lhs[] = |
202 | { -1, |
203 | 0, 0, 6, 6, 6, 6, 6, 6, 6, 7, |
204 | 14, 14, 17, 15, 15, 15, 15, 15, 15, 15, |
205 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
206 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
207 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
208 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
209 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
210 | 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, |
211 | 18, 18, 18, 5, 5, 4, 4, 8, 19, 19, |
212 | 20, 20, 20, 20, 20, 20, 20, 20, 9, 21, |
213 | 21, 22, 22, 22, 22, 22, 22, 22, 24, 11, |
214 | 23, 23, 25, 25, 25, 25, 25, 27, 10, 26, |
215 | 26, 28, 28, 28, 30, 13, 29, 29, 31, 31, |
216 | 34, 12, 33, 33, 35, 35, 32, 32, 32, 32, |
217 | 32, 32, 37, 32, 38, 32, 32, 32, 32, 32, |
218 | 32, 32, 32, 32, 32, 32, 32, 32, 32, 3, |
219 | 1, 2, 36, 36, |
220 | }; |
221 | const short c_len[] = |
222 | { 2, |
223 | 0, 2, 1, 1, 1, 1, 1, 1, 1, 2, |
224 | 2, 0, 0, 4, 2, 2, 2, 2, 2, 2, |
225 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
226 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
227 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
228 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
229 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
230 | 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, |
231 | 2, 2, 2, 0, 2, 1, 1, 2, 2, 0, |
232 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
233 | 0, 2, 2, 2, 2, 2, 2, 2, 0, 3, |
234 | 2, 0, 2, 2, 2, 2, 2, 0, 3, 2, |
235 | 0, 2, 2, 2, 0, 3, 2, 0, 2, 1, |
236 | 0, 3, 2, 0, 2, 1, 2, 2, 2, 2, |
237 | 2, 2, 0, 5, 0, 6, 4, 3, 3, 3, |
238 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, |
239 | 1, 1, 0, 1, |
240 | }; |
241 | const short c_defred[] = |
242 | { 1, |
243 | 0, 12, 90, 101, 118, 109, 131, 125, 2, 3, |
244 | 4, 5, 6, 7, 8, 9, 0, 0, 0, 121, |
245 | 112, 134, 128, 0, 0, 0, 0, 0, 0, 0, |
246 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
247 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
248 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
249 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
250 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
251 | 0, 0, 84, 86, 87, 0, 0, 0, 0, 0, |
252 | 11, 0, 0, 0, 0, 0, 0, 0, 0, 89, |
253 | 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, |
254 | 0, 0, 161, 15, 160, 13, 162, 16, 17, 45, |
255 | 18, 19, 20, 25, 26, 27, 28, 44, 21, 55, |
256 | 48, 47, 49, 50, 29, 33, 34, 43, 51, 52, |
257 | 53, 22, 23, 31, 30, 32, 35, 36, 37, 38, |
258 | 39, 40, 41, 42, 46, 54, 64, 65, 66, 67, |
259 | 68, 62, 63, 56, 57, 58, 59, 60, 61, 69, |
260 | 71, 70, 72, 73, 0, 24, 74, 75, 76, 78, |
261 | 91, 92, 93, 94, 95, 96, 97, 98, 102, 103, |
262 | 104, 105, 106, 107, 108, 0, 0, 0, 120, 0, |
263 | 0, 0, 0, 0, 111, 0, 0, 0, 0, 0, |
264 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
265 | 0, 0, 0, 0, 0, 136, 133, 0, 127, 130, |
266 | 79, 85, 123, 124, 122, 114, 115, 116, 117, 113, |
267 | 135, 138, 0, 0, 0, 154, 0, 0, 0, 0, |
268 | 153, 152, 155, 156, 157, 158, 159, 141, 140, 139, |
269 | 142, 137, 129, 0, 149, 150, 151, 148, 143, 0, |
270 | 0, 0, 0, 0, 80, 0, 145, 147, 81, 82, |
271 | 83, 164, 144, 0, 146, |
272 | }; |
273 | const short c_dgoto[] = |
274 | { 1, |
275 | 114, 118, 116, 90, 175, 9, 10, 11, 12, 13, |
276 | 14, 15, 16, 17, 91, 264, 231, 275, 18, 100, |
277 | 19, 108, 110, 21, 205, 109, 20, 199, 112, 23, |
278 | 229, 226, 111, 22, 227, 283, 276, 284, |
279 | }; |
280 | const short c_sindex[] = |
281 | { 0, |
282 | -223, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
283 | 0, 0, 0, 0, 0, 0, 440, -198, -135, 0, |
284 | 0, 0, 0, -257, -253, -252, -252, -252, -257, -257, |
285 | -252, -252, -252, -252, -252, -257, -252, -257, -246, -238, |
286 | -235, -234, -233, -224, -252, -221, -220, -219, -218, -252, |
287 | -252, -211, -210, -209, -257, -252, -257, -257, -257, -257, |
288 | -257, -257, -257, -257, -252, -252, -252, -252, -252, -252, |
289 | -257, -257, -257, -257, -257, -257, -257, -206, -205, -204, |
290 | -257, -203, 0, 0, 0, -252, -252, -202, -200, -257, |
291 | 0, -252, -197, -252, -252, -194, -193, -252, -252, 0, |
292 | -252, -253, -257, -192, -191, -189, -186, 0, -327, -316, |
293 | -213, -187, 0, 0, 0, 0, 0, 0, 0, 0, |
294 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
295 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
296 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
297 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
298 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
299 | 0, 0, 0, 0, -185, 0, 0, 0, 0, 0, |
300 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
301 | 0, 0, 0, 0, 0, -172, -171, -170, 0, -169, |
302 | -168, -167, -159, -157, 0, -155, -154, -153, -152, -151, |
303 | -257, -150, -242, -252, -148, -257, -257, -257, -257, -144, |
304 | -252, -257, -143, -142, -139, 0, 0, -137, 0, 0, |
305 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
306 | 0, 0, -136, -124, -123, 0, -117, -116, -110, -109, |
307 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
308 | 0, 0, 0, -358, 0, 0, 0, 0, 0, -98, |
309 | -91, -90, -252, -257, 0, -84, 0, 0, 0, 0, |
310 | 0, 0, 0, -84, 0,}; |
311 | const short c_rindex[] = |
312 | { 0, |
313 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
314 | 0, 0, 0, 0, 0, 0, 297, 298, 299, 0, |
315 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
316 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
317 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
318 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
319 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
320 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
321 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
322 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
323 | 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, |
324 | 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, |
325 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
326 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
327 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
328 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
329 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
330 | 0, 0, 0, 0, 117, 0, 0, 0, 0, 0, |
331 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
332 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
333 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
334 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
335 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
336 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
337 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
338 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
339 | 0, 0, 0, 232, 0, 0, 0, 0, 0, 0, |
340 | 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, |
341 | 0, 0, 0, 1, 0,}; |
342 | const short c_gindex[] = |
343 | { 0, |
344 | 20, -25, -68, 0, 0, 0, 0, 0, 0, 0, |
345 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
346 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
347 | 0, -53, 0, 0, 0, -162, 0, 0, |
348 | }; |
349 | #define YYTABLESIZE 802 |
350 | const short c_table[] = |
351 | { 113, |
352 | 163, 119, 120, 115, 117, 123, 124, 125, 126, 127, |
353 | 131, 129, 196, 197, 248, 272, 273, 274, 132, 137, |
354 | 198, 133, 134, 135, 142, 143, 200, 201, 202, 203, |
355 | 148, 204, 136, 190, 2, 138, 139, 140, 141, 157, |
356 | 158, 159, 160, 161, 162, 144, 145, 146, 121, 122, |
357 | 170, 171, 172, 174, 178, 128, 179, 130, 230, 182, |
358 | 176, 177, 185, 186, 192, 193, 181, 194, 183, 184, |
359 | 195, 232, 187, 188, 147, 189, 149, 150, 151, 152, |
360 | 153, 154, 155, 156, 233, 234, 235, 236, 237, 238, |
361 | 163, 164, 165, 166, 167, 168, 169, 239, 3, 240, |
362 | 173, 241, 242, 243, 244, 245, 247, 4, 252, 180, |
363 | 249, 250, 257, 260, 261, 5, 77, 262, 6, 263, |
364 | 265, 285, 191, 7, 92, 93, 94, 95, 96, 97, |
365 | 98, 99, 266, 267, 206, 207, 208, 209, 210, 268, |
366 | 269, 211, 212, 213, 214, 215, 270, 271, 8, 216, |
367 | 217, 218, 219, 220, 221, 222, 223, 224, 277, 225, |
368 | 228, 207, 208, 209, 210, 278, 279, 211, 212, 213, |
369 | 214, 215, 282, 0, 0, 216, 217, 218, 219, 220, |
370 | 221, 222, 223, 224, 0, 225, 0, 0, 251, 0, |
371 | 0, 0, 0, 0, 0, 258, 101, 102, 103, 104, |
372 | 105, 106, 107, 0, 0, 0, 0, 0, 0, 0, |
373 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
374 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
375 | 246, 14, 0, 0, 0, 253, 254, 255, 256, 0, |
376 | 0, 259, 0, 0, 0, 0, 0, 280, 0, 0, |
377 | 0, 0, 0, 0, 0, 0, 0, 0, 163, 0, |
378 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
379 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
380 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
381 | 0, 0, 0, 281, 0, 0, 10, 88, 99, 0, |
382 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
383 | 119, 110, 0, 0, 0, 0, 0, 0, 0, 0, |
384 | 0, 0, 163, 0, 132, 126, 0, 0, 0, 0, |
385 | 0, 163, 0, 0, 0, 0, 0, 0, 0, 163, |
386 | 0, 0, 163, 0, 0, 0, 0, 163, 163, 163, |
387 | 163, 163, 163, 0, 0, 163, 163, 163, 163, 163, |
388 | 0, 0, 0, 163, 163, 163, 163, 163, 163, 163, |
389 | 163, 163, 163, 163, 77, 77, 77, 77, 77, 77, |
390 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, |
391 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, |
392 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, |
393 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, |
394 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, |
395 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 0, |
396 | 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, |
397 | 0, 0, 0, 0, 0, 77, 0, 0, 77, 0, |
398 | 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, |
399 | 0, 0, 0, 0, 0, 0, 77, 77, 77, 0, |
400 | 0, 0, 0, 0, 0, 0, 0, 0, 77, 14, |
401 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
402 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
403 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
404 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
405 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
406 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
407 | 14, 14, 14, 14, 10, 88, 99, 0, 0, 0, |
408 | 0, 0, 14, 0, 0, 0, 0, 0, 119, 110, |
409 | 14, 0, 0, 14, 0, 0, 0, 0, 14, 0, |
410 | 0, 0, 132, 126, 0, 0, 0, 0, 0, 0, |
411 | 0, 14, 14, 14, 0, 0, 0, 0, 0, 0, |
412 | 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, |
413 | 0, 0, 0, 0, 0, 0, 0, 0, 10, 88, |
414 | 99, 0, 0, 0, 0, 0, 0, 10, 88, 99, |
415 | 0, 0, 119, 110, 0, 10, 88, 99, 10, 88, |
416 | 99, 119, 110, 10, 88, 99, 132, 126, 0, 119, |
417 | 110, 0, 119, 110, 0, 132, 126, 119, 110, 0, |
418 | 0, 0, 0, 132, 126, 0, 132, 126, 10, 88, |
419 | 99, 132, 126, 0, 0, 0, 0, 0, 0, 0, |
420 | 0, 0, 119, 110, 0, 0, 0, 0, 0, 0, |
421 | 0, 0, 0, 0, 0, 0, 132, 126, 24, 25, |
422 | 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, |
423 | 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, |
424 | 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, |
425 | 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, |
426 | 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, |
427 | 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, |
428 | 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
429 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
430 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
431 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, |
432 | 88, 89, |
433 | }; |
434 | const short c_check[] = |
435 | { 257, |
436 | 0, 27, 28, 257, 257, 31, 32, 33, 34, 35, |
437 | 257, 37, 340, 341, 257, 374, 375, 376, 257, 45, |
438 | 348, 257, 257, 257, 50, 51, 343, 344, 345, 346, |
439 | 56, 348, 257, 102, 258, 257, 257, 257, 257, 65, |
440 | 66, 67, 68, 69, 70, 257, 257, 257, 29, 30, |
441 | 257, 257, 257, 257, 257, 36, 257, 38, 112, 257, |
442 | 86, 87, 257, 257, 257, 257, 92, 257, 94, 95, |
443 | 257, 257, 98, 99, 55, 101, 57, 58, 59, 60, |
444 | 61, 62, 63, 64, 257, 257, 257, 257, 257, 257, |
445 | 71, 72, 73, 74, 75, 76, 77, 257, 322, 257, |
446 | 81, 257, 257, 257, 257, 257, 257, 331, 257, 90, |
447 | 353, 354, 257, 257, 257, 339, 0, 257, 342, 257, |
448 | 257, 284, 103, 347, 323, 324, 325, 326, 327, 328, |
449 | 329, 330, 257, 257, 348, 349, 350, 351, 352, 257, |
450 | 257, 355, 356, 357, 358, 359, 257, 257, 372, 363, |
451 | 364, 365, 366, 367, 368, 369, 370, 371, 257, 373, |
452 | 348, 349, 350, 351, 352, 257, 257, 355, 356, 357, |
453 | 358, 359, 257, -1, -1, 363, 364, 365, 366, 367, |
454 | 368, 369, 370, 371, -1, 373, -1, -1, 214, -1, |
455 | -1, -1, -1, -1, -1, 221, 332, 333, 334, 335, |
456 | 336, 337, 338, -1, -1, -1, -1, -1, -1, -1, |
457 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
458 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
459 | 211, 0, -1, -1, -1, 216, 217, 218, 219, -1, |
460 | -1, 222, -1, -1, -1, -1, -1, 273, -1, -1, |
461 | -1, -1, -1, -1, -1, -1, -1, -1, 258, -1, |
462 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
463 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
464 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
465 | -1, -1, -1, 274, -1, -1, 0, 0, 0, -1, |
466 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
467 | 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, |
468 | -1, -1, 322, -1, 0, 0, -1, -1, -1, -1, |
469 | -1, 331, -1, -1, -1, -1, -1, -1, -1, 339, |
470 | -1, -1, 342, -1, -1, -1, -1, 347, 348, 349, |
471 | 350, 351, 352, -1, -1, 355, 356, 357, 358, 359, |
472 | -1, -1, -1, 363, 364, 365, 366, 367, 368, 369, |
473 | 370, 371, 372, 373, 258, 259, 260, 261, 262, 263, |
474 | 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, |
475 | 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, |
476 | 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, |
477 | 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, |
478 | 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, |
479 | 314, 315, 316, 317, 318, 319, 320, 321, 322, -1, |
480 | -1, -1, -1, -1, -1, -1, -1, 331, -1, -1, |
481 | -1, -1, -1, -1, -1, 339, -1, -1, 342, -1, |
482 | -1, -1, -1, 347, -1, -1, -1, -1, -1, -1, |
483 | -1, -1, -1, -1, -1, -1, 360, 361, 362, -1, |
484 | -1, -1, -1, -1, -1, -1, -1, -1, 372, 258, |
485 | 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, |
486 | 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, |
487 | 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, |
488 | 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, |
489 | 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, |
490 | 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, |
491 | 319, 320, 321, 322, 258, 258, 258, -1, -1, -1, |
492 | -1, -1, 331, -1, -1, -1, -1, -1, 258, 258, |
493 | 339, -1, -1, 342, -1, -1, -1, -1, 347, -1, |
494 | -1, -1, 258, 258, -1, -1, -1, -1, -1, -1, |
495 | -1, 360, 361, 362, -1, -1, -1, -1, -1, -1, |
496 | -1, -1, -1, 372, -1, -1, -1, -1, -1, -1, |
497 | -1, -1, -1, -1, -1, -1, -1, -1, 322, 322, |
498 | 322, -1, -1, -1, -1, -1, -1, 331, 331, 331, |
499 | -1, -1, 322, 322, -1, 339, 339, 339, 342, 342, |
500 | 342, 331, 331, 347, 347, 347, 322, 322, -1, 339, |
501 | 339, -1, 342, 342, -1, 331, 331, 347, 347, -1, |
502 | -1, -1, -1, 339, 339, -1, 342, 342, 372, 372, |
503 | 372, 347, 347, -1, -1, -1, -1, -1, -1, -1, |
504 | -1, -1, 372, 372, -1, -1, -1, -1, -1, -1, |
505 | -1, -1, -1, -1, -1, -1, 372, 372, 259, 260, |
506 | 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, |
507 | 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, |
508 | 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, |
509 | 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, |
510 | 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, |
511 | 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, |
512 | 321, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
513 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
514 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
515 | -1, -1, -1, -1, -1, -1, -1, -1, -1, 360, |
516 | 361, 362, |
517 | }; |
518 | #define YYFINAL 1 |
519 | #ifndef YYDEBUG |
520 | #define YYDEBUG 0 |
521 | #endif |
522 | #define YYMAXTOKEN 376 |
523 | #if YYDEBUG |
524 | const char * const c_name[] = |
525 | { |
526 | "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
527 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
528 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
529 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
530 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
531 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
532 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"STRING","VAR_SERVER", |
533 | "VAR_SERVER_COUNT","VAR_IP_ADDRESS","VAR_IP_TRANSPARENT","VAR_IP_FREEBIND", |
534 | "VAR_REUSEPORT","VAR_SEND_BUFFER_SIZE","VAR_RECEIVE_BUFFER_SIZE", |
535 | "VAR_DEBUG_MODE","VAR_IP4_ONLY","VAR_IP6_ONLY","VAR_DO_IP4","VAR_DO_IP6", |
536 | "VAR_PORT","VAR_USE_SYSTEMD","VAR_VERBOSITY","VAR_USERNAME","VAR_CHROOT", |
537 | "VAR_ZONESDIR","VAR_ZONELISTFILE","VAR_DATABASE","VAR_LOGFILE", |
538 | "VAR_LOG_ONLY_SYSLOG","VAR_PIDFILE","VAR_DIFFFILE","VAR_XFRDFILE","VAR_XFRDIR", |
539 | "VAR_HIDE_VERSION","VAR_HIDE_IDENTITY","VAR_VERSION","VAR_IDENTITY","VAR_NSID", |
540 | "VAR_TCP_COUNT","VAR_TCP_REJECT_OVERFLOW","VAR_TCP_QUERY_COUNT", |
541 | "VAR_TCP_TIMEOUT","VAR_TCP_MSS","VAR_OUTGOING_TCP_MSS","VAR_IPV4_EDNS_SIZE", |
542 | "VAR_IPV6_EDNS_SIZE","VAR_STATISTICS","VAR_XFRD_RELOAD_TIMEOUT", |
543 | "VAR_LOG_TIME_ASCII","VAR_ROUND_ROBIN","VAR_MINIMAL_RESPONSES", |
544 | "VAR_CONFINE_TO_ZONE","VAR_REFUSE_ANY","VAR_ZONEFILES_CHECK", |
545 | "VAR_ZONEFILES_WRITE","VAR_RRL_SIZE","VAR_RRL_RATELIMIT","VAR_RRL_SLIP", |
546 | "VAR_RRL_IPV4_PREFIX_LENGTH","VAR_RRL_IPV6_PREFIX_LENGTH", |
547 | "VAR_RRL_WHITELIST_RATELIMIT","VAR_TLS_SERVICE_KEY","VAR_TLS_SERVICE_PEM", |
548 | "VAR_TLS_SERVICE_OCSP","VAR_TLS_PORT","VAR_TLS_CERT_BUNDLE","VAR_CPU_AFFINITY", |
549 | "VAR_XFRD_CPU_AFFINITY","VAR_SERVER_CPU_AFFINITY","VAR_DROP_UPDATES", |
550 | "VAR_DNSTAP","VAR_DNSTAP_ENABLE","VAR_DNSTAP_SOCKET_PATH", |
551 | "VAR_DNSTAP_SEND_IDENTITY","VAR_DNSTAP_SEND_VERSION","VAR_DNSTAP_IDENTITY", |
552 | "VAR_DNSTAP_VERSION","VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES", |
553 | "VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES","VAR_REMOTE_CONTROL", |
554 | "VAR_CONTROL_ENABLE","VAR_CONTROL_INTERFACE","VAR_CONTROL_PORT", |
555 | "VAR_SERVER_KEY_FILE","VAR_SERVER_CERT_FILE","VAR_CONTROL_KEY_FILE", |
556 | "VAR_CONTROL_CERT_FILE","VAR_KEY","VAR_ALGORITHM","VAR_SECRET","VAR_TLS_AUTH", |
557 | "VAR_TLS_AUTH_DOMAIN_NAME","VAR_TLS_AUTH_CLIENT_CERT","VAR_TLS_AUTH_CLIENT_KEY", |
558 | "VAR_TLS_AUTH_CLIENT_KEY_PW","VAR_PATTERN","VAR_NAME","VAR_ZONEFILE", |
559 | "VAR_NOTIFY","VAR_PROVIDE_XFR","VAR_ALLOW_QUERY","VAR_AXFR","VAR_UDP", |
560 | "VAR_NOTIFY_RETRY","VAR_ALLOW_NOTIFY","VAR_REQUEST_XFR", |
561 | "VAR_ALLOW_AXFR_FALLBACK","VAR_OUTGOING_INTERFACE","VAR_ANSWER_COOKIE", |
562 | "VAR_COOKIE_SECRET","VAR_COOKIE_SECRET_FILE","VAR_MAX_REFRESH_TIME", |
563 | "VAR_MIN_REFRESH_TIME","VAR_MAX_RETRY_TIME","VAR_MIN_RETRY_TIME", |
564 | "VAR_MIN_EXPIRE_TIME","VAR_MULTI_MASTER_CHECK","VAR_SIZE_LIMIT_XFR", |
565 | "VAR_ZONESTATS","VAR_INCLUDE_PATTERN","VAR_ZONE","VAR_RRL_WHITELIST", |
566 | "VAR_SERVERS","VAR_BINDTODEVICE","VAR_SETFIB", |
567 | }; |
568 | const char * const c_rule[] = |
569 | {"$accept : blocks", |
570 | "blocks :", |
571 | "blocks : blocks block", |
572 | "block : server", |
573 | "block : dnstap", |
574 | "block : remote_control", |
575 | "block : key", |
576 | "block : tls_auth", |
577 | "block : pattern", |
578 | "block : zone", |
579 | "server : VAR_SERVER server_block", |
580 | "server_block : server_block server_option", |
581 | "server_block :", |
582 | "$$1 :", |
583 | "server_option : VAR_IP_ADDRESS ip_address $$1 socket_options", |
584 | "server_option : VAR_SERVER_COUNT number", |
585 | "server_option : VAR_IP_TRANSPARENT boolean", |
586 | "server_option : VAR_IP_FREEBIND boolean", |
587 | "server_option : VAR_SEND_BUFFER_SIZE number", |
588 | "server_option : VAR_RECEIVE_BUFFER_SIZE number", |
589 | "server_option : VAR_DEBUG_MODE boolean", |
590 | "server_option : VAR_USE_SYSTEMD boolean", |
591 | "server_option : VAR_HIDE_VERSION boolean", |
592 | "server_option : VAR_HIDE_IDENTITY boolean", |
593 | "server_option : VAR_DROP_UPDATES boolean", |
594 | "server_option : VAR_IP4_ONLY boolean", |
595 | "server_option : VAR_IP6_ONLY boolean", |
596 | "server_option : VAR_DO_IP4 boolean", |
597 | "server_option : VAR_DO_IP6 boolean", |
598 | "server_option : VAR_DATABASE STRING", |
599 | "server_option : VAR_IDENTITY STRING", |
600 | "server_option : VAR_VERSION STRING", |
601 | "server_option : VAR_NSID STRING", |
602 | "server_option : VAR_LOGFILE STRING", |
603 | "server_option : VAR_LOG_ONLY_SYSLOG boolean", |
604 | "server_option : VAR_TCP_COUNT number", |
605 | "server_option : VAR_TCP_REJECT_OVERFLOW boolean", |
606 | "server_option : VAR_TCP_QUERY_COUNT number", |
607 | "server_option : VAR_TCP_TIMEOUT number", |
608 | "server_option : VAR_TCP_MSS number", |
609 | "server_option : VAR_OUTGOING_TCP_MSS number", |
610 | "server_option : VAR_IPV4_EDNS_SIZE number", |
611 | "server_option : VAR_IPV6_EDNS_SIZE number", |
612 | "server_option : VAR_PIDFILE STRING", |
613 | "server_option : VAR_PORT number", |
614 | "server_option : VAR_REUSEPORT boolean", |
615 | "server_option : VAR_STATISTICS number", |
616 | "server_option : VAR_CHROOT STRING", |
617 | "server_option : VAR_USERNAME STRING", |
618 | "server_option : VAR_ZONESDIR STRING", |
619 | "server_option : VAR_ZONELISTFILE STRING", |
620 | "server_option : VAR_DIFFFILE STRING", |
621 | "server_option : VAR_XFRDFILE STRING", |
622 | "server_option : VAR_XFRDIR STRING", |
623 | "server_option : VAR_XFRD_RELOAD_TIMEOUT number", |
624 | "server_option : VAR_VERBOSITY number", |
625 | "server_option : VAR_RRL_SIZE number", |
626 | "server_option : VAR_RRL_RATELIMIT number", |
627 | "server_option : VAR_RRL_SLIP number", |
628 | "server_option : VAR_RRL_IPV4_PREFIX_LENGTH number", |
629 | "server_option : VAR_RRL_IPV6_PREFIX_LENGTH number", |
630 | "server_option : VAR_RRL_WHITELIST_RATELIMIT number", |
631 | "server_option : VAR_ZONEFILES_CHECK boolean", |
632 | "server_option : VAR_ZONEFILES_WRITE number", |
633 | "server_option : VAR_LOG_TIME_ASCII boolean", |
634 | "server_option : VAR_ROUND_ROBIN boolean", |
635 | "server_option : VAR_MINIMAL_RESPONSES boolean", |
636 | "server_option : VAR_CONFINE_TO_ZONE boolean", |
637 | "server_option : VAR_REFUSE_ANY boolean", |
638 | "server_option : VAR_TLS_SERVICE_KEY STRING", |
639 | "server_option : VAR_TLS_SERVICE_OCSP STRING", |
640 | "server_option : VAR_TLS_SERVICE_PEM STRING", |
641 | "server_option : VAR_TLS_PORT number", |
642 | "server_option : VAR_TLS_CERT_BUNDLE STRING", |
643 | "server_option : VAR_ANSWER_COOKIE boolean", |
644 | "server_option : VAR_COOKIE_SECRET STRING", |
645 | "server_option : VAR_COOKIE_SECRET_FILE STRING", |
646 | "server_option : VAR_CPU_AFFINITY cpus", |
647 | "server_option : service_cpu_affinity number", |
648 | "socket_options :", |
649 | "socket_options : socket_options socket_option", |
650 | "socket_option : VAR_SERVERS STRING", |
651 | "socket_option : VAR_BINDTODEVICE boolean", |
652 | "socket_option : VAR_SETFIB number", |
653 | "cpus :", |
654 | "cpus : cpus STRING", |
655 | "service_cpu_affinity : VAR_XFRD_CPU_AFFINITY", |
656 | "service_cpu_affinity : VAR_SERVER_CPU_AFFINITY", |
657 | "dnstap : VAR_DNSTAP dnstap_block", |
658 | "dnstap_block : dnstap_block dnstap_option", |
659 | "dnstap_block :", |
660 | "dnstap_option : VAR_DNSTAP_ENABLE boolean", |
661 | "dnstap_option : VAR_DNSTAP_SOCKET_PATH STRING", |
662 | "dnstap_option : VAR_DNSTAP_SEND_IDENTITY boolean", |
663 | "dnstap_option : VAR_DNSTAP_SEND_VERSION boolean", |
664 | "dnstap_option : VAR_DNSTAP_IDENTITY STRING", |
665 | "dnstap_option : VAR_DNSTAP_VERSION STRING", |
666 | "dnstap_option : VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES boolean", |
667 | "dnstap_option : VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES boolean", |
668 | "remote_control : VAR_REMOTE_CONTROL remote_control_block", |
669 | "remote_control_block : remote_control_block remote_control_option", |
670 | "remote_control_block :", |
671 | "remote_control_option : VAR_CONTROL_ENABLE boolean", |
672 | "remote_control_option : VAR_CONTROL_INTERFACE ip_address", |
673 | "remote_control_option : VAR_CONTROL_PORT number", |
674 | "remote_control_option : VAR_SERVER_KEY_FILE STRING", |
675 | "remote_control_option : VAR_SERVER_CERT_FILE STRING", |
676 | "remote_control_option : VAR_CONTROL_KEY_FILE STRING", |
677 | "remote_control_option : VAR_CONTROL_CERT_FILE STRING", |
678 | "$$2 :", |
679 | "tls_auth : VAR_TLS_AUTH $$2 tls_auth_block", |
680 | "tls_auth_block : tls_auth_block tls_auth_option", |
681 | "tls_auth_block :", |
682 | "tls_auth_option : VAR_NAME STRING", |
683 | "tls_auth_option : VAR_TLS_AUTH_DOMAIN_NAME STRING", |
684 | "tls_auth_option : VAR_TLS_AUTH_CLIENT_CERT STRING", |
685 | "tls_auth_option : VAR_TLS_AUTH_CLIENT_KEY STRING", |
686 | "tls_auth_option : VAR_TLS_AUTH_CLIENT_KEY_PW STRING", |
687 | "$$3 :", |
688 | "key : VAR_KEY $$3 key_block", |
689 | "key_block : key_block key_option", |
690 | "key_block :", |
691 | "key_option : VAR_NAME STRING", |
692 | "key_option : VAR_ALGORITHM STRING", |
693 | "key_option : VAR_SECRET STRING", |
694 | "$$4 :", |
695 | "zone : VAR_ZONE $$4 zone_block", |
696 | "zone_block : zone_block zone_option", |
697 | "zone_block :", |
698 | "zone_option : VAR_NAME STRING", |
699 | "zone_option : pattern_or_zone_option", |
700 | "$$5 :", |
701 | "pattern : VAR_PATTERN $$5 pattern_block", |
702 | "pattern_block : pattern_block pattern_option", |
703 | "pattern_block :", |
704 | "pattern_option : VAR_NAME STRING", |
705 | "pattern_option : pattern_or_zone_option", |
706 | "pattern_or_zone_option : VAR_RRL_WHITELIST STRING", |
707 | "pattern_or_zone_option : VAR_ZONEFILE STRING", |
708 | "pattern_or_zone_option : VAR_ZONESTATS STRING", |
709 | "pattern_or_zone_option : VAR_SIZE_LIMIT_XFR number", |
710 | "pattern_or_zone_option : VAR_MULTI_MASTER_CHECK boolean", |
711 | "pattern_or_zone_option : VAR_INCLUDE_PATTERN STRING", |
712 | "$$6 :", |
713 | "pattern_or_zone_option : VAR_REQUEST_XFR STRING STRING $$6 tlsauth_option", |
714 | "$$7 :", |
715 | "pattern_or_zone_option : VAR_REQUEST_XFR VAR_AXFR STRING STRING $$7 tlsauth_option", |
716 | "pattern_or_zone_option : VAR_REQUEST_XFR VAR_UDP STRING STRING", |
717 | "pattern_or_zone_option : VAR_ALLOW_NOTIFY STRING STRING", |
718 | "pattern_or_zone_option : VAR_NOTIFY STRING STRING", |
719 | "pattern_or_zone_option : VAR_PROVIDE_XFR STRING STRING", |
720 | "pattern_or_zone_option : VAR_ALLOW_QUERY STRING STRING", |
721 | "pattern_or_zone_option : VAR_OUTGOING_INTERFACE STRING", |
722 | "pattern_or_zone_option : VAR_ALLOW_AXFR_FALLBACK boolean", |
723 | "pattern_or_zone_option : VAR_NOTIFY_RETRY number", |
724 | "pattern_or_zone_option : VAR_MAX_REFRESH_TIME number", |
725 | "pattern_or_zone_option : VAR_MIN_REFRESH_TIME number", |
726 | "pattern_or_zone_option : VAR_MAX_RETRY_TIME number", |
727 | "pattern_or_zone_option : VAR_MIN_RETRY_TIME number", |
728 | "pattern_or_zone_option : VAR_MIN_EXPIRE_TIME STRING", |
729 | "ip_address : STRING", |
730 | "number : STRING", |
731 | "boolean : STRING", |
732 | "tlsauth_option :", |
733 | "tlsauth_option : STRING", |
734 | }; |
735 | #endif |
736 | #ifdef YYSTACKSIZE |
737 | #undef YYMAXDEPTH |
738 | #define YYMAXDEPTH YYSTACKSIZE |
739 | #else |
740 | #ifdef YYMAXDEPTH |
741 | #define YYSTACKSIZE YYMAXDEPTH |
742 | #else |
743 | #define YYSTACKSIZE 10000 |
744 | #define YYMAXDEPTH 10000 |
745 | #endif |
746 | #endif |
747 | #define YYINITSTACKSIZE 200 |
748 | |
749 | int yydebug; |
750 | int yynerrs; |
751 | int yyerrflag; |
752 | int yychar; |
753 | short *yyssp; |
754 | YYSTYPE *yyvsp; |
755 | YYSTYPE yyval; |
756 | YYSTYPE yylval; |
757 | short *yyss; |
758 | short *yysslim; |
759 | YYSTYPE *yyvs; |
760 | unsigned int yystacksize; |
761 | int yyparse(void); |
762 | #line 995 "/usr/src/usr.sbin/nsd/configparser.y" |
763 | |
764 | static void |
765 | append_acl(struct acl_options **list, struct acl_options *acl) |
766 | { |
767 | assert(list != NULL); |
768 | |
769 | if(*list == NULL) { |
770 | *list = acl; |
771 | } else { |
772 | struct acl_options *tail = *list; |
773 | while(tail->next != NULL) |
774 | tail = tail->next; |
775 | tail->next = acl; |
776 | } |
777 | } |
778 | |
779 | static void |
780 | add_to_last_acl(struct acl_options **list, char *tls_auth_name) |
781 | { |
782 | struct acl_options *tail = *list; |
783 | assert(list != NULL); |
784 | assert(*list != NULL); |
785 | while(tail->next != NULL) |
786 | tail = tail->next; |
787 | tail->tls_auth_name = tls_auth_name; |
788 | } |
789 | |
790 | static int |
791 | parse_boolean(const char *str, int *bln) |
792 | { |
793 | if(strcmp(str, "yes") == 0) { |
794 | *bln = 1; |
795 | } else if(strcmp(str, "no") == 0) { |
796 | *bln = 0; |
797 | } else { |
798 | return 0; |
799 | } |
800 | |
801 | return 1; |
802 | } |
803 | |
804 | static int |
805 | parse_expire_expr(const char *str, long long *num, uint8_t *expr) |
806 | { |
807 | if(parse_number(str, num)) { |
808 | *expr = EXPIRE_TIME_HAS_VALUE; |
809 | return 1; |
810 | } |
811 | if(strcmp(str, REFRESHPLUSRETRYPLUS1_STR) == 0) { |
812 | *num = 0; |
813 | *expr = REFRESHPLUSRETRYPLUS1; |
814 | return 1; |
815 | } |
816 | return 0; |
817 | } |
818 | |
819 | static int |
820 | parse_number(const char *str, long long *num) |
821 | { |
822 | |
823 | size_t pos = 0; |
824 | while(str[pos] >= '0' && str[pos] <= '9') { |
825 | pos++; |
826 | } |
827 | |
828 | if(pos != 0 && str[pos] == '\0') { |
829 | *num = strtoll(str, NULL, 10); |
830 | return 1; |
831 | } |
832 | |
833 | return 0; |
834 | } |
835 | |
836 | static int |
837 | parse_range(const char *str, long long *low, long long *high) |
838 | { |
839 | const char *ptr = str; |
840 | long long num[2]; |
841 | |
842 | |
843 | if(*ptr < '0' || *ptr > '9') { |
844 | return 0; |
845 | } |
846 | |
847 | num[0] = strtoll(ptr, (char **)&ptr, 10); |
848 | |
849 | |
850 | if(*ptr == '\0') { |
851 | *low = num[0]; |
852 | *high = num[0]; |
853 | return 1; |
854 | } else if(*ptr != '-') { |
855 | return 0; |
856 | } |
857 | |
858 | ++ptr; |
859 | |
860 | if(*ptr < '0' || *ptr > '9') { |
861 | return 0; |
862 | } |
863 | |
864 | num[1] = strtoll(ptr, (char **)&ptr, 10); |
865 | |
866 | |
867 | if(*ptr == '\0') { |
868 | if(num[0] < num[1]) { |
869 | *low = num[0]; |
870 | *high = num[1]; |
871 | } else { |
872 | *low = num[1]; |
873 | *high = num[0]; |
874 | } |
875 | return 1; |
876 | } |
877 | |
878 | return 0; |
879 | } |
880 | #line 873 "configparser.c" |
881 | |
882 | static int yygrowstack(void) |
883 | { |
884 | unsigned int newsize; |
885 | long sslen; |
886 | short *newss; |
887 | YYSTYPE *newvs; |
888 | |
889 | if ((newsize = yystacksize) == 0) |
| 31 | | Assuming the condition is false | |
|
| |
890 | newsize = YYINITSTACKSIZE; |
891 | else if (newsize >= YYMAXDEPTH) |
| 33 | | Assuming 'newsize' is < YYMAXDEPTH | |
|
| |
892 | return -1; |
893 | else if ((newsize *= 2) > YYMAXDEPTH) |
| 35 | | Assuming the condition is false | |
|
| |
894 | newsize = YYMAXDEPTH; |
895 | sslen = yyssp - yyss; |
896 | #ifdef SIZE_MAX |
897 | #define YY_SIZE_MAX SIZE_MAX |
898 | #else |
899 | #define YY_SIZE_MAX 0xffffffffU |
900 | #endif |
901 | if (newsize && YY_SIZE_MAX / newsize < sizeof *newss) |
| 37 | | Assuming 'newsize' is 0 | |
|
902 | goto bail; |
903 | newss = (short *)realloc(yyss, newsize * sizeof *newss); |
904 | if (newss == NULL) |
| 38 | | Assuming 'newss' is not equal to NULL | |
|
| |
905 | goto bail; |
906 | yyss = newss; |
907 | yyssp = newss + sslen; |
908 | if (newsize && YY_SIZE_MAX / newsize < sizeof *newvs) |
909 | goto bail; |
910 | newvs = (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs); |
911 | if (newvs == NULL) |
| 40 | | Assuming 'newvs' is not equal to NULL | |
|
| |
912 | goto bail; |
913 | yyvs = newvs; |
914 | yyvsp = newvs + sslen; |
915 | yystacksize = newsize; |
916 | yysslim = yyss + newsize - 1; |
917 | return 0; |
918 | bail: |
919 | if (yyss) |
920 | free(yyss); |
921 | if (yyvs) |
922 | free(yyvs); |
923 | yyss = yyssp = NULL; |
924 | yyvs = yyvsp = NULL; |
925 | yystacksize = 0; |
926 | return -1; |
927 | } |
928 | |
929 | #define YYABORT goto yyabort |
930 | #define YYREJECT goto yyabort |
931 | #define YYACCEPT goto yyaccept |
932 | #define YYERROR goto yyerrlab |
933 | int |
934 | yyparse(void) |
935 | { |
936 | int yym, yyn, yystate; |
937 | #if YYDEBUG |
938 | const char *yys; |
939 | |
940 | if ((yys = getenv("YYDEBUG"))) |
941 | { |
942 | yyn = *yys; |
943 | if (yyn >= '0' && yyn <= '9') |
944 | yydebug = yyn - '0'; |
945 | } |
946 | #endif /* YYDEBUG */ |
947 | |
948 | yynerrs = 0; |
949 | yyerrflag = 0; |
950 | yychar = (-1); |
951 | |
952 | if (yyss == NULL && yygrowstack()) goto yyoverflow; |
| 1 | Assuming 'c_ss' is not equal to NULL | |
|
953 | yyssp = yyss; |
954 | yyvsp = yyvs; |
955 | *yyssp = yystate = 0; |
956 | |
957 | yyloop: |
958 | if ((yyn = yydefred[yystate]) != 0) goto yyreduce; |
| |
| 3 | | Control jumps to line 1065 | |
|
| |
959 | if (yychar < 0) |
| |
960 | { |
961 | if ((yychar = yylex()) < 0) yychar = 0; |
962 | #if YYDEBUG |
963 | if (yydebug) |
964 | { |
965 | yys = 0; |
966 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
967 | if (!yys) yys = "illegal-symbol"; |
968 | printf("%sdebug: state %d, reading %d (%s)\n", |
969 | YYPREFIX, yystate, yychar, yys); |
970 | } |
971 | #endif |
972 | } |
973 | if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && |
| 15 | | Assuming 'yyn' is not equal to 0 | |
|
| 16 | | Assuming the condition is false | |
|
974 | yyn <= YYTABLESIZE && yycheck[yyn] == yychar) |
975 | { |
976 | #if YYDEBUG |
977 | if (yydebug) |
978 | printf("%sdebug: state %d, shifting to state %d\n", |
979 | YYPREFIX, yystate, yytable[yyn]); |
980 | #endif |
981 | if (yyssp >= yysslim && yygrowstack()) |
982 | { |
983 | goto yyoverflow; |
984 | } |
985 | *++yyssp = yystate = yytable[yyn]; |
986 | *++yyvsp = yylval; |
987 | yychar = (-1); |
988 | if (yyerrflag > 0) --yyerrflag; |
989 | goto yyloop; |
990 | } |
991 | if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && |
| |
992 | yyn <= YYTABLESIZE && yycheck[yyn] == yychar) |
993 | { |
994 | yyn = yytable[yyn]; |
995 | goto yyreduce; |
996 | } |
997 | if (yyerrflag) goto yyinrecovery; |
| 18 | | Assuming 'c_errflag' is not equal to 0 | |
|
| |
| 20 | | Control jumps to line 1009 | |
|
998 | #if defined(__GNUC__) |
999 | goto yynewerror; |
1000 | #endif |
1001 | yynewerror: |
1002 | yyerror("syntax error"); |
1003 | #if defined(__GNUC__) |
1004 | goto yyerrlab; |
1005 | #endif |
1006 | yyerrlab: |
1007 | ++yynerrs; |
1008 | yyinrecovery: |
1009 | if (yyerrflag < 3) |
| 21 | | Assuming 'c_errflag' is < 3 | |
|
| |
1010 | { |
1011 | yyerrflag = 3; |
1012 | for (;;) |
| 23 | | Loop condition is true. Entering loop body | |
|
1013 | { |
1014 | if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && |
| 24 | | Assuming 'yyn' is not equal to 0 | |
|
| 25 | | Assuming the condition is true | |
|
| |
1015 | yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) |
| 26 | | Assuming 'yyn' is <= YYTABLESIZE | |
|
| 27 | | Assuming the condition is true | |
|
1016 | { |
1017 | #if YYDEBUG |
1018 | if (yydebug) |
1019 | printf("%sdebug: state %d, error recovery shifting\ |
1020 | to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); |
1021 | #endif |
1022 | if (yyssp >= yysslim && yygrowstack()) |
| 29 | | Assuming 'c_ssp' is >= 'c_sslim' | |
|
| |
| 42 | | Returning from 'yygrowstack' | |
|
| |
1023 | { |
1024 | goto yyoverflow; |
1025 | } |
1026 | *++yyssp = yystate = yytable[yyn]; |
| 44 | | Use of zero-allocated memory |
|
1027 | *++yyvsp = yylval; |
1028 | goto yyloop; |
1029 | } |
1030 | else |
1031 | { |
1032 | #if YYDEBUG |
1033 | if (yydebug) |
1034 | printf("%sdebug: error recovery discarding state %d\n", |
1035 | YYPREFIX, *yyssp); |
1036 | #endif |
1037 | if (yyssp <= yyss) goto yyabort; |
1038 | --yyssp; |
1039 | --yyvsp; |
1040 | } |
1041 | } |
1042 | } |
1043 | else |
1044 | { |
1045 | if (yychar == 0) goto yyabort; |
1046 | #if YYDEBUG |
1047 | if (yydebug) |
1048 | { |
1049 | yys = 0; |
1050 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
1051 | if (!yys) yys = "illegal-symbol"; |
1052 | printf("%sdebug: state %d, error recovery discards token %d (%s)\n", |
1053 | YYPREFIX, yystate, yychar, yys); |
1054 | } |
1055 | #endif |
1056 | yychar = (-1); |
1057 | goto yyloop; |
1058 | } |
1059 | yyreduce: |
1060 | #if YYDEBUG |
1061 | if (yydebug) |
1062 | printf("%sdebug: state %d, reducing by rule %d (%s)\n", |
1063 | YYPREFIX, yystate, yyn, yyrule[yyn]); |
1064 | #endif |
1065 | yym = yylen[yyn]; |
1066 | if (yym) |
| |
1067 | yyval = yyvsp[1-yym]; |
1068 | else |
1069 | memset(&yyval, 0, sizeof yyval); |
1070 | switch (yyn) |
| 5 | | 'Default' branch taken. Execution continues on line 2047 | |
|
1071 | { |
1072 | case 13: |
1073 | #line 215 "/usr/src/usr.sbin/nsd/configparser.y" |
1074 | { |
1075 | struct ip_address_option *ip = cfg_parser->opt->ip_addresses; |
1076 | |
1077 | if(ip == NULL) { |
1078 | cfg_parser->opt->ip_addresses = yyvsp[0].ip; |
1079 | } else { |
1080 | while(ip->next) { ip = ip->next; } |
1081 | ip->next = yyvsp[0].ip; |
1082 | } |
1083 | |
1084 | cfg_parser->ip = yyvsp[0].ip; |
1085 | } |
1086 | break; |
1087 | case 14: |
1088 | #line 228 "/usr/src/usr.sbin/nsd/configparser.y" |
1089 | { |
1090 | cfg_parser->ip = NULL; |
1091 | } |
1092 | break; |
1093 | case 15: |
1094 | #line 232 "/usr/src/usr.sbin/nsd/configparser.y" |
1095 | { |
1096 | if (yyvsp[0].llng > 0) { |
1097 | cfg_parser->opt->server_count = (int)yyvsp[0].llng; |
1098 | } else { |
1099 | yyerror("expected a number greater than zero"); |
1100 | } |
1101 | } |
1102 | break; |
1103 | case 16: |
1104 | #line 240 "/usr/src/usr.sbin/nsd/configparser.y" |
1105 | { cfg_parser->opt->ip_transparent = yyvsp[0].bln; } |
1106 | break; |
1107 | case 17: |
1108 | #line 242 "/usr/src/usr.sbin/nsd/configparser.y" |
1109 | { cfg_parser->opt->ip_freebind = yyvsp[0].bln; } |
1110 | break; |
1111 | case 18: |
1112 | #line 244 "/usr/src/usr.sbin/nsd/configparser.y" |
1113 | { cfg_parser->opt->send_buffer_size = (int)yyvsp[0].llng; } |
1114 | break; |
1115 | case 19: |
1116 | #line 246 "/usr/src/usr.sbin/nsd/configparser.y" |
1117 | { cfg_parser->opt->receive_buffer_size = (int)yyvsp[0].llng; } |
1118 | break; |
1119 | case 20: |
1120 | #line 248 "/usr/src/usr.sbin/nsd/configparser.y" |
1121 | { cfg_parser->opt->debug_mode = yyvsp[0].bln; } |
1122 | break; |
1123 | case 21: |
1124 | #line 250 "/usr/src/usr.sbin/nsd/configparser.y" |
1125 | { } |
1126 | break; |
1127 | case 22: |
1128 | #line 252 "/usr/src/usr.sbin/nsd/configparser.y" |
1129 | { cfg_parser->opt->hide_version = yyvsp[0].bln; } |
1130 | break; |
1131 | case 23: |
1132 | #line 254 "/usr/src/usr.sbin/nsd/configparser.y" |
1133 | { cfg_parser->opt->hide_identity = yyvsp[0].bln; } |
1134 | break; |
1135 | case 24: |
1136 | #line 256 "/usr/src/usr.sbin/nsd/configparser.y" |
1137 | { cfg_parser->opt->drop_updates = yyvsp[0].bln; } |
1138 | break; |
1139 | case 25: |
1140 | #line 258 "/usr/src/usr.sbin/nsd/configparser.y" |
1141 | { if(yyvsp[0].bln) { cfg_parser->opt->do_ip4 = 1; cfg_parser->opt->do_ip6 = 0; } } |
1142 | break; |
1143 | case 26: |
1144 | #line 260 "/usr/src/usr.sbin/nsd/configparser.y" |
1145 | { if(yyvsp[0].bln) { cfg_parser->opt->do_ip4 = 0; cfg_parser->opt->do_ip6 = 1; } } |
1146 | break; |
1147 | case 27: |
1148 | #line 262 "/usr/src/usr.sbin/nsd/configparser.y" |
1149 | { cfg_parser->opt->do_ip4 = yyvsp[0].bln; } |
1150 | break; |
1151 | case 28: |
1152 | #line 264 "/usr/src/usr.sbin/nsd/configparser.y" |
1153 | { cfg_parser->opt->do_ip6 = yyvsp[0].bln; } |
1154 | break; |
1155 | case 29: |
1156 | #line 266 "/usr/src/usr.sbin/nsd/configparser.y" |
1157 | { |
1158 | cfg_parser->opt->database = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1159 | if(cfg_parser->opt->database[0] == 0 && |
1160 | cfg_parser->opt->zonefiles_write == 0) |
1161 | { |
1162 | cfg_parser->opt->zonefiles_write = ZONEFILES_WRITE_INTERVAL; |
1163 | } |
1164 | } |
1165 | break; |
1166 | case 30: |
1167 | #line 275 "/usr/src/usr.sbin/nsd/configparser.y" |
1168 | { cfg_parser->opt->identity = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1169 | break; |
1170 | case 31: |
1171 | #line 277 "/usr/src/usr.sbin/nsd/configparser.y" |
1172 | { cfg_parser->opt->version = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1173 | break; |
1174 | case 32: |
1175 | #line 279 "/usr/src/usr.sbin/nsd/configparser.y" |
1176 | { |
1177 | unsigned char* nsid = 0; |
1178 | size_t nsid_len = strlen(yyvsp[0].str); |
1179 | |
1180 | if (strncasecmp(yyvsp[0].str, "ascii_", 6) == 0) { |
1181 | nsid_len -= 6; |
1182 | if(nsid_len < 65535) { |
1183 | cfg_parser->opt->nsid = region_alloc(cfg_parser->opt->region, nsid_len*2+1); |
1184 | hex_ntop((uint8_t*)yyvsp[0].str+6, nsid_len, (char*)cfg_parser->opt->nsid, nsid_len*2+1); |
1185 | } else { |
1186 | yyerror("NSID too long"); |
1187 | } |
1188 | } else if (nsid_len % 2 != 0) { |
1189 | yyerror("the NSID must be a hex string of an even length."); |
1190 | } else { |
1191 | nsid_len = nsid_len / 2; |
1192 | if(nsid_len < 65535) { |
1193 | nsid = xalloc(nsid_len); |
1194 | if (hex_pton(yyvsp[0].str, nsid, nsid_len) == -1) { |
1195 | yyerror("hex string cannot be parsed in NSID."); |
1196 | } else { |
1197 | cfg_parser->opt->nsid = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1198 | } |
1199 | free(nsid); |
1200 | } else { |
1201 | yyerror("NSID too long"); |
1202 | } |
1203 | } |
1204 | } |
1205 | break; |
1206 | case 33: |
1207 | #line 309 "/usr/src/usr.sbin/nsd/configparser.y" |
1208 | { cfg_parser->opt->logfile = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1209 | break; |
1210 | case 34: |
1211 | #line 311 "/usr/src/usr.sbin/nsd/configparser.y" |
1212 | { cfg_parser->opt->log_only_syslog = yyvsp[0].bln; } |
1213 | break; |
1214 | case 35: |
1215 | #line 313 "/usr/src/usr.sbin/nsd/configparser.y" |
1216 | { |
1217 | if (yyvsp[0].llng > 0) { |
1218 | cfg_parser->opt->tcp_count = (int)yyvsp[0].llng; |
1219 | } else { |
1220 | yyerror("expected a number greater than zero"); |
1221 | } |
1222 | } |
1223 | break; |
1224 | case 36: |
1225 | #line 321 "/usr/src/usr.sbin/nsd/configparser.y" |
1226 | { cfg_parser->opt->tcp_reject_overflow = yyvsp[0].bln; } |
1227 | break; |
1228 | case 37: |
1229 | #line 323 "/usr/src/usr.sbin/nsd/configparser.y" |
1230 | { cfg_parser->opt->tcp_query_count = (int)yyvsp[0].llng; } |
1231 | break; |
1232 | case 38: |
1233 | #line 325 "/usr/src/usr.sbin/nsd/configparser.y" |
1234 | { cfg_parser->opt->tcp_timeout = (int)yyvsp[0].llng; } |
1235 | break; |
1236 | case 39: |
1237 | #line 327 "/usr/src/usr.sbin/nsd/configparser.y" |
1238 | { cfg_parser->opt->tcp_mss = (int)yyvsp[0].llng; } |
1239 | break; |
1240 | case 40: |
1241 | #line 329 "/usr/src/usr.sbin/nsd/configparser.y" |
1242 | { cfg_parser->opt->outgoing_tcp_mss = (int)yyvsp[0].llng; } |
1243 | break; |
1244 | case 41: |
1245 | #line 331 "/usr/src/usr.sbin/nsd/configparser.y" |
1246 | { cfg_parser->opt->ipv4_edns_size = (size_t)yyvsp[0].llng; } |
1247 | break; |
1248 | case 42: |
1249 | #line 333 "/usr/src/usr.sbin/nsd/configparser.y" |
1250 | { cfg_parser->opt->ipv6_edns_size = (size_t)yyvsp[0].llng; } |
1251 | break; |
1252 | case 43: |
1253 | #line 335 "/usr/src/usr.sbin/nsd/configparser.y" |
1254 | { cfg_parser->opt->pidfile = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1255 | break; |
1256 | case 44: |
1257 | #line 337 "/usr/src/usr.sbin/nsd/configparser.y" |
1258 | { |
1259 | |
1260 | char buf[16]; |
1261 | (void)snprintf(buf, sizeof(buf), "%lld", yyvsp[0].llng); |
1262 | cfg_parser->opt->port = region_strdup(cfg_parser->opt->region, buf); |
1263 | } |
1264 | break; |
1265 | case 45: |
1266 | #line 344 "/usr/src/usr.sbin/nsd/configparser.y" |
1267 | { cfg_parser->opt->reuseport = yyvsp[0].bln; } |
1268 | break; |
1269 | case 46: |
1270 | #line 346 "/usr/src/usr.sbin/nsd/configparser.y" |
1271 | { cfg_parser->opt->statistics = (int)yyvsp[0].llng; } |
1272 | break; |
1273 | case 47: |
1274 | #line 348 "/usr/src/usr.sbin/nsd/configparser.y" |
1275 | { cfg_parser->opt->chroot = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1276 | break; |
1277 | case 48: |
1278 | #line 350 "/usr/src/usr.sbin/nsd/configparser.y" |
1279 | { cfg_parser->opt->username = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1280 | break; |
1281 | case 49: |
1282 | #line 352 "/usr/src/usr.sbin/nsd/configparser.y" |
1283 | { cfg_parser->opt->zonesdir = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1284 | break; |
1285 | case 50: |
1286 | #line 354 "/usr/src/usr.sbin/nsd/configparser.y" |
1287 | { cfg_parser->opt->zonelistfile = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1288 | break; |
1289 | case 51: |
1290 | #line 356 "/usr/src/usr.sbin/nsd/configparser.y" |
1291 | { } |
1292 | break; |
1293 | case 52: |
1294 | #line 358 "/usr/src/usr.sbin/nsd/configparser.y" |
1295 | { cfg_parser->opt->xfrdfile = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1296 | break; |
1297 | case 53: |
1298 | #line 360 "/usr/src/usr.sbin/nsd/configparser.y" |
1299 | { cfg_parser->opt->xfrdir = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1300 | break; |
1301 | case 54: |
1302 | #line 362 "/usr/src/usr.sbin/nsd/configparser.y" |
1303 | { cfg_parser->opt->xfrd_reload_timeout = (int)yyvsp[0].llng; } |
1304 | break; |
1305 | case 55: |
1306 | #line 364 "/usr/src/usr.sbin/nsd/configparser.y" |
1307 | { cfg_parser->opt->verbosity = (int)yyvsp[0].llng; } |
1308 | break; |
1309 | case 56: |
1310 | #line 366 "/usr/src/usr.sbin/nsd/configparser.y" |
1311 | { |
1312 | #ifdef RATELIMIT |
1313 | if (yyvsp[0].llng > 0) { |
1314 | cfg_parser->opt->rrl_size = (size_t)yyvsp[0].llng; |
1315 | } else { |
1316 | yyerror("expected a number greater than zero"); |
1317 | } |
1318 | #endif |
1319 | } |
1320 | break; |
1321 | case 57: |
1322 | #line 376 "/usr/src/usr.sbin/nsd/configparser.y" |
1323 | { |
1324 | #ifdef RATELIMIT |
1325 | cfg_parser->opt->rrl_ratelimit = (size_t)yyvsp[0].llng; |
1326 | #endif |
1327 | } |
1328 | break; |
1329 | case 58: |
1330 | #line 382 "/usr/src/usr.sbin/nsd/configparser.y" |
1331 | { |
1332 | #ifdef RATELIMIT |
1333 | cfg_parser->opt->rrl_slip = (size_t)yyvsp[0].llng; |
1334 | #endif |
1335 | } |
1336 | break; |
1337 | case 59: |
1338 | #line 388 "/usr/src/usr.sbin/nsd/configparser.y" |
1339 | { |
1340 | #ifdef RATELIMIT |
1341 | if (yyvsp[0].llng > 32) { |
1342 | yyerror("invalid IPv4 prefix length"); |
1343 | } else { |
1344 | cfg_parser->opt->rrl_ipv4_prefix_length = (size_t)yyvsp[0].llng; |
1345 | } |
1346 | #endif |
1347 | } |
1348 | break; |
1349 | case 60: |
1350 | #line 398 "/usr/src/usr.sbin/nsd/configparser.y" |
1351 | { |
1352 | #ifdef RATELIMIT |
1353 | if (yyvsp[0].llng > 64) { |
1354 | yyerror("invalid IPv6 prefix length"); |
1355 | } else { |
1356 | cfg_parser->opt->rrl_ipv6_prefix_length = (size_t)yyvsp[0].llng; |
1357 | } |
1358 | #endif |
1359 | } |
1360 | break; |
1361 | case 61: |
1362 | #line 408 "/usr/src/usr.sbin/nsd/configparser.y" |
1363 | { |
1364 | #ifdef RATELIMIT |
1365 | cfg_parser->opt->rrl_whitelist_ratelimit = (size_t)yyvsp[0].llng; |
1366 | #endif |
1367 | } |
1368 | break; |
1369 | case 62: |
1370 | #line 414 "/usr/src/usr.sbin/nsd/configparser.y" |
1371 | { cfg_parser->opt->zonefiles_check = yyvsp[0].bln; } |
1372 | break; |
1373 | case 63: |
1374 | #line 416 "/usr/src/usr.sbin/nsd/configparser.y" |
1375 | { cfg_parser->opt->zonefiles_write = (int)yyvsp[0].llng; } |
1376 | break; |
1377 | case 64: |
1378 | #line 418 "/usr/src/usr.sbin/nsd/configparser.y" |
1379 | { |
1380 | cfg_parser->opt->log_time_ascii = yyvsp[0].bln; |
1381 | log_time_asc = cfg_parser->opt->log_time_ascii; |
1382 | } |
1383 | break; |
1384 | case 65: |
1385 | #line 423 "/usr/src/usr.sbin/nsd/configparser.y" |
1386 | { |
1387 | cfg_parser->opt->round_robin = yyvsp[0].bln; |
1388 | round_robin = cfg_parser->opt->round_robin; |
1389 | } |
1390 | break; |
1391 | case 66: |
1392 | #line 428 "/usr/src/usr.sbin/nsd/configparser.y" |
1393 | { |
1394 | cfg_parser->opt->minimal_responses = yyvsp[0].bln; |
1395 | minimal_responses = cfg_parser->opt->minimal_responses; |
1396 | } |
1397 | break; |
1398 | case 67: |
1399 | #line 433 "/usr/src/usr.sbin/nsd/configparser.y" |
1400 | { cfg_parser->opt->confine_to_zone = yyvsp[0].bln; } |
1401 | break; |
1402 | case 68: |
1403 | #line 435 "/usr/src/usr.sbin/nsd/configparser.y" |
1404 | { cfg_parser->opt->refuse_any = yyvsp[0].bln; } |
1405 | break; |
1406 | case 69: |
1407 | #line 437 "/usr/src/usr.sbin/nsd/configparser.y" |
1408 | { cfg_parser->opt->tls_service_key = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1409 | break; |
1410 | case 70: |
1411 | #line 439 "/usr/src/usr.sbin/nsd/configparser.y" |
1412 | { cfg_parser->opt->tls_service_ocsp = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1413 | break; |
1414 | case 71: |
1415 | #line 441 "/usr/src/usr.sbin/nsd/configparser.y" |
1416 | { cfg_parser->opt->tls_service_pem = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1417 | break; |
1418 | case 72: |
1419 | #line 443 "/usr/src/usr.sbin/nsd/configparser.y" |
1420 | { |
1421 | |
1422 | char buf[16]; |
1423 | (void)snprintf(buf, sizeof(buf), "%lld", yyvsp[0].llng); |
1424 | cfg_parser->opt->tls_port = region_strdup(cfg_parser->opt->region, buf); |
1425 | } |
1426 | break; |
1427 | case 73: |
1428 | #line 450 "/usr/src/usr.sbin/nsd/configparser.y" |
1429 | { cfg_parser->opt->tls_cert_bundle = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1430 | break; |
1431 | case 74: |
1432 | #line 452 "/usr/src/usr.sbin/nsd/configparser.y" |
1433 | { cfg_parser->opt->answer_cookie = yyvsp[0].bln; } |
1434 | break; |
1435 | case 75: |
1436 | #line 454 "/usr/src/usr.sbin/nsd/configparser.y" |
1437 | { cfg_parser->opt->cookie_secret = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1438 | break; |
1439 | case 76: |
1440 | #line 456 "/usr/src/usr.sbin/nsd/configparser.y" |
1441 | { cfg_parser->opt->cookie_secret_file = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1442 | break; |
1443 | case 77: |
1444 | #line 458 "/usr/src/usr.sbin/nsd/configparser.y" |
1445 | { |
1446 | cfg_parser->opt->cpu_affinity = yyvsp[0].cpu; |
1447 | } |
1448 | break; |
1449 | case 78: |
1450 | #line 462 "/usr/src/usr.sbin/nsd/configparser.y" |
1451 | { |
1452 | if(yyvsp[0].llng < 0) { |
1453 | yyerror("expected a non-negative number"); |
1454 | YYABORT; |
1455 | } else { |
1456 | struct cpu_map_option *opt, *tail; |
1457 | |
1458 | opt = cfg_parser->opt->service_cpu_affinity; |
1459 | while(opt && opt->service != yyvsp[-1].llng) { opt = opt->next; } |
1460 | |
1461 | if(opt) { |
1462 | opt->cpu = yyvsp[0].llng; |
1463 | } else { |
1464 | opt = region_alloc_zero(cfg_parser->opt->region, sizeof(*opt)); |
1465 | opt->service = (int)yyvsp[-1].llng; |
1466 | opt->cpu = (int)yyvsp[0].llng; |
1467 | |
1468 | tail = cfg_parser->opt->service_cpu_affinity; |
1469 | if(tail) { |
1470 | while(tail->next) { tail = tail->next; } |
1471 | tail->next = opt; |
1472 | } else { |
1473 | cfg_parser->opt->service_cpu_affinity = opt; |
1474 | } |
1475 | } |
1476 | } |
1477 | } |
1478 | break; |
1479 | case 81: |
1480 | #line 496 "/usr/src/usr.sbin/nsd/configparser.y" |
1481 | { |
1482 | char *tok, *ptr, *str; |
1483 | struct range_option *servers = NULL; |
1484 | long long first, last; |
1485 | |
1486 | |
1487 | for(str = yyvsp[0].str; (tok = strtok_r(str, " \t", &ptr)); str = NULL) { |
1488 | struct range_option *opt = |
1489 | region_alloc(cfg_parser->opt->region, sizeof(*opt)); |
1490 | first = last = 0; |
1491 | if(!parse_range(tok, &first, &last)) { |
1492 | yyerror("invalid server range '%s'", tok); |
1493 | YYABORT; |
1494 | } |
1495 | assert(first >= 0); |
1496 | assert(last >= 0); |
1497 | opt->next = NULL; |
1498 | opt->first = (int)first; |
1499 | opt->last = (int)last; |
1500 | if(servers) { |
1501 | servers = servers->next = opt; |
1502 | } else { |
1503 | servers = cfg_parser->ip->servers = opt; |
1504 | } |
1505 | } |
1506 | } |
1507 | break; |
1508 | case 82: |
1509 | #line 523 "/usr/src/usr.sbin/nsd/configparser.y" |
1510 | { cfg_parser->ip->dev = yyvsp[0].bln; } |
1511 | break; |
1512 | case 83: |
1513 | #line 525 "/usr/src/usr.sbin/nsd/configparser.y" |
1514 | { cfg_parser->ip->fib = yyvsp[0].llng; } |
1515 | break; |
1516 | case 84: |
1517 | #line 529 "/usr/src/usr.sbin/nsd/configparser.y" |
1518 | { yyval.cpu = NULL; } |
1519 | break; |
1520 | case 85: |
1521 | #line 531 "/usr/src/usr.sbin/nsd/configparser.y" |
1522 | { |
1523 | char *tok, *ptr, *str; |
1524 | struct cpu_option *tail; |
1525 | long long cpu; |
1526 | |
1527 | str = yyvsp[0].str; |
1528 | yyval.cpu = tail = yyvsp[-1].cpu; |
1529 | if(tail) { |
1530 | while(tail->next) { tail = tail->next; } |
1531 | } |
1532 | |
1533 | |
1534 | for(str = yyvsp[0].str; (tok = strtok_r(str, " \t", &ptr)); str = NULL) { |
1535 | struct cpu_option *opt = |
1536 | region_alloc_zero(cfg_parser->opt->region, sizeof(*opt)); |
1537 | cpu = 0; |
1538 | if(!parse_number(tok, &cpu) || cpu < 0) { |
1539 | yyerror("expected a positive number"); |
1540 | YYABORT; |
1541 | } |
1542 | assert(cpu >=0); |
1543 | opt->cpu = (int)cpu; |
1544 | if(tail) { |
1545 | tail->next = opt; |
1546 | tail = opt; |
1547 | } else { |
1548 | yyval.cpu = tail = opt; |
1549 | } |
1550 | } |
1551 | } |
1552 | break; |
1553 | case 86: |
1554 | #line 565 "/usr/src/usr.sbin/nsd/configparser.y" |
1555 | { yyval.llng = -1; } |
1556 | break; |
1557 | case 87: |
1558 | #line 567 "/usr/src/usr.sbin/nsd/configparser.y" |
1559 | { |
1560 | if(yyvsp[0].llng <= 0) { |
1561 | yyerror("invalid server identifier"); |
1562 | YYABORT; |
1563 | } |
1564 | yyval.llng = yyvsp[0].llng; |
1565 | } |
1566 | break; |
1567 | case 91: |
1568 | #line 584 "/usr/src/usr.sbin/nsd/configparser.y" |
1569 | { cfg_parser->opt->dnstap_enable = yyvsp[0].bln; } |
1570 | break; |
1571 | case 92: |
1572 | #line 586 "/usr/src/usr.sbin/nsd/configparser.y" |
1573 | { cfg_parser->opt->dnstap_socket_path = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1574 | break; |
1575 | case 93: |
1576 | #line 588 "/usr/src/usr.sbin/nsd/configparser.y" |
1577 | { cfg_parser->opt->dnstap_send_identity = yyvsp[0].bln; } |
1578 | break; |
1579 | case 94: |
1580 | #line 590 "/usr/src/usr.sbin/nsd/configparser.y" |
1581 | { cfg_parser->opt->dnstap_send_version = yyvsp[0].bln; } |
1582 | break; |
1583 | case 95: |
1584 | #line 592 "/usr/src/usr.sbin/nsd/configparser.y" |
1585 | { cfg_parser->opt->dnstap_identity = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1586 | break; |
1587 | case 96: |
1588 | #line 594 "/usr/src/usr.sbin/nsd/configparser.y" |
1589 | { cfg_parser->opt->dnstap_version = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1590 | break; |
1591 | case 97: |
1592 | #line 596 "/usr/src/usr.sbin/nsd/configparser.y" |
1593 | { cfg_parser->opt->dnstap_log_auth_query_messages = yyvsp[0].bln; } |
1594 | break; |
1595 | case 98: |
1596 | #line 598 "/usr/src/usr.sbin/nsd/configparser.y" |
1597 | { cfg_parser->opt->dnstap_log_auth_response_messages = yyvsp[0].bln; } |
1598 | break; |
1599 | case 102: |
1600 | #line 609 "/usr/src/usr.sbin/nsd/configparser.y" |
1601 | { cfg_parser->opt->control_enable = yyvsp[0].bln; } |
1602 | break; |
1603 | case 103: |
1604 | #line 611 "/usr/src/usr.sbin/nsd/configparser.y" |
1605 | { |
1606 | struct ip_address_option *ip = cfg_parser->opt->control_interface; |
1607 | if(ip == NULL) { |
1608 | cfg_parser->opt->control_interface = yyvsp[0].ip; |
1609 | } else { |
1610 | while(ip->next != NULL) { ip = ip->next; } |
1611 | ip->next = yyvsp[0].ip; |
1612 | } |
1613 | } |
1614 | break; |
1615 | case 104: |
1616 | #line 621 "/usr/src/usr.sbin/nsd/configparser.y" |
1617 | { |
1618 | if(yyvsp[0].llng == 0) { |
1619 | yyerror("control port number expected"); |
1620 | } else { |
1621 | cfg_parser->opt->control_port = (int)yyvsp[0].llng; |
1622 | } |
1623 | } |
1624 | break; |
1625 | case 105: |
1626 | #line 629 "/usr/src/usr.sbin/nsd/configparser.y" |
1627 | { cfg_parser->opt->server_key_file = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1628 | break; |
1629 | case 106: |
1630 | #line 631 "/usr/src/usr.sbin/nsd/configparser.y" |
1631 | { cfg_parser->opt->server_cert_file = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1632 | break; |
1633 | case 107: |
1634 | #line 633 "/usr/src/usr.sbin/nsd/configparser.y" |
1635 | { cfg_parser->opt->control_key_file = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1636 | break; |
1637 | case 108: |
1638 | #line 635 "/usr/src/usr.sbin/nsd/configparser.y" |
1639 | { cfg_parser->opt->control_cert_file = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1640 | break; |
1641 | case 109: |
1642 | #line 640 "/usr/src/usr.sbin/nsd/configparser.y" |
1643 | { |
1644 | tls_auth_options_type *tls_auth = tls_auth_options_create(cfg_parser->opt->region); |
1645 | assert(cfg_parser->tls_auth == NULL); |
1646 | cfg_parser->tls_auth = tls_auth; |
1647 | } |
1648 | break; |
1649 | case 110: |
1650 | #line 646 "/usr/src/usr.sbin/nsd/configparser.y" |
1651 | { |
1652 | struct tls_auth_options *tls_auth = cfg_parser->tls_auth; |
1653 | if(tls_auth->name == NULL) { |
1654 | yyerror("tls-auth has no name"); |
1655 | } else if(tls_auth->auth_domain_name == NULL) { |
1656 | yyerror("tls-auth %s has no auth-domain-name", tls_auth->name); |
1657 | } else if(tls_auth_options_find(cfg_parser->opt, tls_auth->name)) { |
1658 | yyerror("duplicate tls-auth %s", tls_auth->name); |
1659 | } else { |
1660 | tls_auth_options_insert(cfg_parser->opt, tls_auth); |
1661 | cfg_parser->tls_auth = NULL; |
1662 | } |
1663 | } |
1664 | break; |
1665 | case 113: |
1666 | #line 665 "/usr/src/usr.sbin/nsd/configparser.y" |
1667 | { |
1668 | dname_type *dname; |
1669 | dname = (dname_type *)dname_parse(cfg_parser->opt->region, yyvsp[0].str); |
1670 | cfg_parser->tls_auth->name = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1671 | if(dname == NULL) { |
1672 | yyerror("bad tls-auth name %s", yyvsp[0].str); |
1673 | } else { |
1674 | region_recycle(cfg_parser->opt->region, dname, dname_total_size(dname)); |
1675 | } |
1676 | } |
1677 | break; |
1678 | case 114: |
1679 | #line 676 "/usr/src/usr.sbin/nsd/configparser.y" |
1680 | { |
1681 | cfg_parser->tls_auth->auth_domain_name = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1682 | } |
1683 | break; |
1684 | case 115: |
1685 | #line 680 "/usr/src/usr.sbin/nsd/configparser.y" |
1686 | { |
1687 | cfg_parser->tls_auth->client_cert = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1688 | } |
1689 | break; |
1690 | case 116: |
1691 | #line 684 "/usr/src/usr.sbin/nsd/configparser.y" |
1692 | { |
1693 | cfg_parser->tls_auth->client_key = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1694 | } |
1695 | break; |
1696 | case 117: |
1697 | #line 688 "/usr/src/usr.sbin/nsd/configparser.y" |
1698 | { |
1699 | cfg_parser->tls_auth->client_key_pw = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1700 | } |
1701 | break; |
1702 | case 118: |
1703 | #line 695 "/usr/src/usr.sbin/nsd/configparser.y" |
1704 | { |
1705 | key_options_type *key = key_options_create(cfg_parser->opt->region); |
1706 | key->algorithm = region_strdup(cfg_parser->opt->region, "sha256"); |
1707 | assert(cfg_parser->key == NULL); |
1708 | cfg_parser->key = key; |
1709 | } |
1710 | break; |
1711 | case 119: |
1712 | #line 702 "/usr/src/usr.sbin/nsd/configparser.y" |
1713 | { |
1714 | struct key_options *key = cfg_parser->key; |
1715 | if(key->name == NULL) { |
1716 | yyerror("tsig key has no name"); |
1717 | } else if(key->algorithm == NULL) { |
1718 | yyerror("tsig key %s has no algorithm", key->name); |
1719 | } else if(key->secret == NULL) { |
1720 | yyerror("tsig key %s has no secret blob", key->name); |
1721 | } else if(key_options_find(cfg_parser->opt, key->name)) { |
1722 | yyerror("duplicate tsig key %s", key->name); |
1723 | } else { |
1724 | key_options_insert(cfg_parser->opt, key); |
1725 | cfg_parser->key = NULL; |
1726 | } |
1727 | } |
1728 | break; |
1729 | case 122: |
1730 | #line 723 "/usr/src/usr.sbin/nsd/configparser.y" |
1731 | { |
1732 | dname_type *dname; |
1733 | |
1734 | dname = (dname_type *)dname_parse(cfg_parser->opt->region, yyvsp[0].str); |
1735 | cfg_parser->key->name = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1736 | if(dname == NULL) { |
1737 | yyerror("bad tsig key name %s", yyvsp[0].str); |
1738 | } else { |
1739 | region_recycle(cfg_parser->opt->region, dname, dname_total_size(dname)); |
1740 | } |
1741 | } |
1742 | break; |
1743 | case 123: |
1744 | #line 735 "/usr/src/usr.sbin/nsd/configparser.y" |
1745 | { |
1746 | if(tsig_get_algorithm_by_name(yyvsp[0].str) == NULL) { |
1747 | yyerror("bad tsig key algorithm %s", yyvsp[0].str); |
1748 | } else { |
1749 | cfg_parser->key->algorithm = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1750 | } |
1751 | } |
1752 | break; |
1753 | case 124: |
1754 | #line 743 "/usr/src/usr.sbin/nsd/configparser.y" |
1755 | { |
1756 | uint8_t data[16384]; |
1757 | int size; |
1758 | |
1759 | cfg_parser->key->secret = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1760 | size = __b64_pton(yyvsp[0].str, data, sizeof(data)); |
1761 | if(size == -1) { |
1762 | yyerror("cannot base64 decode tsig secret %s", |
1763 | cfg_parser->key->name? |
1764 | cfg_parser->key->name:""); |
1765 | } else if(size != 0) { |
1766 | memset(data, 0xdd, size); |
1767 | } |
1768 | } |
1769 | break; |
1770 | case 125: |
1771 | #line 761 "/usr/src/usr.sbin/nsd/configparser.y" |
1772 | { |
1773 | assert(cfg_parser->pattern == NULL); |
1774 | assert(cfg_parser->zone == NULL); |
1775 | cfg_parser->zone = zone_options_create(cfg_parser->opt->region); |
1776 | cfg_parser->zone->part_of_config = 1; |
1777 | cfg_parser->zone->pattern = cfg_parser->pattern = |
1778 | pattern_options_create(cfg_parser->opt->region); |
1779 | cfg_parser->zone->pattern->implicit = 1; |
1780 | } |
1781 | break; |
1782 | case 126: |
1783 | #line 771 "/usr/src/usr.sbin/nsd/configparser.y" |
1784 | { |
1785 | assert(cfg_parser->zone != NULL); |
1786 | if(cfg_parser->zone->name == NULL) { |
1787 | yyerror("zone has no name"); |
1788 | } else if(!nsd_options_insert_zone(cfg_parser->opt, cfg_parser->zone)) { |
1789 | yyerror("duplicate zone %s", cfg_parser->zone->name); |
1790 | } else if(!nsd_options_insert_pattern(cfg_parser->opt, cfg_parser->zone->pattern)) { |
1791 | yyerror("duplicate pattern %s", cfg_parser->zone->pattern->pname); |
1792 | } |
1793 | cfg_parser->pattern = NULL; |
1794 | cfg_parser->zone = NULL; |
1795 | } |
1796 | break; |
1797 | case 129: |
1798 | #line 789 "/usr/src/usr.sbin/nsd/configparser.y" |
1799 | { |
1800 | const char *marker = PATTERN_IMPLICIT_MARKER; |
1801 | char *pname = region_alloc(cfg_parser->opt->region, strlen(yyvsp[0].str) + strlen(marker) + 1); |
1802 | memmove(pname, marker, strlen(marker)); |
1803 | memmove(pname + strlen(marker), yyvsp[0].str, strlen(yyvsp[0].str) + 1); |
1804 | cfg_parser->zone->pattern->pname = pname; |
1805 | cfg_parser->zone->name = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1806 | if(pattern_options_find(cfg_parser->opt, pname)) { |
1807 | yyerror("zone %s cannot be created because implicit pattern %s " |
1808 | "already exists", yyvsp[0].str, pname); |
1809 | } |
1810 | } |
1811 | break; |
1812 | case 131: |
1813 | #line 805 "/usr/src/usr.sbin/nsd/configparser.y" |
1814 | { |
1815 | assert(cfg_parser->pattern == NULL); |
1816 | cfg_parser->pattern = pattern_options_create(cfg_parser->opt->region); |
1817 | } |
1818 | break; |
1819 | case 132: |
1820 | #line 810 "/usr/src/usr.sbin/nsd/configparser.y" |
1821 | { |
1822 | pattern_options_type *pattern = cfg_parser->pattern; |
1823 | if(pattern->pname == NULL) { |
1824 | yyerror("pattern has no name"); |
1825 | } else if(!nsd_options_insert_pattern(cfg_parser->opt, pattern)) { |
1826 | yyerror("duplicate pattern %s", pattern->pname); |
1827 | } |
1828 | cfg_parser->pattern = NULL; |
1829 | } |
1830 | break; |
1831 | case 135: |
1832 | #line 825 "/usr/src/usr.sbin/nsd/configparser.y" |
1833 | { |
1834 | if(strchr(yyvsp[0].str, ' ')) { |
1835 | yyerror("space is not allowed in pattern name: '%s'", yyvsp[0].str); |
1836 | } |
1837 | cfg_parser->pattern->pname = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
1838 | } |
1839 | break; |
1840 | case 137: |
1841 | #line 835 "/usr/src/usr.sbin/nsd/configparser.y" |
1842 | { |
1843 | #ifdef RATELIMIT |
1844 | cfg_parser->pattern->rrl_whitelist |= rrlstr2type(yyvsp[0].str); |
1845 | #endif |
1846 | } |
1847 | break; |
1848 | case 138: |
1849 | #line 841 "/usr/src/usr.sbin/nsd/configparser.y" |
1850 | { cfg_parser->pattern->zonefile = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1851 | break; |
1852 | case 139: |
1853 | #line 843 "/usr/src/usr.sbin/nsd/configparser.y" |
1854 | { cfg_parser->pattern->zonestats = region_strdup(cfg_parser->opt->region, yyvsp[0].str); } |
1855 | break; |
1856 | case 140: |
1857 | #line 845 "/usr/src/usr.sbin/nsd/configparser.y" |
1858 | { |
1859 | if(yyvsp[0].llng > 0) { |
1860 | cfg_parser->pattern->size_limit_xfr = (int)yyvsp[0].llng; |
1861 | } else { |
1862 | yyerror("expected a number greater than zero"); |
1863 | } |
1864 | } |
1865 | break; |
1866 | case 141: |
1867 | #line 853 "/usr/src/usr.sbin/nsd/configparser.y" |
1868 | { cfg_parser->pattern->multi_master_check = (int)yyvsp[0].bln; } |
1869 | break; |
1870 | case 142: |
1871 | #line 855 "/usr/src/usr.sbin/nsd/configparser.y" |
1872 | { config_apply_pattern(cfg_parser->pattern, yyvsp[0].str); } |
1873 | break; |
1874 | case 143: |
1875 | #line 857 "/usr/src/usr.sbin/nsd/configparser.y" |
1876 | { |
1877 | acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvsp[-1].str, yyvsp[0].str); |
1878 | if(acl->blocked) |
1879 | yyerror("blocked address used for request-xfr"); |
1880 | if(acl->rangetype != acl_range_single) |
1881 | yyerror("address range used for request-xfr"); |
1882 | append_acl(&cfg_parser->pattern->request_xfr, acl); |
1883 | } |
1884 | break; |
1885 | case 144: |
1886 | #line 866 "/usr/src/usr.sbin/nsd/configparser.y" |
1887 | { } |
1888 | break; |
1889 | case 145: |
1890 | #line 868 "/usr/src/usr.sbin/nsd/configparser.y" |
1891 | { |
1892 | acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvsp[-1].str, yyvsp[0].str); |
1893 | acl->use_axfr_only = 1; |
1894 | if(acl->blocked) |
1895 | yyerror("blocked address used for request-xfr"); |
1896 | if(acl->rangetype != acl_range_single) |
1897 | yyerror("address range used for request-xfr"); |
1898 | append_acl(&cfg_parser->pattern->request_xfr, acl); |
1899 | } |
1900 | break; |
1901 | case 146: |
1902 | #line 878 "/usr/src/usr.sbin/nsd/configparser.y" |
1903 | { } |
1904 | break; |
1905 | case 147: |
1906 | #line 880 "/usr/src/usr.sbin/nsd/configparser.y" |
1907 | { |
1908 | acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvsp[-1].str, yyvsp[0].str); |
1909 | acl->allow_udp = 1; |
1910 | if(acl->blocked) |
1911 | yyerror("blocked address used for request-xfr"); |
1912 | if(acl->rangetype != acl_range_single) |
1913 | yyerror("address range used for request-xfr"); |
1914 | append_acl(&cfg_parser->pattern->request_xfr, acl); |
1915 | } |
1916 | break; |
1917 | case 148: |
1918 | #line 890 "/usr/src/usr.sbin/nsd/configparser.y" |
1919 | { |
1920 | acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvsp[-1].str, yyvsp[0].str); |
1921 | append_acl(&cfg_parser->pattern->allow_notify, acl); |
1922 | } |
1923 | break; |
1924 | case 149: |
1925 | #line 895 "/usr/src/usr.sbin/nsd/configparser.y" |
1926 | { |
1927 | acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvsp[-1].str, yyvsp[0].str); |
1928 | if(acl->blocked) |
1929 | yyerror("blocked address used for notify"); |
1930 | if(acl->rangetype != acl_range_single) |
1931 | yyerror("address range used for notify"); |
1932 | append_acl(&cfg_parser->pattern->notify, acl); |
1933 | } |
1934 | break; |
1935 | case 150: |
1936 | #line 904 "/usr/src/usr.sbin/nsd/configparser.y" |
1937 | { |
1938 | acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvsp[-1].str, yyvsp[0].str); |
1939 | append_acl(&cfg_parser->pattern->provide_xfr, acl); |
1940 | } |
1941 | break; |
1942 | case 151: |
1943 | #line 909 "/usr/src/usr.sbin/nsd/configparser.y" |
1944 | { |
1945 | acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvsp[-1].str, yyvsp[0].str); |
1946 | append_acl(&cfg_parser->pattern->allow_query, acl); |
1947 | } |
1948 | break; |
1949 | case 152: |
1950 | #line 914 "/usr/src/usr.sbin/nsd/configparser.y" |
1951 | { |
1952 | acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvsp[0].str, "NOKEY"); |
1953 | append_acl(&cfg_parser->pattern->outgoing_interface, acl); |
1954 | } |
1955 | break; |
1956 | case 153: |
1957 | #line 919 "/usr/src/usr.sbin/nsd/configparser.y" |
1958 | { |
1959 | cfg_parser->pattern->allow_axfr_fallback = yyvsp[0].bln; |
1960 | cfg_parser->pattern->allow_axfr_fallback_is_default = 0; |
1961 | } |
1962 | break; |
1963 | case 154: |
1964 | #line 924 "/usr/src/usr.sbin/nsd/configparser.y" |
1965 | { |
1966 | cfg_parser->pattern->notify_retry = yyvsp[0].llng; |
1967 | cfg_parser->pattern->notify_retry_is_default = 0; |
1968 | } |
1969 | break; |
1970 | case 155: |
1971 | #line 929 "/usr/src/usr.sbin/nsd/configparser.y" |
1972 | { |
1973 | cfg_parser->pattern->max_refresh_time = yyvsp[0].llng; |
1974 | cfg_parser->pattern->max_refresh_time_is_default = 0; |
1975 | } |
1976 | break; |
1977 | case 156: |
1978 | #line 934 "/usr/src/usr.sbin/nsd/configparser.y" |
1979 | { |
1980 | cfg_parser->pattern->min_refresh_time = yyvsp[0].llng; |
1981 | cfg_parser->pattern->min_refresh_time_is_default = 0; |
1982 | } |
1983 | break; |
1984 | case 157: |
1985 | #line 939 "/usr/src/usr.sbin/nsd/configparser.y" |
1986 | { |
1987 | cfg_parser->pattern->max_retry_time = yyvsp[0].llng; |
1988 | cfg_parser->pattern->max_retry_time_is_default = 0; |
1989 | } |
1990 | break; |
1991 | case 158: |
1992 | #line 944 "/usr/src/usr.sbin/nsd/configparser.y" |
1993 | { |
1994 | cfg_parser->pattern->min_retry_time = yyvsp[0].llng; |
1995 | cfg_parser->pattern->min_retry_time_is_default = 0; |
1996 | } |
1997 | break; |
1998 | case 159: |
1999 | #line 949 "/usr/src/usr.sbin/nsd/configparser.y" |
2000 | { |
2001 | long long num; |
2002 | uint8_t expr; |
2003 | |
2004 | if (!parse_expire_expr(yyvsp[0].str, &num, &expr)) { |
2005 | yyerror("expected an expire time in seconds or \"refresh+retry+1\""); |
2006 | YYABORT; |
2007 | } |
2008 | cfg_parser->pattern->min_expire_time = num; |
2009 | cfg_parser->pattern->min_expire_time_expr = expr; |
2010 | } |
2011 | break; |
2012 | case 160: |
2013 | #line 963 "/usr/src/usr.sbin/nsd/configparser.y" |
2014 | { |
2015 | struct ip_address_option *ip = region_alloc_zero( |
2016 | cfg_parser->opt->region, sizeof(*ip)); |
2017 | ip->address = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
2018 | ip->fib = -1; |
2019 | yyval.ip = ip; |
2020 | } |
2021 | break; |
2022 | case 161: |
2023 | #line 973 "/usr/src/usr.sbin/nsd/configparser.y" |
2024 | { |
2025 | if(!parse_number(yyvsp[0].str, &yyval.llng)) { |
2026 | yyerror("expected a number"); |
2027 | YYABORT; |
2028 | } |
2029 | } |
2030 | break; |
2031 | case 162: |
2032 | #line 982 "/usr/src/usr.sbin/nsd/configparser.y" |
2033 | { |
2034 | if(!parse_boolean(yyvsp[0].str, &yyval.bln)) { |
2035 | yyerror("expected yes or no"); |
2036 | YYABORT; |
2037 | } |
2038 | } |
2039 | break; |
2040 | case 164: |
2041 | #line 991 "/usr/src/usr.sbin/nsd/configparser.y" |
2042 | { char *tls_auth_name = region_strdup(cfg_parser->opt->region, yyvsp[0].str); |
2043 | add_to_last_acl(&cfg_parser->pattern->request_xfr, tls_auth_name);} |
2044 | break; |
2045 | #line 2038 "configparser.c" |
2046 | } |
2047 | yyssp -= yym; |
2048 | yystate = *yyssp; |
2049 | yyvsp -= yym; |
2050 | yym = yylhs[yyn]; |
2051 | if (yystate == 0 && yym == 0) |
| |
2052 | { |
2053 | #if YYDEBUG |
2054 | if (yydebug) |
2055 | printf("%sdebug: after reduction, shifting from state 0 to\ |
2056 | state %d\n", YYPREFIX, YYFINAL); |
2057 | #endif |
2058 | yystate = YYFINAL; |
2059 | *++yyssp = YYFINAL; |
2060 | *++yyvsp = yyval; |
2061 | if (yychar < 0) |
| |
2062 | { |
2063 | if ((yychar = yylex()) < 0) yychar = 0; |
| 8 | | Assuming the condition is false | |
|
| |
2064 | #if YYDEBUG |
2065 | if (yydebug) |
2066 | { |
2067 | yys = 0; |
2068 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
2069 | if (!yys) yys = "illegal-symbol"; |
2070 | printf("%sdebug: state %d, reading %d (%s)\n", |
2071 | YYPREFIX, YYFINAL, yychar, yys); |
2072 | } |
2073 | #endif |
2074 | } |
2075 | if (yychar == 0) goto yyaccept; |
| 10 | | Assuming 'c_char' is not equal to 0 | |
|
| |
2076 | goto yyloop; |
| 12 | | Control jumps to line 958 | |
|
2077 | } |
2078 | if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && |
2079 | yyn <= YYTABLESIZE && yycheck[yyn] == yystate) |
2080 | yystate = yytable[yyn]; |
2081 | else |
2082 | yystate = yydgoto[yym]; |
2083 | #if YYDEBUG |
2084 | if (yydebug) |
2085 | printf("%sdebug: after reduction, shifting from state %d \ |
2086 | to state %d\n", YYPREFIX, *yyssp, yystate); |
2087 | #endif |
2088 | if (yyssp >= yysslim && yygrowstack()) |
2089 | { |
2090 | goto yyoverflow; |
2091 | } |
2092 | *++yyssp = yystate; |
2093 | *++yyvsp = yyval; |
2094 | goto yyloop; |
2095 | yyoverflow: |
2096 | yyerror("yacc stack overflow"); |
2097 | yyabort: |
2098 | if (yyss) |
2099 | free(yyss); |
2100 | if (yyvs) |
2101 | free(yyvs); |
2102 | yyss = yyssp = NULL; |
2103 | yyvs = yyvsp = NULL; |
2104 | yystacksize = 0; |
2105 | return (1); |
2106 | yyaccept: |
2107 | if (yyss) |
2108 | free(yyss); |
2109 | if (yyvs) |
2110 | free(yyvs); |
2111 | yyss = yyssp = NULL; |
2112 | yyvs = yyvsp = NULL; |
2113 | yystacksize = 0; |
2114 | return (0); |
2115 | } |