From 502d1464155eb258d71e339ea7e8fd4e8d1ca00d Mon Sep 17 00:00:00 2001 From: Igor Ivanov Date: Tue, 19 Jun 2018 19:28:08 +0300 Subject: [PATCH] issue: 1387232 Add 'daemon' parameter into libvma.conf This parameter sets a location for any temporary files created by VMA processes including unix-socket names. Any VMA process should use the same value for this parameter as daemon uses. As for daemon still not read libvma.conf file at the moment default value is set as VMA_AGENT_PATH. Signed-off-by: Igor Ivanov --- src/vma/config_parser.c | 347 ++++++++++-------- src/vma/config_parser.h | 16 +- src/vma/config_scanner.c | 663 ++++++++++++++++++++-------------- src/vma/main.cpp | 20 +- src/vma/util/agent.cpp | 12 +- src/vma/util/config_parser.y | 16 +- src/vma/util/config_scanner.l | 21 +- src/vma/util/libvma.conf | 7 +- src/vma/util/libvma.h | 4 + 9 files changed, 651 insertions(+), 455 deletions(-) diff --git a/src/vma/config_parser.c b/src/vma/config_parser.c index e6314ef178..06c6faecc9 100644 --- a/src/vma/config_parser.c +++ b/src/vma/config_parser.c @@ -103,12 +103,33 @@ static int __vma_rule_push_head = 0; static int current_role = 0; static configuration_t current_conf_type = CONF_RULE; static struct instance *curr_instance = NULL; +static char *__vma_daemon_path = NULL; int __vma_config_empty(void) { return ((__instance_list.head == NULL) && (__instance_list.tail == NULL)); } + +char* __vma_get_daemon_path(void) +{ + return __vma_daemon_path; +}; + +int __vma_set_daemon_path(char *pathname) +{ + static char __vma_daemon_path_buf[4096] = {0}; + if (pathname) { + int n = -1; + n = snprintf(__vma_daemon_path_buf, sizeof(__vma_daemon_path_buf), "%s", pathname); + if (((int)sizeof(__vma_daemon_path_buf) < n) || (n < 0)) { + strcpy(__vma_daemon_path_buf, "/tmp/vma"); + } + __vma_daemon_path = __vma_daemon_path_buf; + } + return 0; +}; + /* define the address by 4 integers */ static void __vma_set_ipv4_addr(short a0, short a1, short a2, short a3) { @@ -135,6 +156,8 @@ static void __vma_set_inet_addr_prefix_len(unsigned char prefixlen) // SM: log part is not used... int __vma_min_level = 9; + + void __vma_dump_address_port_rule_config_state(char *buf) { if (__vma_address_port_rule->match_by_addr) { char str_addr[INET_ADDRSTRLEN]; @@ -403,7 +426,9 @@ extern int libvma_yydebug; FILENAME = 278, NAME = 279, LEVEL = 280, - LINE = 281 + LINE = 281, + DAEMON_KEY = 282, + DAEMON_VALUE = 283 }; #endif /* Tokens. */ @@ -431,6 +456,8 @@ extern int libvma_yydebug; #define NAME 279 #define LEVEL 280 #define LINE 281 +#define DAEMON_KEY 282 +#define DAEMON_VALUE 283 @@ -438,14 +465,14 @@ extern int libvma_yydebug; typedef union YYSTYPE { /* Line 387 of yacc.c */ -/* Line 306 of config_parser.y */ +/* Line 314 of config_parser.y */ int ival; char *sval; /* Line 387 of yacc.c */ -/* Line 442 of config_parser.c */ +/* Line 454 of config_parser.c */ } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -472,12 +499,12 @@ int libvma_yyparse (); /* Copy the second part of user declarations. */ /* Line 390 of yacc.c */ -/* Line 339 of config_parser.y */ +/* Line 349 of config_parser.y */ long __vma_config_line_num; /* Line 390 of yacc.c */ -/* Line 474 of config_parser.c */ +/* Line 486 of config_parser.c */ #ifdef short # undef short @@ -697,20 +724,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 7 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 48 +#define YYLAST 52 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 32 +#define YYNTOKENS 34 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 26 +#define YYNNTS 28 /* YYNRULES -- Number of rules. */ -#define YYNRULES 50 +#define YYNRULES 53 /* YYNRULES -- Number of states. */ -#define YYNSTATES 74 +#define YYNSTATES 79 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 281 +#define YYMAXUTOK 283 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -722,8 +749,8 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 27, 2, 2, 31, 30, 29, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 28, 2, + 2, 2, 29, 2, 2, 33, 32, 31, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 30, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -746,7 +773,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26 + 25, 26, 27, 28 }; #if YYDEBUG @@ -755,41 +782,42 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 8, 9, 10, 12, 15, 16, - 19, 21, 23, 25, 29, 30, 33, 36, 39, 42, - 46, 49, 52, 56, 60, 66, 68, 70, 72, 74, - 76, 78, 80, 82, 84, 86, 88, 90, 92, 96, - 104, 105, 108, 109, 112, 114, 118, 120, 128, 130, - 134 + 19, 21, 23, 25, 27, 31, 32, 35, 38, 41, + 44, 48, 51, 54, 58, 62, 65, 68, 74, 76, + 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, + 98, 100, 104, 112, 113, 116, 117, 120, 122, 126, + 128, 136, 138, 142 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 35, 0, -1, 26, -1, 33, 26, -1, -1, -1, - 33, -1, 34, 36, -1, -1, 36, 37, -1, 38, - -1, 42, -1, 44, -1, 19, 39, 33, -1, -1, - 39, 40, -1, 39, 41, -1, 20, 21, -1, 20, - 22, -1, 20, 23, 24, -1, 25, 15, -1, 43, - 33, -1, 16, 17, 18, -1, 16, 17, 15, -1, - 45, 46, 47, 48, 33, -1, 3, -1, 11, -1, - 12, -1, 13, -1, 14, -1, 27, -1, 5, -1, - 4, -1, 7, -1, 6, -1, 8, -1, 49, -1, - 50, -1, 51, 28, 57, -1, 51, 28, 57, 28, - 53, 28, 57, -1, -1, 52, 55, -1, -1, 54, - 55, -1, 56, -1, 56, 29, 15, -1, 27, -1, - 15, 30, 15, 30, 15, 30, 15, -1, 15, -1, - 15, 31, 15, -1, 27, -1 + 37, 0, -1, 26, -1, 35, 26, -1, -1, -1, + 35, -1, 36, 38, -1, -1, 38, 39, -1, 40, + -1, 44, -1, 48, -1, 46, -1, 19, 41, 35, + -1, -1, 41, 42, -1, 41, 43, -1, 20, 21, + -1, 20, 22, -1, 20, 23, 24, -1, 25, 15, + -1, 45, 35, -1, 16, 17, 18, -1, 16, 17, + 15, -1, 47, 35, -1, 27, 28, -1, 49, 50, + 51, 52, 35, -1, 3, -1, 11, -1, 12, -1, + 13, -1, 14, -1, 29, -1, 5, -1, 4, -1, + 7, -1, 6, -1, 8, -1, 53, -1, 54, -1, + 55, 30, 61, -1, 55, 30, 61, 30, 57, 30, + 61, -1, -1, 56, 59, -1, -1, 58, 59, -1, + 60, -1, 60, 31, 15, -1, 29, -1, 15, 32, + 15, 32, 15, 32, 15, -1, 15, -1, 15, 33, + 15, -1, 29, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 345, 345, 346, 347, 349, 350, 353, 356, 357, - 361, 362, 363, 367, 370, 371, 372, 376, 377, 378, - 382, 386, 390, 391, 396, 400, 404, 405, 406, 407, - 408, 413, 414, 415, 416, 417, 421, 422, 426, 430, - 434, 434, 438, 438, 442, 443, 444, 448, 452, 453, - 454 + 0, 355, 355, 356, 357, 359, 360, 363, 366, 367, + 371, 372, 373, 374, 378, 381, 382, 383, 387, 388, + 389, 393, 397, 401, 402, 406, 410, 414, 418, 422, + 423, 424, 425, 426, 431, 432, 433, 434, 435, 439, + 440, 444, 448, 452, 452, 456, 456, 460, 461, 462, + 466, 470, 471, 472 }; #endif @@ -804,9 +832,10 @@ static const char *const yytname[] = "\"sa\"", "\"integer value\"", "\"application id\"", "\"program name\"", "\"userdefined id str\"", "\"log statement\"", "\"destination\"", "\"ystderr\"", "\"syslog\"", "\"yfile\"", "\"a name\"", "\"min-level\"", - "\"new line\"", "'*'", "':'", "'/'", "'.'", "'-'", "$accept", "NL", - "ONL", "config", "statements", "statement", "log_statement", "log_opts", - "log_dest", "verbosity", "app_id_statement", "app_id", + "\"new line\"", "\"daemon\"", "\"daemon path\"", "'*'", "':'", "'/'", + "'.'", "'-'", "$accept", "NL", "ONL", "config", "statements", + "statement", "log_statement", "log_opts", "log_dest", "verbosity", + "app_id_statement", "app_id", "daemon_statement", "daemon", "socket_statement", "use", "transport", "role", "tuple", "three_tuple", "five_tuple", "address_first", "$@1", "address_second", "$@2", "address", "ipv4", "ports", YY_NULL @@ -820,31 +849,31 @@ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 42, 58, 47, - 46, 45 + 275, 276, 277, 278, 279, 280, 281, 282, 283, 42, + 58, 47, 46, 45 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 32, 33, 33, 33, 34, 34, 35, 36, 36, - 37, 37, 37, 38, 39, 39, 39, 40, 40, 40, - 41, 42, 43, 43, 44, 45, 46, 46, 46, 46, - 46, 47, 47, 47, 47, 47, 48, 48, 49, 50, - 52, 51, 54, 53, 55, 55, 55, 56, 57, 57, - 57 + 0, 34, 35, 35, 35, 36, 36, 37, 38, 38, + 39, 39, 39, 39, 40, 41, 41, 41, 42, 42, + 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, + 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, + 52, 53, 54, 56, 55, 58, 57, 59, 59, 59, + 60, 61, 61, 61 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 2, 0, 0, 1, 2, 0, 2, - 1, 1, 1, 3, 0, 2, 2, 2, 2, 3, - 2, 2, 3, 3, 5, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 7, - 0, 2, 0, 2, 1, 3, 1, 7, 1, 3, - 1 + 1, 1, 1, 1, 3, 0, 2, 2, 2, 2, + 3, 2, 2, 3, 3, 2, 2, 5, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 7, 0, 2, 0, 2, 1, 3, 1, + 7, 1, 3, 1 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -852,45 +881,45 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 4, 2, 6, 8, 0, 3, 7, 1, 25, 0, - 14, 9, 10, 11, 4, 12, 0, 0, 4, 21, - 26, 27, 28, 29, 30, 0, 23, 22, 0, 0, - 13, 15, 16, 32, 31, 34, 33, 35, 40, 17, - 18, 0, 20, 4, 36, 37, 0, 0, 19, 24, - 0, 0, 46, 41, 44, 48, 50, 38, 0, 0, - 0, 42, 0, 45, 49, 0, 0, 0, 0, 43, - 0, 39, 0, 47 + 4, 2, 6, 8, 0, 3, 7, 1, 28, 0, + 15, 0, 9, 10, 11, 4, 13, 4, 12, 0, + 0, 4, 26, 22, 25, 29, 30, 31, 32, 33, + 0, 24, 23, 0, 0, 14, 16, 17, 35, 34, + 37, 36, 38, 43, 18, 19, 0, 21, 4, 39, + 40, 0, 0, 20, 27, 0, 0, 49, 44, 47, + 51, 53, 41, 0, 0, 0, 45, 0, 48, 52, + 0, 0, 0, 0, 46, 0, 42, 0, 50 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 2, 3, 4, 6, 11, 12, 18, 31, 32, - 13, 14, 15, 16, 25, 38, 43, 44, 45, 46, - 47, 65, 66, 53, 54, 57 + -1, 2, 3, 4, 6, 12, 13, 21, 36, 37, + 14, 15, 16, 17, 18, 19, 30, 43, 48, 49, + 50, 51, 52, 70, 71, 58, 59, 62 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -25 +#define YYPACT_NINF -24 static const yytype_int8 yypact[] = { - -24, -25, -17, -25, 12, -25, -2, -25, -25, -1, - -25, -25, -25, -25, -24, -25, -6, 13, -7, -17, - -25, -25, -25, -25, -25, 19, -25, -25, 11, -4, - -17, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, 6, -25, -24, -25, -25, -8, -12, -25, -17, - -5, 5, -25, -25, 7, 8, -25, 9, 23, 25, - 26, -25, 14, -25, -25, 15, -12, 27, -5, -25, - 16, -25, 30, -25 + -23, -24, 2, -24, 15, -24, -2, -24, -24, -1, + -24, 1, -24, -24, -24, -23, -24, -23, -24, -3, + 12, -13, -24, 2, 2, -24, -24, -24, -24, -24, + 16, -24, -24, 13, 17, 2, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, 7, -24, -23, -24, + -24, 8, -11, -24, 2, -10, 5, -24, -24, 9, + 6, -24, 11, 27, 28, 29, -24, 14, -24, -24, + 18, -11, 30, -10, -24, 19, -24, 32, -24 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -25, -14, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -19, -25, -20 + -24, -15, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -22, -24, -21 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -899,40 +928,42 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 19, 8, 1, 51, 30, 20, 21, 22, 23, 5, - 55, 42, 7, 28, 9, 52, 17, 10, 29, 1, - 50, 24, 56, 33, 34, 35, 36, 37, 26, 49, - 48, 27, 39, 40, 41, 58, 59, 61, 62, 60, - 63, 64, 70, 68, 67, 73, 72, 69, 71 + 23, 8, 24, 1, 56, 60, 35, 33, 25, 26, + 27, 28, 34, 1, 9, 7, 20, 10, 57, 61, + 38, 39, 40, 41, 42, 11, 29, 31, 5, 22, + 32, 53, 47, 54, 44, 45, 46, 63, 55, 65, + 64, 66, 67, 68, 69, 75, 72, 78, 73, 74, + 0, 77, 76 }; #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-25))) + (!!((Yystate) == (-24))) #define yytable_value_is_error(Yytable_value) \ YYID (0) -static const yytype_uint8 yycheck[] = +static const yytype_int8 yycheck[] = { - 14, 3, 26, 15, 18, 11, 12, 13, 14, 26, - 15, 15, 0, 20, 16, 27, 17, 19, 25, 26, - 28, 27, 27, 4, 5, 6, 7, 8, 15, 43, - 24, 18, 21, 22, 23, 30, 29, 28, 15, 31, - 15, 15, 15, 28, 30, 15, 30, 66, 68 + 15, 3, 17, 26, 15, 15, 21, 20, 11, 12, + 13, 14, 25, 26, 16, 0, 17, 19, 29, 29, + 4, 5, 6, 7, 8, 27, 29, 15, 26, 28, + 18, 24, 15, 48, 21, 22, 23, 32, 30, 33, + 31, 30, 15, 15, 15, 15, 32, 15, 30, 71, + -1, 32, 73 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 26, 33, 34, 35, 26, 36, 0, 3, 16, - 19, 37, 38, 42, 43, 44, 45, 17, 39, 33, - 11, 12, 13, 14, 27, 46, 15, 18, 20, 25, - 33, 40, 41, 4, 5, 6, 7, 8, 47, 21, - 22, 23, 15, 48, 49, 50, 51, 52, 24, 33, - 28, 15, 27, 55, 56, 15, 27, 57, 30, 29, - 31, 28, 15, 15, 15, 53, 54, 30, 28, 55, - 15, 57, 30, 15 + 0, 26, 35, 36, 37, 26, 38, 0, 3, 16, + 19, 27, 39, 40, 44, 45, 46, 47, 48, 49, + 17, 41, 28, 35, 35, 11, 12, 13, 14, 29, + 50, 15, 18, 20, 25, 35, 42, 43, 4, 5, + 6, 7, 8, 51, 21, 22, 23, 15, 52, 53, + 54, 55, 56, 24, 35, 30, 15, 29, 59, 60, + 15, 29, 61, 32, 31, 33, 30, 15, 15, 15, + 57, 58, 32, 30, 59, 15, 61, 32, 15 }; #define yyerrok (yyerrstatus = 0) @@ -1742,171 +1773,177 @@ yyparse () YY_REDUCE_PRINT (yyn); switch (yyn) { - case 17: + case 18: /* Line 1792 of yacc.c */ -/* Line 376 of config_parser.y */ +/* Line 387 of config_parser.y */ { __vma_log_set_log_stderr(); } break; - case 18: + case 19: /* Line 1792 of yacc.c */ -/* Line 377 of config_parser.y */ +/* Line 388 of config_parser.y */ { __vma_log_set_log_syslog(); } break; - case 19: + case 20: /* Line 1792 of yacc.c */ -/* Line 378 of config_parser.y */ +/* Line 389 of config_parser.y */ { __vma_log_set_log_file((yyvsp[(3) - (3)].sval)); } break; - case 20: + case 21: /* Line 1792 of yacc.c */ -/* Line 382 of config_parser.y */ +/* Line 393 of config_parser.y */ { __vma_log_set_min_level((yyvsp[(2) - (2)].ival)); } break; - case 22: + case 23: /* Line 1792 of yacc.c */ -/* Line 390 of config_parser.y */ +/* Line 401 of config_parser.y */ {__vma_add_instance((yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); if ((yyvsp[(2) - (3)].sval)) free((yyvsp[(2) - (3)].sval)); if ((yyvsp[(3) - (3)].sval)) free((yyvsp[(3) - (3)].sval)); } break; - case 23: + case 24: /* Line 1792 of yacc.c */ -/* Line 391 of config_parser.y */ +/* Line 402 of config_parser.y */ {__vma_add_inst_with_int_uid((yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].ival)); if ((yyvsp[(2) - (3)].sval)) free((yyvsp[(2) - (3)].sval)); } break; - case 24: + case 26: +/* Line 1792 of yacc.c */ +/* Line 410 of config_parser.y */ + { __vma_set_daemon_path((yyvsp[(2) - (2)].sval)); if ((yyvsp[(2) - (2)].sval)) free((yyvsp[(2) - (2)].sval)); } + break; + + case 27: /* Line 1792 of yacc.c */ -/* Line 396 of config_parser.y */ +/* Line 414 of config_parser.y */ { __vma_add_rule(); } break; - case 25: + case 28: /* Line 1792 of yacc.c */ -/* Line 400 of config_parser.y */ +/* Line 418 of config_parser.y */ { current_conf_type = CONF_RULE; } break; - case 26: + case 29: /* Line 1792 of yacc.c */ -/* Line 404 of config_parser.y */ +/* Line 422 of config_parser.y */ { __vma_rule.target_transport = TRANS_OS; } break; - case 27: + case 30: /* Line 1792 of yacc.c */ -/* Line 405 of config_parser.y */ +/* Line 423 of config_parser.y */ { __vma_rule.target_transport = TRANS_VMA; } break; - case 28: + case 31: /* Line 1792 of yacc.c */ -/* Line 406 of config_parser.y */ +/* Line 424 of config_parser.y */ { __vma_rule.target_transport = TRANS_SDP; } break; - case 29: + case 32: /* Line 1792 of yacc.c */ -/* Line 407 of config_parser.y */ +/* Line 425 of config_parser.y */ { __vma_rule.target_transport = TRANS_SA; } break; - case 30: + case 33: /* Line 1792 of yacc.c */ -/* Line 408 of config_parser.y */ +/* Line 426 of config_parser.y */ { __vma_rule.target_transport = TRANS_ULP; } break; - case 31: + case 34: /* Line 1792 of yacc.c */ -/* Line 413 of config_parser.y */ +/* Line 431 of config_parser.y */ { current_role = ROLE_TCP_SERVER; __vma_rule.protocol = PROTO_TCP; } break; - case 32: + case 35: /* Line 1792 of yacc.c */ -/* Line 414 of config_parser.y */ +/* Line 432 of config_parser.y */ { current_role = ROLE_TCP_CLIENT; __vma_rule.protocol = PROTO_TCP; } break; - case 33: + case 36: /* Line 1792 of yacc.c */ -/* Line 415 of config_parser.y */ +/* Line 433 of config_parser.y */ { current_role = ROLE_UDP_RECEIVER; __vma_rule.protocol = PROTO_UDP; } break; - case 34: + case 37: /* Line 1792 of yacc.c */ -/* Line 416 of config_parser.y */ +/* Line 434 of config_parser.y */ { current_role = ROLE_UDP_SENDER; __vma_rule.protocol = PROTO_UDP; } break; - case 35: + case 38: /* Line 1792 of yacc.c */ -/* Line 417 of config_parser.y */ +/* Line 435 of config_parser.y */ { current_role = ROLE_UDP_CONNECT; __vma_rule.protocol = PROTO_UDP; } break; - case 40: + case 43: /* Line 1792 of yacc.c */ -/* Line 434 of config_parser.y */ +/* Line 452 of config_parser.y */ { __vma_address_port_rule = &(__vma_rule.first); __vma_rule.use_second = 0; } break; - case 42: + case 45: /* Line 1792 of yacc.c */ -/* Line 438 of config_parser.y */ +/* Line 456 of config_parser.y */ { __vma_address_port_rule = &(__vma_rule.second); __vma_rule.use_second = 1; } break; - case 44: + case 47: /* Line 1792 of yacc.c */ -/* Line 442 of config_parser.y */ +/* Line 460 of config_parser.y */ { if (current_conf_type == CONF_RULE) __vma_address_port_rule->match_by_addr = 1; __vma_set_inet_addr_prefix_len(32); } break; - case 45: + case 48: /* Line 1792 of yacc.c */ -/* Line 443 of config_parser.y */ +/* Line 461 of config_parser.y */ { if (current_conf_type == CONF_RULE) __vma_address_port_rule->match_by_addr = 1; __vma_set_inet_addr_prefix_len((yyvsp[(3) - (3)].ival)); } break; - case 46: + case 49: /* Line 1792 of yacc.c */ -/* Line 444 of config_parser.y */ +/* Line 462 of config_parser.y */ { if (current_conf_type == CONF_RULE) __vma_address_port_rule->match_by_addr = 0; __vma_set_inet_addr_prefix_len(32); } break; - case 47: + case 50: /* Line 1792 of yacc.c */ -/* Line 448 of config_parser.y */ +/* Line 466 of config_parser.y */ { __vma_set_ipv4_addr((yyvsp[(1) - (7)].ival),(yyvsp[(3) - (7)].ival),(yyvsp[(5) - (7)].ival),(yyvsp[(7) - (7)].ival)); } break; - case 48: + case 51: /* Line 1792 of yacc.c */ -/* Line 452 of config_parser.y */ +/* Line 470 of config_parser.y */ { __vma_address_port_rule->match_by_port = 1; __vma_address_port_rule->sport= (yyvsp[(1) - (1)].ival); __vma_address_port_rule->eport= (yyvsp[(1) - (1)].ival); } break; - case 49: + case 52: /* Line 1792 of yacc.c */ -/* Line 453 of config_parser.y */ +/* Line 471 of config_parser.y */ { __vma_address_port_rule->match_by_port = 1; __vma_address_port_rule->sport= (yyvsp[(1) - (3)].ival); __vma_address_port_rule->eport= (yyvsp[(3) - (3)].ival); } break; - case 50: + case 53: /* Line 1792 of yacc.c */ -/* Line 454 of config_parser.y */ +/* Line 472 of config_parser.y */ { __vma_address_port_rule->match_by_port = 0; __vma_address_port_rule->sport= 0; __vma_address_port_rule->eport= 0; } break; /* Line 1792 of yacc.c */ -/* Line 1893 of config_parser.c */ +/* Line 1915 of config_parser.c */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2138,7 +2175,7 @@ yyparse () /* Line 2055 of yacc.c */ -/* Line 457 of config_parser.y */ +/* Line 475 of config_parser.y */ int yyerror(const char *msg) @@ -2153,7 +2190,7 @@ int yyerror(const char *msg) final_msg[0] = '\0'; while (word != NULL) { if (!strncmp(word, "$undefined", 10)) { - strcat(final_msg, "unrecognized-token "); + strcat(final_msg, " "); } else if (!strncmp(word, "$end",4)) { strcat(final_msg, "end-of-file "); } else { diff --git a/src/vma/config_parser.h b/src/vma/config_parser.h index 3502c794e1..d68ddc8858 100644 --- a/src/vma/config_parser.h +++ b/src/vma/config_parser.h @@ -30,8 +30,8 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -#ifndef YY_LIBVMA_YY_CONFIG_PARSER_H_INCLUDED -# define YY_LIBVMA_YY_CONFIG_PARSER_H_INCLUDED +#ifndef YY_LIBVMA_YY_UTIL_CONFIG_PARSER_H_INCLUDED +# define YY_LIBVMA_YY_UTIL_CONFIG_PARSER_H_INCLUDED /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -69,7 +69,9 @@ extern int libvma_yydebug; FILENAME = 278, NAME = 279, LEVEL = 280, - LINE = 281 + LINE = 281, + DAEMON_KEY = 282, + DAEMON_VALUE = 283 }; #endif /* Tokens. */ @@ -97,6 +99,8 @@ extern int libvma_yydebug; #define NAME 279 #define LEVEL 280 #define LINE 281 +#define DAEMON_KEY 282 +#define DAEMON_VALUE 283 @@ -104,14 +108,14 @@ extern int libvma_yydebug; typedef union YYSTYPE { /* Line 2058 of yacc.c */ -/* Line 306 of config_parser.y */ +#line 314 "../../../src/vma/util/config_parser.y" int ival; char *sval; /* Line 2058 of yacc.c */ -/* Line 115 of config_parser.h */ +#line 119 "util/config_parser.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -134,4 +138,4 @@ int libvma_yyparse (); #endif #endif /* ! YYPARSE_PARAM */ -#endif /* !YY_LIBVMA_YY_CONFIG_PARSER_H_INCLUDED */ +#endif /* !YY_LIBVMA_YY_UTIL_CONFIG_PARSER_H_INCLUDED */ diff --git a/src/vma/config_scanner.c b/src/vma/config_scanner.c index 7034bc7664..ff7000d71d 100644 --- a/src/vma/config_scanner.c +++ b/src/vma/config_scanner.c @@ -388,8 +388,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 29 -#define YY_END_OF_BUFFER 30 +#define YY_NUM_RULES 31 +#define YY_END_OF_BUFFER 32 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -397,60 +397,76 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[473] = +static yyconst flex_int16_t yy_accept[614] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 30, 28, - 27, 25, 26, 5, 5, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 27, 1, 24, 24, 5, - 5, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 1, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 1, 4, 4, 4, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 32, 30, 29, 27, 28, 5, 5, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 29, 1, 24, + 24, 5, 5, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 1, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 1, 27, 26, 5, 0, 0, 0, 0, 15, - 18, 0, 0, 0, 0, 0, 0, 0, 0, 27, - 1, 1, 24, 24, 5, 24, 24, 24, 24, 15, + 4, 4, 4, 1, 26, 26, 5, 5, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 1, 29, + 28, 5, 0, 0, 0, 0, 0, 15, 18, 0, - 18, 24, 24, 24, 24, 24, 24, 24, 24, 1, + 0, 0, 0, 0, 0, 0, 0, 29, 1, 1, + 24, 24, 5, 24, 24, 24, 24, 24, 15, 18, + 24, 24, 24, 24, 24, 24, 24, 24, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 1, 0, 0, 6, 0, - 17, 0, 13, 14, 12, 16, 0, 0, 1, 24, - 24, 6, 24, 17, 24, 13, 14, 12, 16, 24, + 4, 4, 4, 4, 4, 4, 1, 26, 26, 5, + 26, 26, 26, 26, 26, 15, 18, 26, 26, 26, + 26, 26, 26, 26, 26, 1, 0, 0, 0, 6, + 0, 17, 0, 13, 14, 12, 16, 0, 0, 1, + + 24, 24, 24, 6, 24, 17, 24, 13, 14, 12, + 16, 24, 24, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 26, + 26, 26, 6, 26, 17, 26, 13, 14, 12, 16, + 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 11, 0, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 11, 24, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, - - 0, 0, 0, 24, 24, 24, 24, 24, 24, 24, - 24, 3, 3, 3, 3, 3, 3, 3, 3, 4, - 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 11, 0, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 11, 24, 3, + 4, 4, 4, 4, 4, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 11, 26, 0, 25, 0, + 0, 10, 0, 0, 0, 0, 0, 0, 24, 24, + 24, 24, 10, 24, 24, 24, 24, 24, 24, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 0, 0, 0, 10, 0, 0, 0, 0, 0, - 0, 24, 24, 24, 10, 24, 24, 24, 24, 24, - 24, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 0, 0, 0, 0, 0, 0, 0, 0, 9, - 24, 24, 24, 24, 24, 24, 24, 24, 9, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, + 4, 26, 25, 26, 26, 10, 26, 26, 26, 26, + 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, + 9, 24, 24, 24, 24, 24, 24, 24, 24, 9, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 26, 26, + 26, 26, 26, 26, 26, 26, 9, 0, 0, 0, 0, 0, 0, 0, 0, 24, 24, 24, 24, 24, 24, 24, 24, 3, 3, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 4, 4, 0, - 0, 8, 0, 0, 0, 0, 0, 24, 24, 8, - 24, 24, 24, 24, 24, 3, 3, 3, 3, 3, + 3, 4, 4, 4, 4, 4, 4, 4, 4, 26, + 26, 26, 26, 26, 26, 26, 26, 0, 0, 8, - 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, - 4, 0, 0, 19, 20, 0, 0, 21, 24, 24, - 19, 20, 24, 24, 21, 3, 3, 3, 3, 3, - 3, 3, 4, 4, 4, 4, 4, 4, 4, 0, - 7, 23, 0, 24, 7, 23, 24, 3, 3, 3, - 3, 4, 4, 4, 4, 0, 22, 24, 22, 3, - 3, 4, 4, 0, 24, 3, 4, 2, 2, 2, - 2, 0 + 0, 0, 0, 0, 0, 24, 24, 8, 24, 24, + 24, 24, 24, 3, 3, 3, 3, 3, 3, 3, + 3, 4, 4, 4, 4, 4, 4, 4, 4, 26, + 26, 8, 26, 26, 26, 26, 26, 0, 0, 19, + 20, 0, 0, 21, 24, 24, 19, 20, 24, 24, + 21, 3, 3, 3, 3, 3, 3, 3, 4, 4, + 4, 4, 4, 4, 4, 26, 26, 19, 20, 26, + 26, 21, 0, 7, 23, 0, 24, 7, 23, 24, + 3, 3, 3, 3, 4, 4, 4, 4, 26, 7, + 23, 26, 0, 22, 24, 22, 3, 3, 4, 4, + + 26, 22, 0, 24, 3, 4, 26, 2, 2, 2, + 2, 2, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -492,145 +508,199 @@ static yyconst flex_int32_t yy_meta[27] = 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[485] = +static yyconst flex_int16_t yy_base[629] = { 0, - 0, 25, 29, 54, 58, 83, 87, 112, 548, 549, - 545, 549, 0, 549, 111, 526, 533, 525, 528, 520, - 110, 531, 104, 523, 107, 120, 0, 0, 537, 0, - 121, 518, 525, 517, 520, 512, 114, 523, 119, 515, - 120, 529, 0, 528, 0, 125, 509, 516, 508, 511, - 503, 126, 514, 123, 506, 125, 520, 0, 519, 0, - 137, 500, 507, 499, 502, 494, 137, 505, 128, 497, - 136, 511, 510, 0, 147, 491, 488, 495, 490, 549, - 549, 487, 484, 485, 484, 491, 493, 486, 477, 153, - 0, 0, 0, 497, 153, 478, 475, 482, 477, 0, - - 0, 474, 471, 472, 471, 478, 480, 473, 464, 484, - 0, 483, 155, 464, 461, 468, 463, 0, 0, 460, - 457, 458, 457, 464, 466, 459, 450, 470, 0, 469, - 158, 450, 447, 454, 449, 0, 0, 446, 443, 444, - 443, 450, 452, 445, 436, 456, 441, 433, 549, 450, - 549, 438, 445, 444, 549, 549, 435, 439, 0, 433, - 425, 0, 442, 0, 430, 437, 436, 0, 0, 427, - 431, 425, 417, 0, 434, 0, 422, 429, 428, 0, - 0, 419, 423, 417, 409, 0, 426, 0, 414, 421, - 420, 0, 0, 411, 415, 410, 409, 407, 403, 146, - - 156, 409, 408, 404, 403, 401, 397, 157, 159, 403, - 402, 398, 397, 395, 391, 160, 162, 397, 396, 392, - 391, 389, 385, 163, 165, 391, 390, 391, 382, 387, - 384, 381, 384, 376, 382, 381, 549, 371, 381, 372, - 377, 374, 371, 374, 366, 372, 371, 0, 361, 371, - 362, 367, 364, 361, 364, 356, 362, 361, 0, 351, - 361, 352, 357, 354, 351, 354, 346, 352, 351, 0, - 341, 352, 351, 334, 549, 343, 336, 338, 345, 336, - 332, 343, 342, 325, 0, 334, 327, 329, 336, 327, - 323, 334, 333, 316, 0, 325, 318, 320, 327, 318, - - 314, 325, 324, 307, 0, 316, 309, 311, 318, 309, - 305, 302, 301, 311, 310, 296, 302, 307, 307, 549, - 294, 293, 303, 302, 288, 294, 299, 299, 0, 286, - 285, 295, 294, 280, 286, 291, 291, 0, 278, 277, - 287, 286, 272, 278, 283, 283, 0, 278, 277, 275, - 272, 277, 276, 272, 274, 270, 269, 267, 264, 269, - 268, 264, 266, 262, 261, 259, 256, 261, 260, 256, - 258, 254, 253, 251, 248, 253, 252, 248, 250, 242, - 241, 549, 236, 237, 247, 231, 234, 235, 234, 0, - 229, 230, 240, 224, 227, 228, 227, 0, 222, 223, - - 233, 217, 220, 221, 220, 0, 215, 216, 226, 210, - 213, 215, 214, 549, 549, 208, 218, 549, 211, 210, - 0, 0, 204, 214, 0, 207, 206, 0, 0, 200, - 210, 0, 203, 202, 0, 0, 196, 206, 0, 212, - 549, 549, 195, 210, 0, 0, 193, 208, 0, 0, - 191, 206, 0, 0, 189, 194, 549, 193, 0, 192, - 0, 191, 0, 165, 163, 160, 140, 549, 0, 0, - 0, 549, 187, 189, 85, 191, 193, 56, 195, 197, - 27, 199, 201, 203 + 0, 25, 29, 54, 58, 83, 87, 112, 116, 141, + 709, 710, 706, 710, 0, 710, 140, 687, 139, 687, + 690, 682, 141, 693, 133, 685, 136, 152, 0, 0, + 699, 0, 153, 680, 152, 680, 683, 675, 154, 686, + 146, 678, 140, 692, 0, 691, 0, 163, 672, 162, + 672, 675, 667, 164, 678, 155, 670, 159, 684, 0, + 683, 0, 172, 664, 173, 664, 667, 659, 175, 670, + 165, 662, 170, 676, 0, 675, 0, 182, 656, 182, + 656, 659, 651, 184, 662, 185, 654, 184, 668, 667, + 0, 192, 648, 655, 644, 651, 646, 710, 710, 643, + + 640, 641, 640, 647, 649, 642, 633, 198, 0, 0, + 0, 653, 197, 634, 641, 630, 637, 632, 0, 0, + 629, 626, 627, 626, 633, 635, 628, 619, 639, 0, + 638, 202, 619, 626, 615, 622, 617, 0, 0, 614, + 611, 612, 611, 618, 620, 613, 604, 624, 0, 623, + 205, 604, 611, 600, 607, 602, 0, 0, 599, 596, + 597, 596, 603, 605, 598, 589, 609, 0, 608, 207, + 589, 596, 585, 592, 587, 0, 0, 584, 581, 582, + 581, 588, 590, 583, 574, 594, 579, 577, 570, 710, + 587, 710, 575, 582, 581, 710, 710, 572, 576, 0, + + 570, 568, 561, 0, 578, 0, 566, 573, 572, 0, + 0, 563, 567, 561, 559, 552, 0, 569, 0, 557, + 564, 563, 0, 0, 554, 558, 552, 550, 543, 0, + 560, 0, 548, 555, 554, 0, 0, 545, 549, 543, + 541, 534, 0, 551, 0, 539, 546, 545, 0, 0, + 536, 540, 535, 530, 533, 531, 527, 195, 205, 533, + 532, 528, 523, 526, 524, 520, 206, 208, 526, 525, + 521, 516, 519, 517, 513, 209, 211, 519, 518, 514, + 509, 512, 510, 506, 212, 214, 512, 511, 507, 502, + 505, 503, 499, 215, 228, 505, 504, 505, 496, 495, + + 500, 497, 494, 497, 489, 495, 494, 710, 484, 494, + 485, 484, 489, 486, 483, 486, 478, 484, 483, 0, + 473, 483, 474, 473, 478, 475, 472, 475, 467, 473, + 472, 0, 462, 472, 463, 462, 467, 464, 461, 464, + 456, 462, 461, 0, 451, 461, 452, 451, 456, 453, + 450, 453, 445, 451, 450, 0, 440, 451, 710, 450, + 433, 710, 442, 435, 437, 444, 435, 431, 442, 0, + 441, 424, 0, 433, 426, 428, 435, 426, 422, 433, + 0, 432, 415, 0, 424, 417, 419, 426, 417, 413, + 424, 0, 423, 406, 0, 415, 408, 410, 417, 408, + + 404, 415, 0, 414, 397, 0, 406, 399, 401, 408, + 399, 395, 392, 391, 401, 400, 386, 392, 397, 397, + 710, 384, 383, 393, 392, 378, 384, 389, 389, 0, + 376, 375, 385, 384, 370, 376, 381, 381, 0, 368, + 367, 377, 376, 362, 368, 373, 373, 0, 360, 359, + 369, 368, 354, 360, 365, 365, 0, 360, 359, 357, + 354, 359, 358, 354, 356, 352, 351, 349, 346, 351, + 350, 346, 348, 344, 343, 341, 338, 343, 342, 338, + 340, 336, 335, 333, 330, 335, 334, 330, 332, 328, + 327, 325, 322, 327, 326, 322, 324, 316, 315, 710, + + 310, 311, 321, 305, 308, 309, 308, 0, 303, 304, + 314, 298, 301, 302, 301, 0, 296, 297, 307, 291, + 294, 295, 294, 0, 289, 290, 300, 284, 287, 288, + 287, 0, 282, 283, 293, 277, 280, 282, 281, 710, + 710, 275, 285, 710, 278, 277, 0, 0, 271, 281, + 0, 274, 273, 0, 0, 267, 277, 0, 270, 269, + 0, 0, 263, 273, 0, 266, 265, 0, 0, 259, + 269, 0, 275, 710, 710, 258, 273, 0, 0, 256, + 271, 0, 0, 254, 269, 0, 0, 252, 243, 0, + 0, 226, 231, 710, 230, 0, 229, 0, 228, 0, + + 227, 0, 230, 229, 228, 212, 209, 710, 0, 0, + 0, 0, 710, 250, 252, 114, 254, 256, 85, 258, + 260, 56, 262, 264, 27, 266, 268, 270 } ; -static yyconst flex_int16_t yy_def[485] = +static yyconst flex_int16_t yy_def[629] = { 0, - 472, 1, 472, 3, 472, 5, 472, 7, 472, 472, - 472, 472, 473, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 474, 475, 476, 475, - 475, 475, 475, 475, 475, 475, 475, 475, 475, 475, - 475, 477, 478, 479, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 480, 481, 482, 481, - 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, - 481, 483, 472, 473, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 484, 474, 475, 476, 475, 475, 475, 475, 475, 475, - - 475, 475, 475, 475, 475, 475, 475, 475, 475, 477, - 478, 479, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 480, 481, 482, - 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, - 481, 481, 481, 481, 481, 483, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 484, 475, - 475, 475, 475, 475, 475, 475, 475, 475, 475, 475, - 475, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 481, 481, 481, 481, 481, 481, 481, - 481, 481, 481, 481, 481, 472, 472, 472, 472, 472, - - 472, 472, 472, 475, 475, 475, 475, 475, 475, 475, - 475, 478, 478, 478, 478, 478, 478, 478, 478, 481, - 481, 481, 481, 481, 481, 481, 481, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 475, 475, - 475, 475, 475, 475, 475, 475, 475, 475, 475, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, - 481, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 475, 475, 475, 475, 475, 475, 475, 475, 475, - 475, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 481, 481, 481, 481, 481, 481, 481, 481, 481, - 481, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 475, 475, 475, 475, 475, 475, 475, 475, 475, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 481, 481, - 481, 481, 481, 481, 481, 481, 481, 472, 472, 472, - 472, 472, 472, 472, 472, 475, 475, 475, 475, 475, - 475, 475, 475, 478, 478, 478, 478, 478, 478, 478, - 478, 481, 481, 481, 481, 481, 481, 481, 481, 472, - 472, 472, 472, 472, 472, 472, 472, 475, 475, 475, - 475, 475, 475, 475, 475, 478, 478, 478, 478, 478, - - 478, 478, 478, 481, 481, 481, 481, 481, 481, 481, - 481, 472, 472, 472, 472, 472, 472, 472, 475, 475, - 475, 475, 475, 475, 475, 478, 478, 478, 478, 478, - 478, 478, 481, 481, 481, 481, 481, 481, 481, 472, - 472, 472, 472, 475, 475, 475, 475, 478, 478, 478, - 478, 481, 481, 481, 481, 472, 472, 475, 475, 478, - 478, 481, 481, 472, 475, 478, 481, 472, 475, 478, - 481, 0, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472 + 613, 1, 613, 3, 613, 5, 613, 7, 613, 9, + 613, 613, 613, 613, 614, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 615, 616, + 617, 616, 616, 616, 616, 616, 616, 616, 616, 616, + 616, 616, 616, 618, 619, 620, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 621, 622, + 623, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 624, 625, 626, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, 627, 613, + 614, 613, 613, 613, 613, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 628, 615, + 616, 617, 616, 616, 616, 616, 616, 616, 616, 616, + 616, 616, 616, 616, 616, 616, 616, 616, 618, 619, + 620, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 621, 622, 623, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 624, 625, 626, 625, + 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 627, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 628, + + 616, 616, 616, 616, 616, 616, 616, 616, 616, 616, + 616, 616, 616, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 625, + 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 616, 616, 616, 616, 616, 616, 616, 616, 616, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 616, + 616, 616, 616, 616, 616, 616, 616, 616, 616, 616, + 616, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 616, 616, + 616, 616, 616, 616, 616, 616, 616, 616, 616, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + + 622, 625, 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 616, 616, 616, 616, 616, 616, 616, 616, 616, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 613, 613, 613, + 613, 613, 613, 613, 613, 616, 616, 616, 616, 616, + 616, 616, 616, 619, 619, 619, 619, 619, 619, 619, + 619, 622, 622, 622, 622, 622, 622, 622, 622, 625, + 625, 625, 625, 625, 625, 625, 625, 613, 613, 613, + + 613, 613, 613, 613, 613, 616, 616, 616, 616, 616, + 616, 616, 616, 619, 619, 619, 619, 619, 619, 619, + 619, 622, 622, 622, 622, 622, 622, 622, 622, 625, + 625, 625, 625, 625, 625, 625, 625, 613, 613, 613, + 613, 613, 613, 613, 616, 616, 616, 616, 616, 616, + 616, 619, 619, 619, 619, 619, 619, 619, 622, 622, + 622, 622, 622, 622, 622, 625, 625, 625, 625, 625, + 625, 625, 613, 613, 613, 613, 616, 616, 616, 616, + 619, 619, 619, 619, 622, 622, 622, 622, 625, 625, + 625, 625, 613, 613, 616, 616, 619, 619, 622, 622, + + 625, 625, 613, 616, 619, 622, 625, 613, 616, 619, + 622, 625, 0, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613 } ; -static yyconst flex_int16_t yy_nxt[576] = +static yyconst flex_int16_t yy_nxt[737] = { 0, - 10, 11, 12, 13, 10, 14, 15, 10, 16, 10, - 17, 10, 10, 10, 10, 18, 19, 10, 20, 10, - 10, 21, 22, 23, 24, 25, 26, 129, 27, 28, - 11, 12, 29, 28, 30, 31, 28, 32, 28, 33, - 28, 28, 28, 28, 34, 35, 28, 36, 28, 28, - 37, 38, 39, 40, 41, 26, 111, 42, 43, 11, - 12, 44, 43, 45, 46, 43, 47, 43, 48, 43, - 43, 43, 43, 49, 50, 43, 51, 43, 43, 52, - 53, 54, 55, 56, 26, 93, 57, 58, 11, 12, - 59, 58, 60, 61, 58, 62, 58, 63, 58, 58, - - 58, 58, 64, 65, 58, 66, 58, 58, 67, 68, - 69, 70, 71, 26, 85, 72, 75, 75, 81, 88, - 82, 90, 101, 91, 102, 86, 95, 95, 89, 105, - 113, 113, 108, 123, 119, 83, 120, 126, 141, 103, - 106, 109, 131, 131, 124, 137, 127, 138, 144, 142, - 471, 121, 75, 75, 90, 232, 91, 145, 95, 95, - 113, 113, 139, 131, 131, 234, 243, 233, 245, 254, - 470, 256, 265, 469, 267, 468, 235, 236, 244, 246, - 247, 255, 257, 258, 266, 268, 269, 74, 74, 92, - 92, 94, 94, 110, 110, 112, 112, 128, 128, 130, - - 130, 146, 146, 159, 159, 467, 466, 465, 464, 463, + 12, 13, 14, 15, 12, 16, 17, 12, 18, 12, + 19, 12, 12, 12, 12, 20, 21, 12, 22, 12, + 12, 23, 24, 25, 26, 27, 28, 168, 29, 30, + 13, 14, 31, 30, 32, 33, 30, 34, 30, 35, + 30, 30, 30, 30, 36, 37, 30, 38, 30, 30, + 39, 40, 41, 42, 43, 28, 149, 44, 45, 13, + 14, 46, 45, 47, 48, 45, 49, 45, 50, 45, + 45, 45, 45, 51, 52, 45, 53, 45, 45, 54, + 55, 56, 57, 58, 28, 130, 59, 60, 13, 14, + 61, 60, 62, 63, 60, 64, 60, 65, 60, 60, + + 60, 60, 66, 67, 60, 68, 60, 60, 69, 70, + 71, 72, 73, 28, 111, 74, 75, 13, 14, 76, + 75, 77, 78, 75, 79, 75, 80, 75, 75, 75, + 75, 81, 82, 75, 83, 75, 75, 84, 85, 86, + 87, 88, 28, 103, 89, 92, 92, 94, 106, 99, + 95, 100, 127, 108, 104, 109, 124, 107, 113, 113, + 115, 128, 120, 116, 121, 143, 101, 125, 132, 132, + 134, 146, 139, 135, 140, 162, 144, 151, 151, 122, + 147, 153, 165, 158, 154, 159, 163, 170, 170, 141, + 172, 166, 177, 173, 178, 181, 184, 92, 92, 108, + + 160, 109, 113, 113, 303, 185, 182, 132, 132, 179, + 151, 151, 170, 170, 305, 315, 304, 317, 327, 612, + 329, 339, 611, 341, 351, 306, 307, 316, 318, 319, + 328, 330, 331, 340, 342, 343, 352, 353, 610, 609, + 608, 607, 606, 605, 604, 603, 602, 601, 354, 355, + 91, 91, 110, 110, 112, 112, 129, 129, 131, 131, + 148, 148, 150, 150, 167, 167, 169, 169, 186, 186, + 200, 200, 600, 599, 598, 597, 596, 595, 594, 593, + 592, 591, 590, 589, 588, 587, 586, 585, 584, 583, + 582, 581, 580, 579, 578, 577, 576, 575, 574, 573, + + 572, 571, 570, 569, 568, 567, 566, 565, 564, 563, + 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, + 552, 551, 550, 549, 548, 547, 546, 545, 544, 543, + 542, 541, 540, 539, 538, 537, 536, 535, 534, 533, + 532, 531, 530, 529, 528, 527, 526, 525, 524, 523, + 522, 521, 520, 519, 518, 517, 516, 515, 514, 513, + 512, 511, 510, 509, 508, 507, 506, 505, 504, 503, + 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, + 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, + 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, + + 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, @@ -642,102 +712,116 @@ static yyconst flex_int16_t yy_nxt[576] = 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, - 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, - 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, - 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, - 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, - 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, - 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, - 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, - - 272, 271, 270, 264, 263, 262, 261, 260, 259, 253, - 252, 251, 250, 249, 248, 242, 241, 240, 239, 238, - 237, 231, 230, 229, 228, 227, 226, 225, 224, 223, - 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, - 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, - 202, 201, 200, 199, 198, 197, 196, 92, 195, 194, - 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, - 74, 92, 183, 182, 181, 180, 179, 178, 177, 176, - 175, 174, 173, 172, 74, 92, 171, 170, 169, 168, - 167, 166, 165, 164, 163, 162, 161, 160, 74, 158, - - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 73, 92, 143, 140, 136, 135, 134, 133, 132, - 74, 92, 125, 122, 118, 117, 116, 115, 114, 74, - 92, 107, 104, 100, 99, 98, 97, 96, 74, 87, - 84, 80, 79, 78, 77, 76, 73, 472, 9, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472 + 362, 361, 360, 359, 358, 357, 356, 350, 349, 348, + 347, 346, 345, 344, 338, 337, 336, 335, 334, 333, + 332, 326, 325, 324, 323, 322, 321, 320, 314, 313, + 312, 311, 310, 309, 308, 302, 301, 300, 299, 298, + 297, 296, 295, 294, 293, 292, 291, 290, 289, 288, + 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, + 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, + 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, + 257, 256, 255, 254, 253, 110, 252, 251, 250, 249, + + 248, 247, 246, 245, 244, 243, 242, 241, 240, 91, + 110, 239, 238, 237, 236, 235, 234, 233, 232, 231, + 230, 229, 228, 227, 91, 110, 226, 225, 224, 223, + 222, 221, 220, 219, 218, 217, 216, 215, 214, 91, + 110, 213, 212, 211, 210, 209, 208, 207, 206, 205, + 204, 203, 202, 201, 91, 199, 198, 197, 196, 195, + 194, 193, 192, 191, 190, 189, 188, 187, 90, 110, + 183, 180, 176, 175, 174, 171, 91, 110, 164, 161, + 157, 156, 155, 152, 91, 110, 145, 142, 138, 137, + 136, 133, 91, 110, 126, 123, 119, 118, 117, 114, + + 91, 105, 102, 98, 97, 96, 93, 90, 613, 11, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613 } ; -static yyconst flex_int16_t yy_chk[576] = +static yyconst flex_int16_t yy_chk[737] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 481, 2, 3, + 1, 1, 1, 1, 1, 1, 2, 625, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 4, 478, 4, 5, 5, + 3, 3, 3, 3, 3, 4, 622, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 6, 475, 6, 7, 7, 7, + 5, 5, 5, 5, 6, 619, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 8, 23, 8, 15, 15, 21, 25, - 21, 26, 37, 26, 37, 23, 31, 31, 25, 39, - 46, 46, 41, 54, 52, 21, 52, 56, 69, 37, - 39, 41, 61, 61, 54, 67, 56, 67, 71, 69, - 467, 52, 75, 75, 90, 200, 90, 71, 95, 95, - 113, 113, 67, 131, 131, 201, 208, 200, 209, 216, - 466, 217, 224, 465, 225, 464, 201, 201, 208, 209, - 209, 216, 217, 217, 224, 225, 225, 473, 473, 474, - 474, 476, 476, 477, 477, 479, 479, 480, 480, 482, - - 482, 483, 483, 484, 484, 462, 460, 458, 456, 455, - 452, 451, 448, 447, 444, 443, 440, 438, 437, 434, - 433, 431, 430, 427, 426, 424, 423, 420, 419, 417, - 416, 413, 412, 411, 410, 409, 408, 407, 405, 404, - 403, 402, 401, 400, 399, 397, 396, 395, 394, 393, - 392, 391, 389, 388, 387, 386, 385, 384, 383, 381, - 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, - 350, 349, 348, 346, 345, 344, 343, 342, 341, 340, - - 339, 337, 336, 335, 334, 333, 332, 331, 330, 328, - 327, 326, 325, 324, 323, 322, 321, 319, 318, 317, - 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, - 306, 304, 303, 302, 301, 300, 299, 298, 297, 296, - 294, 293, 292, 291, 290, 289, 288, 287, 286, 284, - 283, 282, 281, 280, 279, 278, 277, 276, 274, 273, - 272, 271, 269, 268, 267, 266, 265, 264, 263, 262, - 261, 260, 258, 257, 256, 255, 254, 253, 252, 251, - 250, 249, 247, 246, 245, 244, 243, 242, 241, 240, - 239, 238, 236, 235, 234, 233, 232, 231, 230, 229, - - 228, 227, 226, 223, 222, 221, 220, 219, 218, 215, - 214, 213, 212, 211, 210, 207, 206, 205, 204, 203, - 202, 199, 198, 197, 196, 195, 194, 191, 190, 189, - 187, 185, 184, 183, 182, 179, 178, 177, 175, 173, - 172, 171, 170, 167, 166, 165, 163, 161, 160, 158, - 157, 154, 153, 152, 150, 148, 147, 146, 145, 144, - 143, 142, 141, 140, 139, 138, 135, 134, 133, 132, - 130, 128, 127, 126, 125, 124, 123, 122, 121, 120, - 117, 116, 115, 114, 112, 110, 109, 108, 107, 106, - 105, 104, 103, 102, 99, 98, 97, 96, 94, 89, - - 88, 87, 86, 85, 84, 83, 82, 79, 78, 77, - 76, 73, 72, 70, 68, 66, 65, 64, 63, 62, - 59, 57, 55, 53, 51, 50, 49, 48, 47, 44, - 42, 40, 38, 36, 35, 34, 33, 32, 29, 24, - 22, 20, 19, 18, 17, 16, 11, 9, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472 + 7, 7, 7, 8, 616, 8, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 10, 25, 10, 17, 17, 19, 27, 23, + 19, 23, 43, 28, 25, 28, 41, 27, 33, 33, + 35, 43, 39, 35, 39, 56, 23, 41, 48, 48, + 50, 58, 54, 50, 54, 71, 56, 63, 63, 39, + 58, 65, 73, 69, 65, 69, 71, 78, 78, 54, + 80, 73, 84, 80, 84, 86, 88, 92, 92, 108, + + 69, 108, 113, 113, 258, 88, 86, 132, 132, 84, + 151, 151, 170, 170, 259, 267, 258, 268, 276, 607, + 277, 285, 606, 286, 294, 259, 259, 267, 268, 268, + 276, 277, 277, 285, 286, 286, 294, 295, 605, 604, + 603, 601, 599, 597, 595, 593, 592, 589, 295, 295, + 614, 614, 615, 615, 617, 617, 618, 618, 620, 620, + 621, 621, 623, 623, 624, 624, 626, 626, 627, 627, + 628, 628, 588, 585, 584, 581, 580, 577, 576, 573, + 571, 570, 567, 566, 564, 563, 560, 559, 557, 556, + 553, 552, 550, 549, 546, 545, 543, 542, 539, 538, + + 537, 536, 535, 534, 533, 531, 530, 529, 528, 527, + 526, 525, 523, 522, 521, 520, 519, 518, 517, 515, + 514, 513, 512, 511, 510, 509, 507, 506, 505, 504, + 503, 502, 501, 499, 498, 497, 496, 495, 494, 493, + 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, + 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, + 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, + 462, 461, 460, 459, 458, 456, 455, 454, 453, 452, + 451, 450, 449, 447, 446, 445, 444, 443, 442, 441, + 440, 438, 437, 436, 435, 434, 433, 432, 431, 429, + + 428, 427, 426, 425, 424, 423, 422, 420, 419, 418, + 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, + 407, 405, 404, 402, 401, 400, 399, 398, 397, 396, + 394, 393, 391, 390, 389, 388, 387, 386, 385, 383, + 382, 380, 379, 378, 377, 376, 375, 374, 372, 371, + 369, 368, 367, 366, 365, 364, 363, 361, 360, 358, + 357, 355, 354, 353, 352, 351, 350, 349, 348, 347, + 346, 345, 343, 342, 341, 340, 339, 338, 337, 336, + 335, 334, 333, 331, 330, 329, 328, 327, 326, 325, + 324, 323, 322, 321, 319, 318, 317, 316, 315, 314, + + 313, 312, 311, 310, 309, 307, 306, 305, 304, 303, + 302, 301, 300, 299, 298, 297, 296, 293, 292, 291, + 290, 289, 288, 287, 284, 283, 282, 281, 280, 279, + 278, 275, 274, 273, 272, 271, 270, 269, 266, 265, + 264, 263, 262, 261, 260, 257, 256, 255, 254, 253, + 252, 251, 248, 247, 246, 244, 242, 241, 240, 239, + 238, 235, 234, 233, 231, 229, 228, 227, 226, 225, + 222, 221, 220, 218, 216, 215, 214, 213, 212, 209, + 208, 207, 205, 203, 202, 201, 199, 198, 195, 194, + 193, 191, 189, 188, 187, 186, 185, 184, 183, 182, + + 181, 180, 179, 178, 175, 174, 173, 172, 171, 169, + 167, 166, 165, 164, 163, 162, 161, 160, 159, 156, + 155, 154, 153, 152, 150, 148, 147, 146, 145, 144, + 143, 142, 141, 140, 137, 136, 135, 134, 133, 131, + 129, 128, 127, 126, 125, 124, 123, 122, 121, 118, + 117, 116, 115, 114, 112, 107, 106, 105, 104, 103, + 102, 101, 100, 97, 96, 95, 94, 93, 90, 89, + 87, 85, 83, 82, 81, 79, 76, 74, 72, 70, + 68, 67, 66, 64, 61, 59, 57, 55, 53, 52, + 51, 49, 46, 44, 42, 40, 38, 37, 36, 34, + + 31, 26, 24, 22, 21, 20, 18, 13, 11, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613 } ; static yy_state_type yy_last_accepting_state; @@ -808,12 +892,13 @@ char *libvma_yytext; extern long __vma_config_line_num; #define YY_NO_INPUT 1 -/* Line 812 of config_scanner.c */ +/* Line 887 of config_scanner.c */ #define INITIAL 0 #define CANNAME 1 #define APP_ID_S1 2 #define APP_ID_S2 3 +#define DAEMON_VALUE_S 4 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way @@ -1051,7 +1136,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1060,13 +1145,13 @@ YY_DECL while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 473 ) + if ( yy_current_state >= 614 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 549 ); + while ( yy_base[yy_current_state] != 710 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1357,9 +1442,34 @@ YY_RULE_SETUP } YY_BREAK case 25: -/* rule 25 can match eol */ YY_RULE_SETUP /* Line 255 of config_scanner.l */ +{ + yylval.ival = DAEMON_KEY; +#ifdef DEBUG + printf("DAEMON_KEY\n"); +#endif + BEGIN(DAEMON_VALUE_S); + return DAEMON_KEY; +} + YY_BREAK +case 26: +YY_RULE_SETUP +/* Line 264 of config_scanner.l */ +{ + yylval.sval = (char *)malloc(strlen(libvma_yytext) + 1); + strcpy(yylval.sval, libvma_yytext); +#ifdef DEBUG + printf("DAEMON_VALUE:%s\n",yylval.sval); +#endif + BEGIN(0); + return (DAEMON_VALUE); +} + YY_BREAK +case 27: +/* rule 25 can match eol */ +YY_RULE_SETUP +/* Line 274 of config_scanner.l */ { __vma_config_line_num++; #ifdef DEBUG @@ -1369,21 +1479,21 @@ YY_RULE_SETUP return(LINE); } YY_BREAK -case 26: +case 28: YY_RULE_SETUP -/* Line 264 of config_scanner.l */ +/* Line 283 of config_scanner.l */ { __vma_config_line_num++; } YY_BREAK -case 27: +case 29: YY_RULE_SETUP -/* Line 268 of config_scanner.l */ +/* Line 287 of config_scanner.l */ {} YY_BREAK -case 28: +case 30: YY_RULE_SETUP -/* Line 270 of config_scanner.l */ +/* Line 289 of config_scanner.l */ { #ifdef DEBUG printf("CHAR:%c\n",libvma_yytext[0]); @@ -1391,16 +1501,17 @@ YY_RULE_SETUP return(libvma_yytext[0]); } YY_BREAK -case 29: +case 31: YY_RULE_SETUP -/* Line 277 of config_scanner.l */ +/* Line 296 of config_scanner.l */ ECHO; YY_BREAK -/* Line 1397 of config_scanner.c */ +/* Line 1492 of config_scanner.c */ case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(CANNAME): case YY_STATE_EOF(APP_ID_S1): case YY_STATE_EOF(APP_ID_S2): +case YY_STATE_EOF(DAEMON_VALUE_S): yyterminate(); case YY_END_OF_BUFFER: @@ -1693,7 +1804,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 473 ) + if ( yy_current_state >= 614 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1721,11 +1832,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 473 ) + if ( yy_current_state >= 614 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 472); + yy_is_jam = (yy_current_state == 613); return yy_is_jam ? 0 : yy_current_state; } @@ -2367,7 +2478,7 @@ void libvma_yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -/* Line 276 of config_scanner.l */ +/* Line 296 of config_scanner.l */ diff --git a/src/vma/main.cpp b/src/vma/main.cpp index cc6996e763..732879f570 100644 --- a/src/vma/main.cpp +++ b/src/vma/main.cpp @@ -800,6 +800,16 @@ static void do_global_ctors_helper() if (g_is_forked_child == true) g_is_forked_child = false; + if (check_if_regular_file (safe_mce_sys().conf_filename)) + { + vlog_printf(VLOG_WARNING,"FAILED to read VMA configuration file. %s is not a regular file.\n", + safe_mce_sys().conf_filename); + if (strcmp (MCE_DEFAULT_CONF_FILE, safe_mce_sys().conf_filename)) + vlog_printf(VLOG_INFO,"Please see README.txt section regarding VMA_CONFIG_FILE\n"); + } + else if (__vma_parse_config_file(safe_mce_sys().conf_filename)) + vlog_printf(VLOG_DEBUG,"FAILED to read VMA configuration file: %s\n", safe_mce_sys().conf_filename); + /* Open communication with daemon */ NEW_CTOR(g_p_agent, agent()); vlog_printf(VLOG_DEBUG,"Agent setup state: g_p_agent=%p active=%d\n", @@ -844,16 +854,6 @@ static void do_global_ctors_helper() NEW_CTOR(g_p_fd_collection, fd_collection()); - if (check_if_regular_file (safe_mce_sys().conf_filename)) - { - vlog_printf(VLOG_WARNING,"FAILED to read VMA configuration file. %s is not a regular file.\n", - safe_mce_sys().conf_filename); - if (strcmp (MCE_DEFAULT_CONF_FILE, safe_mce_sys().conf_filename)) - vlog_printf(VLOG_INFO,"Please see README.txt section regarding VMA_CONFIG_FILE\n"); - } - else if (__vma_parse_config_file(safe_mce_sys().conf_filename)) - vlog_printf(VLOG_DEBUG,"FAILED to read VMA configuration file: %s\n", safe_mce_sys().conf_filename); - // initialize LWIP tcp/ip stack NEW_CTOR(g_p_lwip, vma_lwip()); diff --git a/src/vma/util/agent.cpp b/src/vma/util/agent.cpp index 32f9f6f4c3..76942b1d17 100644 --- a/src/vma/util/agent.cpp +++ b/src/vma/util/agent.cpp @@ -45,6 +45,7 @@ #include "vlogger/vlogger.h" #include "utils/lock_wrapper.h" #include "vma/sock/sock-redirect.h" +#include "vma/util/libvma.h" #include "vma/util/list.h" #include "vma/util/agent.h" @@ -84,10 +85,13 @@ agent::agent() : int rc = 0; agent_msg_t *msg = NULL; int i = 0; + const char *path = (__vma_get_daemon_path() ? __vma_get_daemon_path() : VMA_AGENT_PATH); INIT_LIST_HEAD(&m_free_queue); INIT_LIST_HEAD(&m_wait_queue); + __log_dbg("use location: %s\n", path); + /* Fill free queue with empty messages */ i = m_msg_num; m_msg_num = 0; @@ -104,14 +108,14 @@ agent::agent() : m_msg_num++; } - if ((mkdir(VMA_AGENT_PATH, 0777) != 0) && (errno != EEXIST)) { + if ((mkdir(path, 0777) != 0) && (errno != EEXIST)) { rc = -errno; - __log_dbg("failed create folder %s (rc = %d)\n", VMA_AGENT_PATH, rc); + __log_dbg("failed create folder %s (rc = %d)\n", path, rc); goto err; } rc = snprintf(m_sock_file, sizeof(m_sock_file) - 1, - "%s/%s.%d.sock", VMA_AGENT_PATH, VMA_AGENT_BASE_NAME, getpid()); + "%s/%s.%d.sock", path, VMA_AGENT_BASE_NAME, getpid()); if ((rc < 0 ) || (rc == (sizeof(m_sock_file) - 1) )) { rc = -ENOMEM; __log_dbg("failed allocate sock file (rc = %d)\n", rc); @@ -119,7 +123,7 @@ agent::agent() : } rc = snprintf(m_pid_file, sizeof(m_pid_file) - 1, - "%s/%s.%d.pid", VMA_AGENT_PATH, VMA_AGENT_BASE_NAME, getpid()); + "%s/%s.%d.pid", path, VMA_AGENT_BASE_NAME, getpid()); if ((rc < 0 ) || (rc == (sizeof(m_pid_file) - 1) )) { rc = -ENOMEM; __log_dbg("failed allocate pid file (rc = %d)\n", rc); diff --git a/src/vma/util/config_parser.y b/src/vma/util/config_parser.y index e75330f242..9a39383de0 100644 --- a/src/vma/util/config_parser.y +++ b/src/vma/util/config_parser.y @@ -100,6 +100,8 @@ static void __vma_set_inet_addr_prefix_len(unsigned char prefixlen) // SM: log part is not used... int __vma_min_level = 9; +char *__vma_daemon_path = "/tmp/vma"; + void __vma_dump_address_port_rule_config_state(char *buf) { if (__vma_address_port_rule->match_by_addr) { char str_addr[INET_ADDRSTRLEN]; @@ -338,8 +340,10 @@ static void __vma_add_rule() { %token NAME "a name" %token LEVEL "min-level" %token LINE "new line" -%type NAME PROGRAM USER_DEFINED_ID_STR -%type INT LOG DEST STDERR SYSLOG FILENAME APP_ID USE OS VMA SDP TCP UDP TCP_CLIENT TCP_SERVER UDP_SENDER UDP_RECEIVER UDP_CONNECT LEVEL LINE +%token DAEMON_KEY "daemon" +%token DAEMON_VALUE "daemon path" +%type NAME PROGRAM USER_DEFINED_ID_STR DAEMON_VALUE +%type INT LOG DEST STDERR SYSLOG FILENAME APP_ID USE OS VMA SDP TCP UDP TCP_CLIENT TCP_SERVER UDP_SENDER UDP_RECEIVER UDP_CONNECT LEVEL LINE DAEMON_KEY %start config %{ @@ -367,6 +371,7 @@ statement: log_statement | app_id_statement | socket_statement + | daemon_statement ; log_statement: @@ -397,6 +402,13 @@ app_id: | APP_ID PROGRAM INT {__vma_add_inst_with_int_uid($2, $3); if ($2) free($2); } ; +daemon_statement: + daemon NL + ; + +daemon: + DAEMON_KEY DAEMON_VALUE { __vma_set_daemon_path($2); if ($2) free($2); } + ; socket_statement: use transport role tuple NL { __vma_add_rule(); } diff --git a/src/vma/util/config_scanner.l b/src/vma/util/config_scanner.l index 3cf236ebc8..6c561e2c1d 100644 --- a/src/vma/util/config_scanner.l +++ b/src/vma/util/config_scanner.l @@ -53,7 +53,7 @@ extern long __vma_config_line_num; %} %option nounput %option noinput -%s CANNAME APP_ID_S1 APP_ID_S2 +%s CANNAME APP_ID_S1 APP_ID_S2 DAEMON_VALUE_S %% ^[ \t]*#.* {} @@ -252,6 +252,25 @@ udp_connect { return (NAME); } +daemon { + yylval.ival = DAEMON_KEY; +#ifdef DEBUG + printf("DAEMON_KEY\n"); +#endif + BEGIN(DAEMON_VALUE_S); + return DAEMON_KEY; +} + +[^ \t\n]+ { + yylval.sval = (char *)malloc(strlen(yytext) + 1); + strcpy(yylval.sval, yytext); +#ifdef DEBUG + printf("DAEMON_VALUE:%s\n",yylval.sval); +#endif + BEGIN(0); + return (DAEMON_VALUE); +} + \n { __vma_config_line_num++; #ifdef DEBUG diff --git a/src/vma/util/libvma.conf b/src/vma/util/libvma.conf index 101a082cc1..4eb4264415 100644 --- a/src/vma/util/libvma.conf +++ b/src/vma/util/libvma.conf @@ -15,11 +15,16 @@ # takes immidiate effect we define these straight after the "application-id". # ############################################################################## -# DEAFUALT SETTINGS: +# DEFAULT SETTINGS: # Please do not forget to comment if you want to change these. # (the rest of this file explains the syntax and give examples) # +# +# Location for auxiliary files (this parameter should be +# identical for daemon and process) +daemon /tmp/vma + # # By default apply the statments to any application with any ID application-id * * diff --git a/src/vma/util/libvma.h b/src/vma/util/libvma.h index e4ed297fab..e21ad0606e 100644 --- a/src/vma/util/libvma.h +++ b/src/vma/util/libvma.h @@ -329,6 +329,10 @@ static inline int __vma_log_set_log_file(char *filename ) return 0; }; +char* __vma_get_daemon_path(void); + +int __vma_set_daemon_path(char *pathname); + int __vma_sockaddr_to_vma(const struct sockaddr *addr_in, socklen_t addrlen, struct sockaddr_in *addr_out, int *was_ipv6 ); #ifdef __cplusplus