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.3 2004/10/17 12:28:02 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 130
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, 130, 133, 136,
432 139, 142, 145, 148, 151, 154, 157, 160, 163, 166,
433 169, 172, 175, 178, 181, 184, 187, 190, 193, 196,
434 199, 202, 205, 208, 211, 214, 217, 221
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, 92, 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, 93, -1, 94, -1, 17, 6, -1,
453 31, 43, -1, 32, 10, -1, 33, 44, -1, 34,
454 44, -1, 35, 8, -1, 36, 8, -1, 37, 8,
455 -1, 38, 8, -1, 39, 8, -1, 40, 8, -1,
456 41, 8, -1, 42, 8, -1, 11, 7, -1, 12,
457 7, -1, 43, 43, -1, 44, 7, -1, 6, 6,
458 -1, 18, 9, -1, 19, 7, -1, 20, 7, -1,
459 21, 9, -1, 22, 9, -1, 23, 8, -1, 24,
460 8, -1, 25, 8, -1, 26, 8, -1, 27, 7,
461 -1, 28, 7, -1, 15, 6, -1, 30, 6, 6,
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, 229, 252, 271, 279,
474 299, 317, 324, 331, 338, 345, 352, 359, 366, 375,
475 393, 407, 443, 480, 504, 511, 526, 541, 557, 573,
476 582, 591, 599, 609, 625, 641, 663, 675
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", "plblock", "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, 63, 64, 65, 66,
530 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
531 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
532 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, 2, 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, 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, 87, 4, 3, 0, 5, 6, 7, 8, 9,
557 10, 11, 12, 13, 14, 15, 16, 17, 0, 18,
558 69, 70, 25, 19, 28, 20, 85, 31, 21, 56,
559 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
560 84, 36, 23, 52, 22, 0, 0, 0, 0, 0,
561 24, 0, 26, 27, 0, 29, 30, 0, 32, 33,
562 34, 35, 0, 0, 0, 0, 0, 0, 0, 0,
563 0, 0, 0, 0, 37, 39, 40, 41, 42, 43,
564 44, 45, 46, 47, 48, 49, 50, 38, 51, 0,
565 53, 54, 55, 71, 72, 73, 57, 58, 59, 60,
566 61, 62, 63, 64, 65, 66, 67, 68, 0, 86
569 /* YYDEFGOTO[NTERM-NUM]. */
570 static const yysigned_char yydefgoto[] =
572 -1, 1, 22, 23, 43, 65, 45, 66, 48, 67,
573 78, 62, 68, 94, 64, 69, 110, 24, 95, 96,
574 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
575 25, 26, 72, 75, 79, 27, 28, 29, 30, 31,
576 32, 33, 34, 35, 36, 37, 38, 111, 39
579 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
581 #define YYPACT_NINF -61
582 static const yysigned_char yypact[] =
584 -61, 0, -61, 3, 40, 45, 46, 44, 48, 47,
585 -5, 49, 50, 43, 51, 53, 54, 55, 56, 52,
586 58, -61, -61, -61, 63, -61, -61, -61, -61, -61,
587 -61, -61, -61, -61, -61, -61, -61, -61, 65, -61,
588 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
589 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
590 -61, -61, -61, -61, -61, 1, 2, -3, -2, 37,
591 -61, 11, -61, -61, 62, -61, -61, 64, -61, -61,
592 -61, -61, 12, 61, 14, 28, 66, 67, 68, 69,
593 70, 71, 72, 73, -61, -61, -61, -61, -61, -61,
594 -61, -61, -61, -61, -61, -61, -61, -61, -61, 77,
595 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
596 -61, -61, -61, -61, -61, -61, -61, -61, 78, -61
599 /* YYPGOTO[NTERM-NUM]. */
600 static const yysigned_char yypgoto[] =
602 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
603 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
604 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
605 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
606 -61, -61, -61, -61, -61, -61, -61, -61, -60
609 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
610 positive, shift that token. If negative, reduce the rule which
611 number is the opposite. If zero, do what YYDEFACT says.
612 If YYTABLE_NINF, syntax error. */
613 #define YYTABLE_NINF -1
614 static const unsigned char yytable[] =
616 2, 76, 81, 77, 50, 70, 73, 80, 107, 112,
617 40, 3, 4, 5, 6, 7, 8, 9, 10, 11,
618 12, 13, 14, 15, 16, 17, 18, 19, 20, 82,
619 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
620 93, 108, 21, 21, 71, 21, 74, 41, 42, 44,
621 46, 47, 53, 49, 113, 116, 51, 52, 118, 59,
622 54, 55, 56, 57, 58, 60, 61, 109, 63, 114,
623 115, 117, 119, 0, 120, 121, 122, 123, 124, 125,
624 126, 127, 21, 128, 129
627 static const yysigned_char yycheck[] =
629 0, 4, 4, 6, 9, 4, 4, 67, 68, 69,
630 7, 11, 12, 13, 14, 15, 16, 17, 18, 19,
631 20, 21, 22, 23, 24, 25, 26, 27, 28, 31,
632 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
633 42, 4, 45, 45, 43, 45, 44, 7, 3, 3,
634 6, 3, 9, 6, 43, 43, 7, 7, 44, 7,
635 9, 8, 8, 8, 8, 7, 3, 30, 3, 7,
636 6, 10, 44, -1, 8, 8, 8, 8, 8, 8,
640 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
641 symbol of state STATE-NUM. */
642 static const unsigned char yystos[] =
644 0, 47, 0, 11, 12, 13, 14, 15, 16, 17,
645 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
646 28, 45, 48, 49, 63, 76, 77, 81, 82, 83,
647 84, 85, 86, 87, 88, 89, 90, 91, 92, 94,
648 7, 7, 3, 50, 3, 52, 6, 3, 54, 6,
649 9, 7, 7, 9, 9, 8, 8, 8, 8, 7,
650 7, 3, 57, 3, 60, 51, 53, 55, 58, 61,
651 4, 43, 78, 4, 44, 79, 4, 6, 56, 80,
652 94, 4, 31, 32, 33, 34, 35, 36, 37, 38,
653 39, 40, 41, 42, 59, 64, 65, 66, 67, 68,
654 69, 70, 71, 72, 73, 74, 75, 94, 4, 30,
655 62, 93, 94, 43, 7, 6, 43, 10, 44, 44,
656 8, 8, 8, 8, 8, 8, 8, 8, 6, 6
659 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
660 # define YYSIZE_T __SIZE_TYPE__
662 #if ! defined (YYSIZE_T) && defined (size_t)
663 # define YYSIZE_T size_t
665 #if ! defined (YYSIZE_T)
666 # if defined (__STDC__) || defined (__cplusplus)
667 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
668 # define YYSIZE_T size_t
671 #if ! defined (YYSIZE_T)
672 # define YYSIZE_T unsigned int
675 #define yyerrok (yyerrstatus = 0)
676 #define yyclearin (yychar = YYEMPTY)
680 #define YYACCEPT goto yyacceptlab
681 #define YYABORT goto yyabortlab
682 #define YYERROR goto yyerrlab1
685 /* Like YYERROR except do call yyerror. This remains here temporarily
686 to ease the transition to the new meaning of YYERROR, for GCC.
687 Once GCC version 2 has supplanted version 1, this can go. */
689 #define YYFAIL goto yyerrlab
691 #define YYRECOVERING() (!!yyerrstatus)
693 #define YYBACKUP(Token, Value) \
695 if (yychar == YYEMPTY && yylen == 1) \
699 yytoken = YYTRANSLATE (yychar); \
705 yyerror ("syntax error: cannot back up");\
711 #define YYERRCODE 256
713 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
716 #ifndef YYLLOC_DEFAULT
717 # define YYLLOC_DEFAULT(Current, Rhs, N) \
718 Current.first_line = Rhs[1].first_line; \
719 Current.first_column = Rhs[1].first_column; \
720 Current.last_line = Rhs[N].last_line; \
721 Current.last_column = Rhs[N].last_column;
724 /* YYLEX -- calling `yylex' with the right arguments. */
727 # define YYLEX yylex (YYLEX_PARAM)
729 # define YYLEX yylex ()
732 /* Enable debugging if requested. */
736 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
737 # define YYFPRINTF fprintf
740 # define YYDPRINTF(Args) \
746 # define YYDSYMPRINT(Args) \
752 # define YYDSYMPRINTF(Title, Token, Value, Location) \
756 YYFPRINTF (stderr, "%s ", Title); \
757 yysymprint (stderr, \
759 YYFPRINTF (stderr, "\n"); \
763 /*------------------------------------------------------------------.
764 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
766 `------------------------------------------------------------------*/
768 #if defined (__STDC__) || defined (__cplusplus)
770 yy_stack_print (short *bottom, short *top)
773 yy_stack_print (bottom, top)
778 YYFPRINTF (stderr, "Stack now");
779 for (/* Nothing. */; bottom <= top; ++bottom)
780 YYFPRINTF (stderr, " %d", *bottom);
781 YYFPRINTF (stderr, "\n");
784 # define YY_STACK_PRINT(Bottom, Top) \
787 yy_stack_print ((Bottom), (Top)); \
791 /*------------------------------------------------.
792 | Report that the YYRULE is going to be reduced. |
793 `------------------------------------------------*/
795 #if defined (__STDC__) || defined (__cplusplus)
797 yy_reduce_print (int yyrule)
800 yy_reduce_print (yyrule)
805 unsigned int yylineno = yyrline[yyrule];
806 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
807 yyrule - 1, yylineno);
808 /* Print the symbols being reduced, and their result. */
809 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
810 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
811 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
814 # define YY_REDUCE_PRINT(Rule) \
817 yy_reduce_print (Rule); \
820 /* Nonzero means print parse trace. It is left uninitialized so that
821 multiple parsers can coexist. */
824 # define YYDPRINTF(Args)
825 # define YYDSYMPRINT(Args)
826 # define YYDSYMPRINTF(Title, Token, Value, Location)
827 # define YY_STACK_PRINT(Bottom, Top)
828 # define YY_REDUCE_PRINT(Rule)
829 #endif /* !YYDEBUG */
832 /* YYINITDEPTH -- initial size of the parser's stacks. */
834 # define YYINITDEPTH 200
837 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
838 if the built-in stack extension method is used).
840 Do not make this value too large; the results are undefined if
841 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
842 evaluated with infinite-precision integer arithmetic. */
849 # define YYMAXDEPTH 10000
857 # if defined (__GLIBC__) && defined (_STRING_H)
858 # define yystrlen strlen
860 /* Return the length of YYSTR. */
862 # if defined (__STDC__) || defined (__cplusplus)
863 yystrlen (const char *yystr)
869 register const char *yys = yystr;
871 while (*yys++ != '\0')
874 return yys - yystr - 1;
880 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
881 # define yystpcpy stpcpy
883 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
886 # if defined (__STDC__) || defined (__cplusplus)
887 yystpcpy (char *yydest, const char *yysrc)
889 yystpcpy (yydest, yysrc)
894 register char *yyd = yydest;
895 register const char *yys = yysrc;
897 while ((*yyd++ = *yys++) != '\0')
905 #endif /* !YYERROR_VERBOSE */
910 /*--------------------------------.
911 | Print this symbol on YYOUTPUT. |
912 `--------------------------------*/
914 #if defined (__STDC__) || defined (__cplusplus)
916 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
919 yysymprint (yyoutput, yytype, yyvaluep)
925 /* Pacify ``unused variable'' warnings. */
928 if (yytype < YYNTOKENS)
930 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
932 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
936 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
943 YYFPRINTF (yyoutput, ")");
946 #endif /* ! YYDEBUG */
947 /*-----------------------------------------------.
948 | Release the memory associated to this symbol. |
949 `-----------------------------------------------*/
951 #if defined (__STDC__) || defined (__cplusplus)
953 yydestruct (int yytype, YYSTYPE *yyvaluep)
956 yydestruct (yytype, yyvaluep)
961 /* Pacify ``unused variable'' warnings. */
973 /* Prevent warnings from -Wmissing-prototypes. */
976 # if defined (__STDC__) || defined (__cplusplus)
977 int yyparse (void *YYPARSE_PARAM);
981 #else /* ! YYPARSE_PARAM */
982 #if defined (__STDC__) || defined (__cplusplus)
987 #endif /* ! YYPARSE_PARAM */
991 /* The lookahead symbol. */
994 /* The semantic value of the lookahead symbol. */
997 /* Number of syntax errors so far. */
1006 #ifdef YYPARSE_PARAM
1007 # if defined (__STDC__) || defined (__cplusplus)
1008 int yyparse (void *YYPARSE_PARAM)
1010 int yyparse (YYPARSE_PARAM)
1011 void *YYPARSE_PARAM;
1013 #else /* ! YYPARSE_PARAM */
1014 #if defined (__STDC__) || defined (__cplusplus)
1025 register int yystate;
1028 /* Number of tokens to shift before error messages enabled. */
1030 /* Lookahead token as an internal (translated) token number. */
1033 /* Three stacks and their tools:
1034 `yyss': related to states,
1035 `yyvs': related to semantic values,
1036 `yyls': related to locations.
1038 Refer to the stacks thru separate pointers, to allow yyoverflow
1039 to reallocate them elsewhere. */
1041 /* The state stack. */
1042 short yyssa[YYINITDEPTH];
1043 short *yyss = yyssa;
1044 register short *yyssp;
1046 /* The semantic value stack. */
1047 YYSTYPE yyvsa[YYINITDEPTH];
1048 YYSTYPE *yyvs = yyvsa;
1049 register YYSTYPE *yyvsp;
1053 #define YYPOPSTACK (yyvsp--, yyssp--)
1055 YYSIZE_T yystacksize = YYINITDEPTH;
1057 /* The variables used to return semantic value and location from the
1062 /* When reducing, the number of symbols on the RHS of the reduced
1066 YYDPRINTF ((stderr, "Starting parse\n"));
1071 yychar = YYEMPTY; /* Cause a token to be read. */
1073 /* Initialize stack pointers.
1074 Waste one element of value and location stack
1075 so that they stay on the same level as the state stack.
1076 The wasted elements are never initialized. */
1083 /*------------------------------------------------------------.
1084 | yynewstate -- Push a new state, which is found in yystate. |
1085 `------------------------------------------------------------*/
1087 /* In all cases, when you get here, the value and location stacks
1088 have just been pushed. so pushing a state here evens the stacks.
1095 if (yyss + yystacksize - 1 <= yyssp)
1097 /* Get the current used size of the three stacks, in elements. */
1098 YYSIZE_T yysize = yyssp - yyss + 1;
1102 /* Give user a chance to reallocate the stack. Use copies of
1103 these so that the &'s don't force the real ones into
1105 YYSTYPE *yyvs1 = yyvs;
1106 short *yyss1 = yyss;
1109 /* Each stack pointer address is followed by the size of the
1110 data in use in that stack, in bytes. This used to be a
1111 conditional around just the two extra args, but that might
1112 be undefined if yyoverflow is a macro. */
1113 yyoverflow ("parser stack overflow",
1114 &yyss1, yysize * sizeof (*yyssp),
1115 &yyvs1, yysize * sizeof (*yyvsp),
1122 #else /* no yyoverflow */
1123 # ifndef YYSTACK_RELOCATE
1126 /* Extend the stack our own way. */
1127 if (YYMAXDEPTH <= yystacksize)
1130 if (YYMAXDEPTH < yystacksize)
1131 yystacksize = YYMAXDEPTH;
1134 short *yyss1 = yyss;
1135 union yyalloc *yyptr =
1136 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1139 YYSTACK_RELOCATE (yyss);
1140 YYSTACK_RELOCATE (yyvs);
1142 # undef YYSTACK_RELOCATE
1144 YYSTACK_FREE (yyss1);
1147 #endif /* no yyoverflow */
1149 yyssp = yyss + yysize - 1;
1150 yyvsp = yyvs + yysize - 1;
1153 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1154 (unsigned long int) yystacksize));
1156 if (yyss + yystacksize - 1 <= yyssp)
1160 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1169 /* Do appropriate processing given the current state. */
1170 /* Read a lookahead token if we need one and don't already have one. */
1173 /* First try to decide what to do without reference to lookahead token. */
1175 yyn = yypact[yystate];
1176 if (yyn == YYPACT_NINF)
1179 /* Not known => get a lookahead token if don't already have one. */
1181 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1182 if (yychar == YYEMPTY)
1184 YYDPRINTF ((stderr, "Reading a token: "));
1188 if (yychar <= YYEOF)
1190 yychar = yytoken = YYEOF;
1191 YYDPRINTF ((stderr, "Now at end of input.\n"));
1195 yytoken = YYTRANSLATE (yychar);
1196 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1199 /* If the proper action on seeing token YYTOKEN is to reduce or to
1200 detect an error, take that action. */
1202 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1207 if (yyn == 0 || yyn == YYTABLE_NINF)
1216 /* Shift the lookahead token. */
1217 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1219 /* Discard the token being shifted unless it is eof. */
1220 if (yychar != YYEOF)
1226 /* Count tokens shifted since error; after three, turn off error
1235 /*-----------------------------------------------------------.
1236 | yydefault -- do the default action for the current state. |
1237 `-----------------------------------------------------------*/
1239 yyn = yydefact[yystate];
1245 /*-----------------------------.
1246 | yyreduce -- Do a reduction. |
1247 `-----------------------------*/
1249 /* yyn is the number of a rule to reduce with. */
1252 /* If YYLEN is nonzero, implement the default value of the action:
1255 Otherwise, the following line sets YYVAL to garbage.
1256 This behavior is undocumented and Bison
1257 users should not rely upon it. Assigning to YYVAL
1258 unconditionally makes the parser a bit smaller, and it avoids a
1259 GCC warning that YYVAL may be used uninitialized. */
1260 yyval = yyvsp[1-yylen];
1263 YY_REDUCE_PRINT (yyn);
1267 #line 230 "src/cfgparser/oparse.y"
1269 struct if_config_options *io = get_default_if_config();
1272 fprintf(stderr, "Out of memory(ADD IFRULE)\n");
1276 if(PARSER_DEBUG) printf("Interface setup: \"%s\"\n", yyvsp[0]->string);
1278 io->name = yyvsp[0]->string;
1282 io->next = cnf->if_options;
1283 cnf->if_options = io;
1290 #line 253 "src/cfgparser/oparse.y"
1294 if(PARSER_DEBUG) printf("\tIPv4 broadcast: %s\n", yyvsp[0]->string);
1296 if(inet_aton(yyvsp[0]->string, &in) == 0)
1298 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[-1]->string);
1302 cnf->if_options->ipv4_broadcast.v4 = in.s_addr;
1304 free(yyvsp[0]->string);
1310 #line 272 "src/cfgparser/oparse.y"
1312 cnf->if_options->ipv6_addrtype = yyvsp[0]->boolean;
1319 #line 280 "src/cfgparser/oparse.y"
1321 struct in6_addr in6;
1323 if(PARSER_DEBUG) printf("\tIPv6 site-local multicast: %s\n", yyvsp[0]->string);
1325 if(inet_pton(AF_INET6, yyvsp[0]->string, &in6) < 0)
1327 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[0]->string);
1330 memcpy(&cnf->if_options->ipv6_multi_site.v6, &in6, sizeof(struct in6_addr));
1333 free(yyvsp[0]->string);
1339 #line 300 "src/cfgparser/oparse.y"
1341 struct in6_addr in6;
1343 if(PARSER_DEBUG) printf("\tIPv6 global multicast: %s\n", yyvsp[0]->string);
1345 if(inet_pton(AF_INET6, yyvsp[0]->string, &in6) < 0)
1347 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[0]->string);
1350 memcpy(&cnf->if_options->ipv6_multi_glbl.v6, &in6, sizeof(struct in6_addr));
1353 free(yyvsp[0]->string);
1359 #line 318 "src/cfgparser/oparse.y"
1361 if(PARSER_DEBUG) printf("\tHELLO interval: %0.2f\n", yyvsp[0]->floating);
1362 cnf->if_options->hello_params.emission_interval = yyvsp[0]->floating;
1368 #line 325 "src/cfgparser/oparse.y"
1370 if(PARSER_DEBUG) printf("\tHELLO validity: %0.2f\n", yyvsp[0]->floating);
1371 cnf->if_options->hello_params.validity_time = yyvsp[0]->floating;
1377 #line 332 "src/cfgparser/oparse.y"
1379 if(PARSER_DEBUG) printf("\tTC interval: %0.2f\n", yyvsp[0]->floating);
1380 cnf->if_options->tc_params.emission_interval = yyvsp[0]->floating;
1386 #line 339 "src/cfgparser/oparse.y"
1388 if(PARSER_DEBUG) printf("\tTC validity: %0.2f\n", yyvsp[0]->floating);
1389 cnf->if_options->tc_params.validity_time = yyvsp[0]->floating;
1395 #line 346 "src/cfgparser/oparse.y"
1397 if(PARSER_DEBUG) printf("\tMID interval: %0.2f\n", yyvsp[0]->floating);
1398 cnf->if_options->mid_params.emission_interval = yyvsp[0]->floating;
1404 #line 353 "src/cfgparser/oparse.y"
1406 if(PARSER_DEBUG) printf("\tMID validity: %0.2f\n", yyvsp[0]->floating);
1407 cnf->if_options->mid_params.validity_time = yyvsp[0]->floating;
1413 #line 360 "src/cfgparser/oparse.y"
1415 if(PARSER_DEBUG) printf("\tHNA interval: %0.2f\n", yyvsp[0]->floating);
1416 cnf->if_options->hna_params.emission_interval = yyvsp[0]->floating;
1422 #line 367 "src/cfgparser/oparse.y"
1424 if(PARSER_DEBUG) printf("\tHNA validity: %0.2f\n", yyvsp[0]->floating);
1425 cnf->if_options->hna_params.validity_time = yyvsp[0]->floating;
1431 #line 376 "src/cfgparser/oparse.y"
1434 if(yyvsp[0]->boolean == 1)
1436 if(PARSER_DEBUG) printf("Debug levl AUTO\n");
1440 cnf->debug_level = yyvsp[0]->integer;
1441 if(PARSER_DEBUG) printf("Debug level: %d\n", cnf->debug_level);
1449 #line 394 "src/cfgparser/oparse.y"
1451 if((yyvsp[0]->integer != 4) && (yyvsp[0]->integer != 6))
1453 fprintf(stderr, "IPversion must be 4 or 6!\n");
1456 cnf->ip_version = yyvsp[0]->integer;
1457 if(PARSER_DEBUG) printf("IpVersion: %d\n", cnf->ip_version);
1463 #line 408 "src/cfgparser/oparse.y"
1465 struct hna4_entry *h = malloc(sizeof(struct hna4_entry));
1468 if(PARSER_DEBUG) printf("HNA IPv4 entry: %s/%s\n", yyvsp[-1]->string, yyvsp[0]->string);
1472 fprintf(stderr, "Out of memory(HNA4)\n");
1476 if(inet_aton(yyvsp[-1]->string, &in) == 0)
1478 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[-1]->string);
1482 if(inet_aton(yyvsp[0]->string, &in) == 0)
1484 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[-1]->string);
1487 h->netmask = in.s_addr;
1489 h->next = cnf->hna4_entries;
1490 cnf->hna4_entries = h;
1492 free(yyvsp[-1]->string);
1494 free(yyvsp[0]->string);
1501 #line 444 "src/cfgparser/oparse.y"
1503 struct hna6_entry *h = malloc(sizeof(struct hna6_entry));
1504 struct in6_addr in6;
1506 if(PARSER_DEBUG) printf("HNA IPv6 entry: %s/%d\n", yyvsp[-1]->string, yyvsp[0]->integer);
1510 fprintf(stderr, "Out of memory(HNA6)\n");
1514 if(inet_pton(AF_INET6, yyvsp[-1]->string, &in6) < 0)
1516 fprintf(stderr, "Failed converting IP address %s\n", yyvsp[-1]->string);
1519 memcpy(&h->net, &in6, sizeof(struct in6_addr));
1521 if((yyvsp[0]->integer < 0) || (yyvsp[0]->integer > 128))
1523 fprintf(stderr, "Illegal IPv6 prefix length %d\n", yyvsp[0]->integer);
1527 h->prefix_len = yyvsp[0]->integer;
1529 h->next = cnf->hna6_entries;
1530 cnf->hna6_entries = h;
1532 free(yyvsp[-1]->string);
1540 #line 481 "src/cfgparser/oparse.y"
1542 struct olsr_if *in = malloc(sizeof(struct olsr_if));
1546 fprintf(stderr, "Out of memory(ADD IF)\n");
1550 in->name = yyvsp[-1]->string;
1551 in->config = yyvsp[0]->string;
1553 if(PARSER_DEBUG) printf("Interface: %s Ruleset: %s\n", yyvsp[-1]->string, yyvsp[0]->string);
1556 in->next = cnf->interfaces;
1557 cnf->interfaces = in;
1565 #line 505 "src/cfgparser/oparse.y"
1567 if(PARSER_DEBUG) printf("Noint set to %d\n", yyvsp[0]->boolean);
1573 #line 512 "src/cfgparser/oparse.y"
1575 if(yyvsp[0]->boolean == 1)
1577 if(PARSER_DEBUG) printf("Tos AUTO\n");
1581 if(PARSER_DEBUG) printf("TOS: %d\n", yyvsp[0]->integer);
1589 #line 527 "src/cfgparser/oparse.y"
1591 if(yyvsp[0]->boolean == 1)
1593 if(PARSER_DEBUG) printf("Willingness AUTO\n");
1597 if(PARSER_DEBUG) printf("Willingness: %d\n", yyvsp[0]->integer);
1605 #line 542 "src/cfgparser/oparse.y"
1607 if(yyvsp[0]->boolean == 1)
1609 if(PARSER_DEBUG) printf("IPC allowed\n");
1613 if(PARSER_DEBUG) printf("IPC blocked\n");
1621 #line 558 "src/cfgparser/oparse.y"
1623 if(yyvsp[0]->boolean == 1)
1625 if(PARSER_DEBUG) printf("Hysteresis enabled\n");
1629 if(PARSER_DEBUG) printf("Hysteresis disabled\n");
1637 #line 574 "src/cfgparser/oparse.y"
1639 cnf->hysteresis_param.scaling = yyvsp[0]->floating;
1640 if(PARSER_DEBUG) printf("Hysteresis Scaling: %0.2f\n", yyvsp[0]->floating);
1646 #line 583 "src/cfgparser/oparse.y"
1648 cnf->hysteresis_param.thr_high = yyvsp[0]->floating;
1649 if(PARSER_DEBUG) printf("Hysteresis UpperThr: %0.2f\n", yyvsp[0]->floating);
1655 #line 592 "src/cfgparser/oparse.y"
1657 cnf->hysteresis_param.thr_low = yyvsp[0]->floating;
1658 if(PARSER_DEBUG) printf("Hysteresis LowerThr: %0.2f\n", yyvsp[0]->floating);
1664 #line 600 "src/cfgparser/oparse.y"
1666 if(PARSER_DEBUG) printf("Pollrate %0.2f\n", yyvsp[0]->floating);
1667 cnf->pollrate = yyvsp[0]->floating;
1674 #line 610 "src/cfgparser/oparse.y"
1676 if(yyvsp[0]->boolean == 1)
1678 if(PARSER_DEBUG) printf("TC redundancy AUTO\n");
1682 if(PARSER_DEBUG) printf("TC redundancy %d\n", yyvsp[0]->integer);
1683 cnf->tc_redundancy = yyvsp[0]->integer;
1691 #line 626 "src/cfgparser/oparse.y"
1693 if(yyvsp[0]->boolean == 1)
1695 if(PARSER_DEBUG) printf("MPR coverage AUTO\n");
1699 if(PARSER_DEBUG) printf("MPR coverage %d\n", yyvsp[0]->integer);
1700 cnf->mpr_coverage = yyvsp[0]->integer;
1707 #line 642 "src/cfgparser/oparse.y"
1709 struct plugin_entry *pe = malloc(sizeof(struct plugin_entry));
1713 fprintf(stderr, "Out of memory(ADD PL)\n");
1717 pe->name = yyvsp[0]->string;
1719 if(PARSER_DEBUG) printf("Plugin: %s\n", yyvsp[0]->string);
1722 pe->next = cnf->plugins;
1730 #line 664 "src/cfgparser/oparse.y"
1733 if(PARSER_DEBUG) printf("Plugin param key:\"%s\" val: \"%s\"\n", yyvsp[-1]->string, yyvsp[0]->string);
1735 free(yyvsp[-1]->string);
1737 free(yyvsp[0]->string);
1743 #line 676 "src/cfgparser/oparse.y"
1745 //if(PARSER_DEBUG) printf("Comment\n");
1752 /* Line 999 of yacc.c. */
1753 #line 1754 "y.tab.c"
1759 YY_STACK_PRINT (yyss, yyssp);
1764 /* Now `shift' the result of the reduction. Determine what state
1765 that goes to, based on the state we popped back to and the rule
1766 number reduced by. */
1770 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1771 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1772 yystate = yytable[yystate];
1774 yystate = yydefgoto[yyn - YYNTOKENS];
1779 /*------------------------------------.
1780 | yyerrlab -- here on detecting error |
1781 `------------------------------------*/
1783 /* If not already recovering from an error, report this error. */
1788 yyn = yypact[yystate];
1790 if (YYPACT_NINF < yyn && yyn < YYLAST)
1792 YYSIZE_T yysize = 0;
1793 int yytype = YYTRANSLATE (yychar);
1798 /* Start YYX at -YYN if negative to avoid negative indexes in
1800 for (yyx = yyn < 0 ? -yyn : 0;
1801 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1802 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1803 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1804 yysize += yystrlen ("syntax error, unexpected ") + 1;
1805 yysize += yystrlen (yytname[yytype]);
1806 yymsg = (char *) YYSTACK_ALLOC (yysize);
1809 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1810 yyp = yystpcpy (yyp, yytname[yytype]);
1815 for (yyx = yyn < 0 ? -yyn : 0;
1816 yyx < (int) (sizeof (yytname) / sizeof (char *));
1818 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1820 const char *yyq = ! yycount ? ", expecting " : " or ";
1821 yyp = yystpcpy (yyp, yyq);
1822 yyp = yystpcpy (yyp, yytname[yyx]);
1827 YYSTACK_FREE (yymsg);
1830 yyerror ("syntax error; also virtual memory exhausted");
1833 #endif /* YYERROR_VERBOSE */
1834 yyerror ("syntax error");
1839 if (yyerrstatus == 3)
1841 /* If just tried and failed to reuse lookahead token after an
1842 error, discard it. */
1844 /* Return failure if at end of input. */
1845 if (yychar == YYEOF)
1847 /* Pop the error token. */
1849 /* Pop the rest of the stack. */
1850 while (yyss < yyssp)
1852 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1853 yydestruct (yystos[*yyssp], yyvsp);
1859 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1860 yydestruct (yytoken, &yylval);
1865 /* Else will try to reuse lookahead token after shifting the error
1870 /*----------------------------------------------------.
1871 | yyerrlab1 -- error raised explicitly by an action. |
1872 `----------------------------------------------------*/
1874 yyerrstatus = 3; /* Each real token shifted decrements this. */
1878 yyn = yypact[yystate];
1879 if (yyn != YYPACT_NINF)
1882 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1890 /* Pop the current state because it cannot handle the error token. */
1894 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1895 yydestruct (yystos[yystate], yyvsp);
1899 YY_STACK_PRINT (yyss, yyssp);
1905 YYDPRINTF ((stderr, "Shifting error token, "));
1914 /*-------------------------------------.
1915 | yyacceptlab -- YYACCEPT comes here. |
1916 `-------------------------------------*/
1921 /*-----------------------------------.
1922 | yyabortlab -- YYABORT comes here. |
1923 `-----------------------------------*/
1929 /*----------------------------------------------.
1930 | yyoverflowlab -- parser overflow comes here. |
1931 `----------------------------------------------*/
1933 yyerror ("parser stack overflow");
1941 YYSTACK_FREE (yyss);
1947 #line 683 "src/cfgparser/oparse.y"
1950 void yyerror (char *string)
1952 fprintf(stderr, "Config line %d: %s\n", current_line, string);