1 /* A Bison parser, made by GNU Bison 1.875a. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, 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 YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
73 TOK_WILLINGNESS = 275,
80 TOK_TCREDUNDANCY = 282,
81 TOK_MPRCOVERAGE = 283,
84 TOK_IP4BROADCAST = 286,
85 TOK_IP6ADDRTYPE = 287,
86 TOK_IP6MULTISITE = 288,
87 TOK_IP6MULTIGLOBAL = 289,
102 #define TOK_CLOSE 259
104 #define TOK_STRING 261
105 #define TOK_INTEGER 262
106 #define TOK_FLOAT 263
107 #define TOK_BOOLEAN 264
108 #define TOK_IP6TYPE 265
109 #define TOK_DEBUGLEVEL 266
110 #define TOK_IPVERSION 267
113 #define TOK_PLUGIN 270
114 #define TOK_INTERFACES 271
115 #define TOK_IFSETUP 272
116 #define TOK_NOINT 273
118 #define TOK_WILLINGNESS 275
119 #define TOK_IPCCON 276
120 #define TOK_USEHYST 277
121 #define TOK_HYSTSCALE 278
122 #define TOK_HYSTUPPER 279
123 #define TOK_HYSTLOWER 280
124 #define TOK_POLLRATE 281
125 #define TOK_TCREDUNDANCY 282
126 #define TOK_MPRCOVERAGE 283
127 #define TOK_PLNAME 284
128 #define TOK_PLPARAM 285
129 #define TOK_IP4BROADCAST 286
130 #define TOK_IP6ADDRTYPE 287
131 #define TOK_IP6MULTISITE 288
132 #define TOK_IP6MULTIGLOBAL 289
133 #define TOK_HELLOINT 290
134 #define TOK_HELLOVAL 291
135 #define TOK_TCINT 292
136 #define TOK_TCVAL 293
137 #define TOK_MIDINT 294
138 #define TOK_MIDVAL 295
139 #define TOK_HNAINT 296
140 #define TOK_HNAVAL 297
141 #define TOK_IP4_ADDR 298
142 #define TOK_IP6_ADDR 299
143 #define TOK_COMMENT 300
148 /* Copy the first part of user declarations. */
149 #line 1 "src/cfgparser/oparse.y"
153 * OLSR ad-hoc routing table management protocol config parser
154 * Copyright (C) 2004 Andreas Tønnesen (andreto@olsr.org)
156 * This file is part of the olsr.org OLSR daemon.
158 * olsr.org is free software; you can redistribute it and/or modify
159 * it under the terms of the GNU General Public License as published by
160 * the Free Software Foundation; either version 2 of the License, or
161 * (at your option) any later version.
163 * olsr.org is distributed in the hope that it will be useful,
164 * but WITHOUT ANY WARRANTY; without even the implied warranty of
165 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
166 * GNU General Public License for more details.
168 * You should have received a copy of the GNU General Public License
169 * along with olsr.org; if not, write to the Free Software
170 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
173 * $Id: oparse.c,v 1.2 2004/10/17 11:52:41 kattemat Exp $
181 #include <sys/socket.h>
182 #include <netinet/in.h>
183 #include <arpa/inet.h>
186 #include "olsrd_conf.h"
188 #define PARSER_DEBUG 0
190 #define YYSTYPE struct conf_token *
192 void yyerror(char *);
195 struct if_config_options *
196 get_default_if_config(void);
199 struct if_config_options *
200 get_default_if_config()
202 struct if_config_options *io = malloc(sizeof(struct if_config_options));
205 memset(io, 0, sizeof(struct if_config_options));
207 io->ipv6_addrtype = 1;
209 if(inet_pton(AF_INET6, OLSR_IPV6_MCAST_SITE_LOCAL, &in6) < 0)
211 fprintf(stderr, "Failed converting IP address %s\n", OLSR_IPV6_MCAST_SITE_LOCAL);
214 memcpy(&io->ipv6_multi_site.v6, &in6, sizeof(struct in6_addr));
216 if(inet_pton(AF_INET6, OLSR_IPV6_MCAST_GLOBAL, &in6) < 0)
218 fprintf(stderr, "Failed converting IP address %s\n", OLSR_IPV6_MCAST_GLOBAL);
221 memcpy(&io->ipv6_multi_glbl.v6, &in6, sizeof(struct in6_addr));
224 io->hello_params.emission_interval = HELLO_INTERVAL;
225 io->hello_params.validity_time = NEIGHB_HOLD_TIME;
226 io->tc_params.emission_interval = TC_INTERVAL;
227 io->tc_params.validity_time = TOP_HOLD_TIME;
228 io->mid_params.emission_interval = MID_INTERVAL;
229 io->mid_params.validity_time = MID_HOLD_TIME;
230 io->hna_params.emission_interval = HNA_INTERVAL;
231 io->hna_params.validity_time = HNA_HOLD_TIME;
242 /* Enabling traces. */
247 /* Enabling verbose error messages. */
248 #ifdef YYERROR_VERBOSE
249 # undef YYERROR_VERBOSE
250 # define YYERROR_VERBOSE 1
252 # define YYERROR_VERBOSE 0
255 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
257 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
258 # define YYSTYPE_IS_DECLARED 1
259 # define YYSTYPE_IS_TRIVIAL 1
264 /* Copy the second part of user declarations. */
267 /* Line 214 of yacc.c. */
270 #if ! defined (yyoverflow) || YYERROR_VERBOSE
272 /* The parser invokes alloca or malloc; define the necessary symbols. */
274 # if YYSTACK_USE_ALLOCA
275 # define YYSTACK_ALLOC alloca
277 # ifndef YYSTACK_USE_ALLOCA
278 # if defined (alloca) || defined (_ALLOCA_H)
279 # define YYSTACK_ALLOC alloca
282 # define YYSTACK_ALLOC __builtin_alloca
288 # ifdef YYSTACK_ALLOC
289 /* Pacify GCC's `empty if-body' warning. */
290 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
292 # if defined (__STDC__) || defined (__cplusplus)
293 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
294 # define YYSIZE_T size_t
296 # define YYSTACK_ALLOC malloc
297 # define YYSTACK_FREE free
299 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
302 #if (! defined (yyoverflow) \
303 && (! defined (__cplusplus) \
304 || (YYSTYPE_IS_TRIVIAL)))
306 /* A type that is properly aligned for any stack member. */
313 /* The size of the maximum gap between one aligned stack and the next. */
314 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
316 /* The size of an array large to enough to hold all stacks, each with
318 # define YYSTACK_BYTES(N) \
319 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
320 + YYSTACK_GAP_MAXIMUM)
322 /* Copy COUNT objects from FROM to TO. The source and destination do
326 # define YYCOPY(To, From, Count) \
327 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
329 # define YYCOPY(To, From, Count) \
332 register YYSIZE_T yyi; \
333 for (yyi = 0; yyi < (Count); yyi++) \
334 (To)[yyi] = (From)[yyi]; \
340 /* Relocate STACK from its old location to the new one. The
341 local variables YYSIZE and YYSTACKSIZE give the old and new number of
342 elements in the stack, and YYPTR gives the new location of the
343 stack. Advance YYPTR to a properly aligned location for the next
345 # define YYSTACK_RELOCATE(Stack) \
348 YYSIZE_T yynewbytes; \
349 YYCOPY (&yyptr->Stack, Stack, yysize); \
350 Stack = &yyptr->Stack; \
351 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
352 yyptr += yynewbytes / sizeof (*yyptr); \
358 #if defined (__STDC__) || defined (__cplusplus)
359 typedef signed char yysigned_char;
361 typedef short yysigned_char;
364 /* YYFINAL -- State number of the termination state. */
366 /* YYLAST -- Last index in YYTABLE. */
369 /* YYNTOKENS -- Number of terminals. */
371 /* YYNNTS -- Number of nonterminals. */
373 /* YYNRULES -- Number of rules. */
375 /* YYNRULES -- Number of states. */
376 #define YYNSTATES 131
378 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
380 #define YYMAXUTOK 300
382 #define YYTRANSLATE(YYX) \
383 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
385 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
386 static const unsigned char yytranslate[] =
388 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
414 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
415 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
416 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
417 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
422 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
424 static const unsigned char yyprhs[] =
426 0, 0, 3, 4, 7, 10, 12, 14, 16, 18,
427 20, 22, 24, 26, 28, 30, 32, 34, 36, 38,
428 41, 44, 47, 50, 53, 57, 58, 61, 65, 66,
429 69, 73, 74, 77, 79, 81, 85, 86, 89, 91,
430 93, 95, 97, 99, 101, 103, 105, 107, 109, 111,
431 113, 115, 119, 120, 123, 125, 127, 129, 132, 135,
432 138, 141, 144, 147, 150, 153, 156, 159, 162, 165,
433 168, 171, 174, 177, 180, 183, 186, 189, 192, 195,
434 198, 201, 204, 207, 210, 213, 216, 219, 223
437 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
438 static const yysigned_char yyrhs[] =
440 47, 0, -1, -1, 47, 49, -1, 47, 48, -1,
441 76, -1, 77, -1, 81, -1, 82, -1, 83, -1,
442 84, -1, 85, -1, 86, -1, 87, -1, 88, -1,
443 89, -1, 90, -1, 91, -1, 94, -1, 13, 50,
444 -1, 14, 52, -1, 16, 54, -1, 15, 60, -1,
445 63, 57, -1, 3, 51, 4, -1, -1, 51, 78,
446 -1, 3, 53, 4, -1, -1, 53, 79, -1, 3,
447 55, 4, -1, -1, 55, 56, -1, 80, -1, 94,
448 -1, 3, 58, 4, -1, -1, 58, 59, -1, 94,
449 -1, 64, -1, 65, -1, 66, -1, 67, -1, 68,
450 -1, 69, -1, 70, -1, 71, -1, 72, -1, 73,
451 -1, 74, -1, 75, -1, 3, 61, 4, -1, -1,
452 61, 62, -1, 92, -1, 93, -1, 94, -1, 17,
453 6, -1, 31, 43, -1, 32, 10, -1, 33, 44,
454 -1, 34, 44, -1, 35, 8, -1, 36, 8, -1,
455 37, 8, -1, 38, 8, -1, 39, 8, -1, 40,
456 8, -1, 41, 8, -1, 42, 8, -1, 11, 7,
457 -1, 12, 7, -1, 43, 43, -1, 44, 7, -1,
458 6, 6, -1, 18, 9, -1, 19, 7, -1, 20,
459 7, -1, 21, 9, -1, 22, 9, -1, 23, 8,
460 -1, 24, 8, -1, 25, 8, -1, 26, 8, -1,
461 27, 7, -1, 28, 7, -1, 29, 6, -1, 30,
465 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
466 static const unsigned short yyrline[] =
468 0, 145, 145, 146, 147, 150, 151, 152, 153, 154,
469 155, 156, 157, 158, 159, 160, 161, 162, 163, 166,
470 167, 168, 169, 170, 173, 176, 176, 179, 182, 182,
471 185, 188, 188, 191, 192, 195, 198, 198, 201, 202,
472 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
473 213, 216, 219, 219, 222, 223, 224, 230, 253, 272,
474 280, 300, 318, 325, 332, 339, 346, 353, 360, 367,
475 376, 394, 408, 444, 481, 505, 512, 527, 542, 558,
476 574, 583, 592, 600, 610, 626, 642, 664, 676
480 #if YYDEBUG || YYERROR_VERBOSE
481 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
482 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
483 static const char *const yytname[] =
485 "$end", "error", "$undefined", "TOK_OPEN", "TOK_CLOSE", "TOK_SEMI",
486 "TOK_STRING", "TOK_INTEGER", "TOK_FLOAT", "TOK_BOOLEAN", "TOK_IP6TYPE",
487 "TOK_DEBUGLEVEL", "TOK_IPVERSION", "TOK_HNA4", "TOK_HNA6", "TOK_PLUGIN",
488 "TOK_INTERFACES", "TOK_IFSETUP", "TOK_NOINT", "TOK_TOS",
489 "TOK_WILLINGNESS", "TOK_IPCCON", "TOK_USEHYST", "TOK_HYSTSCALE",
490 "TOK_HYSTUPPER", "TOK_HYSTLOWER", "TOK_POLLRATE", "TOK_TCREDUNDANCY",
491 "TOK_MPRCOVERAGE", "TOK_PLNAME", "TOK_PLPARAM", "TOK_IP4BROADCAST",
492 "TOK_IP6ADDRTYPE", "TOK_IP6MULTISITE", "TOK_IP6MULTIGLOBAL",
493 "TOK_HELLOINT", "TOK_HELLOVAL", "TOK_TCINT", "TOK_TCVAL", "TOK_MIDINT",
494 "TOK_MIDVAL", "TOK_HNAINT", "TOK_HNAVAL", "TOK_IP4_ADDR",
495 "TOK_IP6_ADDR", "TOK_COMMENT", "$accept", "conf", "stmt", "block",
496 "hna4body", "hna4stmts", "hna6body", "hna6stmts", "ifbody", "ifstmts",
497 "ifstmt", "isetbody", "isetstmts", "isetstmt", "plbody", "plstmts",
498 "plstmt", "isetblock", "isetip4br", "isetip6addrt", "isetip6mults",
499 "isetip6multg", "isethelloint", "isethelloval", "isettcint",
500 "isettcval", "isetmidint", "isetmidval", "isethnaint", "isethnaval",
501 "idebug", "iipversion", "ihna4entry", "ihna6entry", "ifentry", "bnoint",
502 "atos", "awillingness", "bipccon", "busehyst", "fhystscale",
503 "fhystupper", "fhystlower", "fpollrate", "atcredundancy",
504 "amprcoverage", "plname", "plparam", "vcomment", 0
509 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
511 static const unsigned short yytoknum[] =
513 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
514 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
515 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
516 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
517 295, 296, 297, 298, 299, 300
521 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
522 static const unsigned char yyr1[] =
524 0, 46, 47, 47, 47, 48, 48, 48, 48, 48,
525 48, 48, 48, 48, 48, 48, 48, 48, 48, 49,
526 49, 49, 49, 49, 50, 51, 51, 52, 53, 53,
527 54, 55, 55, 56, 56, 57, 58, 58, 59, 59,
528 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
529 59, 60, 61, 61, 62, 62, 62, 63, 64, 65,
530 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
531 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
532 86, 87, 88, 89, 90, 91, 92, 93, 94
535 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
536 static const unsigned char yyr2[] =
538 0, 2, 0, 2, 2, 1, 1, 1, 1, 1,
539 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
540 2, 2, 2, 2, 3, 0, 2, 3, 0, 2,
541 3, 0, 2, 1, 1, 3, 0, 2, 1, 1,
542 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
543 1, 3, 0, 2, 1, 1, 1, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 3, 1
549 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
550 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
551 means the default is an error. */
552 static const unsigned char yydefact[] =
554 2, 0, 1, 0, 0, 0, 0, 0, 0, 0,
555 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
556 0, 88, 4, 3, 0, 5, 6, 7, 8, 9,
557 10, 11, 12, 13, 14, 15, 16, 17, 18, 70,
558 71, 25, 19, 28, 20, 52, 22, 31, 21, 57,
559 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
560 85, 36, 23, 0, 0, 0, 0, 0, 24, 0,
561 26, 27, 0, 29, 51, 0, 0, 53, 54, 55,
562 56, 30, 0, 32, 33, 34, 35, 0, 0, 0,
563 0, 0, 0, 0, 0, 0, 0, 0, 0, 37,
564 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
565 49, 50, 38, 72, 73, 86, 0, 74, 58, 59,
566 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
570 /* YYDEFGOTO[NTERM-NUM]. */
571 static const yysigned_char yydefgoto[] =
573 -1, 1, 22, 23, 42, 63, 44, 64, 48, 66,
574 83, 62, 67, 99, 46, 65, 77, 24, 100, 101,
575 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
576 25, 26, 70, 73, 84, 27, 28, 29, 30, 31,
577 32, 33, 34, 35, 36, 37, 78, 79, 38
580 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
582 #define YYPACT_NINF -59
583 static const yysigned_char yypact[] =
585 -59, 0, -59, 3, 40, 45, 46, 47, 48, 49,
586 -5, 50, 51, 43, 44, 52, 53, 54, 55, 57,
587 58, -59, -59, -59, 56, -59, -59, -59, -59, -59,
588 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
589 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
590 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
591 -59, -59, -59, 1, 2, 37, -3, -2, -59, 11,
592 -59, -59, 61, -59, -59, 63, 64, -59, -59, -59,
593 -59, -59, 65, -59, -59, -59, -59, 13, 62, 29,
594 30, 67, 68, 69, 70, 71, 72, 73, 75, -59,
595 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
596 -59, -59, -59, -59, -59, -59, 78, -59, -59, -59,
597 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
601 /* YYPGOTO[NTERM-NUM]. */
602 static const yysigned_char yypgoto[] =
604 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
605 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
606 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
607 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
608 -59, -59, -59, -59, -59, -59, -59, -59, -58
611 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
612 positive, shift that token. If negative, reduce the rule which
613 number is the opposite. If zero, do what YYDEFACT says.
614 If YYTABLE_NINF, syntax error. */
615 #define YYTABLE_NINF -1
616 static const unsigned char yytable[] =
618 2, 81, 86, 82, 50, 68, 71, 80, 85, 112,
619 39, 3, 4, 5, 6, 7, 8, 9, 10, 11,
620 12, 13, 14, 15, 16, 17, 18, 19, 20, 87,
621 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
622 98, 74, 21, 21, 69, 21, 72, 40, 41, 43,
623 45, 47, 53, 54, 113, 49, 118, 51, 52, 61,
624 55, 56, 57, 58, 59, 60, 75, 76, 114, 115,
625 116, 117, 119, 120, 121, 122, 123, 124, 125, 126,
626 127, 128, 21, 129, 130
629 static const unsigned char yycheck[] =
631 0, 4, 4, 6, 9, 4, 4, 65, 66, 67,
632 7, 11, 12, 13, 14, 15, 16, 17, 18, 19,
633 20, 21, 22, 23, 24, 25, 26, 27, 28, 31,
634 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
635 42, 4, 45, 45, 43, 45, 44, 7, 3, 3,
636 3, 3, 9, 9, 43, 6, 43, 7, 7, 3,
637 8, 8, 8, 8, 7, 7, 29, 30, 7, 6,
638 6, 6, 10, 44, 44, 8, 8, 8, 8, 8,
642 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
643 symbol of state STATE-NUM. */
644 static const unsigned char yystos[] =
646 0, 47, 0, 11, 12, 13, 14, 15, 16, 17,
647 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
648 28, 45, 48, 49, 63, 76, 77, 81, 82, 83,
649 84, 85, 86, 87, 88, 89, 90, 91, 94, 7,
650 7, 3, 50, 3, 52, 3, 60, 3, 54, 6,
651 9, 7, 7, 9, 9, 8, 8, 8, 8, 7,
652 7, 3, 57, 51, 53, 61, 55, 58, 4, 43,
653 78, 4, 44, 79, 4, 29, 30, 62, 92, 93,
654 94, 4, 6, 56, 80, 94, 4, 31, 32, 33,
655 34, 35, 36, 37, 38, 39, 40, 41, 42, 59,
656 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
657 74, 75, 94, 43, 7, 6, 6, 6, 43, 10,
658 44, 44, 8, 8, 8, 8, 8, 8, 8, 8,
662 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
663 # define YYSIZE_T __SIZE_TYPE__
665 #if ! defined (YYSIZE_T) && defined (size_t)
666 # define YYSIZE_T size_t
668 #if ! defined (YYSIZE_T)
669 # if defined (__STDC__) || defined (__cplusplus)
670 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
671 # define YYSIZE_T size_t
674 #if ! defined (YYSIZE_T)
675 # define YYSIZE_T unsigned int
678 #define yyerrok (yyerrstatus = 0)
679 #define yyclearin (yychar = YYEMPTY)
683 #define YYACCEPT goto yyacceptlab
684 #define YYABORT goto yyabortlab
685 #define YYERROR goto yyerrlab1
688 /* Like YYERROR except do call yyerror. This remains here temporarily
689 to ease the transition to the new meaning of YYERROR, for GCC.
690 Once GCC version 2 has supplanted version 1, this can go. */
692 #define YYFAIL goto yyerrlab
694 #define YYRECOVERING() (!!yyerrstatus)
696 #define YYBACKUP(Token, Value) \
698 if (yychar == YYEMPTY && yylen == 1) \
702 yytoken = YYTRANSLATE (yychar); \
708 yyerror ("syntax error: cannot back up");\
714 #define YYERRCODE 256
716 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
719 #ifndef YYLLOC_DEFAULT
720 # define YYLLOC_DEFAULT(Current, Rhs, N) \
721 Current.first_line = Rhs[1].first_line; \
722 Current.first_column = Rhs[1].first_column; \
723 Current.last_line = Rhs[N].last_line; \
724 Current.last_column = Rhs[N].last_column;
727 /* YYLEX -- calling `yylex' with the right arguments. */
730 # define YYLEX yylex (YYLEX_PARAM)
732 # define YYLEX yylex ()
735 /* Enable debugging if requested. */
739 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
740 # define YYFPRINTF fprintf
743 # define YYDPRINTF(Args) \
749 # define YYDSYMPRINT(Args) \
755 # define YYDSYMPRINTF(Title, Token, Value, Location) \
759 YYFPRINTF (stderr, "%s ", Title); \
760 yysymprint (stderr, \
762 YYFPRINTF (stderr, "\n"); \
766 /*------------------------------------------------------------------.
767 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
769 `------------------------------------------------------------------*/
771 #if defined (__STDC__) || defined (__cplusplus)
773 yy_stack_print (short *bottom, short *top)
776 yy_stack_print (bottom, top)
781 YYFPRINTF (stderr, "Stack now");
782 for (/* Nothing. */; bottom <= top; ++bottom)
783 YYFPRINTF (stderr, " %d", *bottom);
784 YYFPRINTF (stderr, "\n");
787 # define YY_STACK_PRINT(Bottom, Top) \
790 yy_stack_print ((Bottom), (Top)); \
794 /*------------------------------------------------.
795 | Report that the YYRULE is going to be reduced. |
796 `------------------------------------------------*/
798 #if defined (__STDC__) || defined (__cplusplus)
800 yy_reduce_print (int yyrule)
803 yy_reduce_print (yyrule)
808 unsigned int yylineno = yyrline[yyrule];
809 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
810 yyrule - 1, yylineno);
811 /* Print the symbols being reduced, and their result. */
812 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
813 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
814 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
817 # define YY_REDUCE_PRINT(Rule) \
820 yy_reduce_print (Rule); \
823 /* Nonzero means print parse trace. It is left uninitialized so that
824 multiple parsers can coexist. */
827 # define YYDPRINTF(Args)
828 # define YYDSYMPRINT(Args)
829 # define YYDSYMPRINTF(Title, Token, Value, Location)
830 # define YY_STACK_PRINT(Bottom, Top)
831 # define YY_REDUCE_PRINT(Rule)
832 #endif /* !YYDEBUG */
835 /* YYINITDEPTH -- initial size of the parser's stacks. */
837 # define YYINITDEPTH 200
840 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
841 if the built-in stack extension method is used).
843 Do not make this value too large; the results are undefined if
844 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
845 evaluated with infinite-precision integer arithmetic. */
852 # define YYMAXDEPTH 10000
860 # if defined (__GLIBC__) && defined (_STRING_H)
861 # define yystrlen strlen
863 /* Return the length of YYSTR. */
865 # if defined (__STDC__) || defined (__cplusplus)
866 yystrlen (const char *yystr)
872 register const char *yys = yystr;
874 while (*yys++ != '\0')
877 return yys - yystr - 1;
883 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
884 # define yystpcpy stpcpy
886 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
889 # if defined (__STDC__) || defined (__cplusplus)
890 yystpcpy (char *yydest, const char *yysrc)
892 yystpcpy (yydest, yysrc)
897 register char *yyd = yydest;
898 register const char *yys = yysrc;
900 while ((*yyd++ = *yys++) != '\0')
908 #endif /* !YYERROR_VERBOSE */
913 /*--------------------------------.
914 | Print this symbol on YYOUTPUT. |
915 `--------------------------------*/
917 #if defined (__STDC__) || defined (__cplusplus)
919 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
922 yysymprint (yyoutput, yytype, yyvaluep)
928 /* Pacify ``unused variable'' warnings. */
931 if (yytype < YYNTOKENS)
933 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
935 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
939 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
946 YYFPRINTF (yyoutput, ")");
949 #endif /* ! YYDEBUG */
950 /*-----------------------------------------------.
951 | Release the memory associated to this symbol. |
952 `-----------------------------------------------*/
954 #if defined (__STDC__) || defined (__cplusplus)
956 yydestruct (int yytype, YYSTYPE *yyvaluep)
959 yydestruct (yytype, yyvaluep)
964 /* Pacify ``unused variable'' warnings. */
976 /* Prevent warnings from -Wmissing-prototypes. */
979 # if defined (__STDC__) || defined (__cplusplus)
980 int yyparse (void *YYPARSE_PARAM);
984 #else /* ! YYPARSE_PARAM */
985 #if defined (__STDC__) || defined (__cplusplus)
990 #endif /* ! YYPARSE_PARAM */
994 /* The lookahead symbol. */
997 /* The semantic value of the lookahead symbol. */
1000 /* Number of syntax errors so far. */
1009 #ifdef YYPARSE_PARAM
1010 # if defined (__STDC__) || defined (__cplusplus)
1011 int yyparse (void *YYPARSE_PARAM)
1013 int yyparse (YYPARSE_PARAM)
1014 void *YYPARSE_PARAM;
1016 #else /* ! YYPARSE_PARAM */
1017 #if defined (__STDC__) || defined (__cplusplus)
1028 register int yystate;
1031 /* Number of tokens to shift before error messages enabled. */
1033 /* Lookahead token as an internal (translated) token number. */
1036 /* Three stacks and their tools:
1037 `yyss': related to states,
1038 `yyvs': related to semantic values,
1039 `yyls': related to locations.
1041 Refer to the stacks thru separate pointers, to allow yyoverflow
1042 to reallocate them elsewhere. */
1044 /* The state stack. */
1045 short yyssa[YYINITDEPTH];
1046 short *yyss = yyssa;
1047 register short *yyssp;
1049 /* The semantic value stack. */
1050 YYSTYPE yyvsa[YYINITDEPTH];
1051 YYSTYPE *yyvs = yyvsa;
1052 register YYSTYPE *yyvsp;
1056 #define YYPOPSTACK (yyvsp--, yyssp--)
1058 YYSIZE_T yystacksize = YYINITDEPTH;
1060 /* The variables used to return semantic value and location from the
1065 /* When reducing, the number of symbols on the RHS of the reduced
1069 YYDPRINTF ((stderr, "Starting parse\n"));
1074 yychar = YYEMPTY; /* Cause a token to be read. */
1076 /* Initialize stack pointers.
1077 Waste one element of value and location stack
1078 so that they stay on the same level as the state stack.
1079 The wasted elements are never initialized. */
1086 /*------------------------------------------------------------.
1087 | yynewstate -- Push a new state, which is found in yystate. |
1088 `------------------------------------------------------------*/
1090 /* In all cases, when you get here, the value and location stacks
1091 have just been pushed. so pushing a state here evens the stacks.
1098 if (yyss + yystacksize - 1 <= yyssp)
1100 /* Get the current used size of the three stacks, in elements. */
1101 YYSIZE_T yysize = yyssp - yyss + 1;
1105 /* Give user a chance to reallocate the stack. Use copies of
1106 these so that the &'s don't force the real ones into
1108 YYSTYPE *yyvs1 = yyvs;
1109 short *yyss1 = yyss;
1112 /* Each stack pointer address is followed by the size of the
1113 data in use in that stack, in bytes. This used to be a
1114 conditional around just the two extra args, but that might
1115 be undefined if yyoverflow is a macro. */
1116 yyoverflow ("parser stack overflow",
1117 &yyss1, yysize * sizeof (*yyssp),
1118 &yyvs1, yysize * sizeof (*yyvsp),
1125 #else /* no yyoverflow */
1126 # ifndef YYSTACK_RELOCATE
1129 /* Extend the stack our own way. */
1130 if (YYMAXDEPTH <= yystacksize)
1133 if (YYMAXDEPTH < yystacksize)
1134 yystacksize = YYMAXDEPTH;
1137 short *yyss1 = yyss;
1138 union yyalloc *yyptr =
1139 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1142 YYSTACK_RELOCATE (yyss);
1143 YYSTACK_RELOCATE (yyvs);
1145 # undef YYSTACK_RELOCATE
1147 YYSTACK_FREE (yyss1);
1150 #endif /* no yyoverflow */
1152 yyssp = yyss + yysize - 1;
1153 yyvsp = yyvs + yysize - 1;
1156 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1157 (unsigned long int) yystacksize));
1159 if (yyss + yystacksize - 1 <= yyssp)
1163 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1172 /* Do appropriate processing given the current state. */
1173 /* Read a lookahead token if we need one and don't already have one. */
1176 /* First try to decide what to do without reference to lookahead token. */
1178 yyn = yypact[yystate];
1179 if (yyn == YYPACT_NINF)
1182 /* Not known => get a lookahead token if don't already have one. */
1184 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1185 if (yychar == YYEMPTY)
1187 YYDPRINTF ((stderr, "Reading a token: "));
1191 if (yychar <= YYEOF)
1193 yychar = yytoken = YYEOF;
1194 YYDPRINTF ((stderr, "Now at end of input.\n"));
1198 yytoken = YYTRANSLATE (yychar);
1199 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1202 /* If the proper action on seeing token YYTOKEN is to reduce or to
1203 detect an error, take that action. */
1205 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1210 if (yyn == 0 || yyn == YYTABLE_NINF)
1219 /* Shift the lookahead token. */
1220 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1222 /* Discard the token being shifted unless it is eof. */
1223 if (yychar != YYEOF)
1229 /* Count tokens shifted since error; after three, turn off error
1238 /*-----------------------------------------------------------.
1239 | yydefault -- do the default action for the current state. |
1240 `-----------------------------------------------------------*/
1242 yyn = yydefact[yystate];
1248 /*-----------------------------.
1249 | yyreduce -- Do a reduction. |
1250 `-----------------------------*/
1252 /* yyn is the number of a rule to reduce with. */
1255 /* If YYLEN is nonzero, implement the default value of the action:
1258 Otherwise, the following line sets YYVAL to garbage.
1259 This behavior is undocumented and Bison
1260 users should not rely upon it. Assigning to YYVAL
1261 unconditionally makes the parser a bit smaller, and it avoids a
1262 GCC warning that YYVAL may be used uninitialized. */
1263 yyval = yyvsp[1-yylen];
1266 YY_REDUCE_PRINT (yyn);
1270 #line 231 "src/cfgparser/oparse.y"
1272 struct if_config_options *io = get_default_if_config();
1275 fprintf(stderr, "Out of memory(ADD IFRULE)\n");
1279 if(PARSER_DEBUG) printf("Interface setup: \"%s\"\n", yyvsp[0]->string);
1281 io->name = yyvsp[0]->string;
1285 io->next = cnf->if_options;
1286 cnf->if_options = io;
1293 #line 254 "src/cfgparser/oparse.y"
1297 if(PARSER_DEBUG) printf("\tIPv4 broadcast: %s\n", yyvsp[0]->string);
1299 if(inet_aton(yyvsp[0]->string, &in) == 0)
1301 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[-1]->string);
1305 cnf->if_options->ipv4_broadcast.v4 = in.s_addr;
1307 free(yyvsp[0]->string);
1313 #line 273 "src/cfgparser/oparse.y"
1315 cnf->if_options->ipv6_addrtype = yyvsp[0]->boolean;
1322 #line 281 "src/cfgparser/oparse.y"
1324 struct in6_addr in6;
1326 if(PARSER_DEBUG) printf("\tIPv6 site-local multicast: %s\n", yyvsp[0]->string);
1328 if(inet_pton(AF_INET6, yyvsp[0]->string, &in6) < 0)
1330 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[0]->string);
1333 memcpy(&cnf->if_options->ipv6_multi_site.v6, &in6, sizeof(struct in6_addr));
1336 free(yyvsp[0]->string);
1342 #line 301 "src/cfgparser/oparse.y"
1344 struct in6_addr in6;
1346 if(PARSER_DEBUG) printf("\tIPv6 global multicast: %s\n", yyvsp[0]->string);
1348 if(inet_pton(AF_INET6, yyvsp[0]->string, &in6) < 0)
1350 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[0]->string);
1353 memcpy(&cnf->if_options->ipv6_multi_glbl.v6, &in6, sizeof(struct in6_addr));
1356 free(yyvsp[0]->string);
1362 #line 319 "src/cfgparser/oparse.y"
1364 if(PARSER_DEBUG) printf("\tHELLO interval: %0.2f\n", yyvsp[0]->floating);
1365 cnf->if_options->hello_params.emission_interval = yyvsp[0]->floating;
1371 #line 326 "src/cfgparser/oparse.y"
1373 if(PARSER_DEBUG) printf("\tHELLO validity: %0.2f\n", yyvsp[0]->floating);
1374 cnf->if_options->hello_params.validity_time = yyvsp[0]->floating;
1380 #line 333 "src/cfgparser/oparse.y"
1382 if(PARSER_DEBUG) printf("\tTC interval: %0.2f\n", yyvsp[0]->floating);
1383 cnf->if_options->tc_params.emission_interval = yyvsp[0]->floating;
1389 #line 340 "src/cfgparser/oparse.y"
1391 if(PARSER_DEBUG) printf("\tTC validity: %0.2f\n", yyvsp[0]->floating);
1392 cnf->if_options->tc_params.validity_time = yyvsp[0]->floating;
1398 #line 347 "src/cfgparser/oparse.y"
1400 if(PARSER_DEBUG) printf("\tMID interval: %0.2f\n", yyvsp[0]->floating);
1401 cnf->if_options->mid_params.emission_interval = yyvsp[0]->floating;
1407 #line 354 "src/cfgparser/oparse.y"
1409 if(PARSER_DEBUG) printf("\tMID validity: %0.2f\n", yyvsp[0]->floating);
1410 cnf->if_options->mid_params.validity_time = yyvsp[0]->floating;
1416 #line 361 "src/cfgparser/oparse.y"
1418 if(PARSER_DEBUG) printf("\tHNA interval: %0.2f\n", yyvsp[0]->floating);
1419 cnf->if_options->hna_params.emission_interval = yyvsp[0]->floating;
1425 #line 368 "src/cfgparser/oparse.y"
1427 if(PARSER_DEBUG) printf("\tHNA validity: %0.2f\n", yyvsp[0]->floating);
1428 cnf->if_options->hna_params.validity_time = yyvsp[0]->floating;
1434 #line 377 "src/cfgparser/oparse.y"
1437 if(yyvsp[0]->boolean == 1)
1439 if(PARSER_DEBUG) printf("Debug levl AUTO\n");
1443 cnf->debug_level = yyvsp[0]->integer;
1444 if(PARSER_DEBUG) printf("Debug level: %d\n", cnf->debug_level);
1452 #line 395 "src/cfgparser/oparse.y"
1454 if((yyvsp[0]->integer != 4) && (yyvsp[0]->integer != 6))
1456 fprintf(stderr, "IPversion must be 4 or 6!\n");
1459 cnf->ip_version = yyvsp[0]->integer;
1460 if(PARSER_DEBUG) printf("IpVersion: %d\n", cnf->ip_version);
1466 #line 409 "src/cfgparser/oparse.y"
1468 struct hna4_entry *h = malloc(sizeof(struct hna4_entry));
1471 if(PARSER_DEBUG) printf("HNA IPv4 entry: %s/%s\n", yyvsp[-1]->string, yyvsp[0]->string);
1475 fprintf(stderr, "Out of memory(HNA4)\n");
1479 if(inet_aton(yyvsp[-1]->string, &in) == 0)
1481 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[-1]->string);
1485 if(inet_aton(yyvsp[0]->string, &in) == 0)
1487 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[-1]->string);
1490 h->netmask = in.s_addr;
1492 h->next = cnf->hna4_entries;
1493 cnf->hna4_entries = h;
1495 free(yyvsp[-1]->string);
1497 free(yyvsp[0]->string);
1504 #line 445 "src/cfgparser/oparse.y"
1506 struct hna6_entry *h = malloc(sizeof(struct hna6_entry));
1507 struct in6_addr in6;
1509 if(PARSER_DEBUG) printf("HNA IPv6 entry: %s/%d\n", yyvsp[-1]->string, yyvsp[0]->integer);
1513 fprintf(stderr, "Out of memory(HNA6)\n");
1517 if(inet_pton(AF_INET6, yyvsp[-1]->string, &in6) < 0)
1519 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[-1]->string);
1522 memcpy(&h->net, &in6, sizeof(struct in6_addr));
1524 if((yyvsp[0]->integer < 0) || (yyvsp[0]->integer > 128))
1526 fprintf(stderr, "Illegal IPv6 prefix length %d\n", yyvsp[0]->integer);
1530 h->prefix_len = yyvsp[0]->integer;
1532 h->next = cnf->hna6_entries;
1533 cnf->hna6_entries = h;
1535 free(yyvsp[-1]->string);
1543 #line 482 "src/cfgparser/oparse.y"
1545 struct olsr_if *in = malloc(sizeof(struct olsr_if));
1549 fprintf(stderr, "Out of memory(ADD IF)\n");
1553 in->name = yyvsp[-1]->string;
1554 in->config = yyvsp[0]->string;
1556 if(PARSER_DEBUG) printf("Interface: %s Ruleset: %s\n", yyvsp[-1]->string, yyvsp[0]->string);
1559 in->next = cnf->interfaces;
1560 cnf->interfaces = in;
1568 #line 506 "src/cfgparser/oparse.y"
1570 if(PARSER_DEBUG) printf("Noint set to %d\n", yyvsp[0]->boolean);
1576 #line 513 "src/cfgparser/oparse.y"
1578 if(yyvsp[0]->boolean == 1)
1580 if(PARSER_DEBUG) printf("Tos AUTO\n");
1584 if(PARSER_DEBUG) printf("TOS: %d\n", yyvsp[0]->integer);
1592 #line 528 "src/cfgparser/oparse.y"
1594 if(yyvsp[0]->boolean == 1)
1596 if(PARSER_DEBUG) printf("Willingness AUTO\n");
1600 if(PARSER_DEBUG) printf("Willingness: %d\n", yyvsp[0]->integer);
1608 #line 543 "src/cfgparser/oparse.y"
1610 if(yyvsp[0]->boolean == 1)
1612 if(PARSER_DEBUG) printf("IPC allowed\n");
1616 if(PARSER_DEBUG) printf("IPC blocked\n");
1624 #line 559 "src/cfgparser/oparse.y"
1626 if(yyvsp[0]->boolean == 1)
1628 if(PARSER_DEBUG) printf("Hysteresis enabled\n");
1632 if(PARSER_DEBUG) printf("Hysteresis disabled\n");
1640 #line 575 "src/cfgparser/oparse.y"
1642 cnf->hysteresis_param.scaling = yyvsp[0]->floating;
1643 if(PARSER_DEBUG) printf("Hysteresis Scaling: %0.2f\n", yyvsp[0]->floating);
1649 #line 584 "src/cfgparser/oparse.y"
1651 cnf->hysteresis_param.thr_high = yyvsp[0]->floating;
1652 if(PARSER_DEBUG) printf("Hysteresis UpperThr: %0.2f\n", yyvsp[0]->floating);
1658 #line 593 "src/cfgparser/oparse.y"
1660 cnf->hysteresis_param.thr_low = yyvsp[0]->floating;
1661 if(PARSER_DEBUG) printf("Hysteresis LowerThr: %0.2f\n", yyvsp[0]->floating);
1667 #line 601 "src/cfgparser/oparse.y"
1669 if(PARSER_DEBUG) printf("Pollrate %0.2f\n", yyvsp[0]->floating);
1670 cnf->pollrate = yyvsp[0]->floating;
1677 #line 611 "src/cfgparser/oparse.y"
1679 if(yyvsp[0]->boolean == 1)
1681 if(PARSER_DEBUG) printf("TC redundancy AUTO\n");
1685 if(PARSER_DEBUG) printf("TC redundancy %d\n", yyvsp[0]->integer);
1686 cnf->tc_redundancy = yyvsp[0]->integer;
1694 #line 627 "src/cfgparser/oparse.y"
1696 if(yyvsp[0]->boolean == 1)
1698 if(PARSER_DEBUG) printf("MPR coverage AUTO\n");
1702 if(PARSER_DEBUG) printf("MPR coverage %d\n", yyvsp[0]->integer);
1703 cnf->mpr_coverage = yyvsp[0]->integer;
1710 #line 643 "src/cfgparser/oparse.y"
1712 struct plugin_entry *pe = malloc(sizeof(struct plugin_entry));
1716 fprintf(stderr, "Out of memory(ADD PL)\n");
1720 pe->name = yyvsp[0]->string;
1722 if(PARSER_DEBUG) printf("Plugin: %s\n", yyvsp[0]->string);
1725 pe->next = cnf->plugins;
1733 #line 665 "src/cfgparser/oparse.y"
1736 if(PARSER_DEBUG) printf("Plugin param key:\"%s\" val: \"%s\"\n", yyvsp[-1]->string, yyvsp[0]->string);
1738 free(yyvsp[-1]->string);
1740 free(yyvsp[0]->string);
1746 #line 677 "src/cfgparser/oparse.y"
1748 //if(PARSER_DEBUG) printf("Comment\n");
1755 /* Line 999 of yacc.c. */
1756 #line 1757 "y.tab.c"
1762 YY_STACK_PRINT (yyss, yyssp);
1767 /* Now `shift' the result of the reduction. Determine what state
1768 that goes to, based on the state we popped back to and the rule
1769 number reduced by. */
1773 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1774 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1775 yystate = yytable[yystate];
1777 yystate = yydefgoto[yyn - YYNTOKENS];
1782 /*------------------------------------.
1783 | yyerrlab -- here on detecting error |
1784 `------------------------------------*/
1786 /* If not already recovering from an error, report this error. */
1791 yyn = yypact[yystate];
1793 if (YYPACT_NINF < yyn && yyn < YYLAST)
1795 YYSIZE_T yysize = 0;
1796 int yytype = YYTRANSLATE (yychar);
1801 /* Start YYX at -YYN if negative to avoid negative indexes in
1803 for (yyx = yyn < 0 ? -yyn : 0;
1804 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1805 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1806 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1807 yysize += yystrlen ("syntax error, unexpected ") + 1;
1808 yysize += yystrlen (yytname[yytype]);
1809 yymsg = (char *) YYSTACK_ALLOC (yysize);
1812 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1813 yyp = yystpcpy (yyp, yytname[yytype]);
1818 for (yyx = yyn < 0 ? -yyn : 0;
1819 yyx < (int) (sizeof (yytname) / sizeof (char *));
1821 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1823 const char *yyq = ! yycount ? ", expecting " : " or ";
1824 yyp = yystpcpy (yyp, yyq);
1825 yyp = yystpcpy (yyp, yytname[yyx]);
1830 YYSTACK_FREE (yymsg);
1833 yyerror ("syntax error; also virtual memory exhausted");
1836 #endif /* YYERROR_VERBOSE */
1837 yyerror ("syntax error");
1842 if (yyerrstatus == 3)
1844 /* If just tried and failed to reuse lookahead token after an
1845 error, discard it. */
1847 /* Return failure if at end of input. */
1848 if (yychar == YYEOF)
1850 /* Pop the error token. */
1852 /* Pop the rest of the stack. */
1853 while (yyss < yyssp)
1855 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1856 yydestruct (yystos[*yyssp], yyvsp);
1862 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1863 yydestruct (yytoken, &yylval);
1868 /* Else will try to reuse lookahead token after shifting the error
1873 /*----------------------------------------------------.
1874 | yyerrlab1 -- error raised explicitly by an action. |
1875 `----------------------------------------------------*/
1877 yyerrstatus = 3; /* Each real token shifted decrements this. */
1881 yyn = yypact[yystate];
1882 if (yyn != YYPACT_NINF)
1885 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1893 /* Pop the current state because it cannot handle the error token. */
1897 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1898 yydestruct (yystos[yystate], yyvsp);
1902 YY_STACK_PRINT (yyss, yyssp);
1908 YYDPRINTF ((stderr, "Shifting error token, "));
1917 /*-------------------------------------.
1918 | yyacceptlab -- YYACCEPT comes here. |
1919 `-------------------------------------*/
1924 /*-----------------------------------.
1925 | yyabortlab -- YYABORT comes here. |
1926 `-----------------------------------*/
1932 /*----------------------------------------------.
1933 | yyoverflowlab -- parser overflow comes here. |
1934 `----------------------------------------------*/
1936 yyerror ("parser stack overflow");
1944 YYSTACK_FREE (yyss);
1950 #line 684 "src/cfgparser/oparse.y"
1953 void yyerror (char *string)
1955 fprintf(stderr, "Config line %d: %s\n", current_line, string);