/* A Bison parser, made from config.y
by GNU Bison version 1.25
*/
#define YYBISON 1 /* Identify Bison output. */
#define NUMBER 258
#define STRING 259
#define IPADDRESS 260
#define STAT 261
#define HOST 262
#define NET 263
#define NETMASK 264
#define STREAM 265
#define IS 266
#define FROM 267
#define TO 268
#define ALL 269
#define EXCEPT 270
#define ITSELF 271
#define DEFINE 272
#define SLICE 273
#define OPTION 274
#define CHANNEL 275
#define K_FILE 276
#define K_SYSLOG 277
#define UDP 278
#define FACILITY 279
#define PRIORITY 280
#define DUMPFILE 281
#define ABSOLUTE 282
#define BOGUS 283
#define EOL 284
#line 18 "config.y"
#if defined(HAVE_CONFIG_H)
# include <config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
#include <varargs.h>
#include <netdb.h>
#include <syslog.h>
#include <string.h>
#include <ipacct.h>
#define YYDEBUG 1
#define PARSER_BUFSIZE 128
/* Note: currently these should be the same: */
#define MAX_STR_LEN PARSER_BUFSIZE
#define OPT_EXACT 1
struct keyword {
char *name;
int val;
};
struct keyword options[] = {
"exact", OPT_EXACT,
NULL, 0
};
int get_mask_by_length(int len, IPADDR *);
int read_address(char **, IPADDR *);
static int xlat_keyword(struct keyword *kw, char *str);
static void yyerrsync();
static void register_address(char *name, IPADDR addr, UINT4 netmask);
#line 58 "config.y"
typedef union {
long number;
char string[MAX_STR_LEN];
UINT4 ipaddr;
network_t network;
list_t list;
stream_t stream;
} YYSTYPE;
#ifndef YYDEBUG
#define YYDEBUG 1
#endif
#include <stdio.h>
#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif
#define YYFINAL 81
#define YYFLAG -32768
#define YYNTBASE 33
#define YYTRANSLATE(x) ((unsigned)(x) <= 284 ? yytranslate[x] : 57)
static const char yytranslate[] = { 0,
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, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 31, 32, 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, 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, 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, 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, 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, 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, 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, 27, 28, 29
};
#if YYDEBUG != 0
static const short yyprhs[] = { 0,
0, 2, 4, 7, 9, 11, 13, 15, 17, 19,
22, 25, 28, 31, 33, 37, 43, 47, 53, 58,
60, 62, 64, 66, 67, 69, 71, 73, 75, 77,
80, 83, 86, 90, 94, 99, 104, 106, 107, 109,
111, 114, 117, 122, 124, 126, 128, 131, 133, 135,
137, 139
};
static const short yyrhs[] = { 34,
0, 35, 0, 34, 35, 0, 36, 0, 45, 0,
46, 0, 48, 0, 56, 0, 1, 0, 6, 37,
0, 18, 38, 0, 19, 4, 0, 20, 39, 0,
3, 0, 3, 30, 3, 0, 3, 30, 3, 30,
3, 0, 21, 4, 42, 0, 22, 40, 31, 41,
42, 0, 23, 43, 44, 42, 0, 3, 0, 24,
0, 3, 0, 25, 0, 0, 27, 0, 5, 0,
4, 0, 3, 0, 4, 0, 26, 4, 0, 7,
5, 0, 8, 47, 0, 5, 32, 3, 0, 5,
9, 5, 0, 10, 49, 50, 55, 0, 10, 49,
50, 51, 0, 4, 0, 0, 11, 0, 52, 0,
51, 52, 0, 53, 54, 0, 53, 54, 15, 54,
0, 12, 0, 13, 0, 55, 0, 54, 55, 0,
5, 0, 47, 0, 14, 0, 16, 0, 17, 49,
54, 0
};
#endif
#if YYDEBUG != 0
static const short yyrline[] = { 0,
96, 99, 100, 103, 104, 105, 106, 107, 108, 116,
119, 123, 133, 136, 137, 141, 147, 152, 157, 164,
165, 168, 169, 172, 176, 182, 183, 194, 198, 212,
219, 225, 233, 238, 245, 250, 256, 259, 260, 263,
268, 275, 281, 290, 294, 300, 305, 312, 317, 318,
323, 331
};
#endif
#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
static const char * const yytname[] = { "$","error","$undefined.","NUMBER",
"STRING","IPADDRESS","STAT","HOST","NET","NETMASK","STREAM","IS","FROM","TO",
"ALL","EXCEPT","ITSELF","DEFINE","SLICE","OPTION","CHANNEL","K_FILE","K_SYSLOG",
"UDP","FACILITY","PRIORITY","DUMPFILE","ABSOLUTE","BOGUS","EOL","':'","'.'",
"'/'","input","list","stmt","stat_stmt","stat_cmd","timeval","channel","facility",
"priority","channel_opts","host","port","dump_stmt","host_stmt","network","stream_stmt",
"strnam","is","stream_decl_list","stream_decl","flow_dir","addr_list","address",
"defn_stmt", NULL
};
#endif
static const short yyr1[] = { 0,
33, 34, 34, 35, 35, 35, 35, 35, 35, 36,
37, 37, 37, 38, 38, 38, 39, 39, 39, 40,
40, 41, 41, 42, 42, 43, 43, 44, 44, 45,
46, 46, 47, 47, 48, 48, 49, 50, 50, 51,
51, 52, 52, 53, 53, 54, 54, 55, 55, 55,
55, 56
};
static const short yyr2[] = { 0,
1, 1, 2, 1, 1, 1, 1, 1, 1, 2,
2, 2, 2, 1, 3, 5, 3, 5, 4, 1,
1, 1, 1, 0, 1, 1, 1, 1, 1, 2,
2, 2, 3, 3, 4, 4, 1, 0, 1, 1,
2, 2, 4, 1, 1, 1, 2, 1, 1, 1,
1, 3
};
static const short yydefact[] = { 0,
9, 0, 0, 0, 0, 0, 0, 0, 2, 4,
5, 6, 7, 8, 0, 0, 0, 10, 31, 0,
32, 37, 38, 0, 30, 3, 14, 11, 12, 0,
0, 0, 13, 0, 0, 39, 0, 48, 50, 51,
49, 52, 46, 0, 24, 20, 21, 0, 27, 26,
0, 34, 33, 44, 45, 36, 40, 0, 35, 47,
15, 25, 17, 0, 28, 29, 24, 41, 42, 0,
22, 23, 24, 19, 0, 16, 18, 43, 0, 0,
0
};
static const short yydefgoto[] = { 79,
8, 9, 10, 18, 28, 33, 48, 73, 63, 51,
67, 11, 12, 41, 13, 23, 37, 56, 57, 58,
42, 43, 14
};
static const short yypact[] = { 9,
-32768, 4, 7, 23, 29, 29, 33, 1,-32768,-32768,
-32768,-32768,-32768,-32768, 41, 49, 27,-32768,-32768, -3,
-32768,-32768, 19, 38,-32768,-32768, 21,-32768,-32768, 57,
10, 51,-32768, 58, 59,-32768, 26, -3,-32768,-32768,
-32768, 38,-32768, 61, 39,-32768,-32768, 34,-32768,-32768,
54,-32768,-32768,-32768,-32768, 47,-32768, 38,-32768,-32768,
37,-32768,-32768, 0,-32768,-32768, 39,-32768, 31, 65,
-32768,-32768, 39,-32768, 38,-32768,-32768, 38, 69, 70,
-32768
};
static const short yypgoto[] = {-32768,
-32768, 63,-32768,-32768,-32768,-32768,-32768,-32768, -53,-32768,
-32768,-32768,-32768, 68,-32768, 67,-32768,-32768, 18,-32768,
-54, -37,-32768
};
#define YYLAST 74
static const short yytable[] = { 59,
-1, 1, 71, 69, 60, 34, 2, 3, 4, 1,
5, 19, 46, 74, 2, 3, 4, 6, 5, 77,
78, 15, 16, 17, 72, 6, 7, 20, 35, 36,
38, 60, 22, 47, 7, 38, 25, 54, 55, 39,
60, 40, 38, 27, 39, 75, 40, 30, 31, 32,
44, 39, 29, 40, 49, 50, 65, 66, 54, 55,
45, 53, 52, 61, 64, 62, 70, 76, 80, 81,
26, 21, 24, 68
};
static const short yycheck[] = { 37,
0, 1, 3, 58, 42, 9, 6, 7, 8, 1,
10, 5, 3, 67, 6, 7, 8, 17, 10, 73,
75, 18, 19, 20, 25, 17, 26, 5, 32, 11,
5, 69, 4, 24, 26, 5, 4, 12, 13, 14,
78, 16, 5, 3, 14, 15, 16, 21, 22, 23,
30, 14, 4, 16, 4, 5, 3, 4, 12, 13,
4, 3, 5, 3, 31, 27, 30, 3, 0, 0,
8, 4, 6, 56
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Fo
|