Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

parser.h

Go to the documentation of this file.
00001 /*             
00002 ** Copyright (C) 1998-2002 Martin Roesch <roesch@sourcefire.com>
00003 ** Copyright (C) 2000-2001 Andrew R. Baker <andrewb@uab.edu>
00004 **             
00005 ** This program is free software; you can redistribute it and/or modify
00006 ** it under the terms of the GNU General Public License as published by
00007 ** the Free Software Foundation; either version 2 of the License, or
00008 ** (at your option) any later version.
00009 **
00010 ** This program is distributed in the hope that it will be useful,
00011 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 ** GNU General Public License for more details.
00014 **     
00015 ** You should have received a copy of the GNU General Public License
00016 ** along with this program; if not, write to the Free Software
00017 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */  
00019 
00020 /* $Id$ */
00021 #ifndef __PARSER_H__
00022 #define __PARSER_H__
00023 
00024 
00025 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #endif
00028 
00029 #include "rules.h"
00030 #include "decode.h"
00031 
00032 #include <stdio.h>
00033 
00034 /* parsing functions */ 
00035 #define ONE_CHECK(_onevar,xxx)                                      \
00036    (_onevar)++;                                                     \
00037    if ((_onevar) > 1)                                               \
00038    {                                                                \
00039        FatalError("%s(%d) => Only one '%s' option per rule\n",\
00040                        file_name, file_line, xxx);                  \
00041    }
00042 
00043 /* exported values */
00044 extern char *file_name;
00045 extern int file_line;
00046 
00047 /* rule setup funcs */
00048 void ParseRulesFile(char *, int);
00049 int ContinuationCheck(char *);
00050 void ParseRule(FILE*, char *, int);
00051 void ParsePreprocessor(char *);
00052 void ParseOutputPlugin(char *);
00053 void ParseRuleOptions(char *, int, int);
00054 void ParseMessage(char *);
00055 void ParseLogto(char *);
00056 void DumpRuleChains();
00057 struct VarEntry *VarDefine(char *, char *);
00058 void VarDelete(char *);
00059 void IntegrityCheckRules();
00060 void ParseListFile(char *, char *);
00061 void LinkDynamicRules();
00062 void ParseActivatedBy(char *);
00063 void ParseActivates(char *);
00064 void ParseCount(char *);
00065 char *VarSearch(char *name);
00066 /* XXX: implemented in detect.c */
00067 void CreateDefaultRules();
00068 void OrderRuleLists(char *);
00069 void printRuleOrder();
00070 
00071 
00072 
00073 int CheckRule(char *);
00074 int RuleType(char *);
00075 int WhichProto(char *);
00076 #if 0 /* Relocated to parser/IpAddrSet.h */
00077 int ParseIP(char *, IpAddrSet *);
00078 #endif /* Relocated to parser/IpAddrSet.h */
00079 int ParsePort(char *, u_short *,  u_short *, char *, int *);
00080 int ConvPort(char *, char *);
00081 
00082 char *VarGet(char *);
00083 char *ExpandVars(char *);
00084 char *CreateRule(char *, char *, char *);
00085 
00086 struct VarEntry *VarAlloc();
00087 
00088 /* XXX: Defined in detect.c */
00089 ListHead *CreateRuleType(char *, int, int, ListHead *);
00090 
00091 void ProcessAlertFileOption(char *);
00092 char *ProcessFileOption(char *);
00093 void ParseConfig(char *);
00094 void ParseRuleTypeDeclaration(FILE*, char *);
00095 /*void ParseClassificationConfig(char *); */
00096 char *ReadLine(FILE *);
00097 int checkKeyowrd(char *);
00098 
00099 #endif /* __PARSER_H__ */
00100 

Generated on Sun May 14 14:51:14 2006 by  doxygen 1.4.2