OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / user / radvd / gram.c
1
2 /*  A Bison parser, made from gram.y
3     by GNU Bison version 1.28  */
4
5 #define YYBISON 1  /* Identify Bison output.  */
6
7 #define T_INTERFACE     257
8 #define T_PREFIX        258
9 #define STRING  259
10 #define NUMBER  260
11 #define SIGNEDNUMBER    261
12 #define DECIMAL 262
13 #define SWITCH  263
14 #define IPV6ADDR        264
15 #define INFINITY        265
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
40
41 #line 16 "gram.y"
42
43 #include <config.h>
44 #include <includes.h>
45 #include <radvd.h>
46 #include <defaults.h>
47
48 extern struct Interface *IfaceList;
49 struct Interface *iface = NULL;
50 struct AdvPrefix *prefix = NULL;
51
52 extern char *conf_file;
53 extern int num_lines;
54 extern char *yytext;
55 extern int sock;
56
57 static void cleanup(void);
58 static void yyerror(char *msg);
59
60 #if 0 /* no longer necessary? */
61 #ifndef HAVE_IN6_ADDR_S6_ADDR
62 # ifdef __FreeBSD__
63 #  define s6_addr32 __u6_addr.__u6_addr32
64 #  define s6_addr16 __u6_addr.__u6_addr16
65 # endif
66 #endif
67 #endif
68
69 #define ABORT   do { cleanup(); YYABORT; } while (0);
70
71
72 #line 92 "gram.y"
73 typedef union {
74         int                     num;
75         int                     snum;
76         double                  dec;
77         int                     bool;
78         struct in6_addr         *addr;
79         char                    *str;
80         struct AdvPrefix        *pinfo;
81 } YYSTYPE;
82 #include <stdio.h>
83
84 #ifndef __cplusplus
85 #ifndef __STDC__
86 #define const
87 #endif
88 #endif
89
90
91
92 #define YYFINAL         109
93 #define YYFLAG          -32768
94 #define YYNTBASE        40
95
96 #define YYTRANSLATE(x) ((unsigned)(x) <= 289 ? yytranslate[x] : 55)
97
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
128 };
129
130 #if YYDEBUG != 0
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
137 };
138
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
156 };
157
158 #endif
159
160 #if YYDEBUG != 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
167 };
168 #endif
169
170
171 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
172
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
184 };
185 #endif
186
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
193 };
194
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,
200      3,     3,     3,     3,     1,     1
201 };
202
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
215 };
216
217 static const short yydefgoto[] = {     2,
218      3,     4,     6,    26,    27,    28,    29,    52,    53,    54,
219     87,    88,    89,    95
220 };
221
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
234 };
235
236 static const short yypgoto[] = {-32768,
237     72,-32768,   -40,-32768,-32768,-32768,    71,-32768,    10,-32768,
238 -32768,-32768,   -28,   -19
239 };
240
241
242 #define YYLAST          107
243
244
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
257 };
258
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
271 };
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.  */
275
276 /* Skeleton output parser for bison,
277    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
278
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)
282    any later version.
283
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.
288
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.  */
293
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.  */
298
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.  */
303
304 #ifndef YYSTACK_USE_ALLOCA
305 #ifdef alloca
306 #define YYSTACK_USE_ALLOCA
307 #else /* alloca not defined */
308 #ifdef __GNUC__
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
314 #include <alloca.h>
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.  */
322 #include <malloc.h>
323 #endif
324 #else /* not MSDOS, or __TURBOC__ */
325 #if defined(_AIX)
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>  */
329  #pragma alloca
330 #define YYSTACK_USE_ALLOCA
331 #else /* not MSDOS, or __TURBOC__, or _AIX */
332 #if 0
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
337 #endif /* __hpux */
338 #endif
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 */
345
346 #ifdef YYSTACK_USE_ALLOCA
347 #define YYSTACK_ALLOC alloca
348 #else
349 #define YYSTACK_ALLOC malloc
350 #endif
351
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.  */
355
356 #define yyerrok         (yyerrstatus = 0)
357 #define yyclearin       (yychar = YYEMPTY)
358 #define YYEMPTY         -2
359 #define YYEOF           0
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) \
370 do                                                              \
371   if (yychar == YYEMPTY && yylen == 1)                          \
372     { yychar = (token), yylval = (value);                       \
373       yychar1 = YYTRANSLATE (yychar);                           \
374       YYPOPSTACK;                                               \
375       goto yybackup;                                            \
376     }                                                           \
377   else                                                          \
378     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
379 while (0)
380
381 #define YYTERROR        1
382 #define YYERRCODE       256
383
384 #ifndef YYPURE
385 #define YYLEX           yylex()
386 #endif
387
388 #ifdef YYPURE
389 #ifdef YYLSP_NEEDED
390 #ifdef YYLEX_PARAM
391 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
392 #else
393 #define YYLEX           yylex(&yylval, &yylloc)
394 #endif
395 #else /* not YYLSP_NEEDED */
396 #ifdef YYLEX_PARAM
397 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
398 #else
399 #define YYLEX           yylex(&yylval)
400 #endif
401 #endif /* not YYLSP_NEEDED */
402 #endif
403
404 /* If nonreentrant, generate the variables here */
405
406 #ifndef YYPURE
407
408 int     yychar;                 /*  the lookahead symbol                */
409 YYSTYPE yylval;                 /*  the semantic value of the           */
410                                 /*  lookahead symbol                    */
411
412 #ifdef YYLSP_NEEDED
413 YYLTYPE yylloc;                 /*  location data for the lookahead     */
414                                 /*  symbol                              */
415 #endif
416
417 int yynerrs;                    /*  number of parse errors so far       */
418 #endif  /* not YYPURE */
419
420 #if YYDEBUG != 0
421 int yydebug;                    /*  nonzero means print parse trace     */
422 /* Since this is uninitialized, it does not stop multiple parsers
423    from coexisting.  */
424 #endif
425
426 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
427
428 #ifndef YYINITDEPTH
429 #define YYINITDEPTH 200
430 #endif
431
432 /*  YYMAXDEPTH is the maximum size the stacks can grow to
433     (effective only if the built-in stack extension method is used).  */
434
435 #if YYMAXDEPTH == 0
436 #undef YYMAXDEPTH
437 #endif
438
439 #ifndef YYMAXDEPTH
440 #define YYMAXDEPTH 10000
441 #endif
442 \f
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.  */
447
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++ */
451 #ifndef __cplusplus
452
453 /* This is the most reliable way to avoid incompatibilities
454    in available built-in functions on various systems.  */
455 static void
456 __yy_memcpy (to, from, count)
457      char *to;
458      char *from;
459      unsigned int count;
460 {
461   register char *f = from;
462   register char *t = to;
463   register int i = count;
464
465   while (i-- > 0)
466     *t++ = *f++;
467 }
468
469 #else /* __cplusplus */
470
471 /* This is the most reliable way to avoid incompatibilities
472    in available built-in functions on various systems.  */
473 static void
474 __yy_memcpy (char *to, char *from, unsigned int count)
475 {
476   register char *t = to;
477   register char *f = from;
478   register int i = count;
479
480   while (i-- > 0)
481     *t++ = *f++;
482 }
483
484 #endif
485 #endif
486 \f
487 #line 217 "/usr/lib/bison.simple"
488
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.  */
494
495 #ifdef YYPARSE_PARAM
496 #ifdef __cplusplus
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 */
507
508 /* Prevent warning if -Wstrict-prototypes.  */
509 #ifdef __GNUC__
510 #ifdef YYPARSE_PARAM
511 int yyparse (void *);
512 #else
513 int yyparse (void);
514 #endif
515 #endif
516
517 int
518 yyparse(YYPARSE_PARAM_ARG)
519      YYPARSE_PARAM_DECL
520 {
521   register int yystate;
522   register int yyn;
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 */
527
528   short yyssa[YYINITDEPTH];     /*  the state stack                     */
529   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
530
531   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
532   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
533
534 #ifdef YYLSP_NEEDED
535   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
536   YYLTYPE *yyls = yylsa;
537   YYLTYPE *yylsp;
538
539 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
540 #else
541 #define YYPOPSTACK   (yyvsp--, yyssp--)
542 #endif
543
544   int yystacksize = YYINITDEPTH;
545   int yyfree_stacks = 0;
546
547 #ifdef YYPURE
548   int yychar;
549   YYSTYPE yylval;
550   int yynerrs;
551 #ifdef YYLSP_NEEDED
552   YYLTYPE yylloc;
553 #endif
554 #endif
555
556   YYSTYPE yyval;                /*  the variable used to return         */
557                                 /*  semantic values from the action     */
558                                 /*  routines                            */
559
560   int yylen;
561
562 #if YYDEBUG != 0
563   if (yydebug)
564     fprintf(stderr, "Starting parse\n");
565 #endif
566
567   yystate = 0;
568   yyerrstatus = 0;
569   yynerrs = 0;
570   yychar = YYEMPTY;             /* Cause a token to be read.  */
571
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.  */
576
577   yyssp = yyss - 1;
578   yyvsp = yyvs;
579 #ifdef YYLSP_NEEDED
580   yylsp = yyls;
581 #endif
582
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.  */
586 yynewstate:
587
588   *++yyssp = yystate;
589
590   if (yyssp >= yyss + yystacksize - 1)
591     {
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;
595       short *yyss1 = yyss;
596 #ifdef YYLSP_NEEDED
597       YYLTYPE *yyls1 = yyls;
598 #endif
599
600       /* Get the current used size of the three stacks, in elements.  */
601       int size = yyssp - yyss + 1;
602
603 #ifdef yyoverflow
604       /* Each stack pointer address is followed by the size of
605          the data in use in that stack, in bytes.  */
606 #ifdef YYLSP_NEEDED
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),
613                  &yystacksize);
614 #else
615       yyoverflow("parser stack overflow",
616                  &yyss1, size * sizeof (*yyssp),
617                  &yyvs1, size * sizeof (*yyvsp),
618                  &yystacksize);
619 #endif
620
621       yyss = yyss1; yyvs = yyvs1;
622 #ifdef YYLSP_NEEDED
623       yyls = yyls1;
624 #endif
625 #else /* no yyoverflow */
626       /* Extend the stack our own way.  */
627       if (yystacksize >= YYMAXDEPTH)
628         {
629           yyerror("parser stack overflow");
630           if (yyfree_stacks)
631             {
632               free (yyss);
633               free (yyvs);
634 #ifdef YYLSP_NEEDED
635               free (yyls);
636 #endif
637             }
638           return 2;
639         }
640       yystacksize *= 2;
641       if (yystacksize > YYMAXDEPTH)
642         yystacksize = YYMAXDEPTH;
643 #ifndef YYSTACK_USE_ALLOCA
644       yyfree_stacks = 1;
645 #endif
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));
652 #ifdef YYLSP_NEEDED
653       yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
654       __yy_memcpy ((char *)yyls, (char *)yyls1,
655                    size * (unsigned int) sizeof (*yylsp));
656 #endif
657 #endif /* no yyoverflow */
658
659       yyssp = yyss + size - 1;
660       yyvsp = yyvs + size - 1;
661 #ifdef YYLSP_NEEDED
662       yylsp = yyls + size - 1;
663 #endif
664
665 #if YYDEBUG != 0
666       if (yydebug)
667         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
668 #endif
669
670       if (yyssp >= yyss + yystacksize - 1)
671         YYABORT;
672     }
673
674 #if YYDEBUG != 0
675   if (yydebug)
676     fprintf(stderr, "Entering state %d\n", yystate);
677 #endif
678
679   goto yybackup;
680  yybackup:
681
682 /* Do appropriate processing given the current state.  */
683 /* Read a lookahead token if we need one and don't already have one.  */
684 /* yyresume: */
685
686   /* First try to decide what to do without reference to lookahead token.  */
687
688   yyn = yypact[yystate];
689   if (yyn == YYFLAG)
690     goto yydefault;
691
692   /* Not known => get a lookahead token if don't already have one.  */
693
694   /* yychar is either YYEMPTY or YYEOF
695      or a valid token in external form.  */
696
697   if (yychar == YYEMPTY)
698     {
699 #if YYDEBUG != 0
700       if (yydebug)
701         fprintf(stderr, "Reading a token: ");
702 #endif
703       yychar = YYLEX;
704     }
705
706   /* Convert token to internal form (in yychar1) for indexing tables with */
707
708   if (yychar <= 0)              /* This means end of input. */
709     {
710       yychar1 = 0;
711       yychar = YYEOF;           /* Don't call YYLEX any more */
712
713 #if YYDEBUG != 0
714       if (yydebug)
715         fprintf(stderr, "Now at end of input.\n");
716 #endif
717     }
718   else
719     {
720       yychar1 = YYTRANSLATE(yychar);
721
722 #if YYDEBUG != 0
723       if (yydebug)
724         {
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.  */
728 #ifdef YYPRINT
729           YYPRINT (stderr, yychar, yylval);
730 #endif
731           fprintf (stderr, ")\n");
732         }
733 #endif
734     }
735
736   yyn += yychar1;
737   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
738     goto yydefault;
739
740   yyn = yytable[yyn];
741
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,
746        just return success.
747      0, or most negative number => error.  */
748
749   if (yyn < 0)
750     {
751       if (yyn == YYFLAG)
752         goto yyerrlab;
753       yyn = -yyn;
754       goto yyreduce;
755     }
756   else if (yyn == 0)
757     goto yyerrlab;
758
759   if (yyn == YYFINAL)
760     YYACCEPT;
761
762   /* Shift the lookahead token.  */
763
764 #if YYDEBUG != 0
765   if (yydebug)
766     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
767 #endif
768
769   /* Discard the token being shifted unless it is eof.  */
770   if (yychar != YYEOF)
771     yychar = YYEMPTY;
772
773   *++yyvsp = yylval;
774 #ifdef YYLSP_NEEDED
775   *++yylsp = yylloc;
776 #endif
777
778   /* count tokens shifted since error; after three, turn off error status.  */
779   if (yyerrstatus) yyerrstatus--;
780
781   yystate = yyn;
782   goto yynewstate;
783
784 /* Do the default action for the current state.  */
785 yydefault:
786
787   yyn = yydefact[yystate];
788   if (yyn == 0)
789     goto yyerrlab;
790
791 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
792 yyreduce:
793   yylen = yyr2[yyn];
794   if (yylen > 0)
795     yyval = yyvsp[1-yylen]; /* implement default value of the action */
796
797 #if YYDEBUG != 0
798   if (yydebug)
799     {
800       int i;
801
802       fprintf (stderr, "Reducing via rule %d (line %d), ",
803                yyn, yyrline[yyn]);
804
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]]);
809     }
810 #endif
811
812
813   switch (yyn) {
814
815 case 3:
816 #line 109 "gram.y"
817 {
818                         struct Interface *iface2;
819
820                         iface2 = IfaceList;
821                         while (iface2)
822                         {
823                                 if (!strcmp(iface2->Name, iface->Name))
824                                 {
825                                         log(LOG_ERR, "duplicate interface "
826                                                 "definition for %s", iface->Name);
827
828                                         ABORT;
829                                 }
830                                 iface2 = iface2->next;
831                         }                       
832
833                         if (check_device(sock, iface) < 0)
834                                 ABORT;
835                         if (setup_deviceinfo(sock, iface) < 0)
836                                 ABORT;
837                         if (check_iface(iface) < 0)
838                                 ABORT;
839                         if (setup_linklocal_addr(sock, iface) < 0)
840                                 ABORT;
841                         if (setup_allrouters_membership(sock, iface) < 0)
842                                 ABORT;
843
844                         iface->next = IfaceList;
845                         IfaceList = iface;
846
847                         dlog(LOG_DEBUG, 4, "interface definition for %s is ok", iface->Name);
848
849                         iface = NULL;
850                 ;
851     break;}
852 case 4:
853 #line 145 "gram.y"
854 {
855                         iface = malloc(sizeof(struct Interface));
856
857                         if (iface == NULL) {
858                                 log(LOG_CRIT, "malloc failed: %s", strerror(errno));
859                                 ABORT;
860                         }
861
862                         iface_init_defaults(iface);
863                         strncpy(iface->Name, yyvsp[0].str, IFNAMSIZ-1);
864                         iface->Name[IFNAMSIZ-1] = '\0';
865                 ;
866     break;}
867 case 5:
868 #line 160 "gram.y"
869 {
870                         /* check vality */
871                         yyval.str = yyvsp[0].str;
872                 ;
873     break;}
874 case 6:
875 #line 167 "gram.y"
876 {
877                         iface->AdvPrefixList = yyvsp[0].pinfo;
878                 ;
879     break;}
880 case 11:
881 #line 181 "gram.y"
882 {
883                         iface->MinRtrAdvInterval = yyvsp[-1].num;
884                 ;
885     break;}
886 case 12:
887 #line 185 "gram.y"
888 {
889                         iface->MaxRtrAdvInterval = yyvsp[-1].num;
890                 ;
891     break;}
892 case 13:
893 #line 189 "gram.y"
894 {
895                         iface->MinRtrAdvInterval = yyvsp[-1].dec;
896                 ;
897     break;}
898 case 14:
899 #line 193 "gram.y"
900 {
901                         iface->MaxRtrAdvInterval = yyvsp[-1].dec;
902                 ;
903     break;}
904 case 15:
905 #line 197 "gram.y"
906 {
907                         iface->AdvSendAdvert = yyvsp[-1].bool;
908                 ;
909     break;}
910 case 16:
911 #line 201 "gram.y"
912 {
913                         iface->AdvManagedFlag = yyvsp[-1].bool;
914                 ;
915     break;}
916 case 17:
917 #line 205 "gram.y"
918 {
919                         iface->AdvOtherConfigFlag = yyvsp[-1].bool;
920                 ;
921     break;}
922 case 18:
923 #line 209 "gram.y"
924 {
925                         iface->AdvLinkMTU = yyvsp[-1].num;
926                 ;
927     break;}
928 case 19:
929 #line 213 "gram.y"
930 {
931                         iface->AdvReachableTime = yyvsp[-1].num;
932                 ;
933     break;}
934 case 20:
935 #line 217 "gram.y"
936 {
937                         iface->AdvRetransTimer = yyvsp[-1].num;
938                 ;
939     break;}
940 case 21:
941 #line 221 "gram.y"
942 {
943                         iface->AdvDefaultLifetime = yyvsp[-1].num;
944                 ;
945     break;}
946 case 22:
947 #line 225 "gram.y"
948 {
949                         iface->AdvCurHopLimit = yyvsp[-1].num;
950                 ;
951     break;}
952 case 23:
953 #line 229 "gram.y"
954 {
955                         iface->AdvSourceLLAddress = yyvsp[-1].bool;
956                 ;
957     break;}
958 case 24:
959 #line 233 "gram.y"
960 {
961                         iface->AdvIntervalOpt = yyvsp[-1].bool;
962                 ;
963     break;}
964 case 25:
965 #line 237 "gram.y"
966 {
967                         iface->AdvHomeAgentInfo = yyvsp[-1].bool;
968                 ;
969     break;}
970 case 26:
971 #line 241 "gram.y"
972 {
973                         iface->AdvHomeAgentFlag = yyvsp[-1].bool;
974                 ;
975     break;}
976 case 27:
977 #line 245 "gram.y"
978 {
979                         iface->HomeAgentPreference = yyvsp[-1].num;
980                 ;
981     break;}
982 case 28:
983 #line 249 "gram.y"
984 {
985                         iface->HomeAgentPreference = yyvsp[-1].snum;
986                 ;
987     break;}
988 case 29:
989 #line 253 "gram.y"
990 {
991                         iface->HomeAgentLifetime = yyvsp[-1].num;
992                 ;
993     break;}
994 case 30:
995 #line 257 "gram.y"
996 {
997                         iface->UnicastOnly = yyvsp[-1].bool;
998                 ;
999     break;}
1000 case 31:
1001 #line 263 "gram.y"
1002 {
1003                         yyval.pinfo = yyvsp[0].pinfo;
1004                 ;
1005     break;}
1006 case 32:
1007 #line 267 "gram.y"
1008 {
1009                         yyvsp[0].pinfo->next = yyvsp[-1].pinfo;
1010                         yyval.pinfo = yyvsp[0].pinfo;
1011                 ;
1012     break;}
1013 case 33:
1014 #line 274 "gram.y"
1015 {
1016                         unsigned int dst;
1017
1018                         if (prefix->AdvPreferredLifetime >
1019                             prefix->AdvValidLifetime)
1020                         {
1021                                 log(LOG_ERR, "AdvValidLifeTime must be "
1022                                         "greater than AdvPreferredLifetime in %s, line %d", 
1023                                         conf_file, num_lines);
1024                                 ABORT;
1025                         }
1026
1027                         if( prefix->if6to4[0] )
1028                         {
1029                                 if (get_v4addr(prefix->if6to4, &dst) < 0)
1030                                 {
1031                                         log(LOG_ERR, "interface %s has no IPv4 addresses, disabling 6to4 prefix", prefix->if6to4 );
1032                                         prefix->enabled = 0;
1033                                 } else
1034                                 {
1035                                         *((uint16_t *)(prefix->Prefix.s6_addr)) = htons(0x2002);
1036                                         memcpy( prefix->Prefix.s6_addr + 2, &dst, sizeof( dst ) );
1037                                 }
1038                         }
1039
1040                         yyval.pinfo = prefix;
1041                         prefix = NULL;
1042                 ;
1043     break;}
1044 case 34:
1045 #line 305 "gram.y"
1046 {
1047                         prefix = malloc(sizeof(struct AdvPrefix));
1048                         
1049                         if (prefix == NULL) {
1050                                 log(LOG_CRIT, "malloc failed: %s", strerror(errno));
1051                                 ABORT;
1052                         }
1053
1054                         prefix_init_defaults(prefix);
1055
1056                         if (yyvsp[0].num > MAX_PrefixLen)
1057                         {
1058                                 log(LOG_ERR, "invalid prefix length in %s, line %d", conf_file, num_lines);
1059                                 ABORT;
1060                         }
1061
1062                         prefix->PrefixLen = yyvsp[0].num;
1063
1064                         memcpy(&prefix->Prefix, yyvsp[-2].addr, sizeof(struct in6_addr));
1065                 ;
1066     break;}
1067 case 39:
1068 #line 335 "gram.y"
1069 {
1070                         prefix->AdvOnLinkFlag = yyvsp[-1].bool;
1071                 ;
1072     break;}
1073 case 40:
1074 #line 339 "gram.y"
1075 {
1076                         prefix->AdvAutonomousFlag = yyvsp[-1].bool;
1077                 ;
1078     break;}
1079 case 41:
1080 #line 343 "gram.y"
1081 {
1082                         prefix->AdvRouterAddr = yyvsp[-1].bool;
1083                 ;
1084     break;}
1085 case 42:
1086 #line 347 "gram.y"
1087 {
1088                         prefix->AdvValidLifetime = yyvsp[-1].num;
1089                 ;
1090     break;}
1091 case 43:
1092 #line 351 "gram.y"
1093 {
1094                         prefix->AdvPreferredLifetime = yyvsp[-1].num;
1095                 ;
1096     break;}
1097 case 44:
1098 #line 355 "gram.y"
1099 {
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';
1103                 ;
1104     break;}
1105 case 45:
1106 #line 363 "gram.y"
1107 {
1108                                 yyval.num = yyvsp[0].num; 
1109                         ;
1110     break;}
1111 case 46:
1112 #line 367 "gram.y"
1113 {
1114                                 yyval.num = (uint32_t)~0;
1115                         ;
1116     break;}
1117 }
1118    /* the action file gets copied in in place of this dollarsign */
1119 #line 543 "/usr/lib/bison.simple"
1120 \f
1121   yyvsp -= yylen;
1122   yyssp -= yylen;
1123 #ifdef YYLSP_NEEDED
1124   yylsp -= yylen;
1125 #endif
1126
1127 #if YYDEBUG != 0
1128   if (yydebug)
1129     {
1130       short *ssp1 = yyss - 1;
1131       fprintf (stderr, "state stack now");
1132       while (ssp1 != yyssp)
1133         fprintf (stderr, " %d", *++ssp1);
1134       fprintf (stderr, "\n");
1135     }
1136 #endif
1137
1138   *++yyvsp = yyval;
1139
1140 #ifdef YYLSP_NEEDED
1141   yylsp++;
1142   if (yylen == 0)
1143     {
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;
1148       yylsp->text = 0;
1149     }
1150   else
1151     {
1152       yylsp->last_line = (yylsp+yylen-1)->last_line;
1153       yylsp->last_column = (yylsp+yylen-1)->last_column;
1154     }
1155 #endif
1156
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.  */
1161
1162   yyn = yyr1[yyn];
1163
1164   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1165   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1166     yystate = yytable[yystate];
1167   else
1168     yystate = yydefgoto[yyn - YYNTBASE];
1169
1170   goto yynewstate;
1171
1172 yyerrlab:   /* here on detecting error */
1173
1174   if (! yyerrstatus)
1175     /* If not already recovering from an error, report this error.  */
1176     {
1177       ++yynerrs;
1178
1179 #ifdef YYERROR_VERBOSE
1180       yyn = yypact[yystate];
1181
1182       if (yyn > YYFLAG && yyn < YYLAST)
1183         {
1184           int size = 0;
1185           char *msg;
1186           int x, count;
1187
1188           count = 0;
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);
1195           if (msg != 0)
1196             {
1197               strcpy(msg, "parse error");
1198
1199               if (count < 5)
1200                 {
1201                   count = 0;
1202                   for (x = (yyn < 0 ? -yyn : 0);
1203                        x < (sizeof(yytname) / sizeof(char *)); x++)
1204                     if (yycheck[x + yyn] == x)
1205                       {
1206                         strcat(msg, count == 0 ? ", expecting `" : " or `");
1207                         strcat(msg, yytname[x]);
1208                         strcat(msg, "'");
1209                         count++;
1210                       }
1211                 }
1212               yyerror(msg);
1213               free(msg);
1214             }
1215           else
1216             yyerror ("parse error; also virtual memory exceeded");
1217         }
1218       else
1219 #endif /* YYERROR_VERBOSE */
1220         yyerror("parse error");
1221     }
1222
1223   goto yyerrlab1;
1224 yyerrlab1:   /* here on error raised explicitly by an action */
1225
1226   if (yyerrstatus == 3)
1227     {
1228       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
1229
1230       /* return failure if at end of input */
1231       if (yychar == YYEOF)
1232         YYABORT;
1233
1234 #if YYDEBUG != 0
1235       if (yydebug)
1236         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1237 #endif
1238
1239       yychar = YYEMPTY;
1240     }
1241
1242   /* Else will try to reuse lookahead token
1243      after shifting the error token.  */
1244
1245   yyerrstatus = 3;              /* Each real token shifted decrements this */
1246
1247   goto yyerrhandle;
1248
1249 yyerrdefault:  /* current state does not do anything special for the error token. */
1250
1251 #if 0
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;
1256 #endif
1257
1258 yyerrpop:   /* pop the current state because it cannot handle the error token */
1259
1260   if (yyssp == yyss) YYABORT;
1261   yyvsp--;
1262   yystate = *--yyssp;
1263 #ifdef YYLSP_NEEDED
1264   yylsp--;
1265 #endif
1266
1267 #if YYDEBUG != 0
1268   if (yydebug)
1269     {
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");
1275     }
1276 #endif
1277
1278 yyerrhandle:
1279
1280   yyn = yypact[yystate];
1281   if (yyn == YYFLAG)
1282     goto yyerrdefault;
1283
1284   yyn += YYTERROR;
1285   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1286     goto yyerrdefault;
1287
1288   yyn = yytable[yyn];
1289   if (yyn < 0)
1290     {
1291       if (yyn == YYFLAG)
1292         goto yyerrpop;
1293       yyn = -yyn;
1294       goto yyreduce;
1295     }
1296   else if (yyn == 0)
1297     goto yyerrpop;
1298
1299   if (yyn == YYFINAL)
1300     YYACCEPT;
1301
1302 #if YYDEBUG != 0
1303   if (yydebug)
1304     fprintf(stderr, "Shifting error token, ");
1305 #endif
1306
1307   *++yyvsp = yylval;
1308 #ifdef YYLSP_NEEDED
1309   *++yylsp = yylloc;
1310 #endif
1311
1312   yystate = yyn;
1313   goto yynewstate;
1314
1315  yyacceptlab:
1316   /* YYACCEPT comes here.  */
1317   if (yyfree_stacks)
1318     {
1319       free (yyss);
1320       free (yyvs);
1321 #ifdef YYLSP_NEEDED
1322       free (yyls);
1323 #endif
1324     }
1325   return 0;
1326
1327  yyabortlab:
1328   /* YYABORT comes here.  */
1329   if (yyfree_stacks)
1330     {
1331       free (yyss);
1332       free (yyvs);
1333 #ifdef YYLSP_NEEDED
1334       free (yyls);
1335 #endif
1336     }
1337   return 1;
1338 }
1339 #line 372 "gram.y"
1340
1341
1342 static
1343 void cleanup(void)
1344 {
1345         if (iface)
1346                 free(iface);
1347         
1348         if (prefix)
1349                 free(prefix);
1350 }
1351
1352 static void
1353 yyerror(char *msg)
1354 {
1355         cleanup();
1356         log(LOG_ERR, "%s in %s, line %d: %s", msg, conf_file, num_lines, yytext);
1357 }