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)
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. */
40 #define YYBISON_VERSION "2.1"
43 #define YYSKELETON_NAME "yacc.c"
48 /* Using locations. */
49 #define YYLSP_NEEDED 0
56 /* Put the tokens into the symbol table, so that GDB and other debuggers
61 PREFIX_INTERFACE
= 260,
129 #define INTERFACE 258
131 #define PREFIX_INTERFACE 260
143 #define PREFERENCE 272
148 #define RAPID_COMMIT 277
149 #define DNS_SERVERS 278
151 #define NTP_SERVERS 280
152 #define REFRESHTIME 281
153 #define SIP_SERVERS 282
155 #define NIS_SERVERS 284
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
163 #define DELAYEDKEY 292
164 #define AUTHENTICATION 293
166 #define ALGORITHM 295
170 #define MONOCOUNTER 299
184 #define ADDRESS_POOL 313
200 /* Copy the first part of user declarations. */
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>
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))); \
230 yywarn("can't allocate memory"); \
231 if (p) cleanup_cflist(p); \
234 memset((l), 0, sizeof(*(l))); \
240 #define MAKE_CFLIST(l, t, pp, pl) do { \
241 (l) = (struct cf_list *)malloc(sizeof(*(l))); \
243 yywarn("can't allocate memory"); \
245 if (pl) cleanup_cflist(pl); \
248 memset((l), 0, sizeof(*(l))); \
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. */
280 /* Enabling verbose error messages. */
281 #ifdef YYERROR_VERBOSE
282 # undef YYERROR_VERBOSE
283 # define YYERROR_VERBOSE 1
285 # define YYERROR_VERBOSE 0
288 /* Enabling the token table. */
289 #ifndef YYTOKEN_TABLE
290 # define YYTOKEN_TABLE 0
293 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
294 #line 126 "cfparse.y"
295 typedef union YYSTYPE
{
298 struct cf_list
*list
;
299 struct dhcp6_prefix
*prefix
;
300 struct dhcp6_range
*range
;
301 struct dhcp6_poolspec
*pool
;
303 /* Line 196 of yacc.c. */
305 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
306 # define YYSTYPE_IS_DECLARED 1
307 # define YYSTYPE_IS_TRIVIAL 1
312 /* Copy the second part of user declarations. */
315 /* Line 219 of yacc.c. */
318 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
319 # define YYSIZE_T __SIZE_TYPE__
321 #if ! defined (YYSIZE_T) && defined (size_t)
322 # define YYSIZE_T size_t
324 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
325 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
326 # define YYSIZE_T size_t
328 #if ! defined (YYSIZE_T)
329 # define YYSIZE_T unsigned int
335 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
336 # define YY_(msgid) dgettext ("bison-runtime", msgid)
340 # define YY_(msgid) msgid
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
351 # define YYSTACK_ALLOC __builtin_alloca
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
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 */
373 # define YYSTACK_ALLOC YYMALLOC
374 # define YYSTACK_FREE YYFREE
375 # ifndef YYSTACK_ALLOC_MAXIMUM
376 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
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 */
390 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
391 && (defined (__STDC__) || defined (__cplusplus)))
392 void free (void *); /* INFRINGES ON USER NAME SPACE */
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. */
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
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
425 # if defined (__GNUC__) && 1 < __GNUC__
426 # define YYCOPY(To, From, Count) \
427 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
429 # define YYCOPY(To, From, Count) \
433 for (yyi = 0; yyi < (Count); yyi++) \
434 (To)[yyi] = (From)[yyi]; \
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
445 # define YYSTACK_RELOCATE(Stack) \
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); \
458 #if defined (__STDC__) || defined (__cplusplus)
459 typedef signed char yysigned_char
;
461 typedef short int yysigned_char
;
464 /* YYFINAL -- State number of the termination state. */
466 /* YYLAST -- Last index in YYTABLE. */
469 /* YYNTOKENS -- Number of terminals. */
471 /* YYNNTS -- Number of nonterminals. */
473 /* YYNRULES -- Number of rules. */
475 /* YYNRULES -- Number of states. */
476 #define YYNSTATES 231
478 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
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,
524 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
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
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
630 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
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
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,
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
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,
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)
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) \
865 if (yychar == YYEMPTY && yylen == 1) \
869 yytoken = YYTRANSLATE (yychar); \
875 yyerror (YY_("syntax error: cannot back up")); \
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) \
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; \
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; \
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)
922 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
927 /* YYLEX -- calling `yylex' with the right arguments. */
930 # define YYLEX yylex (YYLEX_PARAM)
932 # define YYLEX yylex ()
935 /* Enable debugging if requested. */
939 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
940 # define YYFPRINTF fprintf
943 # define YYDPRINTF(Args) \
949 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
953 YYFPRINTF (stderr, "%s ", Title); \
954 yysymprint (stderr, \
956 YYFPRINTF (stderr, "\n"); \
960 /*------------------------------------------------------------------.
961 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
963 `------------------------------------------------------------------*/
965 #if defined (__STDC__) || defined (__cplusplus)
967 yy_stack_print (short int *bottom
, short int *top
)
970 yy_stack_print (bottom
, top
)
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) \
984 yy_stack_print ((Bottom), (Top)); \
988 /*------------------------------------------------.
989 | Report that the YYRULE is going to be reduced. |
990 `------------------------------------------------*/
992 #if defined (__STDC__) || defined (__cplusplus)
994 yy_reduce_print (int yyrule
)
997 yy_reduce_print (yyrule
)
1002 unsigned long int yylno
= yyrline
[yyrule
];
1003 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu), ",
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) \
1014 yy_reduce_print (Rule); \
1017 /* Nonzero means print parse trace. It is left uninitialized so that
1018 multiple parsers can coexist. */
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. */
1030 # define YYINITDEPTH 200
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. */
1041 # define YYMAXDEPTH 10000
1049 # if defined (__GLIBC__) && defined (_STRING_H)
1050 # define yystrlen strlen
1052 /* Return the length of YYSTR. */
1054 # if defined (__STDC__) || defined (__cplusplus)
1055 yystrlen (const char *yystr
)
1061 const char *yys
= yystr
;
1063 while (*yys
++ != '\0')
1066 return yys
- yystr
- 1;
1072 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1073 # define yystpcpy stpcpy
1075 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1078 # if defined (__STDC__) || defined (__cplusplus)
1079 yystpcpy (char *yydest
, const char *yysrc
)
1081 yystpcpy (yydest
, yysrc
)
1087 const char *yys
= yysrc
;
1089 while ((*yyd
++ = *yys
++) != '\0')
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
1106 yytnamerr (char *yyres
, const char *yystr
)
1111 char const *yyp
= yystr
;
1118 goto do_not_strip_quotes
;
1122 goto do_not_strip_quotes
;
1135 do_not_strip_quotes
: ;
1139 return yystrlen (yystr
);
1141 return yystpcpy (yyres
, yystr
) - yyres
;
1145 #endif /* YYERROR_VERBOSE */
1150 /*--------------------------------.
1151 | Print this symbol on YYOUTPUT. |
1152 `--------------------------------*/
1154 #if defined (__STDC__) || defined (__cplusplus)
1156 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
1159 yysymprint (yyoutput
, yytype
, yyvaluep
)
1165 /* Pacify ``unused variable'' warnings. */
1168 if (yytype
< YYNTOKENS
)
1169 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1171 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1175 if (yytype
< YYNTOKENS
)
1176 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1183 YYFPRINTF (yyoutput
, ")");
1186 #endif /* ! YYDEBUG */
1187 /*-----------------------------------------------.
1188 | Release the memory associated to this symbol. |
1189 `-----------------------------------------------*/
1191 #if defined (__STDC__) || defined (__cplusplus)
1193 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1196 yydestruct (yymsg
, yytype
, yyvaluep
)
1202 /* Pacify ``unused variable'' warnings. */
1207 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1218 /* Prevent warnings from -Wmissing-prototypes. */
1220 #ifdef YYPARSE_PARAM
1221 # if defined (__STDC__) || defined (__cplusplus)
1222 int yyparse (void *YYPARSE_PARAM
);
1226 #else /* ! YYPARSE_PARAM */
1227 #if defined (__STDC__) || defined (__cplusplus)
1232 #endif /* ! YYPARSE_PARAM */
1236 /* The look-ahead symbol. */
1239 /* The semantic value of the look-ahead symbol. */
1242 /* Number of syntax errors so far. */
1251 #ifdef YYPARSE_PARAM
1252 # if defined (__STDC__) || defined (__cplusplus)
1253 int yyparse (void *YYPARSE_PARAM
)
1255 int yyparse (YYPARSE_PARAM
)
1256 void *YYPARSE_PARAM
;
1258 #else /* ! YYPARSE_PARAM */
1259 #if defined (__STDC__) || defined (__cplusplus)
1273 /* Number of tokens to shift before error messages enabled. */
1275 /* Look-ahead token as an internal (translated) token number. */
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
;
1291 /* The semantic value stack. */
1292 YYSTYPE yyvsa
[YYINITDEPTH
];
1293 YYSTYPE
*yyvs
= yyvsa
;
1298 #define YYPOPSTACK (yyvsp--, yyssp--)
1300 YYSIZE_T yystacksize
= YYINITDEPTH
;
1302 /* The variables used to return semantic value and location from the
1307 /* When reducing, the number of symbols on the RHS of the reduced
1311 YYDPRINTF ((stderr
, "Starting parse\n"));
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. */
1328 /*------------------------------------------------------------.
1329 | yynewstate -- Push a new state, which is found in yystate. |
1330 `------------------------------------------------------------*/
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.
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;
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
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
),
1367 #else /* no yyoverflow */
1368 # ifndef YYSTACK_RELOCATE
1369 goto yyexhaustedlab
;
1371 /* Extend the stack our own way. */
1372 if (YYMAXDEPTH
<= yystacksize
)
1373 goto yyexhaustedlab
;
1375 if (YYMAXDEPTH
< yystacksize
)
1376 yystacksize
= YYMAXDEPTH
;
1379 short int *yyss1
= yyss
;
1380 union yyalloc
*yyptr
=
1381 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1383 goto yyexhaustedlab
;
1384 YYSTACK_RELOCATE (yyss
);
1385 YYSTACK_RELOCATE (yyvs
);
1387 # undef YYSTACK_RELOCATE
1389 YYSTACK_FREE (yyss1
);
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
)
1405 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1414 /* Do appropriate processing given the current state. */
1415 /* Read a look-ahead token if we need one and don't already have one. */
1418 /* First try to decide what to do without reference to look-ahead token. */
1420 yyn
= yypact
[yystate
];
1421 if (yyn
== YYPACT_NINF
)
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: "));
1433 if (yychar
<= YYEOF
)
1435 yychar
= yytoken
= YYEOF
;
1436 YYDPRINTF ((stderr
, "Now at end of input.\n"));
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. */
1447 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1452 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
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
)
1471 /* Count tokens shifted since error; after three, turn off error
1480 /*-----------------------------------------------------------.
1481 | yydefault -- do the default action for the current state. |
1482 `-----------------------------------------------------------*/
1484 yyn
= yydefact
[yystate
];
1490 /*-----------------------------.
1491 | yyreduce -- Do a reduction. |
1492 `-----------------------------*/
1494 /* yyn is the number of a rule to reduce with. */
1497 /* If YYLEN is nonzero, implement the default value of the action:
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
);
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
))
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
))
1536 #line 191 "cfparse.y"
1538 if (cf_dns_list
== NULL
)
1539 cf_dns_list
= (yyvsp
[-1].list
);
1541 cf_dns_list
->tail
->next
= (yyvsp
[-1].list
);
1542 cf_dns_list
->tail
= (yyvsp
[-1].list
)->tail
;
1548 #line 200 "cfparse.y"
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
;
1559 cf_dns_name_list
->tail
->next
= l
;
1560 cf_dns_name_list
->tail
= l
->tail
;
1566 #line 215 "cfparse.y"
1568 if (cf_ntp_list
== NULL
)
1569 cf_ntp_list
= (yyvsp
[-1].list
);
1571 cf_ntp_list
->tail
->next
= (yyvsp
[-1].list
);
1572 cf_ntp_list
->tail
= (yyvsp
[-1].list
)->tail
;
1578 #line 224 "cfparse.y"
1580 if (cf_sip_list
== NULL
)
1581 cf_sip_list
= (yyvsp
[-1].list
);
1583 cf_sip_list
->tail
->next
= (yyvsp
[-1].list
);
1584 cf_sip_list
->tail
= (yyvsp
[-1].list
)->tail
;
1590 #line 233 "cfparse.y"
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
;
1601 cf_sip_name_list
->tail
->next
= l
;
1602 cf_sip_name_list
->tail
= l
->tail
;
1608 #line 248 "cfparse.y"
1610 if (cf_nis_list
== NULL
)
1611 cf_nis_list
= (yyvsp
[-1].list
);
1613 cf_nis_list
->tail
->next
= (yyvsp
[-1].list
);
1614 cf_nis_list
->tail
= (yyvsp
[-1].list
)->tail
;
1620 #line 257 "cfparse.y"
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
;
1631 cf_nis_name_list
->tail
->next
= l
;
1632 cf_nis_name_list
->tail
= l
->tail
;
1638 #line 272 "cfparse.y"
1640 if (cf_nisp_list
== NULL
)
1641 cf_nisp_list
= (yyvsp
[-1].list
);
1643 cf_nisp_list
->tail
->next
= (yyvsp
[-1].list
);
1644 cf_nisp_list
->tail
= (yyvsp
[-1].list
)->tail
;
1650 #line 281 "cfparse.y"
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
;
1661 cf_nisp_name_list
->tail
->next
= l
;
1662 cf_nisp_name_list
->tail
= l
->tail
;
1668 #line 296 "cfparse.y"
1670 if (cf_bcmcs_list
== NULL
)
1671 cf_bcmcs_list
= (yyvsp
[-1].list
);
1673 cf_bcmcs_list
->tail
->next
= (yyvsp
[-1].list
);
1674 cf_bcmcs_list
->tail
= (yyvsp
[-1].list
)->tail
;
1680 #line 305 "cfparse.y"
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
;
1691 cf_bcmcs_name_list
->tail
->next
= l
;
1692 cf_bcmcs_name_list
->tail
= l
->tail
;
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
1716 yyerror("refresh time is too small "
1717 "(must not be smaller than %d)",
1721 yywarn("multiple refresh times (ignored)");
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
))
1739 #line 358 "cfparse.y"
1741 struct cf_namelist
*iapd
;
1744 if ((zero
= strdup("0")) == NULL
) {
1745 yywarn("can't allocate memory");
1748 MAKE_NAMELIST(iapd
, zero
, (yyvsp
[-2].list
));
1750 if (add_namelist(iapd
, &iapdlist_head
))
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
))
1768 #line 381 "cfparse.y"
1770 struct cf_namelist
*iana
;
1773 if ((zero
= strdup("0")) == NULL
) {
1774 yywarn("can't allocate memory");
1777 MAKE_NAMELIST(iana
, zero
, (yyvsp
[-2].list
));
1779 if (add_namelist(iana
, &ianalist_head
))
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
))
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
))
1809 #line 422 "cfparse.y"
1811 if (cfswitch_buffer((yyvsp
[-1].str
))) {
1812 free((yyvsp
[-1].str
));
1815 free((yyvsp
[-1].str
));
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
))
1832 #line 444 "cfparse.y"
1833 { (yyval
.list
) = NULL
; }
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
);
1846 head
->tail
->next
= (yyvsp
[0].list
);
1847 head
->tail
= (yyvsp
[0].list
)->tail
;
1850 (yyval
.list
) = head
;
1855 #line 464 "cfparse.y"
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
));
1865 if ((a
= malloc(sizeof(*a
))) == NULL
) {
1866 yywarn("can't allocate memory");
1871 MAKE_CFLIST(l
, CFLISTENT_GENERIC
, a
, NULL
);
1878 #line 486 "cfparse.y"
1879 { (yyval
.list
) = NULL
; }
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
);
1892 head
->tail
->next
= (yyvsp
[0].list
);
1893 head
->tail
= (yyvsp
[0].list
)->tail
;
1896 (yyval
.list
) = head
;
1901 #line 506 "cfparse.y"
1905 MAKE_CFLIST(l
, DECL_SEND
, NULL
, (yyvsp
[-1].list
));
1912 #line 514 "cfparse.y"
1916 MAKE_CFLIST(l
, DECL_REQUEST
, NULL
, (yyvsp
[-1].list
));
1923 #line 522 "cfparse.y"
1927 MAKE_CFLIST(l
, DECL_INFO_ONLY
, NULL
, NULL
);
1934 #line 530 "cfparse.y"
1938 MAKE_CFLIST(l
, DECL_ALLOW
, NULL
, (yyvsp
[-1].list
));
1945 #line 538 "cfparse.y"
1949 MAKE_CFLIST(l
, DECL_DUID
, (yyvsp
[-1].str
), NULL
);
1956 #line 546 "cfparse.y"
1960 MAKE_CFLIST(l
, DECL_ADDRESS
, (yyvsp
[-1].prefix
),NULL
);
1967 #line 554 "cfparse.y"
1971 MAKE_CFLIST(l
, DECL_PREFIX
, (yyvsp
[-1].prefix
), NULL
);
1978 #line 562 "cfparse.y"
1982 MAKE_CFLIST(l
, DECL_PREFERENCE
, NULL
, NULL
);
1983 l
->num
= (yyvsp
[-1].num
);
1990 #line 571 "cfparse.y"
1994 MAKE_CFLIST(l
, DECL_SCRIPT
, (yyvsp
[-1].str
), NULL
);
2001 #line 579 "cfparse.y"
2005 MAKE_CFLIST(l
, DECL_DELAYEDKEY
, (yyvsp
[-1].str
), NULL
);
2012 #line 587 "cfparse.y"
2016 MAKE_CFLIST(l
, DECL_RANGE
, (yyvsp
[-1].range
), NULL
);
2023 #line 595 "cfparse.y"
2027 MAKE_CFLIST(l
, DECL_ADDRESSPOOL
, (yyvsp
[-1].pool
), NULL
);
2034 #line 606 "cfparse.y"
2036 (yyval
.list
) = (yyvsp
[0].list
);
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
);
2051 #line 620 "cfparse.y"
2055 MAKE_CFLIST(l
, DHCPOPT_RAPID_COMMIT
, NULL
, NULL
);
2062 #line 628 "cfparse.y"
2066 MAKE_CFLIST(l
, DHCPOPT_AUTHINFO
, NULL
, NULL
);
2067 l
->ptr
= (yyvsp
[0].str
);
2073 #line 636 "cfparse.y"
2077 MAKE_CFLIST(l
, DHCPOPT_IA_PD
, NULL
, NULL
);
2078 l
->num
= (yyvsp
[0].num
);
2084 #line 644 "cfparse.y"
2088 MAKE_CFLIST(l
, DHCPOPT_IA_NA
, NULL
, NULL
);
2089 l
->num
= (yyvsp
[0].num
);
2095 #line 652 "cfparse.y"
2099 MAKE_CFLIST(l
, DHCPOPT_SIP
, NULL
, NULL
);
2100 /* currently no value */
2106 #line 660 "cfparse.y"
2110 MAKE_CFLIST(l
, DHCPOPT_SIPNAME
, NULL
, NULL
);
2111 /* currently no value */
2117 #line 668 "cfparse.y"
2121 MAKE_CFLIST(l
, DHCPOPT_DNS
, NULL
, NULL
);
2122 /* currently no value */
2128 #line 676 "cfparse.y"
2132 MAKE_CFLIST(l
, DHCPOPT_DNSNAME
, NULL
, NULL
);
2133 /* currently no value */
2139 #line 684 "cfparse.y"
2143 MAKE_CFLIST(l
, DHCPOPT_NTP
, NULL
, NULL
);
2144 /* currently no value */
2150 #line 692 "cfparse.y"
2154 MAKE_CFLIST(l
, DHCPOPT_REFRESHTIME
, NULL
, NULL
);
2155 /* currently no value */
2161 #line 700 "cfparse.y"
2165 MAKE_CFLIST(l
, DHCPOPT_NIS
, NULL
, NULL
);
2166 /* currently no value */
2172 #line 708 "cfparse.y"
2176 MAKE_CFLIST(l
, DHCPOPT_NISNAME
, NULL
, NULL
);
2177 /* currently no value */
2183 #line 716 "cfparse.y"
2187 MAKE_CFLIST(l
, DHCPOPT_NISP
, NULL
, NULL
);
2188 /* currently no value */
2194 #line 724 "cfparse.y"
2198 MAKE_CFLIST(l
, DHCPOPT_NISPNAME
, NULL
, NULL
);
2199 /* currently no value */
2205 #line 732 "cfparse.y"
2209 MAKE_CFLIST(l
, DHCPOPT_BCMCS
, NULL
, NULL
);
2210 /* currently no value */
2216 #line 740 "cfparse.y"
2220 MAKE_CFLIST(l
, DHCPOPT_BCMCSNAME
, NULL
, NULL
);
2221 /* currently no value */
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
));
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
));
2244 free((yyvsp
[-2].str
));
2245 free((yyvsp
[0].str
));
2247 if ((range
= malloc(sizeof(*range
))) == NULL
) {
2248 yywarn("can't allocate memory");
2253 (yyval
.range
) = range
;
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
));
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
;
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");
2283 (yyval
.prefix
) = pconf
;
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
));
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
;
2304 pconf0
.pltime
= (u_int32_t
)(yyvsp
[-1].num
);
2305 if ((yyvsp
[0].num
) < 0)
2306 pconf0
.vltime
= DHCP6_DURATION_INFINITE
;
2308 pconf0
.vltime
= (u_int32_t
)(yyvsp
[0].num
);
2310 if ((pconf
= malloc(sizeof(*pconf
))) == NULL
) {
2311 yywarn("can't allocate memory");
2316 (yyval
.prefix
) = pconf
;
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
));
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
;
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");
2346 (yyval
.prefix
) = pconf
;
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
));
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
;
2367 pconf0
.pltime
= (u_int32_t
)(yyvsp
[-1].num
);
2368 if ((yyvsp
[0].num
) < 0)
2369 pconf0
.vltime
= DHCP6_DURATION_INFINITE
;
2371 pconf0
.vltime
= (u_int32_t
)(yyvsp
[0].num
);
2373 if ((pconf
= malloc(sizeof(*pconf
))) == NULL
) {
2374 yywarn("can't allocate memory");
2379 (yyval
.prefix
) = pconf
;
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
));
2393 if ((pool
->name
= strdup((yyvsp
[-1].str
))) == NULL
) {
2394 yywarn("can't allocate memory");
2395 free((yyvsp
[-1].str
));
2398 free((yyvsp
[-1].str
));
2400 /* validate other parameters later */
2401 if ((yyvsp
[0].num
) < 0)
2402 pool
->pltime
= DHCP6_DURATION_INFINITE
;
2404 pool
->pltime
= (u_int32_t
)(yyvsp
[0].num
);
2405 pool
->vltime
= pool
->pltime
;
2407 (yyval
.pool
) = pool
;
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
));
2421 if ((pool
->name
= strdup((yyvsp
[-2].str
))) == NULL
) {
2422 yywarn("can't allocate memory");
2423 free((yyvsp
[-2].str
));
2426 free((yyvsp
[-2].str
));
2428 /* validate other parameters later */
2429 if ((yyvsp
[-1].num
) < 0)
2430 pool
->pltime
= DHCP6_DURATION_INFINITE
;
2432 pool
->pltime
= (u_int32_t
)(yyvsp
[-1].num
);
2433 if ((yyvsp
[0].num
) < 0)
2434 pool
->vltime
= DHCP6_DURATION_INFINITE
;
2436 pool
->vltime
= (u_int32_t
)(yyvsp
[0].num
);
2438 (yyval
.pool
) = pool
;
2443 #line 958 "cfparse.y"
2450 #line 962 "cfparse.y"
2452 (yyval
.num
) = (yyvsp
[0].num
);
2457 #line 968 "cfparse.y"
2458 { (yyval
.list
) = NULL
; }
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
);
2471 head
->tail
->next
= (yyvsp
[0].list
);
2472 head
->tail
= (yyvsp
[0].list
)->tail
;
2475 (yyval
.list
) = head
;
2480 #line 987 "cfparse.y"
2481 { (yyval
.list
) = (yyvsp
[0].list
); }
2485 #line 989 "cfparse.y"
2489 MAKE_CFLIST(l
, IACONF_PREFIX
, (yyvsp
[-1].prefix
), NULL
);
2496 #line 1000 "cfparse.y"
2498 struct cf_list
*ifl
;
2500 MAKE_CFLIST(ifl
, IACONF_PIF
, (yyvsp
[-4].str
), (yyvsp
[-2].list
));
2506 #line 1009 "cfparse.y"
2507 { (yyval
.list
) = NULL
; }
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
);
2520 head
->tail
->next
= (yyvsp
[0].list
);
2521 head
->tail
= (yyvsp
[0].list
)->tail
;
2524 (yyval
.list
) = head
;
2529 #line 1029 "cfparse.y"
2533 MAKE_CFLIST(l
, IFPARAM_SLA_ID
, NULL
, NULL
);
2534 l
->num
= (yyvsp
[-1].num
);
2540 #line 1037 "cfparse.y"
2544 MAKE_CFLIST(l
, IFPARAM_SLA_LEN
, NULL
, NULL
);
2545 l
->num
= (yyvsp
[-1].num
);
2551 #line 1047 "cfparse.y"
2552 { (yyval
.list
) = NULL
; }
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
);
2565 head
->tail
->next
= (yyvsp
[0].list
);
2566 head
->tail
= (yyvsp
[0].list
)->tail
;
2569 (yyval
.list
) = head
;
2574 #line 1067 "cfparse.y"
2578 MAKE_CFLIST(l
, IACONF_ADDR
, (yyvsp
[-1].prefix
), NULL
);
2585 #line 1077 "cfparse.y"
2586 { (yyval
.list
) = NULL
; }
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
);
2599 head
->tail
->next
= (yyvsp
[0].list
);
2600 head
->tail
= (yyvsp
[0].list
)->tail
;
2603 (yyval
.list
) = head
;
2608 #line 1097 "cfparse.y"
2612 MAKE_CFLIST(l
, AUTHPARAM_PROTO
, NULL
, NULL
);
2613 l
->num
= (yyvsp
[-1].num
);
2619 #line 1105 "cfparse.y"
2623 MAKE_CFLIST(l
, AUTHPARAM_ALG
, NULL
, NULL
);
2624 l
->num
= (yyvsp
[-1].num
);
2630 #line 1113 "cfparse.y"
2634 MAKE_CFLIST(l
, AUTHPARAM_RDM
, NULL
, NULL
);
2635 l
->num
= (yyvsp
[-1].num
);
2641 #line 1121 "cfparse.y"
2645 MAKE_CFLIST(l
, AUTHPARAM_KEY
, NULL
, NULL
);
2646 l
->ptr
= (yyvsp
[-1].str
);
2652 #line 1131 "cfparse.y"
2653 { (yyval
.num
) = DHCP6_AUTHPROTO_DELAYED
; }
2657 #line 1132 "cfparse.y"
2658 { (yyval
.num
) = DHCP6_AUTHPROTO_RECONFIG
; }
2662 #line 1136 "cfparse.y"
2663 { (yyval
.num
) = DHCP6_AUTHALG_HMACMD5
; }
2667 #line 1140 "cfparse.y"
2668 { (yyval
.num
) = DHCP6_AUTHRDM_MONOCOUNTER
; }
2672 #line 1144 "cfparse.y"
2673 { (yyval
.list
) = NULL
; }
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
);
2686 head
->tail
->next
= (yyvsp
[0].list
);
2687 head
->tail
= (yyvsp
[0].list
)->tail
;
2690 (yyval
.list
) = head
;
2695 #line 1164 "cfparse.y"
2699 MAKE_CFLIST(l
, KEYPARAM_REALM
, NULL
, NULL
);
2700 l
->ptr
= (yyvsp
[-1].str
);
2706 #line 1172 "cfparse.y"
2710 MAKE_CFLIST(l
, KEYPARAM_KEYID
, NULL
, NULL
);
2711 l
->num
= (yyvsp
[-1].num
);
2717 #line 1180 "cfparse.y"
2721 MAKE_CFLIST(l
, KEYPARAM_SECRET
, NULL
, NULL
);
2722 l
->ptr
= (yyvsp
[-1].str
);
2728 #line 1188 "cfparse.y"
2732 MAKE_CFLIST(l
, KEYPARAM_EXPIRE
, NULL
, NULL
);
2733 l
->ptr
= (yyvsp
[-1].str
);
2742 /* Line 1126 of yacc.c. */
2743 #line 2744 "y.tab.c"
2749 YY_STACK_PRINT (yyss
, yyssp
);
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. */
2760 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2761 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2762 yystate
= yytable
[yystate
];
2764 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2769 /*------------------------------------.
2770 | yyerrlab -- here on detecting error |
2771 `------------------------------------*/
2773 /* If not already recovering from an error, report this error. */
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
;
2786 int yysize_overflow
= 0;
2788 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
2789 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
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");
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
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
;
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
)
2831 yyformat
[sizeof yyunexpected
- 1] = '\0';
2834 yyarg
[yycount
++] = yytname
[yyx
];
2835 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
2836 yysize_overflow
|= yysize1
< yysize
;
2838 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
2842 yyf
= YY_(yyformat
);
2843 yysize1
= yysize
+ yystrlen (yyf
);
2844 yysize_overflow
|= yysize1
< yysize
;
2847 if (!yysize_overflow
&& yysize
<= YYSTACK_ALLOC_MAXIMUM
)
2848 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
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. */
2856 while ((*yyp
= *yyf
))
2858 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
2860 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
2870 YYSTACK_FREE (yymsg
);
2874 yyerror (YY_("syntax error"));
2875 goto yyexhaustedlab
;
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
)
2898 yydestruct ("Error: discarding", yytoken
, &yylval
);
2903 /* Else will try to reuse look-ahead token after shifting the error
2908 /*---------------------------------------------------.
2909 | yyerrorlab -- error raised explicitly by YYERROR. |
2910 `---------------------------------------------------*/
2913 /* Pacify compilers like GCC when the user code never invokes
2914 YYERROR and the label yyerrorlab therefore never appears in user
2925 /*-------------------------------------------------------------.
2926 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2927 `-------------------------------------------------------------*/
2929 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2933 yyn
= yypact
[yystate
];
2934 if (yyn
!= YYPACT_NINF
)
2937 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2945 /* Pop the current state because it cannot handle the error token. */
2950 yydestruct ("Error: popping", yystos
[yystate
], yyvsp
);
2953 YY_STACK_PRINT (yyss
, yyssp
);
2962 /* Shift the error token. */
2963 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2969 /*-------------------------------------.
2970 | yyacceptlab -- YYACCEPT comes here. |
2971 `-------------------------------------*/
2976 /*-----------------------------------.
2977 | yyabortlab -- YYABORT comes here. |
2978 `-----------------------------------*/
2984 /*-------------------------------------------------.
2985 | yyexhaustedlab -- memory exhaustion comes here. |
2986 `-------------------------------------------------*/
2988 yyerror (YY_("memory exhausted"));
2994 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
2995 yydestruct ("Cleanup: discarding lookahead",
2997 while (yyssp
!= yyss
)
2999 yydestruct ("Cleanup: popping",
3000 yystos
[*yyssp
], yyvsp
);
3005 YYSTACK_FREE (yyss
);
3011 #line 1197 "cfparse.y"
3013 /* supplement routines for configuration */
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)",
3025 cleanup_namelist(new);
3036 /* free temporary resources */
3040 cleanup_namelist(iflist_head
);
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
);
3057 cleanup_cflist(cf_sip_name_list
);
3058 cf_sip_name_list
= NULL
;
3059 cleanup_cflist(cf_dns_list
);
3061 cleanup_cflist(cf_dns_name_list
);
3062 cf_dns_name_list
= NULL
;
3063 cleanup_cflist(cf_ntp_list
);
3065 cleanup_cflist(cf_nis_list
);
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
;
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
);
3103 if (p
->type
== DECL_ADDRESSPOOL
) {
3104 free(((struct dhcp6_poolspec
*)p
->ptr
)->name
);
3109 cleanup_cflist(p
->list
);
3115 #define config_fail() \
3116 do { cleanup(); configure_cleanup(); return (-1); } while(0)
3121 if (configure_keys(keylist_head
))
3124 if (configure_authinfo(authinfolist_head
))
3127 if (configure_ia(iapdlist_head
, IATYPE_PD
))
3130 if (configure_ia(ianalist_head
, IATYPE_NA
))
3133 if (configure_pool(addrpoollist_head
))
3136 if (configure_interface(iflist_head
))
3139 if (configure_host(hostlist_head
))
3142 if (configure_global_option())