Changes for kernel and Busybox
[tomato.git] / release / src / router / dhcpv6 / cfparse.c
blob6979c5c6713a354d7b5d0ae4999536f45d65507c
1 /* A Bison parser, made by GNU Bison 2.1. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
37 #define YYBISON 1
39 /* Bison version. */
40 #define YYBISON_VERSION "2.1"
42 /* Skeleton name. */
43 #define YYSKELETON_NAME "yacc.c"
45 /* Pure parsers. */
46 #define YYPURE 0
48 /* Using locations. */
49 #define YYLSP_NEEDED 0
53 /* Tokens. */
54 #ifndef YYTOKENTYPE
55 # define YYTOKENTYPE
56 /* Put the tokens into the symbol table, so that GDB and other debuggers
57 know about them. */
58 enum yytokentype {
59 INTERFACE = 258,
60 IFNAME = 259,
61 PREFIX_INTERFACE = 260,
62 SLA_ID = 261,
63 SLA_LEN = 262,
64 DUID_ID = 263,
65 ID_ASSOC = 264,
66 IA_PD = 265,
67 IAID = 266,
68 IA_NA = 267,
69 ADDRESS = 268,
70 REQUEST = 269,
71 SEND = 270,
72 ALLOW = 271,
73 PREFERENCE = 272,
74 HOST = 273,
75 HOSTNAME = 274,
76 DUID = 275,
77 OPTION = 276,
78 RAPID_COMMIT = 277,
79 DNS_SERVERS = 278,
80 DNS_NAME = 279,
81 NTP_SERVERS = 280,
82 REFRESHTIME = 281,
83 SIP_SERVERS = 282,
84 SIP_NAME = 283,
85 NIS_SERVERS = 284,
86 NIS_NAME = 285,
87 NISP_SERVERS = 286,
88 NISP_NAME = 287,
89 BCMCS_SERVERS = 288,
90 BCMCS_NAME = 289,
91 INFO_ONLY = 290,
92 SCRIPT = 291,
93 DELAYEDKEY = 292,
94 AUTHENTICATION = 293,
95 PROTOCOL = 294,
96 ALGORITHM = 295,
97 DELAYED = 296,
98 RECONFIG = 297,
99 HMACMD5 = 298,
100 MONOCOUNTER = 299,
101 AUTHNAME = 300,
102 RDM = 301,
103 KEY = 302,
104 KEYINFO = 303,
105 REALM = 304,
106 KEYID = 305,
107 SECRET = 306,
108 KEYNAME = 307,
109 EXPIRE = 308,
110 ADDRPOOL = 309,
111 POOLNAME = 310,
112 RANGE = 311,
113 TO = 312,
114 ADDRESS_POOL = 313,
115 INCLUDE = 314,
116 NUMBER = 315,
117 SLASH = 316,
118 EOS = 317,
119 BCL = 318,
120 ECL = 319,
121 STRING = 320,
122 QSTRING = 321,
123 PREFIX = 322,
124 INFINITY = 323,
125 COMMA = 324
127 #endif
128 /* Tokens. */
129 #define INTERFACE 258
130 #define IFNAME 259
131 #define PREFIX_INTERFACE 260
132 #define SLA_ID 261
133 #define SLA_LEN 262
134 #define DUID_ID 263
135 #define ID_ASSOC 264
136 #define IA_PD 265
137 #define IAID 266
138 #define IA_NA 267
139 #define ADDRESS 268
140 #define REQUEST 269
141 #define SEND 270
142 #define ALLOW 271
143 #define PREFERENCE 272
144 #define HOST 273
145 #define HOSTNAME 274
146 #define DUID 275
147 #define OPTION 276
148 #define RAPID_COMMIT 277
149 #define DNS_SERVERS 278
150 #define DNS_NAME 279
151 #define NTP_SERVERS 280
152 #define REFRESHTIME 281
153 #define SIP_SERVERS 282
154 #define SIP_NAME 283
155 #define NIS_SERVERS 284
156 #define NIS_NAME 285
157 #define NISP_SERVERS 286
158 #define NISP_NAME 287
159 #define BCMCS_SERVERS 288
160 #define BCMCS_NAME 289
161 #define INFO_ONLY 290
162 #define SCRIPT 291
163 #define DELAYEDKEY 292
164 #define AUTHENTICATION 293
165 #define PROTOCOL 294
166 #define ALGORITHM 295
167 #define DELAYED 296
168 #define RECONFIG 297
169 #define HMACMD5 298
170 #define MONOCOUNTER 299
171 #define AUTHNAME 300
172 #define RDM 301
173 #define KEY 302
174 #define KEYINFO 303
175 #define REALM 304
176 #define KEYID 305
177 #define SECRET 306
178 #define KEYNAME 307
179 #define EXPIRE 308
180 #define ADDRPOOL 309
181 #define POOLNAME 310
182 #define RANGE 311
183 #define TO 312
184 #define ADDRESS_POOL 313
185 #define INCLUDE 314
186 #define NUMBER 315
187 #define SLASH 316
188 #define EOS 317
189 #define BCL 318
190 #define ECL 319
191 #define STRING 320
192 #define QSTRING 321
193 #define PREFIX 322
194 #define INFINITY 323
195 #define COMMA 324
200 /* Copy the first part of user declarations. */
201 #line 31 "cfparse.y"
203 #include <sys/types.h>
204 #include <sys/socket.h>
205 #include <sys/queue.h>
206 #include <sys/time.h>
208 #include <netinet/in.h>
210 #include <arpa/inet.h>
212 #include <stdlib.h>
213 #include <string.h>
215 #include "dhcp6.h"
216 #include "config.h"
217 #include "common.h"
219 extern int lineno;
220 extern int cfdebug;
222 extern void yywarn __P((char *, ...))
223 __attribute__((__format__(__printf__, 1, 2)));
224 extern void yyerror __P((char *, ...))
225 __attribute__((__format__(__printf__, 1, 2)));
227 #define MAKE_NAMELIST(l, n, p) do { \
228 (l) = (struct cf_namelist *)malloc(sizeof(*(l))); \
229 if ((l) == NULL) { \
230 yywarn("can't allocate memory"); \
231 if (p) cleanup_cflist(p); \
232 return (-1); \
234 memset((l), 0, sizeof(*(l))); \
235 l->line = lineno; \
236 l->name = (n); \
237 l->params = (p); \
238 } while (0)
240 #define MAKE_CFLIST(l, t, pp, pl) do { \
241 (l) = (struct cf_list *)malloc(sizeof(*(l))); \
242 if ((l) == NULL) { \
243 yywarn("can't allocate memory"); \
244 if (pp) free(pp); \
245 if (pl) cleanup_cflist(pl); \
246 return (-1); \
248 memset((l), 0, sizeof(*(l))); \
249 l->line = lineno; \
250 l->type = (t); \
251 l->ptr = (pp); \
252 l->list = (pl); \
253 l->tail = (l); \
254 } while (0)
256 static struct cf_namelist *iflist_head, *hostlist_head, *iapdlist_head;
257 static struct cf_namelist *addrpoollist_head;
258 static struct cf_namelist *authinfolist_head, *keylist_head;
259 static struct cf_namelist *ianalist_head;
260 struct cf_list *cf_dns_list, *cf_dns_name_list, *cf_ntp_list;
261 struct cf_list *cf_sip_list, *cf_sip_name_list;
262 struct cf_list *cf_nis_list, *cf_nis_name_list;
263 struct cf_list *cf_nisp_list, *cf_nisp_name_list;
264 struct cf_list *cf_bcmcs_list, *cf_bcmcs_name_list;
265 long long cf_refreshtime = -1;
267 extern int yylex __P((void));
268 extern int cfswitch_buffer __P((char *));
269 static int add_namelist __P((struct cf_namelist *, struct cf_namelist **));
270 static void cleanup __P((void));
271 static void cleanup_namelist __P((struct cf_namelist *));
272 static void cleanup_cflist __P((struct cf_list *));
275 /* Enabling traces. */
276 #ifndef YYDEBUG
277 # define YYDEBUG 0
278 #endif
280 /* Enabling verbose error messages. */
281 #ifdef YYERROR_VERBOSE
282 # undef YYERROR_VERBOSE
283 # define YYERROR_VERBOSE 1
284 #else
285 # define YYERROR_VERBOSE 0
286 #endif
288 /* Enabling the token table. */
289 #ifndef YYTOKEN_TABLE
290 # define YYTOKEN_TABLE 0
291 #endif
293 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
294 #line 126 "cfparse.y"
295 typedef union YYSTYPE {
296 long long num;
297 char* str;
298 struct cf_list *list;
299 struct dhcp6_prefix *prefix;
300 struct dhcp6_range *range;
301 struct dhcp6_poolspec *pool;
302 } YYSTYPE;
303 /* Line 196 of yacc.c. */
304 #line 305 "y.tab.c"
305 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
306 # define YYSTYPE_IS_DECLARED 1
307 # define YYSTYPE_IS_TRIVIAL 1
308 #endif
312 /* Copy the second part of user declarations. */
315 /* Line 219 of yacc.c. */
316 #line 317 "y.tab.c"
318 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
319 # define YYSIZE_T __SIZE_TYPE__
320 #endif
321 #if ! defined (YYSIZE_T) && defined (size_t)
322 # define YYSIZE_T size_t
323 #endif
324 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
325 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
326 # define YYSIZE_T size_t
327 #endif
328 #if ! defined (YYSIZE_T)
329 # define YYSIZE_T unsigned int
330 #endif
332 #ifndef YY_
333 # if YYENABLE_NLS
334 # if ENABLE_NLS
335 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
336 # define YY_(msgid) dgettext ("bison-runtime", msgid)
337 # endif
338 # endif
339 # ifndef YY_
340 # define YY_(msgid) msgid
341 # endif
342 #endif
344 #if ! defined (yyoverflow) || YYERROR_VERBOSE
346 /* The parser invokes alloca or malloc; define the necessary symbols. */
348 # ifdef YYSTACK_USE_ALLOCA
349 # if YYSTACK_USE_ALLOCA
350 # ifdef __GNUC__
351 # define YYSTACK_ALLOC __builtin_alloca
352 # else
353 # define YYSTACK_ALLOC alloca
354 # if defined (__STDC__) || defined (__cplusplus)
355 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
356 # define YYINCLUDED_STDLIB_H
357 # endif
358 # endif
359 # endif
360 # endif
362 # ifdef YYSTACK_ALLOC
363 /* Pacify GCC's `empty if-body' warning. */
364 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
365 # ifndef YYSTACK_ALLOC_MAXIMUM
366 /* The OS might guarantee only one guard page at the bottom of the stack,
367 and a page size can be as small as 4096 bytes. So we cannot safely
368 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
369 to allow for a few compiler-allocated temporary stack slots. */
370 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
371 # endif
372 # else
373 # define YYSTACK_ALLOC YYMALLOC
374 # define YYSTACK_FREE YYFREE
375 # ifndef YYSTACK_ALLOC_MAXIMUM
376 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
377 # endif
378 # ifdef __cplusplus
379 extern "C" {
380 # endif
381 # ifndef YYMALLOC
382 # define YYMALLOC malloc
383 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
384 && (defined (__STDC__) || defined (__cplusplus)))
385 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
386 # endif
387 # endif
388 # ifndef YYFREE
389 # define YYFREE free
390 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
391 && (defined (__STDC__) || defined (__cplusplus)))
392 void free (void *); /* INFRINGES ON USER NAME SPACE */
393 # endif
394 # endif
395 # ifdef __cplusplus
397 # endif
398 # endif
399 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
402 #if (! defined (yyoverflow) \
403 && (! defined (__cplusplus) \
404 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
406 /* A type that is properly aligned for any stack member. */
407 union yyalloc
409 short int yyss;
410 YYSTYPE yyvs;
413 /* The size of the maximum gap between one aligned stack and the next. */
414 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
416 /* The size of an array large to enough to hold all stacks, each with
417 N elements. */
418 # define YYSTACK_BYTES(N) \
419 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
420 + YYSTACK_GAP_MAXIMUM)
422 /* Copy COUNT objects from FROM to TO. The source and destination do
423 not overlap. */
424 # ifndef YYCOPY
425 # if defined (__GNUC__) && 1 < __GNUC__
426 # define YYCOPY(To, From, Count) \
427 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
428 # else
429 # define YYCOPY(To, From, Count) \
430 do \
432 YYSIZE_T yyi; \
433 for (yyi = 0; yyi < (Count); yyi++) \
434 (To)[yyi] = (From)[yyi]; \
436 while (0)
437 # endif
438 # endif
440 /* Relocate STACK from its old location to the new one. The
441 local variables YYSIZE and YYSTACKSIZE give the old and new number of
442 elements in the stack, and YYPTR gives the new location of the
443 stack. Advance YYPTR to a properly aligned location for the next
444 stack. */
445 # define YYSTACK_RELOCATE(Stack) \
446 do \
448 YYSIZE_T yynewbytes; \
449 YYCOPY (&yyptr->Stack, Stack, yysize); \
450 Stack = &yyptr->Stack; \
451 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
452 yyptr += yynewbytes / sizeof (*yyptr); \
454 while (0)
456 #endif
458 #if defined (__STDC__) || defined (__cplusplus)
459 typedef signed char yysigned_char;
460 #else
461 typedef short int yysigned_char;
462 #endif
464 /* YYFINAL -- State number of the termination state. */
465 #define YYFINAL 2
466 /* YYLAST -- Last index in YYTABLE. */
467 #define YYLAST 227
469 /* YYNTOKENS -- Number of terminals. */
470 #define YYNTOKENS 70
471 /* YYNNTS -- Number of nonterminals. */
472 #define YYNNTS 36
473 /* YYNRULES -- Number of rules. */
474 #define YYNRULES 105
475 /* YYNRULES -- Number of states. */
476 #define YYNSTATES 231
478 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
479 #define YYUNDEFTOK 2
480 #define YYMAXUTOK 324
482 #define YYTRANSLATE(YYX) \
483 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
485 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
486 static const unsigned char yytranslate[] =
488 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
507 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
514 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
515 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
516 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
517 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
518 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
519 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
520 65, 66, 67, 68, 69
523 #if YYDEBUG
524 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
525 YYRHS. */
526 static const unsigned short int yyprhs[] =
528 0, 0, 3, 4, 7, 9, 11, 13, 15, 17,
529 19, 21, 23, 30, 37, 42, 47, 52, 57, 62,
530 67, 72, 77, 82, 87, 92, 97, 105, 112, 120,
531 127, 134, 141, 145, 152, 153, 156, 158, 159, 162,
532 166, 170, 173, 177, 181, 185, 189, 193, 197, 201,
533 205, 209, 211, 215, 217, 220, 223, 226, 228, 230,
534 232, 234, 236, 238, 240, 242, 244, 246, 248, 250,
535 254, 257, 261, 266, 272, 275, 279, 281, 283, 284,
536 287, 289, 293, 300, 301, 304, 308, 312, 313, 316,
537 320, 321, 324, 328, 332, 336, 340, 342, 344, 346,
538 348, 349, 352, 356, 360, 364
541 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
542 static const yysigned_char yyrhs[] =
544 71, 0, -1, -1, 71, 72, -1, 73, -1, 74,
545 -1, 75, -1, 76, -1, 77, -1, 78, -1, 80,
546 -1, 79, -1, 3, 4, 63, 83, 64, 62, -1,
547 18, 19, 63, 83, 64, 62, -1, 21, 23, 81,
548 62, -1, 21, 24, 66, 62, -1, 21, 25, 81,
549 62, -1, 21, 27, 81, 62, -1, 21, 28, 66,
550 62, -1, 21, 29, 81, 62, -1, 21, 30, 66,
551 62, -1, 21, 31, 81, 62, -1, 21, 32, 66,
552 62, -1, 21, 33, 81, 62, -1, 21, 34, 66,
553 62, -1, 21, 26, 60, 62, -1, 9, 10, 11,
554 63, 92, 64, 62, -1, 9, 10, 63, 92, 64,
555 62, -1, 9, 12, 11, 63, 97, 64, 62, -1,
556 9, 12, 63, 97, 64, 62, -1, 38, 45, 63,
557 99, 64, 62, -1, 48, 52, 63, 104, 64, 62,
558 -1, 59, 66, 62, -1, 54, 55, 63, 83, 64,
559 62, -1, -1, 81, 82, -1, 65, -1, -1, 83,
560 84, -1, 15, 85, 62, -1, 14, 85, 62, -1,
561 35, 62, -1, 16, 86, 62, -1, 20, 8, 62,
562 -1, 13, 88, 62, -1, 67, 89, 62, -1, 17,
563 60, 62, -1, 36, 66, 62, -1, 37, 65, 62,
564 -1, 56, 87, 62, -1, 58, 90, 62, -1, 86,
565 -1, 86, 69, 85, -1, 22, -1, 38, 45, -1,
566 10, 60, -1, 12, 60, -1, 27, -1, 28, -1,
567 23, -1, 24, -1, 25, -1, 26, -1, 29, -1,
568 30, -1, 31, -1, 32, -1, 33, -1, 34, -1,
569 65, 57, 65, -1, 65, 91, -1, 65, 91, 91,
570 -1, 65, 61, 60, 91, -1, 65, 61, 60, 91,
571 91, -1, 65, 91, -1, 65, 91, 91, -1, 68,
572 -1, 60, -1, -1, 92, 93, -1, 94, -1, 67,
573 89, 62, -1, 5, 4, 63, 95, 64, 62, -1,
574 -1, 95, 96, -1, 6, 60, 62, -1, 7, 60,
575 62, -1, -1, 97, 98, -1, 13, 88, 62, -1,
576 -1, 99, 100, -1, 39, 101, 62, -1, 40, 102,
577 62, -1, 46, 103, 62, -1, 47, 65, 62, -1,
578 41, -1, 42, -1, 43, -1, 44, -1, -1, 104,
579 105, -1, 49, 66, 62, -1, 50, 60, 62, -1,
580 51, 66, 62, -1, 53, 66, 62, -1
583 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
584 static const unsigned short int yyrline[] =
586 0, 149, 149, 151, 155, 156, 157, 158, 159, 160,
587 161, 162, 166, 178, 190, 199, 214, 223, 232, 247,
588 256, 271, 280, 295, 304, 319, 348, 357, 371, 380,
589 397, 409, 421, 432, 444, 445, 463, 486, 487, 505,
590 513, 521, 529, 537, 545, 553, 561, 570, 578, 586,
591 594, 605, 609, 619, 627, 635, 643, 651, 659, 667,
592 675, 683, 691, 699, 707, 715, 723, 731, 739, 750,
593 781, 808, 841, 868, 901, 926, 957, 961, 968, 969,
594 987, 988, 999, 1009, 1010, 1028, 1036, 1047, 1048, 1066,
595 1077, 1078, 1096, 1104, 1112, 1120, 1131, 1132, 1136, 1140,
596 1144, 1145, 1163, 1171, 1179, 1187
598 #endif
600 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
601 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
602 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
603 static const char *const yytname[] =
605 "$end", "error", "$undefined", "INTERFACE", "IFNAME",
606 "PREFIX_INTERFACE", "SLA_ID", "SLA_LEN", "DUID_ID", "ID_ASSOC", "IA_PD",
607 "IAID", "IA_NA", "ADDRESS", "REQUEST", "SEND", "ALLOW", "PREFERENCE",
608 "HOST", "HOSTNAME", "DUID", "OPTION", "RAPID_COMMIT", "DNS_SERVERS",
609 "DNS_NAME", "NTP_SERVERS", "REFRESHTIME", "SIP_SERVERS", "SIP_NAME",
610 "NIS_SERVERS", "NIS_NAME", "NISP_SERVERS", "NISP_NAME", "BCMCS_SERVERS",
611 "BCMCS_NAME", "INFO_ONLY", "SCRIPT", "DELAYEDKEY", "AUTHENTICATION",
612 "PROTOCOL", "ALGORITHM", "DELAYED", "RECONFIG", "HMACMD5", "MONOCOUNTER",
613 "AUTHNAME", "RDM", "KEY", "KEYINFO", "REALM", "KEYID", "SECRET",
614 "KEYNAME", "EXPIRE", "ADDRPOOL", "POOLNAME", "RANGE", "TO",
615 "ADDRESS_POOL", "INCLUDE", "NUMBER", "SLASH", "EOS", "BCL", "ECL",
616 "STRING", "QSTRING", "PREFIX", "INFINITY", "COMMA", "$accept",
617 "statements", "statement", "interface_statement", "host_statement",
618 "option_statement", "ia_statement", "authentication_statement",
619 "key_statement", "include_statement", "addrpool_statement",
620 "address_list", "address_list_ent", "declarations", "declaration",
621 "dhcpoption_list", "dhcpoption", "rangeparam", "addressparam",
622 "prefixparam", "poolparam", "duration", "iapdconf_list", "iapdconf",
623 "prefix_interface", "ifparams", "ifparam", "ianaconf_list", "ianaconf",
624 "authparam_list", "authparam", "authproto", "authalg", "authrdm",
625 "keyparam_list", "keyparam", 0
627 #endif
629 # ifdef YYPRINT
630 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
631 token YYLEX-NUM. */
632 static const unsigned short int yytoknum[] =
634 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
635 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
636 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
637 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
638 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
639 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
640 315, 316, 317, 318, 319, 320, 321, 322, 323, 324
642 # endif
644 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
645 static const unsigned char yyr1[] =
647 0, 70, 71, 71, 72, 72, 72, 72, 72, 72,
648 72, 72, 73, 74, 75, 75, 75, 75, 75, 75,
649 75, 75, 75, 75, 75, 75, 76, 76, 76, 76,
650 77, 78, 79, 80, 81, 81, 82, 83, 83, 84,
651 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
652 84, 85, 85, 86, 86, 86, 86, 86, 86, 86,
653 86, 86, 86, 86, 86, 86, 86, 86, 86, 87,
654 88, 88, 89, 89, 90, 90, 91, 91, 92, 92,
655 93, 93, 94, 95, 95, 96, 96, 97, 97, 98,
656 99, 99, 100, 100, 100, 100, 101, 101, 102, 103,
657 104, 104, 105, 105, 105, 105
660 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
661 static const unsigned char yyr2[] =
663 0, 2, 0, 2, 1, 1, 1, 1, 1, 1,
664 1, 1, 6, 6, 4, 4, 4, 4, 4, 4,
665 4, 4, 4, 4, 4, 4, 7, 6, 7, 6,
666 6, 6, 3, 6, 0, 2, 1, 0, 2, 3,
667 3, 2, 3, 3, 3, 3, 3, 3, 3, 3,
668 3, 1, 3, 1, 2, 2, 2, 1, 1, 1,
669 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
670 2, 3, 4, 5, 2, 3, 1, 1, 0, 2,
671 1, 3, 6, 0, 2, 3, 3, 0, 2, 3,
672 0, 2, 3, 3, 3, 3, 1, 1, 1, 1,
673 0, 2, 3, 3, 3, 3
676 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
677 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
678 means the default is an error. */
679 static const unsigned char yydefact[] =
681 2, 0, 1, 0, 0, 0, 0, 0, 0, 0,
682 0, 3, 4, 5, 6, 7, 8, 9, 11, 10,
683 0, 0, 0, 0, 34, 0, 34, 0, 34, 0,
684 34, 0, 34, 0, 34, 0, 0, 0, 0, 0,
685 37, 0, 78, 0, 87, 37, 0, 0, 0, 0,
686 0, 0, 0, 0, 0, 0, 0, 0, 90, 100,
687 37, 32, 0, 78, 0, 87, 0, 0, 14, 36,
688 35, 15, 16, 25, 17, 18, 19, 20, 21, 22,
689 23, 24, 0, 0, 0, 0, 0, 0, 0, 0,
690 0, 0, 0, 0, 0, 0, 0, 0, 38, 0,
691 0, 0, 0, 79, 80, 0, 0, 0, 88, 0,
692 0, 0, 0, 0, 0, 91, 0, 0, 0, 0,
693 0, 101, 0, 0, 0, 0, 0, 53, 59, 60,
694 61, 62, 57, 58, 63, 64, 65, 66, 67, 68,
695 0, 0, 51, 0, 0, 0, 0, 41, 0, 0,
696 0, 0, 0, 0, 12, 0, 0, 0, 0, 27,
697 0, 0, 0, 29, 13, 96, 97, 0, 98, 0,
698 99, 0, 0, 30, 0, 0, 0, 0, 31, 33,
699 77, 76, 70, 44, 55, 56, 54, 40, 0, 39,
700 42, 46, 43, 47, 48, 0, 49, 74, 50, 0,
701 45, 26, 83, 81, 28, 89, 92, 93, 94, 95,
702 102, 103, 104, 105, 71, 52, 69, 75, 0, 0,
703 72, 0, 0, 0, 84, 73, 0, 0, 82, 85,
707 /* YYDEFGOTO[NTERM-NUM]. */
708 static const short int yydefgoto[] =
710 -1, 1, 11, 12, 13, 14, 15, 16, 17, 18,
711 19, 46, 70, 62, 98, 141, 142, 151, 124, 156,
712 153, 182, 64, 103, 104, 219, 224, 66, 108, 82,
713 115, 167, 169, 171, 83, 121
716 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
717 STATE-NUM. */
718 #define YYPACT_NINF -152
719 static const short int yypact[] =
721 -152, 4, -152, 8, 64, -4, 119, -28, -14, -26,
722 -22, -152, -152, -152, -152, -152, -152, -152, -152, -152,
723 -15, -6, 5, 21, -152, -7, -152, 0, -152, 27,
724 -152, 32, -152, 34, -152, 36, 40, 41, 42, 37,
725 -152, 43, -152, 44, -152, -152, -51, 46, -25, 55,
726 -12, 56, 16, 58, 20, 59, 30, 60, -152, -152,
727 -152, -152, 19, -152, -3, -152, 6, 74, -152, -152,
728 -152, -152, -152, -152, -152, -152, -152, -152, -152, -152,
729 -152, -152, 33, -23, 99, 31, 146, 146, 146, 63,
730 116, 65, 62, 61, 66, 68, 67, 72, -152, -2,
731 121, 77, 72, -152, -152, 7, 31, 78, -152, 92,
732 -18, 117, 115, 96, 100, -152, 98, 105, 101, 120,
733 123, -152, 125, -50, 126, 122, 129, -152, -152, -152,
734 -152, -152, -152, -152, -152, -152, -152, -152, -152, -152,
735 136, 128, 114, 130, 131, 132, 133, -152, 134, 135,
736 141, 137, -50, 138, -152, 140, 142, 143, 139, -152,
737 144, 145, 147, -152, -152, -152, -152, 148, -152, 149,
738 -152, 150, 151, -152, 152, 153, 154, 155, -152, -152,
739 -152, -152, -50, -152, -152, -152, -152, -152, 146, -152,
740 -152, -152, -152, -152, -152, 156, -152, -50, -152, 158,
741 -152, -152, -152, -152, -152, -152, -152, -152, -152, -152,
742 -152, -152, -152, -152, -152, -152, -152, -152, -50, 2,
743 -50, 159, 160, 161, -152, -152, 162, 163, -152, -152,
744 -152
747 /* YYPGOTO[NTERM-NUM]. */
748 static const short int yypgoto[] =
750 -152, -152, -152, -152, -152, -152, -152, -152, -152, -152,
751 -152, 17, -152, -39, -152, -87, 103, -152, 97, 106,
752 -152, -151, 164, -152, -152, -152, -152, 157, -152, -152,
753 -152, -152, -152, -152, -152, -152
756 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
757 positive, shift that token. If negative, reduce the rule which
758 number is the opposite. If zero, do what YYDEFACT says.
759 If YYTABLE_NINF, syntax error. */
760 #define YYTABLE_NINF -1
761 static const unsigned char yytable[] =
763 143, 197, 100, 100, 2, 41, 67, 3, 221, 222,
764 180, 68, 20, 4, 69, 23, 43, 36, 181, 106,
765 106, 84, 5, 165, 166, 6, 116, 117, 118, 38,
766 119, 214, 85, 86, 87, 88, 89, 72, 37, 90,
767 69, 120, 7, 48, 39, 50, 217, 52, 40, 54,
768 74, 56, 8, 69, 91, 92, 93, 42, 9, 47,
769 49, 101, 157, 10, 102, 102, 223, 220, 44, 225,
770 107, 161, 110, 111, 21, 94, 22, 95, 76, 112,
771 113, 69, 78, 96, 45, 69, 97, 85, 86, 87,
772 88, 89, 80, 51, 90, 69, 123, 114, 53, 61,
773 55, 215, 57, 58, 59, 60, 63, 65, 71, 91,
774 92, 93, 85, 86, 87, 88, 89, 73, 75, 90,
775 77, 79, 81, 145, 146, 158, 149, 147, 148, 154,
776 94, 150, 95, 152, 91, 92, 93, 155, 109, 159,
777 163, 97, 24, 25, 26, 27, 28, 29, 30, 31,
778 32, 33, 34, 35, 164, 94, 125, 95, 126, 170,
779 168, 172, 173, 122, 174, 175, 97, 176, 127, 128,
780 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
781 139, 186, 184, 188, 140, 178, 177, 179, 183, 185,
782 187, 144, 189, 190, 191, 192, 193, 194, 195, 196,
783 198, 199, 202, 162, 200, 201, 203, 204, 160, 205,
784 206, 207, 208, 209, 210, 211, 212, 213, 218, 226,
785 227, 216, 105, 228, 229, 230, 0, 99
788 static const short int yycheck[] =
790 87, 152, 5, 5, 0, 11, 45, 3, 6, 7,
791 60, 62, 4, 9, 65, 19, 11, 45, 68, 13,
792 13, 60, 18, 41, 42, 21, 49, 50, 51, 55,
793 53, 182, 13, 14, 15, 16, 17, 62, 52, 20,
794 65, 64, 38, 26, 66, 28, 197, 30, 63, 32,
795 62, 34, 48, 65, 35, 36, 37, 63, 54, 66,
796 60, 64, 64, 59, 67, 67, 64, 218, 63, 220,
797 64, 64, 39, 40, 10, 56, 12, 58, 62, 46,
798 47, 65, 62, 64, 63, 65, 67, 13, 14, 15,
799 16, 17, 62, 66, 20, 65, 65, 64, 66, 62,
800 66, 188, 66, 63, 63, 63, 63, 63, 62, 35,
801 36, 37, 13, 14, 15, 16, 17, 62, 62, 20,
802 62, 62, 62, 60, 8, 4, 65, 62, 66, 62,
803 56, 65, 58, 65, 35, 36, 37, 65, 64, 62,
804 62, 67, 23, 24, 25, 26, 27, 28, 29, 30,
805 31, 32, 33, 34, 62, 56, 10, 58, 12, 44,
806 43, 65, 62, 64, 66, 60, 67, 66, 22, 23,
807 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
808 34, 45, 60, 69, 38, 62, 66, 62, 62, 60,
809 62, 88, 62, 62, 62, 62, 62, 62, 57, 62,
810 62, 61, 63, 106, 62, 62, 62, 62, 102, 62,
811 62, 62, 62, 62, 62, 62, 62, 62, 60, 60,
812 60, 65, 65, 62, 62, 62, -1, 63
815 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
816 symbol of state STATE-NUM. */
817 static const unsigned char yystos[] =
819 0, 71, 0, 3, 9, 18, 21, 38, 48, 54,
820 59, 72, 73, 74, 75, 76, 77, 78, 79, 80,
821 4, 10, 12, 19, 23, 24, 25, 26, 27, 28,
822 29, 30, 31, 32, 33, 34, 45, 52, 55, 66,
823 63, 11, 63, 11, 63, 63, 81, 66, 81, 60,
824 81, 66, 81, 66, 81, 66, 81, 66, 63, 63,
825 63, 62, 83, 63, 92, 63, 97, 83, 62, 65,
826 82, 62, 62, 62, 62, 62, 62, 62, 62, 62,
827 62, 62, 99, 104, 83, 13, 14, 15, 16, 17,
828 20, 35, 36, 37, 56, 58, 64, 67, 84, 92,
829 5, 64, 67, 93, 94, 97, 13, 64, 98, 64,
830 39, 40, 46, 47, 64, 100, 49, 50, 51, 53,
831 64, 105, 64, 65, 88, 10, 12, 22, 23, 24,
832 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
833 38, 85, 86, 85, 86, 60, 8, 62, 66, 65,
834 65, 87, 65, 90, 62, 65, 89, 64, 4, 62,
835 89, 64, 88, 62, 62, 41, 42, 101, 43, 102,
836 44, 103, 65, 62, 66, 60, 66, 66, 62, 62,
837 60, 68, 91, 62, 60, 60, 45, 62, 69, 62,
838 62, 62, 62, 62, 62, 57, 62, 91, 62, 61,
839 62, 62, 63, 62, 62, 62, 62, 62, 62, 62,
840 62, 62, 62, 62, 91, 85, 65, 91, 60, 95,
841 91, 6, 7, 64, 96, 91, 60, 60, 62, 62,
845 #define yyerrok (yyerrstatus = 0)
846 #define yyclearin (yychar = YYEMPTY)
847 #define YYEMPTY (-2)
848 #define YYEOF 0
850 #define YYACCEPT goto yyacceptlab
851 #define YYABORT goto yyabortlab
852 #define YYERROR goto yyerrorlab
855 /* Like YYERROR except do call yyerror. This remains here temporarily
856 to ease the transition to the new meaning of YYERROR, for GCC.
857 Once GCC version 2 has supplanted version 1, this can go. */
859 #define YYFAIL goto yyerrlab
861 #define YYRECOVERING() (!!yyerrstatus)
863 #define YYBACKUP(Token, Value) \
864 do \
865 if (yychar == YYEMPTY && yylen == 1) \
867 yychar = (Token); \
868 yylval = (Value); \
869 yytoken = YYTRANSLATE (yychar); \
870 YYPOPSTACK; \
871 goto yybackup; \
873 else \
875 yyerror (YY_("syntax error: cannot back up")); \
876 YYERROR; \
878 while (0)
881 #define YYTERROR 1
882 #define YYERRCODE 256
885 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
886 If N is 0, then set CURRENT to the empty location which ends
887 the previous symbol: RHS[0] (always defined). */
889 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
890 #ifndef YYLLOC_DEFAULT
891 # define YYLLOC_DEFAULT(Current, Rhs, N) \
892 do \
893 if (N) \
895 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
896 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
897 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
898 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
900 else \
902 (Current).first_line = (Current).last_line = \
903 YYRHSLOC (Rhs, 0).last_line; \
904 (Current).first_column = (Current).last_column = \
905 YYRHSLOC (Rhs, 0).last_column; \
907 while (0)
908 #endif
911 /* YY_LOCATION_PRINT -- Print the location on the stream.
912 This macro was not mandated originally: define only if we know
913 we won't break user code: when these are the locations we know. */
915 #ifndef YY_LOCATION_PRINT
916 # if YYLTYPE_IS_TRIVIAL
917 # define YY_LOCATION_PRINT(File, Loc) \
918 fprintf (File, "%d.%d-%d.%d", \
919 (Loc).first_line, (Loc).first_column, \
920 (Loc).last_line, (Loc).last_column)
921 # else
922 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
923 # endif
924 #endif
927 /* YYLEX -- calling `yylex' with the right arguments. */
929 #ifdef YYLEX_PARAM
930 # define YYLEX yylex (YYLEX_PARAM)
931 #else
932 # define YYLEX yylex ()
933 #endif
935 /* Enable debugging if requested. */
936 #if YYDEBUG
938 # ifndef YYFPRINTF
939 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
940 # define YYFPRINTF fprintf
941 # endif
943 # define YYDPRINTF(Args) \
944 do { \
945 if (yydebug) \
946 YYFPRINTF Args; \
947 } while (0)
949 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
950 do { \
951 if (yydebug) \
953 YYFPRINTF (stderr, "%s ", Title); \
954 yysymprint (stderr, \
955 Type, Value); \
956 YYFPRINTF (stderr, "\n"); \
958 } while (0)
960 /*------------------------------------------------------------------.
961 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
962 | TOP (included). |
963 `------------------------------------------------------------------*/
965 #if defined (__STDC__) || defined (__cplusplus)
966 static void
967 yy_stack_print (short int *bottom, short int *top)
968 #else
969 static void
970 yy_stack_print (bottom, top)
971 short int *bottom;
972 short int *top;
973 #endif
975 YYFPRINTF (stderr, "Stack now");
976 for (/* Nothing. */; bottom <= top; ++bottom)
977 YYFPRINTF (stderr, " %d", *bottom);
978 YYFPRINTF (stderr, "\n");
981 # define YY_STACK_PRINT(Bottom, Top) \
982 do { \
983 if (yydebug) \
984 yy_stack_print ((Bottom), (Top)); \
985 } while (0)
988 /*------------------------------------------------.
989 | Report that the YYRULE is going to be reduced. |
990 `------------------------------------------------*/
992 #if defined (__STDC__) || defined (__cplusplus)
993 static void
994 yy_reduce_print (int yyrule)
995 #else
996 static void
997 yy_reduce_print (yyrule)
998 int yyrule;
999 #endif
1001 int yyi;
1002 unsigned long int yylno = yyrline[yyrule];
1003 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1004 yyrule - 1, yylno);
1005 /* Print the symbols being reduced, and their result. */
1006 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1007 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1008 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
1011 # define YY_REDUCE_PRINT(Rule) \
1012 do { \
1013 if (yydebug) \
1014 yy_reduce_print (Rule); \
1015 } while (0)
1017 /* Nonzero means print parse trace. It is left uninitialized so that
1018 multiple parsers can coexist. */
1019 int yydebug;
1020 #else /* !YYDEBUG */
1021 # define YYDPRINTF(Args)
1022 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1023 # define YY_STACK_PRINT(Bottom, Top)
1024 # define YY_REDUCE_PRINT(Rule)
1025 #endif /* !YYDEBUG */
1028 /* YYINITDEPTH -- initial size of the parser's stacks. */
1029 #ifndef YYINITDEPTH
1030 # define YYINITDEPTH 200
1031 #endif
1033 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1034 if the built-in stack extension method is used).
1036 Do not make this value too large; the results are undefined if
1037 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1038 evaluated with infinite-precision integer arithmetic. */
1040 #ifndef YYMAXDEPTH
1041 # define YYMAXDEPTH 10000
1042 #endif
1046 #if YYERROR_VERBOSE
1048 # ifndef yystrlen
1049 # if defined (__GLIBC__) && defined (_STRING_H)
1050 # define yystrlen strlen
1051 # else
1052 /* Return the length of YYSTR. */
1053 static YYSIZE_T
1054 # if defined (__STDC__) || defined (__cplusplus)
1055 yystrlen (const char *yystr)
1056 # else
1057 yystrlen (yystr)
1058 const char *yystr;
1059 # endif
1061 const char *yys = yystr;
1063 while (*yys++ != '\0')
1064 continue;
1066 return yys - yystr - 1;
1068 # endif
1069 # endif
1071 # ifndef yystpcpy
1072 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1073 # define yystpcpy stpcpy
1074 # else
1075 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1076 YYDEST. */
1077 static char *
1078 # if defined (__STDC__) || defined (__cplusplus)
1079 yystpcpy (char *yydest, const char *yysrc)
1080 # else
1081 yystpcpy (yydest, yysrc)
1082 char *yydest;
1083 const char *yysrc;
1084 # endif
1086 char *yyd = yydest;
1087 const char *yys = yysrc;
1089 while ((*yyd++ = *yys++) != '\0')
1090 continue;
1092 return yyd - 1;
1094 # endif
1095 # endif
1097 # ifndef yytnamerr
1098 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1099 quotes and backslashes, so that it's suitable for yyerror. The
1100 heuristic is that double-quoting is unnecessary unless the string
1101 contains an apostrophe, a comma, or backslash (other than
1102 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1103 null, do not copy; instead, return the length of what the result
1104 would have been. */
1105 static YYSIZE_T
1106 yytnamerr (char *yyres, const char *yystr)
1108 if (*yystr == '"')
1110 size_t yyn = 0;
1111 char const *yyp = yystr;
1113 for (;;)
1114 switch (*++yyp)
1116 case '\'':
1117 case ',':
1118 goto do_not_strip_quotes;
1120 case '\\':
1121 if (*++yyp != '\\')
1122 goto do_not_strip_quotes;
1123 /* Fall through. */
1124 default:
1125 if (yyres)
1126 yyres[yyn] = *yyp;
1127 yyn++;
1128 break;
1130 case '"':
1131 if (yyres)
1132 yyres[yyn] = '\0';
1133 return yyn;
1135 do_not_strip_quotes: ;
1138 if (! yyres)
1139 return yystrlen (yystr);
1141 return yystpcpy (yyres, yystr) - yyres;
1143 # endif
1145 #endif /* YYERROR_VERBOSE */
1149 #if YYDEBUG
1150 /*--------------------------------.
1151 | Print this symbol on YYOUTPUT. |
1152 `--------------------------------*/
1154 #if defined (__STDC__) || defined (__cplusplus)
1155 static void
1156 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1157 #else
1158 static void
1159 yysymprint (yyoutput, yytype, yyvaluep)
1160 FILE *yyoutput;
1161 int yytype;
1162 YYSTYPE *yyvaluep;
1163 #endif
1165 /* Pacify ``unused variable'' warnings. */
1166 (void) yyvaluep;
1168 if (yytype < YYNTOKENS)
1169 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1170 else
1171 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1174 # ifdef YYPRINT
1175 if (yytype < YYNTOKENS)
1176 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1177 # endif
1178 switch (yytype)
1180 default:
1181 break;
1183 YYFPRINTF (yyoutput, ")");
1186 #endif /* ! YYDEBUG */
1187 /*-----------------------------------------------.
1188 | Release the memory associated to this symbol. |
1189 `-----------------------------------------------*/
1191 #if defined (__STDC__) || defined (__cplusplus)
1192 static void
1193 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1194 #else
1195 static void
1196 yydestruct (yymsg, yytype, yyvaluep)
1197 const char *yymsg;
1198 int yytype;
1199 YYSTYPE *yyvaluep;
1200 #endif
1202 /* Pacify ``unused variable'' warnings. */
1203 (void) yyvaluep;
1205 if (!yymsg)
1206 yymsg = "Deleting";
1207 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1209 switch (yytype)
1212 default:
1213 break;
1218 /* Prevent warnings from -Wmissing-prototypes. */
1220 #ifdef YYPARSE_PARAM
1221 # if defined (__STDC__) || defined (__cplusplus)
1222 int yyparse (void *YYPARSE_PARAM);
1223 # else
1224 int yyparse ();
1225 # endif
1226 #else /* ! YYPARSE_PARAM */
1227 #if defined (__STDC__) || defined (__cplusplus)
1228 int yyparse (void);
1229 #else
1230 int yyparse ();
1231 #endif
1232 #endif /* ! YYPARSE_PARAM */
1236 /* The look-ahead symbol. */
1237 int yychar;
1239 /* The semantic value of the look-ahead symbol. */
1240 YYSTYPE yylval;
1242 /* Number of syntax errors so far. */
1243 int yynerrs;
1247 /*----------.
1248 | yyparse. |
1249 `----------*/
1251 #ifdef YYPARSE_PARAM
1252 # if defined (__STDC__) || defined (__cplusplus)
1253 int yyparse (void *YYPARSE_PARAM)
1254 # else
1255 int yyparse (YYPARSE_PARAM)
1256 void *YYPARSE_PARAM;
1257 # endif
1258 #else /* ! YYPARSE_PARAM */
1259 #if defined (__STDC__) || defined (__cplusplus)
1261 yyparse (void)
1262 #else
1264 yyparse ()
1266 #endif
1267 #endif
1270 int yystate;
1271 int yyn;
1272 int yyresult;
1273 /* Number of tokens to shift before error messages enabled. */
1274 int yyerrstatus;
1275 /* Look-ahead token as an internal (translated) token number. */
1276 int yytoken = 0;
1278 /* Three stacks and their tools:
1279 `yyss': related to states,
1280 `yyvs': related to semantic values,
1281 `yyls': related to locations.
1283 Refer to the stacks thru separate pointers, to allow yyoverflow
1284 to reallocate them elsewhere. */
1286 /* The state stack. */
1287 short int yyssa[YYINITDEPTH];
1288 short int *yyss = yyssa;
1289 short int *yyssp;
1291 /* The semantic value stack. */
1292 YYSTYPE yyvsa[YYINITDEPTH];
1293 YYSTYPE *yyvs = yyvsa;
1294 YYSTYPE *yyvsp;
1298 #define YYPOPSTACK (yyvsp--, yyssp--)
1300 YYSIZE_T yystacksize = YYINITDEPTH;
1302 /* The variables used to return semantic value and location from the
1303 action routines. */
1304 YYSTYPE yyval;
1307 /* When reducing, the number of symbols on the RHS of the reduced
1308 rule. */
1309 int yylen;
1311 YYDPRINTF ((stderr, "Starting parse\n"));
1313 yystate = 0;
1314 yyerrstatus = 0;
1315 yynerrs = 0;
1316 yychar = YYEMPTY; /* Cause a token to be read. */
1318 /* Initialize stack pointers.
1319 Waste one element of value and location stack
1320 so that they stay on the same level as the state stack.
1321 The wasted elements are never initialized. */
1323 yyssp = yyss;
1324 yyvsp = yyvs;
1326 goto yysetstate;
1328 /*------------------------------------------------------------.
1329 | yynewstate -- Push a new state, which is found in yystate. |
1330 `------------------------------------------------------------*/
1331 yynewstate:
1332 /* In all cases, when you get here, the value and location stacks
1333 have just been pushed. so pushing a state here evens the stacks.
1335 yyssp++;
1337 yysetstate:
1338 *yyssp = yystate;
1340 if (yyss + yystacksize - 1 <= yyssp)
1342 /* Get the current used size of the three stacks, in elements. */
1343 YYSIZE_T yysize = yyssp - yyss + 1;
1345 #ifdef yyoverflow
1347 /* Give user a chance to reallocate the stack. Use copies of
1348 these so that the &'s don't force the real ones into
1349 memory. */
1350 YYSTYPE *yyvs1 = yyvs;
1351 short int *yyss1 = yyss;
1354 /* Each stack pointer address is followed by the size of the
1355 data in use in that stack, in bytes. This used to be a
1356 conditional around just the two extra args, but that might
1357 be undefined if yyoverflow is a macro. */
1358 yyoverflow (YY_("memory exhausted"),
1359 &yyss1, yysize * sizeof (*yyssp),
1360 &yyvs1, yysize * sizeof (*yyvsp),
1362 &yystacksize);
1364 yyss = yyss1;
1365 yyvs = yyvs1;
1367 #else /* no yyoverflow */
1368 # ifndef YYSTACK_RELOCATE
1369 goto yyexhaustedlab;
1370 # else
1371 /* Extend the stack our own way. */
1372 if (YYMAXDEPTH <= yystacksize)
1373 goto yyexhaustedlab;
1374 yystacksize *= 2;
1375 if (YYMAXDEPTH < yystacksize)
1376 yystacksize = YYMAXDEPTH;
1379 short int *yyss1 = yyss;
1380 union yyalloc *yyptr =
1381 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1382 if (! yyptr)
1383 goto yyexhaustedlab;
1384 YYSTACK_RELOCATE (yyss);
1385 YYSTACK_RELOCATE (yyvs);
1387 # undef YYSTACK_RELOCATE
1388 if (yyss1 != yyssa)
1389 YYSTACK_FREE (yyss1);
1391 # endif
1392 #endif /* no yyoverflow */
1394 yyssp = yyss + yysize - 1;
1395 yyvsp = yyvs + yysize - 1;
1398 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1399 (unsigned long int) yystacksize));
1401 if (yyss + yystacksize - 1 <= yyssp)
1402 YYABORT;
1405 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1407 goto yybackup;
1409 /*-----------.
1410 | yybackup. |
1411 `-----------*/
1412 yybackup:
1414 /* Do appropriate processing given the current state. */
1415 /* Read a look-ahead token if we need one and don't already have one. */
1416 /* yyresume: */
1418 /* First try to decide what to do without reference to look-ahead token. */
1420 yyn = yypact[yystate];
1421 if (yyn == YYPACT_NINF)
1422 goto yydefault;
1424 /* Not known => get a look-ahead token if don't already have one. */
1426 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1427 if (yychar == YYEMPTY)
1429 YYDPRINTF ((stderr, "Reading a token: "));
1430 yychar = YYLEX;
1433 if (yychar <= YYEOF)
1435 yychar = yytoken = YYEOF;
1436 YYDPRINTF ((stderr, "Now at end of input.\n"));
1438 else
1440 yytoken = YYTRANSLATE (yychar);
1441 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1444 /* If the proper action on seeing token YYTOKEN is to reduce or to
1445 detect an error, take that action. */
1446 yyn += yytoken;
1447 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1448 goto yydefault;
1449 yyn = yytable[yyn];
1450 if (yyn <= 0)
1452 if (yyn == 0 || yyn == YYTABLE_NINF)
1453 goto yyerrlab;
1454 yyn = -yyn;
1455 goto yyreduce;
1458 if (yyn == YYFINAL)
1459 YYACCEPT;
1461 /* Shift the look-ahead token. */
1462 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1464 /* Discard the token being shifted unless it is eof. */
1465 if (yychar != YYEOF)
1466 yychar = YYEMPTY;
1468 *++yyvsp = yylval;
1471 /* Count tokens shifted since error; after three, turn off error
1472 status. */
1473 if (yyerrstatus)
1474 yyerrstatus--;
1476 yystate = yyn;
1477 goto yynewstate;
1480 /*-----------------------------------------------------------.
1481 | yydefault -- do the default action for the current state. |
1482 `-----------------------------------------------------------*/
1483 yydefault:
1484 yyn = yydefact[yystate];
1485 if (yyn == 0)
1486 goto yyerrlab;
1487 goto yyreduce;
1490 /*-----------------------------.
1491 | yyreduce -- Do a reduction. |
1492 `-----------------------------*/
1493 yyreduce:
1494 /* yyn is the number of a rule to reduce with. */
1495 yylen = yyr2[yyn];
1497 /* If YYLEN is nonzero, implement the default value of the action:
1498 `$$ = $1'.
1500 Otherwise, the following line sets YYVAL to garbage.
1501 This behavior is undocumented and Bison
1502 users should not rely upon it. Assigning to YYVAL
1503 unconditionally makes the parser a bit smaller, and it avoids a
1504 GCC warning that YYVAL may be used uninitialized. */
1505 yyval = yyvsp[1-yylen];
1508 YY_REDUCE_PRINT (yyn);
1509 switch (yyn)
1511 case 12:
1512 #line 167 "cfparse.y"
1514 struct cf_namelist *ifl;
1516 MAKE_NAMELIST(ifl, (yyvsp[-4].str), (yyvsp[-2].list));
1518 if (add_namelist(ifl, &iflist_head))
1519 return (-1);
1521 break;
1523 case 13:
1524 #line 179 "cfparse.y"
1526 struct cf_namelist *host;
1528 MAKE_NAMELIST(host, (yyvsp[-4].str), (yyvsp[-2].list));
1530 if (add_namelist(host, &hostlist_head))
1531 return (-1);
1533 break;
1535 case 14:
1536 #line 191 "cfparse.y"
1538 if (cf_dns_list == NULL)
1539 cf_dns_list = (yyvsp[-1].list);
1540 else {
1541 cf_dns_list->tail->next = (yyvsp[-1].list);
1542 cf_dns_list->tail = (yyvsp[-1].list)->tail;
1545 break;
1547 case 15:
1548 #line 200 "cfparse.y"
1550 struct cf_list *l;
1552 MAKE_CFLIST(l, CFLISTENT_GENERIC, (yyvsp[-1].str), NULL);
1554 if (cf_dns_name_list == NULL) {
1555 cf_dns_name_list = l;
1556 cf_dns_name_list->tail = l;
1557 cf_dns_name_list->next = NULL;
1558 } else {
1559 cf_dns_name_list->tail->next = l;
1560 cf_dns_name_list->tail = l->tail;
1563 break;
1565 case 16:
1566 #line 215 "cfparse.y"
1568 if (cf_ntp_list == NULL)
1569 cf_ntp_list = (yyvsp[-1].list);
1570 else {
1571 cf_ntp_list->tail->next = (yyvsp[-1].list);
1572 cf_ntp_list->tail = (yyvsp[-1].list)->tail;
1575 break;
1577 case 17:
1578 #line 224 "cfparse.y"
1580 if (cf_sip_list == NULL)
1581 cf_sip_list = (yyvsp[-1].list);
1582 else {
1583 cf_sip_list->tail->next = (yyvsp[-1].list);
1584 cf_sip_list->tail = (yyvsp[-1].list)->tail;
1587 break;
1589 case 18:
1590 #line 233 "cfparse.y"
1592 struct cf_list *l;
1594 MAKE_CFLIST(l, CFLISTENT_GENERIC, (yyvsp[-1].str), NULL);
1596 if (cf_sip_name_list == NULL) {
1597 cf_sip_name_list = l;
1598 cf_sip_name_list->tail = l;
1599 cf_sip_name_list->next = NULL;
1600 } else {
1601 cf_sip_name_list->tail->next = l;
1602 cf_sip_name_list->tail = l->tail;
1605 break;
1607 case 19:
1608 #line 248 "cfparse.y"
1610 if (cf_nis_list == NULL)
1611 cf_nis_list = (yyvsp[-1].list);
1612 else {
1613 cf_nis_list->tail->next = (yyvsp[-1].list);
1614 cf_nis_list->tail = (yyvsp[-1].list)->tail;
1617 break;
1619 case 20:
1620 #line 257 "cfparse.y"
1622 struct cf_list *l;
1624 MAKE_CFLIST(l, CFLISTENT_GENERIC, (yyvsp[-1].str), NULL);
1626 if (cf_nis_name_list == NULL) {
1627 cf_nis_name_list = l;
1628 cf_nis_name_list->tail = l;
1629 cf_nis_name_list->next = NULL;
1630 } else {
1631 cf_nis_name_list->tail->next = l;
1632 cf_nis_name_list->tail = l->tail;
1635 break;
1637 case 21:
1638 #line 272 "cfparse.y"
1640 if (cf_nisp_list == NULL)
1641 cf_nisp_list = (yyvsp[-1].list);
1642 else {
1643 cf_nisp_list->tail->next = (yyvsp[-1].list);
1644 cf_nisp_list->tail = (yyvsp[-1].list)->tail;
1647 break;
1649 case 22:
1650 #line 281 "cfparse.y"
1652 struct cf_list *l;
1654 MAKE_CFLIST(l, CFLISTENT_GENERIC, (yyvsp[-1].str), NULL);
1656 if (cf_nisp_name_list == NULL) {
1657 cf_nisp_name_list = l;
1658 cf_nisp_name_list->tail = l;
1659 cf_nisp_name_list->next = NULL;
1660 } else {
1661 cf_nisp_name_list->tail->next = l;
1662 cf_nisp_name_list->tail = l->tail;
1665 break;
1667 case 23:
1668 #line 296 "cfparse.y"
1670 if (cf_bcmcs_list == NULL)
1671 cf_bcmcs_list = (yyvsp[-1].list);
1672 else {
1673 cf_bcmcs_list->tail->next = (yyvsp[-1].list);
1674 cf_bcmcs_list->tail = (yyvsp[-1].list)->tail;
1677 break;
1679 case 24:
1680 #line 305 "cfparse.y"
1682 struct cf_list *l;
1684 MAKE_CFLIST(l, CFLISTENT_GENERIC, (yyvsp[-1].str), NULL);
1686 if (cf_bcmcs_name_list == NULL) {
1687 cf_bcmcs_name_list = l;
1688 cf_bcmcs_name_list->tail = l;
1689 cf_bcmcs_name_list->next = NULL;
1690 } else {
1691 cf_bcmcs_name_list->tail->next = l;
1692 cf_bcmcs_name_list->tail = l->tail;
1695 break;
1697 case 25:
1698 #line 320 "cfparse.y"
1700 if (cf_refreshtime == -1) {
1701 cf_refreshtime = (yyvsp[-1].num);
1702 if (cf_refreshtime < -1 ||
1703 cf_refreshtime > 0xffffffff) {
1705 * refresh time should not be negative
1706 * according to the lex definition,
1707 * but check it for safety.
1709 yyerror("refresh time is out of range");
1711 if (cf_refreshtime < DHCP6_IRT_MINIMUM) {
1713 * the value MUST NOT be smaller than
1714 * IRT_MINIMUM.
1716 yyerror("refresh time is too small "
1717 "(must not be smaller than %d)",
1718 DHCP6_IRT_MINIMUM);
1720 } else {
1721 yywarn("multiple refresh times (ignored)");
1724 break;
1726 case 26:
1727 #line 349 "cfparse.y"
1729 struct cf_namelist *iapd;
1731 MAKE_NAMELIST(iapd, (yyvsp[-4].str), (yyvsp[-2].list));
1733 if (add_namelist(iapd, &iapdlist_head))
1734 return (-1);
1736 break;
1738 case 27:
1739 #line 358 "cfparse.y"
1741 struct cf_namelist *iapd;
1742 char *zero;
1744 if ((zero = strdup("0")) == NULL) {
1745 yywarn("can't allocate memory");
1746 return (-1);
1748 MAKE_NAMELIST(iapd, zero, (yyvsp[-2].list));
1750 if (add_namelist(iapd, &iapdlist_head))
1751 return (-1);
1753 break;
1755 case 28:
1756 #line 372 "cfparse.y"
1758 struct cf_namelist *iana;
1760 MAKE_NAMELIST(iana, (yyvsp[-4].str), (yyvsp[-2].list));
1762 if (add_namelist(iana, &ianalist_head))
1763 return (-1);
1765 break;
1767 case 29:
1768 #line 381 "cfparse.y"
1770 struct cf_namelist *iana;
1771 char *zero;
1773 if ((zero = strdup("0")) == NULL) {
1774 yywarn("can't allocate memory");
1775 return (-1);
1777 MAKE_NAMELIST(iana, zero, (yyvsp[-2].list));
1779 if (add_namelist(iana, &ianalist_head))
1780 return (-1);
1782 break;
1784 case 30:
1785 #line 398 "cfparse.y"
1787 struct cf_namelist *authinfo;
1789 MAKE_NAMELIST(authinfo, (yyvsp[-4].str), (yyvsp[-2].list));
1791 if (add_namelist(authinfo, &authinfolist_head))
1792 return (-1);
1794 break;
1796 case 31:
1797 #line 410 "cfparse.y"
1799 struct cf_namelist *key;
1801 MAKE_NAMELIST(key, (yyvsp[-4].str), (yyvsp[-2].list));
1803 if (add_namelist(key, &keylist_head))
1804 return (-1);
1806 break;
1808 case 32:
1809 #line 422 "cfparse.y"
1811 if (cfswitch_buffer((yyvsp[-1].str))) {
1812 free((yyvsp[-1].str));
1813 return (-1);
1815 free((yyvsp[-1].str));
1817 break;
1819 case 33:
1820 #line 433 "cfparse.y"
1822 struct cf_namelist *pool;
1824 MAKE_NAMELIST(pool, (yyvsp[-4].str), (yyvsp[-2].list));
1826 if (add_namelist(pool, &addrpoollist_head))
1827 return (-1);
1829 break;
1831 case 34:
1832 #line 444 "cfparse.y"
1833 { (yyval.list) = NULL; }
1834 break;
1836 case 35:
1837 #line 446 "cfparse.y"
1839 struct cf_list *head;
1841 if ((head = (yyvsp[-1].list)) == NULL) {
1842 (yyvsp[0].list)->next = NULL;
1843 (yyvsp[0].list)->tail = (yyvsp[0].list);
1844 head = (yyvsp[0].list);
1845 } else {
1846 head->tail->next = (yyvsp[0].list);
1847 head->tail = (yyvsp[0].list)->tail;
1850 (yyval.list) = head;
1852 break;
1854 case 36:
1855 #line 464 "cfparse.y"
1857 struct cf_list *l;
1858 struct in6_addr a0, *a;
1860 if (inet_pton(AF_INET6, (yyvsp[0].str), &a0) != 1) {
1861 yywarn("invalid IPv6 address: %s", (yyvsp[0].str));
1862 free((yyvsp[0].str));
1863 return (-1);
1865 if ((a = malloc(sizeof(*a))) == NULL) {
1866 yywarn("can't allocate memory");
1867 return (-1);
1869 *a = a0;
1871 MAKE_CFLIST(l, CFLISTENT_GENERIC, a, NULL);
1873 (yyval.list) = l;
1875 break;
1877 case 37:
1878 #line 486 "cfparse.y"
1879 { (yyval.list) = NULL; }
1880 break;
1882 case 38:
1883 #line 488 "cfparse.y"
1885 struct cf_list *head;
1887 if ((head = (yyvsp[-1].list)) == NULL) {
1888 (yyvsp[0].list)->next = NULL;
1889 (yyvsp[0].list)->tail = (yyvsp[0].list);
1890 head = (yyvsp[0].list);
1891 } else {
1892 head->tail->next = (yyvsp[0].list);
1893 head->tail = (yyvsp[0].list)->tail;
1896 (yyval.list) = head;
1898 break;
1900 case 39:
1901 #line 506 "cfparse.y"
1903 struct cf_list *l;
1905 MAKE_CFLIST(l, DECL_SEND, NULL, (yyvsp[-1].list));
1907 (yyval.list) = l;
1909 break;
1911 case 40:
1912 #line 514 "cfparse.y"
1914 struct cf_list *l;
1916 MAKE_CFLIST(l, DECL_REQUEST, NULL, (yyvsp[-1].list));
1918 (yyval.list) = l;
1920 break;
1922 case 41:
1923 #line 522 "cfparse.y"
1925 struct cf_list *l;
1927 MAKE_CFLIST(l, DECL_INFO_ONLY, NULL, NULL);
1928 /* no value */
1929 (yyval.list) = l;
1931 break;
1933 case 42:
1934 #line 530 "cfparse.y"
1936 struct cf_list *l;
1938 MAKE_CFLIST(l, DECL_ALLOW, NULL, (yyvsp[-1].list));
1940 (yyval.list) = l;
1942 break;
1944 case 43:
1945 #line 538 "cfparse.y"
1947 struct cf_list *l;
1949 MAKE_CFLIST(l, DECL_DUID, (yyvsp[-1].str), NULL);
1951 (yyval.list) = l;
1953 break;
1955 case 44:
1956 #line 546 "cfparse.y"
1958 struct cf_list *l;
1960 MAKE_CFLIST(l, DECL_ADDRESS, (yyvsp[-1].prefix),NULL);
1962 (yyval.list) = l;
1964 break;
1966 case 45:
1967 #line 554 "cfparse.y"
1969 struct cf_list *l;
1971 MAKE_CFLIST(l, DECL_PREFIX, (yyvsp[-1].prefix), NULL);
1973 (yyval.list) = l;
1975 break;
1977 case 46:
1978 #line 562 "cfparse.y"
1980 struct cf_list *l;
1982 MAKE_CFLIST(l, DECL_PREFERENCE, NULL, NULL);
1983 l->num = (yyvsp[-1].num);
1985 (yyval.list) = l;
1987 break;
1989 case 47:
1990 #line 571 "cfparse.y"
1992 struct cf_list *l;
1994 MAKE_CFLIST(l, DECL_SCRIPT, (yyvsp[-1].str), NULL);
1996 (yyval.list) = l;
1998 break;
2000 case 48:
2001 #line 579 "cfparse.y"
2003 struct cf_list *l;
2005 MAKE_CFLIST(l, DECL_DELAYEDKEY, (yyvsp[-1].str), NULL);
2007 (yyval.list) = l;
2009 break;
2011 case 49:
2012 #line 587 "cfparse.y"
2014 struct cf_list *l;
2016 MAKE_CFLIST(l, DECL_RANGE, (yyvsp[-1].range), NULL);
2018 (yyval.list) = l;
2020 break;
2022 case 50:
2023 #line 595 "cfparse.y"
2025 struct cf_list *l;
2027 MAKE_CFLIST(l, DECL_ADDRESSPOOL, (yyvsp[-1].pool), NULL);
2029 (yyval.list) = l;
2031 break;
2033 case 51:
2034 #line 606 "cfparse.y"
2036 (yyval.list) = (yyvsp[0].list);
2038 break;
2040 case 52:
2041 #line 610 "cfparse.y"
2043 (yyvsp[-2].list)->next = (yyvsp[0].list);
2044 (yyvsp[-2].list)->tail = (yyvsp[0].list)->tail;
2046 (yyval.list) = (yyvsp[-2].list);
2048 break;
2050 case 53:
2051 #line 620 "cfparse.y"
2053 struct cf_list *l;
2055 MAKE_CFLIST(l, DHCPOPT_RAPID_COMMIT, NULL, NULL);
2056 /* no value */
2057 (yyval.list) = l;
2059 break;
2061 case 54:
2062 #line 628 "cfparse.y"
2064 struct cf_list *l;
2066 MAKE_CFLIST(l, DHCPOPT_AUTHINFO, NULL, NULL);
2067 l->ptr = (yyvsp[0].str);
2068 (yyval.list) = l;
2070 break;
2072 case 55:
2073 #line 636 "cfparse.y"
2075 struct cf_list *l;
2077 MAKE_CFLIST(l, DHCPOPT_IA_PD, NULL, NULL);
2078 l->num = (yyvsp[0].num);
2079 (yyval.list) = l;
2081 break;
2083 case 56:
2084 #line 644 "cfparse.y"
2086 struct cf_list *l;
2088 MAKE_CFLIST(l, DHCPOPT_IA_NA, NULL, NULL);
2089 l->num = (yyvsp[0].num);
2090 (yyval.list) = l;
2092 break;
2094 case 57:
2095 #line 652 "cfparse.y"
2097 struct cf_list *l;
2099 MAKE_CFLIST(l, DHCPOPT_SIP, NULL, NULL);
2100 /* currently no value */
2101 (yyval.list) = l;
2103 break;
2105 case 58:
2106 #line 660 "cfparse.y"
2108 struct cf_list *l;
2110 MAKE_CFLIST(l, DHCPOPT_SIPNAME, NULL, NULL);
2111 /* currently no value */
2112 (yyval.list) = l;
2114 break;
2116 case 59:
2117 #line 668 "cfparse.y"
2119 struct cf_list *l;
2121 MAKE_CFLIST(l, DHCPOPT_DNS, NULL, NULL);
2122 /* currently no value */
2123 (yyval.list) = l;
2125 break;
2127 case 60:
2128 #line 676 "cfparse.y"
2130 struct cf_list *l;
2132 MAKE_CFLIST(l, DHCPOPT_DNSNAME, NULL, NULL);
2133 /* currently no value */
2134 (yyval.list) = l;
2136 break;
2138 case 61:
2139 #line 684 "cfparse.y"
2141 struct cf_list *l;
2143 MAKE_CFLIST(l, DHCPOPT_NTP, NULL, NULL);
2144 /* currently no value */
2145 (yyval.list) = l;
2147 break;
2149 case 62:
2150 #line 692 "cfparse.y"
2152 struct cf_list *l;
2154 MAKE_CFLIST(l, DHCPOPT_REFRESHTIME, NULL, NULL);
2155 /* currently no value */
2156 (yyval.list) = l;
2158 break;
2160 case 63:
2161 #line 700 "cfparse.y"
2163 struct cf_list *l;
2165 MAKE_CFLIST(l, DHCPOPT_NIS, NULL, NULL);
2166 /* currently no value */
2167 (yyval.list) = l;
2169 break;
2171 case 64:
2172 #line 708 "cfparse.y"
2174 struct cf_list *l;
2176 MAKE_CFLIST(l, DHCPOPT_NISNAME, NULL, NULL);
2177 /* currently no value */
2178 (yyval.list) = l;
2180 break;
2182 case 65:
2183 #line 716 "cfparse.y"
2185 struct cf_list *l;
2187 MAKE_CFLIST(l, DHCPOPT_NISP, NULL, NULL);
2188 /* currently no value */
2189 (yyval.list) = l;
2191 break;
2193 case 66:
2194 #line 724 "cfparse.y"
2196 struct cf_list *l;
2198 MAKE_CFLIST(l, DHCPOPT_NISPNAME, NULL, NULL);
2199 /* currently no value */
2200 (yyval.list) = l;
2202 break;
2204 case 67:
2205 #line 732 "cfparse.y"
2207 struct cf_list *l;
2209 MAKE_CFLIST(l, DHCPOPT_BCMCS, NULL, NULL);
2210 /* currently no value */
2211 (yyval.list) = l;
2213 break;
2215 case 68:
2216 #line 740 "cfparse.y"
2218 struct cf_list *l;
2220 MAKE_CFLIST(l, DHCPOPT_BCMCSNAME, NULL, NULL);
2221 /* currently no value */
2222 (yyval.list) = l;
2224 break;
2226 case 69:
2227 #line 751 "cfparse.y"
2229 struct dhcp6_range range0, *range;
2231 memset(&range0, 0, sizeof(range0));
2232 if (inet_pton(AF_INET6, (yyvsp[-2].str), &range0.min) != 1) {
2233 yywarn("invalid IPv6 address: %s", (yyvsp[-2].str));
2234 free((yyvsp[-2].str));
2235 free((yyvsp[0].str));
2236 return (-1);
2238 if (inet_pton(AF_INET6, (yyvsp[0].str), &range0.max) != 1) {
2239 yywarn("invalid IPv6 address: %s", (yyvsp[0].str));
2240 free((yyvsp[-2].str));
2241 free((yyvsp[0].str));
2242 return (-1);
2244 free((yyvsp[-2].str));
2245 free((yyvsp[0].str));
2247 if ((range = malloc(sizeof(*range))) == NULL) {
2248 yywarn("can't allocate memory");
2249 return (-1);
2251 *range = range0;
2253 (yyval.range) = range;
2255 break;
2257 case 70:
2258 #line 782 "cfparse.y"
2260 struct dhcp6_prefix pconf0, *pconf;
2262 memset(&pconf0, 0, sizeof(pconf0));
2263 if (inet_pton(AF_INET6, (yyvsp[-1].str), &pconf0.addr) != 1) {
2264 yywarn("invalid IPv6 address: %s", (yyvsp[-1].str));
2265 free((yyvsp[-1].str));
2266 return (-1);
2268 free((yyvsp[-1].str));
2269 /* validate other parameters later */
2270 pconf0.plen = 128; /* XXX this field is ignored */
2271 if ((yyvsp[0].num) < 0)
2272 pconf0.pltime = DHCP6_DURATION_INFINITE;
2273 else
2274 pconf0.pltime = (u_int32_t)(yyvsp[0].num);
2275 pconf0.vltime = pconf0.pltime;
2277 if ((pconf = malloc(sizeof(*pconf))) == NULL) {
2278 yywarn("can't allocate memory");
2279 return (-1);
2281 *pconf = pconf0;
2283 (yyval.prefix) = pconf;
2285 break;
2287 case 71:
2288 #line 809 "cfparse.y"
2290 struct dhcp6_prefix pconf0, *pconf;
2292 memset(&pconf0, 0, sizeof(pconf0));
2293 if (inet_pton(AF_INET6, (yyvsp[-2].str), &pconf0.addr) != 1) {
2294 yywarn("invalid IPv6 address: %s", (yyvsp[-2].str));
2295 free((yyvsp[-2].str));
2296 return (-1);
2298 free((yyvsp[-2].str));
2299 /* validate other parameters later */
2300 pconf0.plen = 128; /* XXX */
2301 if ((yyvsp[-1].num) < 0)
2302 pconf0.pltime = DHCP6_DURATION_INFINITE;
2303 else
2304 pconf0.pltime = (u_int32_t)(yyvsp[-1].num);
2305 if ((yyvsp[0].num) < 0)
2306 pconf0.vltime = DHCP6_DURATION_INFINITE;
2307 else
2308 pconf0.vltime = (u_int32_t)(yyvsp[0].num);
2310 if ((pconf = malloc(sizeof(*pconf))) == NULL) {
2311 yywarn("can't allocate memory");
2312 return (-1);
2314 *pconf = pconf0;
2316 (yyval.prefix) = pconf;
2318 break;
2320 case 72:
2321 #line 842 "cfparse.y"
2323 struct dhcp6_prefix pconf0, *pconf;
2325 memset(&pconf0, 0, sizeof(pconf0));
2326 if (inet_pton(AF_INET6, (yyvsp[-3].str), &pconf0.addr) != 1) {
2327 yywarn("invalid IPv6 address: %s", (yyvsp[-3].str));
2328 free((yyvsp[-3].str));
2329 return (-1);
2331 free((yyvsp[-3].str));
2332 /* validate other parameters later */
2333 pconf0.plen = (yyvsp[-1].num);
2334 if ((yyvsp[0].num) < 0)
2335 pconf0.pltime = DHCP6_DURATION_INFINITE;
2336 else
2337 pconf0.pltime = (u_int32_t)(yyvsp[0].num);
2338 pconf0.vltime = pconf0.pltime;
2340 if ((pconf = malloc(sizeof(*pconf))) == NULL) {
2341 yywarn("can't allocate memory");
2342 return (-1);
2344 *pconf = pconf0;
2346 (yyval.prefix) = pconf;
2348 break;
2350 case 73:
2351 #line 869 "cfparse.y"
2353 struct dhcp6_prefix pconf0, *pconf;
2355 memset(&pconf0, 0, sizeof(pconf0));
2356 if (inet_pton(AF_INET6, (yyvsp[-4].str), &pconf0.addr) != 1) {
2357 yywarn("invalid IPv6 address: %s", (yyvsp[-4].str));
2358 free((yyvsp[-4].str));
2359 return (-1);
2361 free((yyvsp[-4].str));
2362 /* validate other parameters later */
2363 pconf0.plen = (yyvsp[-2].num);
2364 if ((yyvsp[-1].num) < 0)
2365 pconf0.pltime = DHCP6_DURATION_INFINITE;
2366 else
2367 pconf0.pltime = (u_int32_t)(yyvsp[-1].num);
2368 if ((yyvsp[0].num) < 0)
2369 pconf0.vltime = DHCP6_DURATION_INFINITE;
2370 else
2371 pconf0.vltime = (u_int32_t)(yyvsp[0].num);
2373 if ((pconf = malloc(sizeof(*pconf))) == NULL) {
2374 yywarn("can't allocate memory");
2375 return (-1);
2377 *pconf = pconf0;
2379 (yyval.prefix) = pconf;
2381 break;
2383 case 74:
2384 #line 902 "cfparse.y"
2386 struct dhcp6_poolspec* pool;
2388 if ((pool = malloc(sizeof(*pool))) == NULL) {
2389 yywarn("can't allocate memory");
2390 free((yyvsp[-1].str));
2391 return (-1);
2393 if ((pool->name = strdup((yyvsp[-1].str))) == NULL) {
2394 yywarn("can't allocate memory");
2395 free((yyvsp[-1].str));
2396 return (-1);
2398 free((yyvsp[-1].str));
2400 /* validate other parameters later */
2401 if ((yyvsp[0].num) < 0)
2402 pool->pltime = DHCP6_DURATION_INFINITE;
2403 else
2404 pool->pltime = (u_int32_t)(yyvsp[0].num);
2405 pool->vltime = pool->pltime;
2407 (yyval.pool) = pool;
2409 break;
2411 case 75:
2412 #line 927 "cfparse.y"
2414 struct dhcp6_poolspec* pool;
2416 if ((pool = malloc(sizeof(*pool))) == NULL) {
2417 yywarn("can't allocate memory");
2418 free((yyvsp[-2].str));
2419 return (-1);
2421 if ((pool->name = strdup((yyvsp[-2].str))) == NULL) {
2422 yywarn("can't allocate memory");
2423 free((yyvsp[-2].str));
2424 return (-1);
2426 free((yyvsp[-2].str));
2428 /* validate other parameters later */
2429 if ((yyvsp[-1].num) < 0)
2430 pool->pltime = DHCP6_DURATION_INFINITE;
2431 else
2432 pool->pltime = (u_int32_t)(yyvsp[-1].num);
2433 if ((yyvsp[0].num) < 0)
2434 pool->vltime = DHCP6_DURATION_INFINITE;
2435 else
2436 pool->vltime = (u_int32_t)(yyvsp[0].num);
2438 (yyval.pool) = pool;
2440 break;
2442 case 76:
2443 #line 958 "cfparse.y"
2445 (yyval.num) = -1;
2447 break;
2449 case 77:
2450 #line 962 "cfparse.y"
2452 (yyval.num) = (yyvsp[0].num);
2454 break;
2456 case 78:
2457 #line 968 "cfparse.y"
2458 { (yyval.list) = NULL; }
2459 break;
2461 case 79:
2462 #line 970 "cfparse.y"
2464 struct cf_list *head;
2466 if ((head = (yyvsp[-1].list)) == NULL) {
2467 (yyvsp[0].list)->next = NULL;
2468 (yyvsp[0].list)->tail = (yyvsp[0].list);
2469 head = (yyvsp[0].list);
2470 } else {
2471 head->tail->next = (yyvsp[0].list);
2472 head->tail = (yyvsp[0].list)->tail;
2475 (yyval.list) = head;
2477 break;
2479 case 80:
2480 #line 987 "cfparse.y"
2481 { (yyval.list) = (yyvsp[0].list); }
2482 break;
2484 case 81:
2485 #line 989 "cfparse.y"
2487 struct cf_list *l;
2489 MAKE_CFLIST(l, IACONF_PREFIX, (yyvsp[-1].prefix), NULL);
2491 (yyval.list) = l;
2493 break;
2495 case 82:
2496 #line 1000 "cfparse.y"
2498 struct cf_list *ifl;
2500 MAKE_CFLIST(ifl, IACONF_PIF, (yyvsp[-4].str), (yyvsp[-2].list));
2501 (yyval.list) = ifl;
2503 break;
2505 case 83:
2506 #line 1009 "cfparse.y"
2507 { (yyval.list) = NULL; }
2508 break;
2510 case 84:
2511 #line 1011 "cfparse.y"
2513 struct cf_list *head;
2515 if ((head = (yyvsp[-1].list)) == NULL) {
2516 (yyvsp[0].list)->next = NULL;
2517 (yyvsp[0].list)->tail = (yyvsp[0].list);
2518 head = (yyvsp[0].list);
2519 } else {
2520 head->tail->next = (yyvsp[0].list);
2521 head->tail = (yyvsp[0].list)->tail;
2524 (yyval.list) = head;
2526 break;
2528 case 85:
2529 #line 1029 "cfparse.y"
2531 struct cf_list *l;
2533 MAKE_CFLIST(l, IFPARAM_SLA_ID, NULL, NULL);
2534 l->num = (yyvsp[-1].num);
2535 (yyval.list) = l;
2537 break;
2539 case 86:
2540 #line 1037 "cfparse.y"
2542 struct cf_list *l;
2544 MAKE_CFLIST(l, IFPARAM_SLA_LEN, NULL, NULL);
2545 l->num = (yyvsp[-1].num);
2546 (yyval.list) = l;
2548 break;
2550 case 87:
2551 #line 1047 "cfparse.y"
2552 { (yyval.list) = NULL; }
2553 break;
2555 case 88:
2556 #line 1049 "cfparse.y"
2558 struct cf_list *head;
2560 if ((head = (yyvsp[-1].list)) == NULL) {
2561 (yyvsp[0].list)->next = NULL;
2562 (yyvsp[0].list)->tail = (yyvsp[0].list);
2563 head = (yyvsp[0].list);
2564 } else {
2565 head->tail->next = (yyvsp[0].list);
2566 head->tail = (yyvsp[0].list)->tail;
2569 (yyval.list) = head;
2571 break;
2573 case 89:
2574 #line 1067 "cfparse.y"
2576 struct cf_list *l;
2578 MAKE_CFLIST(l, IACONF_ADDR, (yyvsp[-1].prefix), NULL);
2580 (yyval.list) = l;
2582 break;
2584 case 90:
2585 #line 1077 "cfparse.y"
2586 { (yyval.list) = NULL; }
2587 break;
2589 case 91:
2590 #line 1079 "cfparse.y"
2592 struct cf_list *head;
2594 if ((head = (yyvsp[-1].list)) == NULL) {
2595 (yyvsp[0].list)->next = NULL;
2596 (yyvsp[0].list)->tail = (yyvsp[0].list);
2597 head = (yyvsp[0].list);
2598 } else {
2599 head->tail->next = (yyvsp[0].list);
2600 head->tail = (yyvsp[0].list)->tail;
2603 (yyval.list) = head;
2605 break;
2607 case 92:
2608 #line 1097 "cfparse.y"
2610 struct cf_list *l;
2612 MAKE_CFLIST(l, AUTHPARAM_PROTO, NULL, NULL);
2613 l->num = (yyvsp[-1].num);
2614 (yyval.list) = l;
2616 break;
2618 case 93:
2619 #line 1105 "cfparse.y"
2621 struct cf_list *l;
2623 MAKE_CFLIST(l, AUTHPARAM_ALG, NULL, NULL);
2624 l->num = (yyvsp[-1].num);
2625 (yyval.list) = l;
2627 break;
2629 case 94:
2630 #line 1113 "cfparse.y"
2632 struct cf_list *l;
2634 MAKE_CFLIST(l, AUTHPARAM_RDM, NULL, NULL);
2635 l->num = (yyvsp[-1].num);
2636 (yyval.list) = l;
2638 break;
2640 case 95:
2641 #line 1121 "cfparse.y"
2643 struct cf_list *l;
2645 MAKE_CFLIST(l, AUTHPARAM_KEY, NULL, NULL);
2646 l->ptr = (yyvsp[-1].str);
2647 (yyval.list) = l;
2649 break;
2651 case 96:
2652 #line 1131 "cfparse.y"
2653 { (yyval.num) = DHCP6_AUTHPROTO_DELAYED; }
2654 break;
2656 case 97:
2657 #line 1132 "cfparse.y"
2658 { (yyval.num) = DHCP6_AUTHPROTO_RECONFIG; }
2659 break;
2661 case 98:
2662 #line 1136 "cfparse.y"
2663 { (yyval.num) = DHCP6_AUTHALG_HMACMD5; }
2664 break;
2666 case 99:
2667 #line 1140 "cfparse.y"
2668 { (yyval.num) = DHCP6_AUTHRDM_MONOCOUNTER; }
2669 break;
2671 case 100:
2672 #line 1144 "cfparse.y"
2673 { (yyval.list) = NULL; }
2674 break;
2676 case 101:
2677 #line 1146 "cfparse.y"
2679 struct cf_list *head;
2681 if ((head = (yyvsp[-1].list)) == NULL) {
2682 (yyvsp[0].list)->next = NULL;
2683 (yyvsp[0].list)->tail = (yyvsp[0].list);
2684 head = (yyvsp[0].list);
2685 } else {
2686 head->tail->next = (yyvsp[0].list);
2687 head->tail = (yyvsp[0].list)->tail;
2690 (yyval.list) = head;
2692 break;
2694 case 102:
2695 #line 1164 "cfparse.y"
2697 struct cf_list *l;
2699 MAKE_CFLIST(l, KEYPARAM_REALM, NULL, NULL);
2700 l->ptr = (yyvsp[-1].str);
2701 (yyval.list) = l;
2703 break;
2705 case 103:
2706 #line 1172 "cfparse.y"
2708 struct cf_list *l;
2710 MAKE_CFLIST(l, KEYPARAM_KEYID, NULL, NULL);
2711 l->num = (yyvsp[-1].num);
2712 (yyval.list) = l;
2714 break;
2716 case 104:
2717 #line 1180 "cfparse.y"
2719 struct cf_list *l;
2721 MAKE_CFLIST(l, KEYPARAM_SECRET, NULL, NULL);
2722 l->ptr = (yyvsp[-1].str);
2723 (yyval.list) = l;
2725 break;
2727 case 105:
2728 #line 1188 "cfparse.y"
2730 struct cf_list *l;
2732 MAKE_CFLIST(l, KEYPARAM_EXPIRE, NULL, NULL);
2733 l->ptr = (yyvsp[-1].str);
2734 (yyval.list) = l;
2736 break;
2739 default: break;
2742 /* Line 1126 of yacc.c. */
2743 #line 2744 "y.tab.c"
2745 yyvsp -= yylen;
2746 yyssp -= yylen;
2749 YY_STACK_PRINT (yyss, yyssp);
2751 *++yyvsp = yyval;
2754 /* Now `shift' the result of the reduction. Determine what state
2755 that goes to, based on the state we popped back to and the rule
2756 number reduced by. */
2758 yyn = yyr1[yyn];
2760 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2761 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2762 yystate = yytable[yystate];
2763 else
2764 yystate = yydefgoto[yyn - YYNTOKENS];
2766 goto yynewstate;
2769 /*------------------------------------.
2770 | yyerrlab -- here on detecting error |
2771 `------------------------------------*/
2772 yyerrlab:
2773 /* If not already recovering from an error, report this error. */
2774 if (!yyerrstatus)
2776 ++yynerrs;
2777 #if YYERROR_VERBOSE
2778 yyn = yypact[yystate];
2780 if (YYPACT_NINF < yyn && yyn < YYLAST)
2782 int yytype = YYTRANSLATE (yychar);
2783 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
2784 YYSIZE_T yysize = yysize0;
2785 YYSIZE_T yysize1;
2786 int yysize_overflow = 0;
2787 char *yymsg = 0;
2788 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
2789 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2790 int yyx;
2792 #if 0
2793 /* This is so xgettext sees the translatable formats that are
2794 constructed on the fly. */
2795 YY_("syntax error, unexpected %s");
2796 YY_("syntax error, unexpected %s, expecting %s");
2797 YY_("syntax error, unexpected %s, expecting %s or %s");
2798 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2799 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2800 #endif
2801 char *yyfmt;
2802 char const *yyf;
2803 static char const yyunexpected[] = "syntax error, unexpected %s";
2804 static char const yyexpecting[] = ", expecting %s";
2805 static char const yyor[] = " or %s";
2806 char yyformat[sizeof yyunexpected
2807 + sizeof yyexpecting - 1
2808 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2809 * (sizeof yyor - 1))];
2810 char const *yyprefix = yyexpecting;
2812 /* Start YYX at -YYN if negative to avoid negative indexes in
2813 YYCHECK. */
2814 int yyxbegin = yyn < 0 ? -yyn : 0;
2816 /* Stay within bounds of both yycheck and yytname. */
2817 int yychecklim = YYLAST - yyn;
2818 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2819 int yycount = 1;
2821 yyarg[0] = yytname[yytype];
2822 yyfmt = yystpcpy (yyformat, yyunexpected);
2824 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2825 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2827 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2829 yycount = 1;
2830 yysize = yysize0;
2831 yyformat[sizeof yyunexpected - 1] = '\0';
2832 break;
2834 yyarg[yycount++] = yytname[yyx];
2835 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2836 yysize_overflow |= yysize1 < yysize;
2837 yysize = yysize1;
2838 yyfmt = yystpcpy (yyfmt, yyprefix);
2839 yyprefix = yyor;
2842 yyf = YY_(yyformat);
2843 yysize1 = yysize + yystrlen (yyf);
2844 yysize_overflow |= yysize1 < yysize;
2845 yysize = yysize1;
2847 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
2848 yymsg = (char *) YYSTACK_ALLOC (yysize);
2849 if (yymsg)
2851 /* Avoid sprintf, as that infringes on the user's name space.
2852 Don't have undefined behavior even if the translation
2853 produced a string with the wrong number of "%s"s. */
2854 char *yyp = yymsg;
2855 int yyi = 0;
2856 while ((*yyp = *yyf))
2858 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2860 yyp += yytnamerr (yyp, yyarg[yyi++]);
2861 yyf += 2;
2863 else
2865 yyp++;
2866 yyf++;
2869 yyerror (yymsg);
2870 YYSTACK_FREE (yymsg);
2872 else
2874 yyerror (YY_("syntax error"));
2875 goto yyexhaustedlab;
2878 else
2879 #endif /* YYERROR_VERBOSE */
2880 yyerror (YY_("syntax error"));
2885 if (yyerrstatus == 3)
2887 /* If just tried and failed to reuse look-ahead token after an
2888 error, discard it. */
2890 if (yychar <= YYEOF)
2892 /* Return failure if at end of input. */
2893 if (yychar == YYEOF)
2894 YYABORT;
2896 else
2898 yydestruct ("Error: discarding", yytoken, &yylval);
2899 yychar = YYEMPTY;
2903 /* Else will try to reuse look-ahead token after shifting the error
2904 token. */
2905 goto yyerrlab1;
2908 /*---------------------------------------------------.
2909 | yyerrorlab -- error raised explicitly by YYERROR. |
2910 `---------------------------------------------------*/
2911 yyerrorlab:
2913 /* Pacify compilers like GCC when the user code never invokes
2914 YYERROR and the label yyerrorlab therefore never appears in user
2915 code. */
2916 if (0)
2917 goto yyerrorlab;
2919 yyvsp -= yylen;
2920 yyssp -= yylen;
2921 yystate = *yyssp;
2922 goto yyerrlab1;
2925 /*-------------------------------------------------------------.
2926 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2927 `-------------------------------------------------------------*/
2928 yyerrlab1:
2929 yyerrstatus = 3; /* Each real token shifted decrements this. */
2931 for (;;)
2933 yyn = yypact[yystate];
2934 if (yyn != YYPACT_NINF)
2936 yyn += YYTERROR;
2937 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2939 yyn = yytable[yyn];
2940 if (0 < yyn)
2941 break;
2945 /* Pop the current state because it cannot handle the error token. */
2946 if (yyssp == yyss)
2947 YYABORT;
2950 yydestruct ("Error: popping", yystos[yystate], yyvsp);
2951 YYPOPSTACK;
2952 yystate = *yyssp;
2953 YY_STACK_PRINT (yyss, yyssp);
2956 if (yyn == YYFINAL)
2957 YYACCEPT;
2959 *++yyvsp = yylval;
2962 /* Shift the error token. */
2963 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2965 yystate = yyn;
2966 goto yynewstate;
2969 /*-------------------------------------.
2970 | yyacceptlab -- YYACCEPT comes here. |
2971 `-------------------------------------*/
2972 yyacceptlab:
2973 yyresult = 0;
2974 goto yyreturn;
2976 /*-----------------------------------.
2977 | yyabortlab -- YYABORT comes here. |
2978 `-----------------------------------*/
2979 yyabortlab:
2980 yyresult = 1;
2981 goto yyreturn;
2983 #ifndef yyoverflow
2984 /*-------------------------------------------------.
2985 | yyexhaustedlab -- memory exhaustion comes here. |
2986 `-------------------------------------------------*/
2987 yyexhaustedlab:
2988 yyerror (YY_("memory exhausted"));
2989 yyresult = 2;
2990 /* Fall through. */
2991 #endif
2993 yyreturn:
2994 if (yychar != YYEOF && yychar != YYEMPTY)
2995 yydestruct ("Cleanup: discarding lookahead",
2996 yytoken, &yylval);
2997 while (yyssp != yyss)
2999 yydestruct ("Cleanup: popping",
3000 yystos[*yyssp], yyvsp);
3001 YYPOPSTACK;
3003 #ifndef yyoverflow
3004 if (yyss != yyssa)
3005 YYSTACK_FREE (yyss);
3006 #endif
3007 return yyresult;
3011 #line 1197 "cfparse.y"
3013 /* supplement routines for configuration */
3014 static int
3015 add_namelist(new, headp)
3016 struct cf_namelist *new, **headp;
3018 struct cf_namelist *n;
3020 /* check for duplicated configuration */
3021 for (n = *headp; n; n = n->next) {
3022 if (strcmp(n->name, new->name) == 0) {
3023 yywarn("duplicated name: %s (ignored)",
3024 new->name);
3025 cleanup_namelist(new);
3026 return (0);
3030 new->next = *headp;
3031 *headp = new;
3033 return (0);
3036 /* free temporary resources */
3037 static void
3038 cleanup()
3040 cleanup_namelist(iflist_head);
3041 iflist_head = NULL;
3042 cleanup_namelist(hostlist_head);
3043 hostlist_head = NULL;
3044 cleanup_namelist(iapdlist_head);
3045 iapdlist_head = NULL;
3046 cleanup_namelist(ianalist_head);
3047 ianalist_head = NULL;
3048 cleanup_namelist(authinfolist_head);
3049 authinfolist_head = NULL;
3050 cleanup_namelist(keylist_head);
3051 keylist_head = NULL;
3052 cleanup_namelist(addrpoollist_head);
3053 addrpoollist_head = NULL;
3055 cleanup_cflist(cf_sip_list);
3056 cf_sip_list = NULL;
3057 cleanup_cflist(cf_sip_name_list);
3058 cf_sip_name_list = NULL;
3059 cleanup_cflist(cf_dns_list);
3060 cf_dns_list = NULL;
3061 cleanup_cflist(cf_dns_name_list);
3062 cf_dns_name_list = NULL;
3063 cleanup_cflist(cf_ntp_list);
3064 cf_ntp_list = NULL;
3065 cleanup_cflist(cf_nis_list);
3066 cf_nis_list = NULL;
3067 cleanup_cflist(cf_nis_name_list);
3068 cf_nis_name_list = NULL;
3069 cleanup_cflist(cf_nisp_list);
3070 cf_nisp_list = NULL;
3071 cleanup_cflist(cf_nisp_name_list);
3072 cf_nisp_name_list = NULL;
3073 cleanup_cflist(cf_bcmcs_list);
3074 cf_bcmcs_list = NULL;
3075 cleanup_cflist(cf_bcmcs_name_list);
3076 cf_bcmcs_name_list = NULL;
3079 static void
3080 cleanup_namelist(head)
3081 struct cf_namelist *head;
3083 struct cf_namelist *ifp, *ifp_next;
3085 for (ifp = head; ifp; ifp = ifp_next) {
3086 ifp_next = ifp->next;
3087 cleanup_cflist(ifp->params);
3088 free(ifp->name);
3089 free(ifp);
3093 static void
3094 cleanup_cflist(p)
3095 struct cf_list *p;
3097 struct cf_list *n;
3099 if (p == NULL)
3100 return;
3102 n = p->next;
3103 if (p->type == DECL_ADDRESSPOOL) {
3104 free(((struct dhcp6_poolspec *)p->ptr)->name);
3106 if (p->ptr)
3107 free(p->ptr);
3108 if (p->list)
3109 cleanup_cflist(p->list);
3110 free(p);
3112 cleanup_cflist(n);
3115 #define config_fail() \
3116 do { cleanup(); configure_cleanup(); return (-1); } while(0)
3119 cf_post_config()
3121 if (configure_keys(keylist_head))
3122 config_fail();
3124 if (configure_authinfo(authinfolist_head))
3125 config_fail();
3127 if (configure_ia(iapdlist_head, IATYPE_PD))
3128 config_fail();
3130 if (configure_ia(ianalist_head, IATYPE_NA))
3131 config_fail();
3133 if (configure_pool(addrpoollist_head))
3134 config_fail();
3136 if (configure_interface(iflist_head))
3137 config_fail();
3139 if (configure_host(hostlist_head))
3140 config_fail();
3142 if (configure_global_option())
3143 config_fail();
3145 configure_commit();
3146 cleanup();
3147 return (0);
3149 #undef config_fail
3151 void
3152 cf_init()
3154 iflist_head = NULL;