/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include using namespace std; #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { istream* yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) typedef unsigned char YY_CHAR; #define yytext_ptr yytext #define YY_INTERACTIVE #include /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 139 #define YY_END_OF_BUFFER 140 static yyconst short int yy_accept[748] = { 0, 135, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 139, 135, 138, 139, 136, 137, 135, 139, 139, 9, 32, 139, 91, 9, 139, 139, 139, 139, 139, 139, 139, 139, 139, 10, 33, 139, 72, 11, 34, 139, 74, 12, 35, 139, 76, 13, 36, 139, 78, 14, 37, 139, 80, 6, 28, 139, 82, 15, 38, 139, 84, 16, 39, 139, 86, 17, 40, 139, 88, 18, 139, 90, 1, 23, 139, 124, 1, 139, 139, 139, 139, 139, 139, 2, 24, 139, 3, 25, 139, 139, 4, 26, 139, 139, 105, 5, 27, 139, 107, 109, 29, 109, 110, 7, 30, 139, 112, 8, 31, 139, 139, 139, 139, 139, 139, 139, 123, 8, 139, 19, 41, 139, 100, 19, 139, 139, 139, 139, 20, 42, 139, 139, 21, 43, 139, 139, 97, 22, 44, 139, 99, 135, 0, 45, 135, 0, 0, 0, 0, 0, 9, 0, 54, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 55, 72, 11, 0, 56, 74, 12, 0, 57, 76, 13, 0, 58, 78, 14, 0, 59, 80, 6, 0, 64, 82, 15, 0, 60, 84, 16, 0, 61, 86, 17, 0, 62, 88, 18, 0, 63, 90, 1, 0, 46, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 47, 3, 0, 48, 0, 0, 4, 0, 49, 0, 0, 5, 0, 50, 107, 109, 109, 51, 0, 7, 0, 52, 112, 8, 0, 53, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 19, 0, 65, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 66, 0, 0, 21, 0, 67, 0, 0, 22, 0, 68, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 0, 104, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 94, 0, 96, 0, 0, 0, 0, 70, 0, 0, 83, 0, 0, 81, 0, 0, 0, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, 127, 0, 102, 104, 118, 119, 0, 0, 116, 0, 0, 0, 0, 0, 133, 94, 96, 0, 0, 70, 0, 0, 83, 0, 0, 0, 0, 131, 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, 111, 127, 0, 102, 104, 117, 0, 0, 0, 0, 0, 133, 94, 96, 0, 0, 92, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, 128, 0, 108, 115, 0, 0, 0, 0, 134, 0, 92, 0, 130, 0, 0, 0, 0, 75, 0, 0, 0, 0, 103, 106, 0, 128, 0, 0, 95, 0, 134, 0, 0, 85, 71, 0, 0, 75, 0, 0, 0, 103, 106, 0, 0, 95, 0, 0, 0, 85, 71, 89, 87, 0, 0, 0, 0, 0, 0, 0, 69, 0, 129, 89, 87, 0, 79, 0, 0, 125, 0, 126, 0, 132, 69, 129, 0, 79, 73, 125, 126, 132, 77, 73, 77, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 5, 4, 1, 4, 6, 1, 1, 4, 1, 7, 1, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 4, 1, 1, 1, 1, 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 21, 28, 29, 30, 31, 21, 32, 33, 34, 35, 1, 1, 1, 4, 1, 4, 36, 21, 37, 21, 38, 39, 21, 40, 41, 21, 21, 42, 43, 44, 45, 46, 21, 47, 48, 49, 21, 21, 50, 51, 21, 21, 52, 1, 53, 4, 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, 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, 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, 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, 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 } ; static yyconst int yy_meta[54] = { 0, 1, 2, 2, 2, 2, 3, 1, 1, 1, 4, 1, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1 } ; static yyconst short int yy_base[784] = { 0, 0, 52, 7, 104, 157, 210, 13, 19, 25, 31, 37, 60, 68, 77, 85, 93, 110, 133, 141, 167, 173, 179, 145, 183, 189, 262, 195, 201, 220, 226, 236, 242, 248, 268, 42, 117, 277, 291, 314, 11, 254, 366, 301, 320, 326, 335, 419, 472, 0, 0, 1229, 1230, 4, 1230, 1225, 1230, 1230, 298, 11, 1200, 49, 1230, 1223, 1230, 524, 23, 1202, 1198, 38, 1192, 1195, 1199, 1208, 5, 74, 1230, 1216, 0, 101, 1230, 1215, 1207, 147, 1230, 1213, 1205, 230, 1230, 1211, 0, 233, 1230, 1210, 0, 270, 1230, 1209, 0, 290, 1230, 1208, 0, 307, 1230, 1207, 1199, 311, 1230, 1205, 1197, 332, 1203, 1195, 339, 1230, 1201, 1230, 553, 1188, 331, 1176, 1175, 1173, 1174, 342, 1230, 1195, 345, 1230, 1194, 64, 352, 1230, 1193, 75, 1230, 354, 1230, 1192, 1184, 0, 0, 58, 1230, 363, 1230, 1190, 1182, 370, 1230, 1188, 1142, 1147, 1149, 1149, 44, 1141, 1230, 379, 1165, 380, 1230, 1181, 1230, 382, 95, 73, 1157, 1155, 388, 1230, 1178, 106, 395, 1230, 1177, 129, 1230, 396, 1230, 1176, 0, 397, 1175, 1230, 429, 147, 1150, 1147, 1152, 1144, 398, 1170, 1230, 0, 175, 1149, 1145, 113, 1139, 1142, 1146, 1155, 193, 1137, 1142, 1138, 1145, 1135, 1136, 1136, 1129, 1128, 1125, 1143, 1128, 404, 1151, 1230, 0, 405, 1150, 1230, 1142, 407, 1148, 1230, 1140, 408, 1146, 1230, 0, 411, 1145, 1230, 0, 430, 1144, 1230, 0, 431, 1143, 1230, 0, 432, 1142, 1230, 1134, 433, 1140, 1230, 1132, 439, 1138, 1230, 1130, 440, 1136, 1230, 0, 1123, 428, 1111, 1110, 1108, 1109, 1118, 1117, 1102, 1107, 1100, 1114, 1097, 1102, 442, 1122, 1230, 449, 1121, 1230, 1113, 216, 450, 1119, 1230, 1111, 258, 451, 1117, 1230, 1109, 0, 150, 0, 1115, 457, 1114, 1230, 1106, 458, 1112, 1230, 1071, 1068, 1069, 313, 1064, 1065, 1061, 482, 1088, 1078, 459, 1103, 1230, 483, 156, 228, 1079, 1077, 1088, 1072, 1072, 1077, 1070, 1068, 460, 1094, 1230, 1086, 366, 461, 1092, 1230, 1084, 478, 485, 1090, 1230, 0, 1078, 1068, 1070, 1075, 1065, 1055, 1069, 1070, 1061, 1066, 1062, 1068, 1063, 1056, 1064, 1049, 1064, 1061, 1051, 1043, 1060, 1051, 1043, 483, 1061, 490, 1060, 1230, 1031, 1016, 1029, 1021, 1014, 1013, 1012, 1230, 1046, 1031, 1039, 1043, 1033, 1025, 1034, 491, 1045, 495, 1044, 1025, 1034, 1023, 1022, 1031, 489, 1034, 1025, 1018, 1020, 1016, 1010, 1017, 1023, 1012, 1021, 1006, 1009, 1018, 1022, 1009, 1005, 1016, 1019, 500, 1018, 503, 978, 978, 976, 988, 983, 979, 976, 994, 1003, 1007, 991, 1000, 1004, 988, 1003, 504, 1002, 507, 995, 996, 984, 992, 993, 986, 985, 990, 975, 984, 975, 975, 982, 972, 968, 973, 966, 982, 977, 978, 989, 978, 964, 962, 508, 979, 511, 978, 938, 1230, 937, 934, 937, 945, 943, 963, 949, 975, 960, 961, 972, 948, 512, 964, 519, 963, 937, 939, 939, 934, 936, 937, 941, 943, 951, 937, 928, 930, 929, 925, 930, 932, 925, 926, 919, 921, 948, 920, 919, 923, 936, 520, 935, 524, 903, 902, 895, 895, 891, 894, 905, 908, 934, 902, 904, 931, 903, 921, 525, 920, 529, 902, 902, 258, 900, 900, 914, 908, 900, 920, 901, 903, 364, 899, 889, 903, 900, 899, 888, 886, 309, 901, 492, 887, 900, 901, 898, 899, 855, 854, 863, 1230, 856, 860, 874, 884, 872, 872, 505, 887, 888, 885, 886, 867, 864, 521, 889, 864, 861, 886, 864, 866, 883, 855, 863, 534, 880, 846, 854, 857, 864, 848, 848, 849, 538, 846, 871, 540, 870, 860, 860, 859, 1230, 1230, 817, 826, 1230, 840, 836, 838, 835, 541, 860, 851, 850, 831, 543, 856, 829, 544, 854, 839, 824, 824, 829, 849, 834, 835, 831, 817, 835, 815, 816, 551, 841, 554, 840, 839, 2, 1230, 1230, 1230, 789, 811, 827, 809, 556, 834, 1230, 1230, 805, 557, 832, 803, 559, 830, 806, 796, 813, 812, 816, 804, 805, 797, 560, 812, 792, 819, 561, 818, 95, 1230, 1230, 789, 562, 788, 564, 815, 800, 813, 798, 811, 801, 800, 795, 780, 806, 790, 741, 693, 566, 716, 707, 692, 697, 682, 567, 687, 672, 630, 601, 598, 621, 620, 606, 604, 608, 587, 589, 576, 600, 599, 572, 571, 596, 569, 568, 569, 592, 589, 587, 586, 564, 574, 440, 572, 573, 575, 576, 467, 578, 448, 415, 389, 367, 373, 332, 579, 330, 581, 324, 582, 300, 297, 288, 275, 281, 232, 218, 197, 177, 143, 139, 122, 1230, 634, 639, 644, 649, 654, 659, 664, 666, 671, 676, 681, 686, 691, 696, 701, 706, 711, 716, 721, 726, 731, 736, 741, 746, 751, 756, 761, 766, 771, 776, 781, 786, 791, 796, 63, 801 } ; static yyconst short int yy_def[784] = { 0, 748, 748, 748, 748, 749, 749, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 750, 750, 748, 748, 748, 39, 748, 748, 748, 748, 748, 748, 751, 751, 748, 748, 747, 747, 747, 747, 752, 747, 747, 747, 747, 747, 747, 747, 753, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 754, 755, 747, 747, 756, 747, 747, 747, 757, 747, 747, 747, 758, 759, 747, 747, 760, 761, 747, 747, 762, 763, 747, 747, 764, 765, 747, 747, 766, 747, 747, 747, 767, 747, 747, 768, 747, 747, 747, 769, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 770, 747, 747, 771, 747, 747, 747, 772, 747, 747, 747, 747, 773, 747, 774, 774, 775, 747, 747, 747, 776, 747, 747, 747, 777, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 778, 747, 747, 747, 747, 747, 747, 747, 747, 779, 747, 747, 747, 780, 747, 747, 747, 747, 781, 782, 747, 752, 747, 747, 747, 747, 747, 747, 747, 747, 753, 747, 65, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 754, 747, 755, 747, 756, 747, 747, 747, 757, 747, 747, 747, 758, 747, 759, 747, 760, 747, 761, 747, 762, 747, 763, 747, 764, 747, 765, 747, 766, 747, 747, 747, 767, 747, 747, 747, 768, 747, 747, 747, 769, 747, 118, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 770, 747, 747, 771, 747, 747, 747, 747, 772, 747, 747, 747, 747, 773, 747, 747, 774, 775, 774, 783, 747, 776, 747, 747, 747, 777, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 778, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 779, 747, 747, 747, 747, 780, 747, 747, 747, 747, 781, 747, 782, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 0, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747 } ; static yyconst short int yy_nxt[1284] = { 0, 747, 53, 54, 663, 55, 183, 53, 664, 61, 62, 183, 63, 159, 61, 79, 80, 215, 81, 216, 79, 79, 80, 82, 81, 160, 79, 83, 84, 82, 85, 189, 83, 83, 84, 86, 85, 190, 83, 87, 88, 86, 89, 205, 87, 142, 90, 143, 144, 206, 209, 192, 56, 57, 58, 54, 192, 55, 210, 53, 64, 294, 87, 88, 295, 89, 59, 87, 340, 90, 91, 92, 281, 93, 282, 91, 217, 94, 60, 91, 92, 217, 93, 286, 91, 287, 94, 95, 96, 307, 97, 308, 95, 323, 98, 95, 96, 663, 97, 324, 95, 664, 98, 221, 56, 57, 65, 62, 221, 63, 321, 61, 99, 100, 330, 101, 331, 99, 66, 102, 142, 67, 143, 144, 746, 209, 322, 68, 69, 70, 71, 72, 73, 210, 74, 99, 100, 335, 101, 336, 99, 745, 102, 103, 104, 746, 105, 111, 103, 225, 112, 106, 111, 294, 225, 113, 295, 64, 52, 75, 76, 52, 77, 52, 75, 52, 52, 189, 52, 103, 104, 321, 105, 190, 103, 107, 108, 106, 109, 743, 107, 107, 108, 110, 109, 111, 107, 322, 112, 110, 111, 114, 115, 113, 116, 205, 114, 125, 126, 742, 127, 206, 125, 125, 126, 215, 127, 216, 125, 52, 52, 52, 75, 76, 52, 77, 52, 75, 52, 52, 741, 52, 128, 129, 281, 130, 365, 128, 128, 129, 131, 130, 229, 128, 745, 233, 131, 229, 132, 133, 233, 134, 117, 132, 132, 133, 135, 134, 323, 132, 137, 138, 135, 139, 324, 137, 161, 162, 140, 163, 568, 161, 52, 52, 118, 115, 286, 116, 367, 114, 137, 138, 237, 139, 119, 137, 120, 237, 140, 145, 146, 121, 147, 739, 145, 122, 744, 148, 123, 136, 737, 124, 241, 145, 146, 136, 147, 241, 145, 736, 186, 148, 743, 170, 171, 183, 172, 164, 170, 245, 569, 173, 187, 249, 245, 117, 149, 150, 249, 151, 587, 149, 170, 171, 188, 172, 742, 170, 174, 175, 173, 176, 741, 174, 253, 588, 177, 174, 175, 253, 176, 257, 174, 740, 275, 177, 257, 278, 268, 275, 152, 269, 278, 153, 283, 154, 288, 270, 155, 283, 156, 288, 372, 157, 373, 296, 578, 158, 165, 162, 296, 163, 300, 161, 330, 739, 385, 300, 166, 178, 167, 310, 313, 738, 316, 168, 300, 313, 178, 313, 327, 726, 169, 311, 317, 327, 318, 332, 337, 183, 192, 319, 332, 337, 183, 192, 217, 221, 320, 225, 229, 217, 221, 233, 225, 229, 579, 725, 233, 164, 52, 179, 180, 52, 181, 52, 179, 52, 52, 52, 52, 186, 237, 241, 245, 249, 183, 237, 241, 245, 249, 253, 257, 187, 275, 268, 253, 257, 269, 275, 737, 278, 283, 288, 270, 188, 278, 283, 288, 296, 300, 313, 327, 332, 296, 300, 313, 327, 332, 736, 729, 52, 52, 52, 179, 180, 52, 181, 52, 179, 52, 52, 52, 52, 310, 316, 335, 337, 387, 300, 313, 411, 337, 412, 590, 317, 311, 318, 413, 429, 414, 430, 319, 431, 438, 432, 439, 604, 411, 320, 458, 413, 429, 460, 476, 431, 503, 478, 504, 505, 520, 506, 521, 568, 52, 52, 195, 522, 503, 523, 548, 192, 505, 520, 550, 563, 578, 522, 196, 565, 626, 197, 590, 604, 591, 644, 647, 198, 199, 200, 201, 202, 203, 626, 204, 260, 661, 605, 669, 644, 257, 647, 683, 661, 689, 261, 669, 262, 683, 689, 721, 723, 263, 569, 730, 732, 264, 734, 721, 265, 723, 730, 266, 732, 734, 728, 579, 727, 726, 725, 627, 712, 591, 605, 711, 645, 648, 720, 707, 719, 718, 704, 703, 627, 717, 716, 662, 715, 670, 645, 699, 648, 684, 662, 690, 714, 670, 713, 684, 690, 722, 724, 712, 711, 731, 733, 710, 735, 722, 709, 724, 731, 692, 733, 735, 52, 52, 52, 52, 52, 78, 78, 78, 78, 78, 141, 141, 141, 141, 141, 182, 182, 182, 182, 182, 184, 184, 184, 184, 184, 193, 193, 193, 193, 193, 218, 218, 218, 218, 218, 220, 220, 222, 222, 222, 222, 222, 226, 226, 226, 226, 226, 230, 230, 230, 230, 230, 232, 708, 707, 232, 232, 234, 234, 234, 234, 234, 236, 706, 687, 236, 236, 238, 238, 238, 238, 238, 240, 705, 704, 240, 240, 242, 242, 242, 242, 242, 244, 703, 702, 244, 244, 246, 246, 246, 246, 246, 250, 250, 250, 250, 250, 254, 254, 254, 254, 254, 258, 258, 258, 258, 258, 276, 276, 276, 276, 276, 279, 279, 279, 279, 279, 284, 284, 284, 284, 284, 289, 289, 289, 289, 289, 292, 292, 701, 292, 292, 293, 293, 293, 293, 293, 297, 297, 297, 297, 297, 301, 301, 301, 301, 301, 314, 314, 314, 314, 314, 328, 328, 328, 328, 328, 333, 333, 333, 333, 333, 338, 338, 338, 338, 338, 295, 295, 295, 295, 295, 700, 699, 698, 697, 696, 695, 674, 694, 672, 693, 692, 691, 688, 687, 660, 686, 685, 682, 681, 680, 679, 678, 677, 676, 675, 674, 673, 672, 671, 640, 668, 667, 666, 665, 630, 629, 660, 659, 658, 657, 656, 655, 654, 653, 618, 652, 651, 650, 649, 613, 646, 610, 643, 642, 641, 640, 639, 638, 637, 636, 635, 634, 633, 632, 631, 630, 629, 628, 625, 624, 623, 622, 621, 620, 619, 618, 617, 616, 575, 615, 614, 613, 612, 611, 610, 609, 608, 522, 607, 520, 606, 603, 602, 601, 600, 599, 598, 597, 596, 595, 505, 594, 503, 593, 592, 589, 586, 585, 584, 583, 582, 581, 580, 577, 576, 575, 574, 573, 572, 571, 570, 567, 566, 564, 562, 561, 518, 560, 559, 515, 558, 557, 556, 555, 554, 553, 552, 551, 549, 547, 546, 545, 544, 499, 543, 542, 541, 540, 539, 538, 537, 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, 526, 525, 524, 431, 429, 519, 518, 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, 413, 411, 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, 481, 480, 479, 477, 475, 474, 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, 461, 459, 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 437, 436, 435, 434, 433, 335, 330, 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, 286, 281, 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, 339, 386, 334, 384, 329, 383, 382, 381, 380, 379, 378, 326, 325, 315, 377, 312, 376, 375, 374, 371, 370, 369, 302, 299, 298, 368, 291, 290, 366, 285, 364, 280, 277, 363, 362, 361, 360, 359, 358, 357, 356, 274, 273, 272, 271, 267, 259, 256, 255, 252, 251, 248, 247, 243, 239, 235, 231, 228, 227, 224, 223, 219, 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, 214, 213, 212, 211, 208, 207, 194, 343, 342, 341, 191, 185, 339, 334, 329, 326, 325, 315, 312, 309, 306, 305, 304, 303, 302, 299, 298, 291, 290, 285, 280, 277, 274, 273, 272, 271, 267, 259, 256, 255, 252, 251, 248, 247, 243, 239, 235, 231, 228, 227, 224, 223, 219, 214, 213, 212, 211, 208, 207, 194, 191, 185, 747, 51, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747 } ; static yyconst short int yy_chk[1284] = { 0, 0, 1, 1, 631, 1, 53, 1, 631, 3, 3, 53, 3, 40, 3, 7, 7, 74, 7, 74, 7, 8, 8, 7, 8, 40, 8, 9, 9, 8, 9, 59, 9, 10, 10, 9, 10, 59, 10, 11, 11, 10, 11, 66, 11, 35, 11, 35, 35, 66, 69, 61, 1, 1, 2, 2, 61, 2, 69, 2, 3, 143, 12, 12, 143, 12, 2, 12, 782, 12, 13, 13, 131, 13, 131, 13, 75, 13, 2, 14, 14, 75, 14, 135, 14, 135, 14, 15, 15, 156, 15, 156, 15, 167, 15, 16, 16, 663, 16, 167, 16, 663, 16, 79, 2, 2, 4, 4, 79, 4, 166, 4, 17, 17, 173, 17, 173, 17, 4, 17, 36, 4, 36, 36, 746, 199, 166, 4, 4, 4, 4, 4, 4, 199, 4, 18, 18, 177, 18, 177, 18, 745, 18, 19, 19, 744, 19, 23, 19, 83, 23, 19, 23, 293, 83, 23, 293, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 187, 5, 20, 20, 317, 20, 187, 20, 21, 21, 20, 21, 743, 21, 22, 22, 21, 22, 24, 22, 317, 24, 22, 24, 25, 25, 24, 25, 196, 25, 27, 27, 742, 27, 196, 27, 28, 28, 204, 28, 204, 28, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 741, 6, 29, 29, 282, 29, 282, 29, 30, 30, 29, 30, 87, 30, 740, 91, 30, 87, 31, 31, 91, 31, 25, 31, 32, 32, 31, 32, 318, 32, 33, 33, 32, 33, 318, 33, 41, 41, 33, 41, 526, 41, 6, 6, 26, 26, 287, 26, 287, 26, 34, 34, 95, 34, 26, 34, 26, 95, 34, 37, 37, 26, 37, 739, 37, 26, 738, 37, 26, 31, 737, 26, 99, 38, 38, 32, 38, 99, 38, 736, 58, 38, 735, 43, 43, 58, 43, 41, 43, 103, 526, 43, 58, 107, 103, 26, 39, 39, 107, 39, 543, 39, 44, 44, 58, 44, 733, 44, 45, 45, 44, 45, 731, 45, 111, 543, 45, 46, 46, 111, 46, 114, 46, 729, 125, 46, 114, 128, 120, 125, 39, 120, 128, 39, 132, 39, 137, 120, 39, 132, 39, 137, 306, 39, 306, 145, 535, 39, 42, 42, 145, 42, 149, 42, 331, 728, 331, 149, 42, 45, 42, 159, 161, 727, 165, 42, 159, 161, 46, 165, 170, 726, 42, 159, 165, 170, 165, 174, 179, 183, 192, 165, 174, 179, 183, 192, 217, 221, 165, 225, 229, 217, 221, 233, 225, 229, 535, 725, 233, 42, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 186, 237, 241, 245, 249, 186, 237, 241, 245, 249, 253, 257, 186, 275, 262, 253, 257, 262, 275, 724, 278, 283, 288, 262, 186, 278, 283, 288, 296, 300, 313, 327, 332, 296, 300, 313, 327, 332, 722, 717, 47, 47, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 310, 316, 336, 337, 336, 310, 316, 364, 337, 364, 545, 316, 310, 316, 366, 384, 366, 384, 316, 386, 393, 386, 393, 561, 412, 316, 412, 414, 430, 414, 430, 432, 457, 432, 457, 459, 475, 459, 475, 568, 48, 48, 65, 477, 504, 477, 504, 65, 506, 521, 506, 521, 578, 523, 65, 523, 587, 65, 590, 604, 545, 609, 612, 65, 65, 65, 65, 65, 65, 626, 65, 118, 628, 561, 639, 644, 118, 647, 657, 661, 667, 118, 669, 118, 683, 689, 709, 710, 118, 568, 718, 719, 118, 720, 721, 118, 723, 730, 118, 732, 734, 716, 578, 715, 714, 713, 587, 712, 590, 604, 711, 609, 612, 708, 707, 706, 705, 704, 703, 626, 702, 701, 628, 700, 639, 644, 699, 647, 657, 661, 667, 698, 669, 697, 683, 689, 709, 710, 696, 695, 718, 719, 694, 720, 721, 693, 723, 730, 692, 732, 734, 748, 748, 748, 748, 748, 749, 749, 749, 749, 749, 750, 750, 750, 750, 750, 751, 751, 751, 751, 751, 752, 752, 752, 752, 752, 753, 753, 753, 753, 753, 754, 754, 754, 754, 754, 755, 755, 756, 756, 756, 756, 756, 757, 757, 757, 757, 757, 758, 758, 758, 758, 758, 759, 691, 690, 759, 759, 760, 760, 760, 760, 760, 761, 688, 687, 761, 761, 762, 762, 762, 762, 762, 763, 686, 685, 763, 763, 764, 764, 764, 764, 764, 765, 684, 682, 765, 765, 766, 766, 766, 766, 766, 767, 767, 767, 767, 767, 768, 768, 768, 768, 768, 769, 769, 769, 769, 769, 770, 770, 770, 770, 770, 771, 771, 771, 771, 771, 772, 772, 772, 772, 772, 773, 773, 773, 773, 773, 774, 774, 681, 774, 774, 775, 775, 775, 775, 775, 776, 776, 776, 776, 776, 777, 777, 777, 777, 777, 778, 778, 778, 778, 778, 779, 779, 779, 779, 779, 780, 780, 780, 780, 780, 781, 781, 781, 781, 781, 783, 783, 783, 783, 783, 680, 679, 678, 677, 676, 675, 674, 673, 672, 671, 670, 668, 666, 662, 660, 659, 658, 656, 655, 654, 653, 652, 651, 650, 649, 648, 646, 645, 643, 640, 638, 637, 636, 635, 630, 629, 627, 625, 624, 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, 613, 611, 610, 608, 607, 606, 605, 603, 602, 601, 600, 598, 597, 594, 593, 592, 591, 589, 588, 586, 585, 584, 583, 582, 581, 580, 579, 577, 576, 575, 574, 573, 572, 571, 570, 569, 567, 566, 565, 564, 563, 562, 560, 559, 558, 557, 556, 555, 553, 552, 551, 550, 549, 548, 547, 546, 544, 542, 541, 540, 539, 538, 537, 536, 534, 533, 532, 531, 530, 529, 528, 527, 525, 524, 522, 520, 519, 518, 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, 505, 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, 476, 474, 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, 461, 460, 458, 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, 431, 429, 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, 413, 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, 394, 392, 391, 390, 389, 388, 387, 385, 383, 382, 381, 380, 379, 378, 377, 375, 374, 373, 372, 371, 370, 369, 367, 365, 363, 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, 338, 335, 333, 330, 328, 326, 325, 324, 323, 322, 321, 320, 319, 314, 312, 311, 309, 308, 307, 305, 304, 303, 301, 299, 297, 295, 291, 289, 286, 284, 281, 279, 276, 274, 273, 272, 271, 270, 269, 268, 267, 266, 265, 264, 263, 261, 258, 256, 254, 252, 250, 248, 246, 242, 238, 234, 230, 228, 226, 224, 222, 218, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 203, 202, 201, 200, 198, 197, 193, 191, 190, 189, 188, 184, 181, 176, 172, 169, 168, 163, 160, 157, 155, 154, 153, 152, 151, 148, 147, 140, 139, 134, 130, 127, 124, 123, 122, 121, 119, 116, 113, 112, 110, 109, 106, 105, 101, 97, 93, 89, 86, 85, 82, 81, 77, 73, 72, 71, 70, 68, 67, 63, 60, 55, 51, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747 } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET #line 1 "config.lex" #define INITIAL 0 #line 2 "config.lex" extern "C" { #include #include #include #include #include #include #include #include #include #include #include #include } #include "aclocal.h" #include "caida_t.h" #include #include "CflowdConfig.hh" #include "CflowdRawFlow.hh" #include "CflowdConfigLex.hh" #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif extern int errno; const char *g_configFileName = (const char *)0; yyFlexLexer *lexer = (yyFlexLexer *)0; static long lineNum = 1; int parenstack = 0; int i; void yyerror(const char *msg); static char rcsid[] = "@(#) $Name: cflowd-2-1-b1 $ $Id: config.lex,v 1.17 1999/05/25 10:27:08 dwm Exp $"; void yyperror(char *msg) { fprintf(stderr,"parse error in %s line %ld: %s\n",g_configFileName,lineNum, msg); return; } #define OPTIONS 1 #define LOGFACILITY 2 #define TCPCOLLECTPORT 3 #define PKTBUFSIZE 4 #define RAWFLOWSOCKFILE 5 #define TABLESOCKFILE 6 #define MAPDIR 7 #define FLOWDIR 8 #define FLOWFILELEN 9 #define NUMFLOWFILES 10 #define MINLOGMISSED 11 #define CISCOEXPORTER 12 #define HOST 13 #define IPADDRESS 14 #define IFADDRESSES 15 #define CFDATAPORT 16 #define SNMPCOMM 17 #define LOCALAS 18 #define COLLECT 19 #define COLLECTOR 20 #define COLLECTORHOST 21 #define COLLECTORADDR 22 #define COLLECTORAUTH 23 #define CONFIG_LEX_ERROR 24 #line 957 "lex.yy.cc" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO #define ECHO LexerOutput( yytext, yyleng ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) LexerError( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yyFlexLexer::yylex() #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ yy_current_buffer->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 104 "config.lex" #line 1090 "lex.yy.cc" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = &cin; if ( ! yyout ) yyout = &cout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); yy_match: do { 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; yy_last_accepting_cpos = yy_cp; } 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 >= 748 ) 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] != 1230 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 106 "config.lex" YY_BREAK case 2: YY_RULE_SETUP #line 107 "config.lex" YY_BREAK case 3: YY_RULE_SETUP #line 108 "config.lex" YY_BREAK case 4: YY_RULE_SETUP #line 109 "config.lex" YY_BREAK case 5: YY_RULE_SETUP #line 110 "config.lex" YY_BREAK case 6: YY_RULE_SETUP #line 111 "config.lex" YY_BREAK case 7: YY_RULE_SETUP #line 112 "config.lex" YY_BREAK case 8: YY_RULE_SETUP #line 113 "config.lex" YY_BREAK case 9: YY_RULE_SETUP #line 114 "config.lex" YY_BREAK case 10: YY_RULE_SETUP #line 115 "config.lex" YY_BREAK case 11: YY_RULE_SETUP #line 116 "config.lex" YY_BREAK case 12: YY_RULE_SETUP #line 117 "config.lex" YY_BREAK case 13: YY_RULE_SETUP #line 118 "config.lex" YY_BREAK case 14: YY_RULE_SETUP #line 119 "config.lex" YY_BREAK case 15: YY_RULE_SETUP #line 120 "config.lex" YY_BREAK case 16: YY_RULE_SETUP #line 121 "config.lex" YY_BREAK case 17: YY_RULE_SETUP #line 122 "config.lex" YY_BREAK case 18: YY_RULE_SETUP #line 123 "config.lex" YY_BREAK case 19: YY_RULE_SETUP #line 124 "config.lex" YY_BREAK case 20: YY_RULE_SETUP #line 125 "config.lex" YY_BREAK case 21: YY_RULE_SETUP #line 126 "config.lex" YY_BREAK case 22: YY_RULE_SETUP #line 127 "config.lex" YY_BREAK case 23: YY_RULE_SETUP #line 129 "config.lex" {lineNum++;} YY_BREAK case 24: YY_RULE_SETUP #line 130 "config.lex" {lineNum++;} YY_BREAK case 25: YY_RULE_SETUP #line 131 "config.lex" {lineNum++;} YY_BREAK case 26: YY_RULE_SETUP #line 132 "config.lex" {lineNum++;} YY_BREAK case 27: YY_RULE_SETUP #line 133 "config.lex" {lineNum++;} YY_BREAK case 28: YY_RULE_SETUP #line 134 "config.lex" {lineNum++;} YY_BREAK case 29: YY_RULE_SETUP #line 135 "config.lex" {lineNum++;} YY_BREAK case 30: YY_RULE_SETUP #line 136 "config.lex" {lineNum++;} YY_BREAK case 31: YY_RULE_SETUP #line 137 "config.lex" {lineNum++;} YY_BREAK case 32: YY_RULE_SETUP #line 138 "config.lex" {lineNum++;} YY_BREAK case 33: YY_RULE_SETUP #line 139 "config.lex" {lineNum++;} YY_BREAK case 34: YY_RULE_SETUP #line 140 "config.lex" {lineNum++;} YY_BREAK case 35: YY_RULE_SETUP #line 141 "config.lex" {lineNum++;} YY_BREAK case 36: YY_RULE_SETUP #line 142 "config.lex" {lineNum++;} YY_BREAK case 37: YY_RULE_SETUP #line 143 "config.lex" {lineNum++;} YY_BREAK case 38: YY_RULE_SETUP #line 144 "config.lex" {lineNum++;} YY_BREAK case 39: YY_RULE_SETUP #line 145 "config.lex" {lineNum++;} YY_BREAK case 40: YY_RULE_SETUP #line 146 "config.lex" {lineNum++;} YY_BREAK case 41: YY_RULE_SETUP #line 147 "config.lex" {lineNum++;} YY_BREAK case 42: YY_RULE_SETUP #line 148 "config.lex" {lineNum++;} YY_BREAK case 43: YY_RULE_SETUP #line 149 "config.lex" {lineNum++;} YY_BREAK case 44: YY_RULE_SETUP #line 150 "config.lex" {lineNum++;} YY_BREAK case 45: YY_RULE_SETUP #line 152 "config.lex" {lineNum++;} YY_BREAK case 46: YY_RULE_SETUP #line 153 "config.lex" {lineNum++;} YY_BREAK case 47: YY_RULE_SETUP #line 154 "config.lex" {lineNum++;} YY_BREAK case 48: YY_RULE_SETUP #line 155 "config.lex" {lineNum++;} YY_BREAK case 49: YY_RULE_SETUP #line 156 "config.lex" {lineNum++;} YY_BREAK case 50: YY_RULE_SETUP #line 157 "config.lex" {lineNum++;} YY_BREAK case 51: YY_RULE_SETUP #line 158 "config.lex" {lineNum++;} YY_BREAK case 52: YY_RULE_SETUP #line 159 "config.lex" {lineNum++;} YY_BREAK case 53: YY_RULE_SETUP #line 160 "config.lex" {lineNum++;} YY_BREAK case 54: YY_RULE_SETUP #line 161 "config.lex" {lineNum++;} YY_BREAK case 55: YY_RULE_SETUP #line 162 "config.lex" {lineNum++;} YY_BREAK case 56: YY_RULE_SETUP #line 163 "config.lex" {lineNum++;} YY_BREAK case 57: YY_RULE_SETUP #line 164 "config.lex" {lineNum++;} YY_BREAK case 58: YY_RULE_SETUP #line 165 "config.lex" {lineNum++;} YY_BREAK case 59: YY_RULE_SETUP #line 166 "config.lex" {lineNum++;} YY_BREAK case 60: YY_RULE_SETUP #line 167 "config.lex" {lineNum++;} YY_BREAK case 61: YY_RULE_SETUP #line 168 "config.lex" {lineNum++;} YY_BREAK case 62: YY_RULE_SETUP #line 169 "config.lex" {lineNum++;} YY_BREAK case 63: YY_RULE_SETUP #line 170 "config.lex" {lineNum++;} YY_BREAK case 64: YY_RULE_SETUP #line 171 "config.lex" {lineNum++;} YY_BREAK case 65: YY_RULE_SETUP #line 172 "config.lex" {lineNum++;} YY_BREAK case 66: YY_RULE_SETUP #line 173 "config.lex" {lineNum++;} YY_BREAK case 67: YY_RULE_SETUP #line 174 "config.lex" {lineNum++;} YY_BREAK case 68: YY_RULE_SETUP #line 175 "config.lex" {lineNum++;} YY_BREAK case 69: YY_RULE_SETUP #line 177 "config.lex" {parenstack++;BEGIN(CISCOEXPORTER); return(CISCOEXPORTER);} YY_BREAK case 70: YY_RULE_SETUP #line 179 "config.lex" {parenstack++;BEGIN(OPTIONS); return(OPTIONS);} YY_BREAK case 71: YY_RULE_SETUP #line 181 "config.lex" {BEGIN(LOGFACILITY);} YY_BREAK case 72: YY_RULE_SETUP #line 182 "config.lex" {BEGIN(OPTIONS);return(LOGFACILITY);} YY_BREAK case 73: YY_RULE_SETUP #line 183 "config.lex" {BEGIN(TCPCOLLECTPORT);} YY_BREAK case 74: YY_RULE_SETUP #line 184 "config.lex" {BEGIN(OPTIONS);return(TCPCOLLECTPORT);} YY_BREAK case 75: YY_RULE_SETUP #line 185 "config.lex" {BEGIN(PKTBUFSIZE);} YY_BREAK case 76: YY_RULE_SETUP #line 186 "config.lex" {BEGIN(OPTIONS);return(PKTBUFSIZE);} YY_BREAK case 77: YY_RULE_SETUP #line 187 "config.lex" {BEGIN(RAWFLOWSOCKFILE);} YY_BREAK case 78: YY_RULE_SETUP #line 188 "config.lex" {BEGIN(OPTIONS);return(RAWFLOWSOCKFILE);} YY_BREAK case 79: YY_RULE_SETUP #line 189 "config.lex" {BEGIN(TABLESOCKFILE);} YY_BREAK case 80: YY_RULE_SETUP #line 190 "config.lex" {BEGIN(OPTIONS);return(TABLESOCKFILE);} YY_BREAK case 81: YY_RULE_SETUP #line 191 "config.lex" {BEGIN(MAPDIR);} YY_BREAK case 82: YY_RULE_SETUP #line 192 "config.lex" {BEGIN(OPTIONS);return(MAPDIR);} YY_BREAK case 83: YY_RULE_SETUP #line 193 "config.lex" {BEGIN(FLOWDIR);} YY_BREAK case 84: YY_RULE_SETUP #line 194 "config.lex" {BEGIN(OPTIONS);return(FLOWDIR);} YY_BREAK case 85: YY_RULE_SETUP #line 195 "config.lex" {BEGIN(FLOWFILELEN);} YY_BREAK case 86: YY_RULE_SETUP #line 196 "config.lex" {BEGIN(OPTIONS);return(FLOWFILELEN);} YY_BREAK case 87: YY_RULE_SETUP #line 197 "config.lex" {BEGIN(NUMFLOWFILES);} YY_BREAK case 88: YY_RULE_SETUP #line 198 "config.lex" {BEGIN(OPTIONS);return(NUMFLOWFILES);} YY_BREAK case 89: YY_RULE_SETUP #line 199 "config.lex" {BEGIN(MINLOGMISSED);} YY_BREAK case 90: YY_RULE_SETUP #line 200 "config.lex" {BEGIN(OPTIONS);return(MINLOGMISSED);} YY_BREAK case 91: YY_RULE_SETUP #line 201 "config.lex" {parenstack--;BEGIN(INITIAL);} YY_BREAK case 92: YY_RULE_SETUP #line 202 "config.lex" {parenstack++;BEGIN(COLLECTOR);} YY_BREAK case 93: YY_RULE_SETUP #line 203 "config.lex" {BEGIN(COLLECTORHOST);} YY_BREAK case 94: YY_RULE_SETUP #line 204 "config.lex" {BEGIN(COLLECTOR);return(COLLECTORHOST);} YY_BREAK case 95: YY_RULE_SETUP #line 205 "config.lex" {parenstack++;BEGIN(COLLECTORADDR);} YY_BREAK case 96: YY_RULE_SETUP #line 206 "config.lex" {return(COLLECTORADDR);} YY_BREAK case 97: YY_RULE_SETUP #line 207 "config.lex" {parenstack--;BEGIN(COLLECTOR);} YY_BREAK case 98: YY_RULE_SETUP #line 208 "config.lex" {BEGIN(COLLECTORAUTH);} YY_BREAK case 99: YY_RULE_SETUP #line 209 "config.lex" {BEGIN(COLLECTOR);return(COLLECTORAUTH);} YY_BREAK case 100: YY_RULE_SETUP #line 210 "config.lex" {parenstack--;BEGIN(INITIAL);} YY_BREAK case 101: YY_RULE_SETUP #line 211 "config.lex" {BEGIN(IPADDRESS);} YY_BREAK case 102: YY_RULE_SETUP #line 212 "config.lex" {BEGIN(CISCOEXPORTER);return(IPADDRESS);} YY_BREAK case 103: YY_RULE_SETUP #line 213 "config.lex" {parenstack++;BEGIN(IFADDRESSES);} YY_BREAK case 104: YY_RULE_SETUP #line 214 "config.lex" {return(IFADDRESSES);} YY_BREAK case 105: YY_RULE_SETUP #line 215 "config.lex" {parenstack--;BEGIN(CISCOEXPORTER);} YY_BREAK case 106: YY_RULE_SETUP #line 216 "config.lex" {BEGIN(CFDATAPORT);} YY_BREAK case 107: YY_RULE_SETUP #line 217 "config.lex" {BEGIN(CISCOEXPORTER);return(CFDATAPORT);} YY_BREAK case 108: YY_RULE_SETUP #line 218 "config.lex" {BEGIN(SNMPCOMM);} YY_BREAK case 109: YY_RULE_SETUP #line 219 "config.lex" {return(SNMPCOMM);} YY_BREAK case 110: YY_RULE_SETUP #line 220 "config.lex" {BEGIN(CISCOEXPORTER);} YY_BREAK case 111: YY_RULE_SETUP #line 221 "config.lex" {BEGIN(LOCALAS);} YY_BREAK case 112: YY_RULE_SETUP #line 222 "config.lex" {BEGIN(CISCOEXPORTER);return(LOCALAS);} YY_BREAK case 113: YY_RULE_SETUP #line 223 "config.lex" {parenstack++;BEGIN(COLLECT);} YY_BREAK case 114: YY_RULE_SETUP #line 224 "config.lex" {return(COLLECT);} YY_BREAK case 115: YY_RULE_SETUP #line 225 "config.lex" {return(COLLECT);} YY_BREAK case 116: YY_RULE_SETUP #line 226 "config.lex" {return(COLLECT);} YY_BREAK case 117: YY_RULE_SETUP #line 227 "config.lex" {return(COLLECT);} YY_BREAK case 118: YY_RULE_SETUP #line 228 "config.lex" {return(COLLECT);} YY_BREAK case 119: YY_RULE_SETUP #line 229 "config.lex" {return(COLLECT);} YY_BREAK case 120: YY_RULE_SETUP #line 230 "config.lex" {return(COLLECT);} YY_BREAK case 121: YY_RULE_SETUP #line 231 "config.lex" {return(COLLECT);} YY_BREAK case 122: YY_RULE_SETUP #line 232 "config.lex" {return(COLLECT);} YY_BREAK case 123: YY_RULE_SETUP #line 233 "config.lex" {parenstack--;BEGIN(CISCOEXPORTER);} YY_BREAK case 124: YY_RULE_SETUP #line 234 "config.lex" {parenstack--;BEGIN(INITIAL);} YY_BREAK case 125: YY_RULE_SETUP #line 235 "config.lex" {yyperror("found CISCOEXPORTER while " "in CISCOEXPORTER stanza. " "Missing right paren?"); return(CONFIG_LEX_ERROR);} YY_BREAK case 126: YY_RULE_SETUP #line 239 "config.lex" {yyperror("found CISCOEXPORTER keyword " "in COLLECT stanza. " "missing right paren?"); return(CONFIG_LEX_ERROR);} YY_BREAK case 127: YY_RULE_SETUP #line 243 "config.lex" {yyperror("found OPTIONS keyword while " "in CISCOEXPORTER stanza."); return(CONFIG_LEX_ERROR);} YY_BREAK case 128: YY_RULE_SETUP #line 246 "config.lex" {yyperror("found COLLECTOR while in " "CISCOEXPORTER stanza."); return(CONFIG_LEX_ERROR);} YY_BREAK case 129: YY_RULE_SETUP #line 249 "config.lex" {yyperror("found CISCOEXPORTER while " "in OPTIONS stanza."); return(CONFIG_LEX_ERROR);} YY_BREAK case 130: YY_RULE_SETUP #line 252 "config.lex" {yyperror("found COLLECTOR while in " "OPTIONS stanza."); return(CONFIG_LEX_ERROR);} YY_BREAK case 131: YY_RULE_SETUP #line 255 "config.lex" {yyperror("found OPTIONS keyword while " "in OPTIONS stanza."); return(CONFIG_LEX_ERROR);} YY_BREAK case 132: YY_RULE_SETUP #line 258 "config.lex" {yyperror("found CISCOEXPORTER while in " "COLLECTOR stanza."); return(CONFIG_LEX_ERROR);} YY_BREAK case 133: YY_RULE_SETUP #line 261 "config.lex" {yyperror("found OPTIONS keyword while " "in COLLECTOR stanza."); return(CONFIG_LEX_ERROR);} YY_BREAK case 134: YY_RULE_SETUP #line 264 "config.lex" {yyperror("found COLLECTOR while in " "COLLECTOR stanza."); return(CONFIG_LEX_ERROR);} YY_BREAK case 135: YY_RULE_SETUP #line 268 "config.lex" YY_BREAK case 136: YY_RULE_SETUP #line 269 "config.lex" {parenstack++;} YY_BREAK case 137: YY_RULE_SETUP #line 270 "config.lex" {parenstack--;} YY_BREAK case 138: YY_RULE_SETUP #line 271 "config.lex" {lineNum++;} YY_BREAK case 139: YY_RULE_SETUP #line 273 "config.lex" ECHO; YY_BREAK #line 1893 "lex.yy.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(OPTIONS): case YY_STATE_EOF(LOGFACILITY): case YY_STATE_EOF(TCPCOLLECTPORT): case YY_STATE_EOF(PKTBUFSIZE): case YY_STATE_EOF(RAWFLOWSOCKFILE): case YY_STATE_EOF(TABLESOCKFILE): case YY_STATE_EOF(MAPDIR): case YY_STATE_EOF(FLOWDIR): case YY_STATE_EOF(FLOWFILELEN): case YY_STATE_EOF(NUMFLOWFILES): case YY_STATE_EOF(MINLOGMISSED): case YY_STATE_EOF(CISCOEXPORTER): case YY_STATE_EOF(HOST): case YY_STATE_EOF(IPADDRESS): case YY_STATE_EOF(IFADDRESSES): case YY_STATE_EOF(CFDATAPORT): case YY_STATE_EOF(SNMPCOMM): case YY_STATE_EOF(LOCALAS): case YY_STATE_EOF(COLLECT): case YY_STATE_EOF(COLLECTOR): case YY_STATE_EOF(COLLECTORHOST): case YY_STATE_EOF(COLLECTORADDR): case YY_STATE_EOF(COLLECTORAUTH): case YY_STATE_EOF(CONFIG_LEX_ERROR): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout ) { yyin = arg_yyin; yyout = arg_yyout; yy_c_buf_p = 0; yy_init = 1; yy_start = 0; yy_flex_debug = 0; yylineno = 1; // this will only get updated if %option yylineno yy_did_buffer_switch_on_eof = 0; yy_looking_for_trail_begin = 0; yy_more_flag = 0; yy_more_len = 0; yy_more_offset = yy_prev_more_offset = 0; yy_start_stack_ptr = yy_start_stack_depth = 0; yy_start_stack = 0; yy_current_buffer = 0; #ifdef YY_USES_REJECT yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2]; #else yy_state_buf = 0; #endif } yyFlexLexer::~yyFlexLexer() { delete yy_state_buf; yy_delete_buffer( yy_current_buffer ); } void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out ) { if ( new_in ) { yy_delete_buffer( yy_current_buffer ); yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); } if ( new_out ) yyout = new_out; } #ifdef YY_INTERACTIVE int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) #else int yyFlexLexer::LexerInput( char* buf, int max_size ) #endif { if ( yyin->eof() || yyin->fail() ) return 0; #ifdef YY_INTERACTIVE yyin->get( buf[0] ); if ( yyin->eof() ) return 0; if ( yyin->bad() ) return -1; return 1; #else (void) yyin->read( buf, max_size ); if ( yyin->bad() ) return -1; else return yyin->gcount(); #endif } void yyFlexLexer::LexerOutput( const char* buf, int size ) { (void) yyout->write( buf, size ); } /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ int yyFlexLexer::yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ yy_state_type yyFlexLexer::yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } 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 >= 748 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } 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 >= 748 ) 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 == 747); return yy_is_jam ? 0 : yy_current_state; } void yyFlexLexer::yyunput( int c, register char* yy_bp ) { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } int yyFlexLexer::yyinput() { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; yy_current_buffer->yy_at_bol = (c == '\n'); return c; } void yyFlexLexer::yyrestart( istream* input_file ) { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } void yyFlexLexer::yy_load_buffer_state() { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } extern "C" int isatty YY_PROTO(( int )); void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file ) { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; b->yy_is_interactive = 0; } void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #endif #ifndef YY_NO_SCAN_STRING #endif #ifndef YY_NO_SCAN_BYTES #endif #ifndef YY_NO_PUSH_STATE void yyFlexLexer::yy_push_state( int new_state ) { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE void yyFlexLexer::yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE int yyFlexLexer::yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif void yyFlexLexer::LexerError( yyconst char msg[] ) { cerr << msg << '\n'; exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 273 "config.lex" void yyerror(const char *msg) { syslog(LOG_ERR,"[E] syntax error in %s at line %d: %s %s", g_configFileName,lineNum,msg,lexer->YYText()); } #ifndef HAVE_STRCASECMP #define HAVE_STRCASECMP static char charmap[] = { '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', '\300', '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\333', '\334', '\335', '\336', '\337', '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', }; int strcasecmp(register char *s1, register char *s2) { register char *cm = charmap; while (cm[*s1] == cm[*s2++]) if (*s1++ == '\0') return(0); return(cm[*s1] - cm[*--s2]); } int strncasecmp(register char *s1, register char *s2, size_t n) { register char *cm = charmap; while (--n >= 0 && cm[*s1] == cm[*s2++]) if (*s1++ == '\0') return(0); return(n < 0 ? 0 : cm[*s1] - cm[*--s2]); } #endif /*---------------------------------------------------------------------------* * int SyslogFacility(const char *facilityname) * *...........................................................................* * * * * * * * * *---------------------------------------------------------------------------*/ int SyslogFacility(const char *facilityname) { if (!strcasecmp(facilityname,"daemon")) return(LOG_DAEMON); if (!strcasecmp(facilityname,"local0")) return(LOG_LOCAL0); if (!strcasecmp(facilityname,"local1")) return(LOG_LOCAL1); if (!strcasecmp(facilityname,"local2")) return(LOG_LOCAL2); if (!strcasecmp(facilityname,"local3")) return(LOG_LOCAL3); if (!strcasecmp(facilityname,"local4")) return(LOG_LOCAL4); if (!strcasecmp(facilityname,"local5")) return(LOG_LOCAL5); if (!strcasecmp(facilityname,"local6")) return(LOG_LOCAL6); if (!strcasecmp(facilityname,"local7")) return(LOG_LOCAL7); return(LOG_LOCAL6); } /*---------------------------------------------------------------------------* * uint16_t CollectionType(const char *colltype) * *...........................................................................* * * * * * * * * *---------------------------------------------------------------------------*/ uint16_t CollectionType(const char *colltype) { if (!strcasecmp(colltype,"protocol")) return(CflowdCisco::k_cflowdProtocolTableMask); if (!strcasecmp(colltype,"port")) return(CflowdCisco::k_cflowdPortTableMask); if (!strcasecmp(colltype,"netmatrix")) return(CflowdCisco::k_cflowdNetMatrixMask); if (!strcasecmp(colltype,"asmatrix")) return(CflowdCisco::k_cflowdAsMatrixMask); if (!strncasecmp(colltype,"flows",5)) return(CflowdCisco::k_cflowdRawFlowMask); if (!strcasecmp(colltype,"portmatrix")) return(CflowdCisco::k_cflowdPortMatrixMask); if (!strcasecmp(colltype,"ifmatrix")) return(CflowdCisco::k_cflowdInterfaceMatrixMask); if (!strcasecmp(colltype,"nexthop")) return(CflowdCisco::k_cflowdNextHopTableMask); if (!strcasecmp(colltype,"tos")) return(CflowdCisco::k_cflowdTosTableMask); return(0); } /*---------------------------------------------------------------------------* * int CollectorAuthType(const char *authtypestr) * *...........................................................................* * * * * * * * * *---------------------------------------------------------------------------*/ int CollectorAuthType(const char *authtypestr) { if (strcasecmp(authtypestr,"krb4") == 0) return(1); if (strcasecmp(authtypestr,"krb5") == 0) return(2); if (strcasecmp(authtypestr,"passwd") == 0) return(3); return(0); } /*-------------------------------------------------------------------------* * int LoadConfigFile(const char *configFileName, * * CflowdConfig & cflowdConfig) * *.........................................................................* * * *-------------------------------------------------------------------------*/ int LoadConfigFile(const char *configFileName, CflowdConfig & cflowdConfig) { int rc; uint16_t indexmask = 0; CflowdCisco *newCisco = (CflowdCisco *)NULL; CflowdCollector *newCollector = (CflowdCollector *)NULL; int foundport; uint32_t IPaddr; ifstream *configStream; CflowdFlowPortList::iterator flowPortIter; CflowdFlowPort newFlowPort; assert(configFileName != NULL); g_configFileName = configFileName; configStream = new ifstream(configFileName); if (! configStream || ! *configStream) { return(-1); } lexer = new yyFlexLexer(configStream,0); assert(lexer != (yyFlexLexer *)0); while ((rc = lexer->yylex()) != 0) { switch (rc) { case OPTIONS: break; case LOGFACILITY: cflowdConfig.LogFacility(SyslogFacility(lexer->YYText())); break; case TCPCOLLECTPORT: cflowdConfig.TcpCollectPort(atoi(lexer->YYText())); break; case PKTBUFSIZE: cflowdConfig.PacketBufSize(atoi(lexer->YYText())); break; case RAWFLOWSOCKFILE: cflowdConfig.RawFlowSockFile(lexer->YYText()); break; case TABLESOCKFILE: cflowdConfig.TableSockFile(lexer->YYText()); break; case MAPDIR: cflowdConfig.MapDirectory(lexer->YYText()); break; case FLOWDIR: cflowdConfig.FlowDirectory(lexer->YYText()); break; case FLOWFILELEN: cflowdConfig.FlowFileLength(atol(lexer->YYText())); break; case NUMFLOWFILES: cflowdConfig.NumFlowFiles(atoi(lexer->YYText())); break; case MINLOGMISSED: cflowdConfig.MinLogMissed(atoi(lexer->YYText())); break; case COLLECTORHOST: IPaddr = inet_addr(lexer->YYText()); if (IPaddr == 0xffffffff) { yyperror("bad IP address"); exit(CONFIG_LEX_ERROR); } else { newCollector = new CflowdCollector(); assert(newCollector != (CflowdCollector *)0); newCollector->IpAddress(IPaddr); cflowdConfig.CollectorMap()[IPaddr] = newCollector; } break; case COLLECTORADDR: IPaddr = inet_addr(lexer->YYText()); if (IPaddr == 0xffffffff) { yyperror("bad IP address"); exit(CONFIG_LEX_ERROR); } else { cflowdConfig.CollectorMap()[IPaddr] = newCollector; } break; case COLLECTORAUTH: newCollector->AuthType(CollectorAuthType(lexer->YYText())); break; case CISCOEXPORTER: newCisco = new CflowdCisco(); assert(newCisco != (CflowdCisco *)0); newCisco->MissedFlowsThreshold(cflowdConfig.MinLogMissed()); break; case IPADDRESS: IPaddr = inet_addr(lexer->YYText()); if (IPaddr == 0xffffffff) { yyperror("bad IP address"); exit(CONFIG_LEX_ERROR); } else { newCisco->IpAddress(IPaddr); cflowdConfig.CiscoMap()[IPaddr] = newCisco; } break; case IFADDRESSES: IPaddr = inet_addr(lexer->YYText()); if (IPaddr == 0xffffffff) { yyperror("bad IP address"); exit(CONFIG_LEX_ERROR); } else { cflowdConfig.CiscoMap()[IPaddr] = newCisco; } break; case CFDATAPORT: newCisco->FlowPort(atoi(lexer->YYText())); foundport = FALSE; for (flowPortIter = cflowdConfig.FlowPortList().begin(); flowPortIter != cflowdConfig.FlowPortList().end(); flowPortIter++) { if ((*flowPortIter).portnum == newCisco->FlowPort()) foundport = TRUE; } if (!foundport) { newFlowPort.portnum = newCisco->FlowPort(); cflowdConfig.FlowPortList().push_back(newFlowPort); } break; case SNMPCOMM: newCisco->SnmpCommunity(lexer->YYText()); break; case LOCALAS: newCisco->LocalAS((uint16_t)(atoi(lexer->YYText()))); break; case COLLECT: indexmask = CollectionType(lexer->YYText()); newCisco->TableIndex(newCisco->TableIndex() | indexmask); break; case CONFIG_LEX_ERROR: exit(CONFIG_LEX_ERROR); break; default: break; } } delete(lexer); delete(configStream); if (parenstack != 0) { if (parenstack > 0) yyperror("missing right paren?"); else yyperror("missing left paren?"); fprintf(stderr,"parenstack: %d\n",parenstack); } return(0); }