2 /* A Bison parser, made from gram.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
7 #define T_INTERFACE 257
11 #define SIGNEDNUMBER 261
16 #define T_AdvSendAdvert 266
17 #define T_MaxRtrAdvInterval 267
18 #define T_MinRtrAdvInterval 268
19 #define T_AdvManagedFlag 269
20 #define T_AdvOtherConfigFlag 270
21 #define T_AdvLinkMTU 271
22 #define T_AdvReachableTime 272
23 #define T_AdvRetransTimer 273
24 #define T_AdvCurHopLimit 274
25 #define T_AdvDefaultLifetime 275
26 #define T_AdvSourceLLAddress 276
27 #define T_AdvOnLink 277
28 #define T_AdvAutonomous 278
29 #define T_AdvValidLifetime 279
30 #define T_AdvPreferredLifetime 280
31 #define T_AdvRouterAddr 281
32 #define T_AdvHomeAgentFlag 282
33 #define T_AdvIntervalOpt 283
34 #define T_AdvHomeAgentInfo 284
35 #define T_Base6to4Interface 285
36 #define T_UnicastOnly 286
37 #define T_HomeAgentPreference 287
38 #define T_HomeAgentLifetime 288
39 #define T_BAD_TOKEN 289
48 extern struct Interface *IfaceList;
49 struct Interface *iface = NULL;
50 struct AdvPrefix *prefix = NULL;
52 extern char *conf_file;
57 static void cleanup(void);
58 static void yyerror(char *msg);
60 #if 0 /* no longer necessary? */
61 #ifndef HAVE_IN6_ADDR_S6_ADDR
63 # define s6_addr32 __u6_addr.__u6_addr32
64 # define s6_addr16 __u6_addr.__u6_addr16
69 #define ABORT do { cleanup(); YYABORT; } while (0);
78 struct in6_addr *addr;
80 struct AdvPrefix *pinfo;
96 #define YYTRANSLATE(x) ((unsigned)(x) <= 289 ? yytranslate[x] : 55)
98 static const char yytranslate[] = { 0,
99 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
100 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
101 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
102 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
103 2, 2, 2, 2, 2, 2, 39, 2, 2, 2,
104 2, 2, 2, 2, 2, 2, 2, 2, 38, 2,
105 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
106 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
107 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
108 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
109 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
110 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
111 2, 2, 36, 2, 37, 2, 2, 2, 2, 2,
112 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
113 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
114 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
115 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
116 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
117 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
118 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
119 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
120 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
121 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
122 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
123 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
124 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
125 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
126 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
127 27, 28, 29, 30, 31, 32, 33, 34, 35
131 static const short yyprhs[] = { 0,
132 0, 3, 5, 11, 14, 16, 19, 20, 22, 25,
133 27, 31, 35, 39, 43, 47, 51, 55, 59, 63,
134 67, 71, 75, 79, 83, 87, 91, 95, 99, 103,
135 107, 109, 112, 118, 123, 124, 126, 129, 131, 135,
136 139, 143, 147, 151, 155, 157
139 static const short yyrhs[] = { 40,
140 41, 0, 41, 0, 42, 36, 44, 37, 38, 0,
141 3, 43, 0, 5, 0, 45, 48, 0, 0, 46,
142 0, 46, 47, 0, 47, 0, 14, 6, 38, 0,
143 13, 6, 38, 0, 14, 8, 38, 0, 13, 8,
144 38, 0, 12, 9, 38, 0, 15, 9, 38, 0,
145 16, 9, 38, 0, 17, 6, 38, 0, 18, 6,
146 38, 0, 19, 6, 38, 0, 21, 6, 38, 0,
147 20, 6, 38, 0, 22, 9, 38, 0, 29, 9,
148 38, 0, 30, 9, 38, 0, 28, 9, 38, 0,
149 33, 6, 38, 0, 33, 7, 38, 0, 34, 6,
150 38, 0, 32, 9, 38, 0, 49, 0, 48, 49,
151 0, 50, 36, 51, 37, 38, 0, 4, 10, 39,
152 6, 0, 0, 52, 0, 52, 53, 0, 53, 0,
153 23, 9, 38, 0, 24, 9, 38, 0, 27, 9,
154 38, 0, 25, 54, 38, 0, 26, 54, 38, 0,
155 31, 43, 38, 0, 6, 0, 11, 0
161 static const short yyrline[] = { 0,
162 104, 105, 108, 144, 159, 166, 172, 173, 176, 177,
163 180, 184, 188, 192, 196, 200, 204, 208, 212, 216,
164 220, 224, 228, 232, 236, 240, 244, 248, 252, 256,
165 262, 266, 273, 304, 327, 328, 330, 331, 334, 338,
166 342, 346, 350, 354, 362, 366
171 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
173 static const char * const yytname[] = { "$","error","$undefined.","T_INTERFACE",
174 "T_PREFIX","STRING","NUMBER","SIGNEDNUMBER","DECIMAL","SWITCH","IPV6ADDR","INFINITY",
175 "T_AdvSendAdvert","T_MaxRtrAdvInterval","T_MinRtrAdvInterval","T_AdvManagedFlag",
176 "T_AdvOtherConfigFlag","T_AdvLinkMTU","T_AdvReachableTime","T_AdvRetransTimer",
177 "T_AdvCurHopLimit","T_AdvDefaultLifetime","T_AdvSourceLLAddress","T_AdvOnLink",
178 "T_AdvAutonomous","T_AdvValidLifetime","T_AdvPreferredLifetime","T_AdvRouterAddr",
179 "T_AdvHomeAgentFlag","T_AdvIntervalOpt","T_AdvHomeAgentInfo","T_Base6to4Interface",
180 "T_UnicastOnly","T_HomeAgentPreference","T_HomeAgentLifetime","T_BAD_TOKEN",
181 "'{'","'}'","';'","'/'","grammar","ifacedef","ifacehead","name","ifaceparams",
182 "optional_ifacevlist","ifacevlist","ifaceval","prefixlist","prefixdef","prefixhead",
183 "optional_prefixplist","prefixplist","prefixparms","number_or_infinity", NULL
187 static const short yyr1[] = { 0,
188 40, 40, 41, 42, 43, 44, 45, 45, 46, 46,
189 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
190 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
191 48, 48, 49, 50, 51, 51, 52, 52, 53, 53,
192 53, 53, 53, 53, 54, 54
195 static const short yyr2[] = { 0,
196 2, 1, 5, 2, 1, 2, 0, 1, 2, 1,
197 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
198 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
199 1, 2, 5, 4, 0, 1, 2, 1, 3, 3,
203 static const short yydefact[] = { 0,
204 0, 0, 2, 0, 5, 4, 1, 7, 0, 0,
205 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
206 0, 0, 0, 0, 0, 0, 0, 8, 10, 0,
207 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
208 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
209 0, 6, 31, 0, 9, 15, 12, 14, 11, 13,
210 16, 17, 18, 19, 20, 22, 21, 23, 26, 24,
211 25, 30, 27, 28, 29, 3, 0, 32, 35, 0,
212 0, 0, 0, 0, 0, 0, 0, 36, 38, 34,
213 0, 0, 45, 46, 0, 0, 0, 0, 0, 37,
214 39, 40, 42, 43, 41, 44, 33, 0, 0
217 static const short yydefgoto[] = { 2,
218 3, 4, 6, 26, 27, 28, 29, 52, 53, 54,
222 static const short yypact[] = { 31,
223 24, 12,-32768, -1,-32768,-32768,-32768, -12, 27, 5,
224 22, 28, 29, 33, 34, 35, 36, 37, 38, 39,
225 40, 41, 42, 26, 46, 7, 49, -12,-32768, 16,
226 17, 18, 19, 20, 21, 23, 25, 30, 32, 43,
227 44, 45, 47, 48, 50, 51, 52, 53, 54, 55,
228 56, 49,-32768, 9,-32768,-32768,-32768,-32768,-32768,-32768,
229 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
230 -32768,-32768,-32768,-32768,-32768,-32768, 57,-32768, 0, 58,
231 60, 62, 8, 8, 63, 24, 61, 0,-32768,-32768,
232 59, 64,-32768,-32768, 65, 66, 67, 68, 69,-32768,
233 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 73,-32768
236 static const short yypgoto[] = {-32768,
237 72,-32768, -40,-32768,-32768,-32768, 71,-32768, 10,-32768,
238 -32768,-32768, -28, -19
245 static const short yytable[] = { 9,
246 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
247 31, 108, 32, 93, 1, 20, 21, 22, 94, 23,
248 24, 25, 81, 82, 83, 84, 85, 33, 5, 34,
249 86, 47, 48, 1, 8, 30, 35, 36, 37, 38,
250 39, 40, 41, 50, 79, 98, 42, 43, 44, 45,
251 46, 49, 51, 56, 57, 58, 59, 60, 61, 100,
252 62, 78, 63, 90, 96, 77, 0, 64, 91, 65,
253 92, 97, 109, 7, 0, 0, 0, 0, 0, 0,
254 66, 67, 68, 0, 69, 70, 0, 71, 72, 73,
255 74, 75, 76, 0, 0, 80, 101, 99, 55, 0,
256 0, 102, 103, 104, 105, 106, 107
259 static const short yycheck[] = { 12,
260 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
261 6, 0, 8, 6, 3, 28, 29, 30, 11, 32,
262 33, 34, 23, 24, 25, 26, 27, 6, 5, 8,
263 31, 6, 7, 3, 36, 9, 9, 9, 6, 6,
264 6, 6, 6, 37, 36, 86, 9, 9, 9, 9,
265 9, 6, 4, 38, 38, 38, 38, 38, 38, 88,
266 38, 52, 38, 6, 84, 10, -1, 38, 9, 38,
267 9, 9, 0, 2, -1, -1, -1, -1, -1, -1,
268 38, 38, 38, -1, 38, 38, -1, 38, 38, 38,
269 38, 38, 38, -1, -1, 39, 38, 37, 28, -1,
270 -1, 38, 38, 38, 38, 38, 38
272 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
273 #line 3 "/usr/lib/bison.simple"
274 /* This file comes from bison-1.28. */
276 /* Skeleton output parser for bison,
277 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
279 This program is free software; you can redistribute it and/or modify
280 it under the terms of the GNU General Public License as published by
281 the Free Software Foundation; either version 2, or (at your option)
284 This program is distributed in the hope that it will be useful,
285 but WITHOUT ANY WARRANTY; without even the implied warranty of
286 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
287 GNU General Public License for more details.
289 You should have received a copy of the GNU General Public License
290 along with this program; if not, write to the Free Software
291 Foundation, Inc., 59 Temple Place - Suite 330,
292 Boston, MA 02111-1307, USA. */
294 /* As a special exception, when this file is copied by Bison into a
295 Bison output file, you may use that output file without restriction.
296 This special exception was added by the Free Software Foundation
297 in version 1.24 of Bison. */
299 /* This is the parser code that is written into each bison parser
300 when the %semantic_parser declaration is not specified in the grammar.
301 It was written by Richard Stallman by simplifying the hairy parser
302 used when %semantic_parser is specified. */
304 #ifndef YYSTACK_USE_ALLOCA
306 #define YYSTACK_USE_ALLOCA
307 #else /* alloca not defined */
309 #define YYSTACK_USE_ALLOCA
310 #define alloca __builtin_alloca
311 #else /* not GNU C. */
312 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
313 #define YYSTACK_USE_ALLOCA
315 #else /* not sparc */
316 /* We think this test detects Watcom and Microsoft C. */
317 /* This used to test MSDOS, but that is a bad idea
318 since that symbol is in the user namespace. */
319 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
320 #if 0 /* No need for malloc.h, which pollutes the namespace;
321 instead, just don't use alloca. */
324 #else /* not MSDOS, or __TURBOC__ */
326 /* I don't know what this was needed for, but it pollutes the namespace.
327 So I turned it off. rms, 2 May 1997. */
328 /* #include <malloc.h> */
330 #define YYSTACK_USE_ALLOCA
331 #else /* not MSDOS, or __TURBOC__, or _AIX */
333 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
334 and on HPUX 10. Eventually we can turn this on. */
335 #define YYSTACK_USE_ALLOCA
336 #define alloca __builtin_alloca
339 #endif /* not _AIX */
340 #endif /* not MSDOS, or __TURBOC__ */
341 #endif /* not sparc */
342 #endif /* not GNU C */
343 #endif /* alloca not defined */
344 #endif /* YYSTACK_USE_ALLOCA not defined */
346 #ifdef YYSTACK_USE_ALLOCA
347 #define YYSTACK_ALLOC alloca
349 #define YYSTACK_ALLOC malloc
352 /* Note: there must be only one dollar sign in this file.
353 It is replaced by the list of actions, each action
354 as one case of the switch. */
356 #define yyerrok (yyerrstatus = 0)
357 #define yyclearin (yychar = YYEMPTY)
360 #define YYACCEPT goto yyacceptlab
361 #define YYABORT goto yyabortlab
362 #define YYERROR goto yyerrlab1
363 /* Like YYERROR except do call yyerror.
364 This remains here temporarily to ease the
365 transition to the new meaning of YYERROR, for GCC.
366 Once GCC version 2 has supplanted version 1, this can go. */
367 #define YYFAIL goto yyerrlab
368 #define YYRECOVERING() (!!yyerrstatus)
369 #define YYBACKUP(token, value) \
371 if (yychar == YYEMPTY && yylen == 1) \
372 { yychar = (token), yylval = (value); \
373 yychar1 = YYTRANSLATE (yychar); \
378 { yyerror ("syntax error: cannot back up"); YYERROR; } \
382 #define YYERRCODE 256
385 #define YYLEX yylex()
391 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
393 #define YYLEX yylex(&yylval, &yylloc)
395 #else /* not YYLSP_NEEDED */
397 #define YYLEX yylex(&yylval, YYLEX_PARAM)
399 #define YYLEX yylex(&yylval)
401 #endif /* not YYLSP_NEEDED */
404 /* If nonreentrant, generate the variables here */
408 int yychar; /* the lookahead symbol */
409 YYSTYPE yylval; /* the semantic value of the */
410 /* lookahead symbol */
413 YYLTYPE yylloc; /* location data for the lookahead */
417 int yynerrs; /* number of parse errors so far */
418 #endif /* not YYPURE */
421 int yydebug; /* nonzero means print parse trace */
422 /* Since this is uninitialized, it does not stop multiple parsers
426 /* YYINITDEPTH indicates the initial size of the parser's stacks */
429 #define YYINITDEPTH 200
432 /* YYMAXDEPTH is the maximum size the stacks can grow to
433 (effective only if the built-in stack extension method is used). */
440 #define YYMAXDEPTH 10000
443 /* Define __yy_memcpy. Note that the size argument
444 should be passed with type unsigned int, because that is what the non-GCC
445 definitions require. With GCC, __builtin_memcpy takes an arg
446 of type size_t, but it can handle unsigned int. */
448 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
449 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
450 #else /* not GNU C or C++ */
453 /* This is the most reliable way to avoid incompatibilities
454 in available built-in functions on various systems. */
456 __yy_memcpy (to, from, count)
461 register char *f = from;
462 register char *t = to;
463 register int i = count;
469 #else /* __cplusplus */
471 /* This is the most reliable way to avoid incompatibilities
472 in available built-in functions on various systems. */
474 __yy_memcpy (char *to, char *from, unsigned int count)
476 register char *t = to;
477 register char *f = from;
478 register int i = count;
487 #line 217 "/usr/lib/bison.simple"
489 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
490 into yyparse. The argument should have type void *.
491 It should actually point to an object.
492 Grammar actions can access the variable by casting it
493 to the proper pointer type. */
497 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
498 #define YYPARSE_PARAM_DECL
499 #else /* not __cplusplus */
500 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
501 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
502 #endif /* not __cplusplus */
503 #else /* not YYPARSE_PARAM */
504 #define YYPARSE_PARAM_ARG
505 #define YYPARSE_PARAM_DECL
506 #endif /* not YYPARSE_PARAM */
508 /* Prevent warning if -Wstrict-prototypes. */
511 int yyparse (void *);
518 yyparse(YYPARSE_PARAM_ARG)
521 register int yystate;
523 register short *yyssp;
524 register YYSTYPE *yyvsp;
525 int yyerrstatus; /* number of tokens to shift before error messages enabled */
526 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
528 short yyssa[YYINITDEPTH]; /* the state stack */
529 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
531 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
532 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
535 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
536 YYLTYPE *yyls = yylsa;
539 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
541 #define YYPOPSTACK (yyvsp--, yyssp--)
544 int yystacksize = YYINITDEPTH;
545 int yyfree_stacks = 0;
556 YYSTYPE yyval; /* the variable used to return */
557 /* semantic values from the action */
564 fprintf(stderr, "Starting parse\n");
570 yychar = YYEMPTY; /* Cause a token to be read. */
572 /* Initialize stack pointers.
573 Waste one element of value and location stack
574 so that they stay on the same level as the state stack.
575 The wasted elements are never initialized. */
583 /* Push a new state, which is found in yystate . */
584 /* In all cases, when you get here, the value and location stacks
585 have just been pushed. so pushing a state here evens the stacks. */
590 if (yyssp >= yyss + yystacksize - 1)
592 /* Give user a chance to reallocate the stack */
593 /* Use copies of these so that the &'s don't force the real ones into memory. */
594 YYSTYPE *yyvs1 = yyvs;
597 YYLTYPE *yyls1 = yyls;
600 /* Get the current used size of the three stacks, in elements. */
601 int size = yyssp - yyss + 1;
604 /* Each stack pointer address is followed by the size of
605 the data in use in that stack, in bytes. */
607 /* This used to be a conditional around just the two extra args,
608 but that might be undefined if yyoverflow is a macro. */
609 yyoverflow("parser stack overflow",
610 &yyss1, size * sizeof (*yyssp),
611 &yyvs1, size * sizeof (*yyvsp),
612 &yyls1, size * sizeof (*yylsp),
615 yyoverflow("parser stack overflow",
616 &yyss1, size * sizeof (*yyssp),
617 &yyvs1, size * sizeof (*yyvsp),
621 yyss = yyss1; yyvs = yyvs1;
625 #else /* no yyoverflow */
626 /* Extend the stack our own way. */
627 if (yystacksize >= YYMAXDEPTH)
629 yyerror("parser stack overflow");
641 if (yystacksize > YYMAXDEPTH)
642 yystacksize = YYMAXDEPTH;
643 #ifndef YYSTACK_USE_ALLOCA
646 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
647 __yy_memcpy ((char *)yyss, (char *)yyss1,
648 size * (unsigned int) sizeof (*yyssp));
649 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
650 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
651 size * (unsigned int) sizeof (*yyvsp));
653 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
654 __yy_memcpy ((char *)yyls, (char *)yyls1,
655 size * (unsigned int) sizeof (*yylsp));
657 #endif /* no yyoverflow */
659 yyssp = yyss + size - 1;
660 yyvsp = yyvs + size - 1;
662 yylsp = yyls + size - 1;
667 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
670 if (yyssp >= yyss + yystacksize - 1)
676 fprintf(stderr, "Entering state %d\n", yystate);
682 /* Do appropriate processing given the current state. */
683 /* Read a lookahead token if we need one and don't already have one. */
686 /* First try to decide what to do without reference to lookahead token. */
688 yyn = yypact[yystate];
692 /* Not known => get a lookahead token if don't already have one. */
694 /* yychar is either YYEMPTY or YYEOF
695 or a valid token in external form. */
697 if (yychar == YYEMPTY)
701 fprintf(stderr, "Reading a token: ");
706 /* Convert token to internal form (in yychar1) for indexing tables with */
708 if (yychar <= 0) /* This means end of input. */
711 yychar = YYEOF; /* Don't call YYLEX any more */
715 fprintf(stderr, "Now at end of input.\n");
720 yychar1 = YYTRANSLATE(yychar);
725 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
726 /* Give the individual parser a way to print the precise meaning
727 of a token, for further debugging info. */
729 YYPRINT (stderr, yychar, yylval);
731 fprintf (stderr, ")\n");
737 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
742 /* yyn is what to do for this token type in this state.
743 Negative => reduce, -yyn is rule number.
744 Positive => shift, yyn is new state.
745 New state is final state => don't bother to shift,
747 0, or most negative number => error. */
762 /* Shift the lookahead token. */
766 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
769 /* Discard the token being shifted unless it is eof. */
778 /* count tokens shifted since error; after three, turn off error status. */
779 if (yyerrstatus) yyerrstatus--;
784 /* Do the default action for the current state. */
787 yyn = yydefact[yystate];
791 /* Do a reduction. yyn is the number of a rule to reduce with. */
795 yyval = yyvsp[1-yylen]; /* implement default value of the action */
802 fprintf (stderr, "Reducing via rule %d (line %d), ",
805 /* Print the symbols being reduced, and their result. */
806 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
807 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
808 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
818 struct Interface *iface2;
823 if (!strcmp(iface2->Name, iface->Name))
825 log(LOG_ERR, "duplicate interface "
826 "definition for %s", iface->Name);
830 iface2 = iface2->next;
833 if (check_device(sock, iface) < 0)
835 if (setup_deviceinfo(sock, iface) < 0)
837 if (check_iface(iface) < 0)
839 if (setup_linklocal_addr(sock, iface) < 0)
841 if (setup_allrouters_membership(sock, iface) < 0)
844 iface->next = IfaceList;
847 dlog(LOG_DEBUG, 4, "interface definition for %s is ok", iface->Name);
855 iface = malloc(sizeof(struct Interface));
858 log(LOG_CRIT, "malloc failed: %s", strerror(errno));
862 iface_init_defaults(iface);
863 strncpy(iface->Name, yyvsp[0].str, IFNAMSIZ-1);
864 iface->Name[IFNAMSIZ-1] = '\0';
871 yyval.str = yyvsp[0].str;
877 iface->AdvPrefixList = yyvsp[0].pinfo;
883 iface->MinRtrAdvInterval = yyvsp[-1].num;
889 iface->MaxRtrAdvInterval = yyvsp[-1].num;
895 iface->MinRtrAdvInterval = yyvsp[-1].dec;
901 iface->MaxRtrAdvInterval = yyvsp[-1].dec;
907 iface->AdvSendAdvert = yyvsp[-1].bool;
913 iface->AdvManagedFlag = yyvsp[-1].bool;
919 iface->AdvOtherConfigFlag = yyvsp[-1].bool;
925 iface->AdvLinkMTU = yyvsp[-1].num;
931 iface->AdvReachableTime = yyvsp[-1].num;
937 iface->AdvRetransTimer = yyvsp[-1].num;
943 iface->AdvDefaultLifetime = yyvsp[-1].num;
949 iface->AdvCurHopLimit = yyvsp[-1].num;
955 iface->AdvSourceLLAddress = yyvsp[-1].bool;
961 iface->AdvIntervalOpt = yyvsp[-1].bool;
967 iface->AdvHomeAgentInfo = yyvsp[-1].bool;
973 iface->AdvHomeAgentFlag = yyvsp[-1].bool;
979 iface->HomeAgentPreference = yyvsp[-1].num;
985 iface->HomeAgentPreference = yyvsp[-1].snum;
991 iface->HomeAgentLifetime = yyvsp[-1].num;
997 iface->UnicastOnly = yyvsp[-1].bool;
1003 yyval.pinfo = yyvsp[0].pinfo;
1009 yyvsp[0].pinfo->next = yyvsp[-1].pinfo;
1010 yyval.pinfo = yyvsp[0].pinfo;
1018 if (prefix->AdvPreferredLifetime >
1019 prefix->AdvValidLifetime)
1021 log(LOG_ERR, "AdvValidLifeTime must be "
1022 "greater than AdvPreferredLifetime in %s, line %d",
1023 conf_file, num_lines);
1027 if( prefix->if6to4[0] )
1029 if (get_v4addr(prefix->if6to4, &dst) < 0)
1031 log(LOG_ERR, "interface %s has no IPv4 addresses, disabling 6to4 prefix", prefix->if6to4 );
1032 prefix->enabled = 0;
1035 *((uint16_t *)(prefix->Prefix.s6_addr)) = htons(0x2002);
1036 memcpy( prefix->Prefix.s6_addr + 2, &dst, sizeof( dst ) );
1040 yyval.pinfo = prefix;
1047 prefix = malloc(sizeof(struct AdvPrefix));
1049 if (prefix == NULL) {
1050 log(LOG_CRIT, "malloc failed: %s", strerror(errno));
1054 prefix_init_defaults(prefix);
1056 if (yyvsp[0].num > MAX_PrefixLen)
1058 log(LOG_ERR, "invalid prefix length in %s, line %d", conf_file, num_lines);
1062 prefix->PrefixLen = yyvsp[0].num;
1064 memcpy(&prefix->Prefix, yyvsp[-2].addr, sizeof(struct in6_addr));
1070 prefix->AdvOnLinkFlag = yyvsp[-1].bool;
1076 prefix->AdvAutonomousFlag = yyvsp[-1].bool;
1082 prefix->AdvRouterAddr = yyvsp[-1].bool;
1088 prefix->AdvValidLifetime = yyvsp[-1].num;
1094 prefix->AdvPreferredLifetime = yyvsp[-1].num;
1100 dlog(LOG_DEBUG, 4, "using interface %s for 6to4", yyvsp[-1].str);
1101 strncpy(prefix->if6to4, yyvsp[-1].str, IFNAMSIZ-1);
1102 prefix->if6to4[IFNAMSIZ-1] = '\0';
1108 yyval.num = yyvsp[0].num;
1114 yyval.num = (uint32_t)~0;
1118 /* the action file gets copied in in place of this dollarsign */
1119 #line 543 "/usr/lib/bison.simple"
1130 short *ssp1 = yyss - 1;
1131 fprintf (stderr, "state stack now");
1132 while (ssp1 != yyssp)
1133 fprintf (stderr, " %d", *++ssp1);
1134 fprintf (stderr, "\n");
1144 yylsp->first_line = yylloc.first_line;
1145 yylsp->first_column = yylloc.first_column;
1146 yylsp->last_line = (yylsp-1)->last_line;
1147 yylsp->last_column = (yylsp-1)->last_column;
1152 yylsp->last_line = (yylsp+yylen-1)->last_line;
1153 yylsp->last_column = (yylsp+yylen-1)->last_column;
1157 /* Now "shift" the result of the reduction.
1158 Determine what state that goes to,
1159 based on the state we popped back to
1160 and the rule number reduced by. */
1164 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1165 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1166 yystate = yytable[yystate];
1168 yystate = yydefgoto[yyn - YYNTBASE];
1172 yyerrlab: /* here on detecting error */
1175 /* If not already recovering from an error, report this error. */
1179 #ifdef YYERROR_VERBOSE
1180 yyn = yypact[yystate];
1182 if (yyn > YYFLAG && yyn < YYLAST)
1189 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1190 for (x = (yyn < 0 ? -yyn : 0);
1191 x < (sizeof(yytname) / sizeof(char *)); x++)
1192 if (yycheck[x + yyn] == x)
1193 size += strlen(yytname[x]) + 15, count++;
1194 msg = (char *) malloc(size + 15);
1197 strcpy(msg, "parse error");
1202 for (x = (yyn < 0 ? -yyn : 0);
1203 x < (sizeof(yytname) / sizeof(char *)); x++)
1204 if (yycheck[x + yyn] == x)
1206 strcat(msg, count == 0 ? ", expecting `" : " or `");
1207 strcat(msg, yytname[x]);
1216 yyerror ("parse error; also virtual memory exceeded");
1219 #endif /* YYERROR_VERBOSE */
1220 yyerror("parse error");
1224 yyerrlab1: /* here on error raised explicitly by an action */
1226 if (yyerrstatus == 3)
1228 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1230 /* return failure if at end of input */
1231 if (yychar == YYEOF)
1236 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1242 /* Else will try to reuse lookahead token
1243 after shifting the error token. */
1245 yyerrstatus = 3; /* Each real token shifted decrements this */
1249 yyerrdefault: /* current state does not do anything special for the error token. */
1252 /* This is wrong; only states that explicitly want error tokens
1253 should shift them. */
1254 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1255 if (yyn) goto yydefault;
1258 yyerrpop: /* pop the current state because it cannot handle the error token */
1260 if (yyssp == yyss) YYABORT;
1270 short *ssp1 = yyss - 1;
1271 fprintf (stderr, "Error: state stack now");
1272 while (ssp1 != yyssp)
1273 fprintf (stderr, " %d", *++ssp1);
1274 fprintf (stderr, "\n");
1280 yyn = yypact[yystate];
1285 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1304 fprintf(stderr, "Shifting error token, ");
1316 /* YYACCEPT comes here. */
1328 /* YYABORT comes here. */
1356 log(LOG_ERR, "%s in %s, line %d: %s", msg, conf_file, num_lines, yytext);