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

debug.h

Go to the documentation of this file.
00001 /* $Id$ */
00002 /*
00003 ** Copyright (C) 1998-2002 Martin Roesch <roesch@sourcefire.com>
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 
00021 #ifndef DEBUG_H
00022 #define DEBUG_H
00023 
00024 #define DEBUG_VARIABLE "SNORT_DEBUG"
00025 
00026 #define DEBUG_ALL             0xffffffff
00027 #define DEBUG_INIT            0x00000001  /* 1 */
00028 #define DEBUG_CONFIGRULES     0x00000002  /* 2 */
00029 #define DEBUG_PLUGIN          0x00000004  /* 4 */
00030 #define DEBUG_DATALINK        0x00000008  /* 8 */
00031 #define DEBUG_IP              0x00000010  /* 16 */
00032 #define DEBUG_TCPUDP          0x00000020  /* 32 */
00033 #define DEBUG_DECODE          0x00000040  /* 64 */
00034 #define DEBUG_LOG             0x00000080  /* 128 */
00035 #define DEBUG_MSTRING         0x00000100  /* 256 */
00036 #define DEBUG_PARSER          0x00000200  /* 512 */
00037 #define DEBUG_PLUGBASE        0x00000400  /* 1024 */
00038 #define DEBUG_RULES           0x00000800  /* 2048 */
00039 #define DEBUG_FLOW            0x00001000  /* 4096 */
00040 #define DEBUG_STREAM          0x00002000  /* 8192 */
00041 #define DEBUG_PATTERN_MATCH   0x00004000  /* 16384 */
00042 #define DEBUG_DETECT          0x00008000  /* 32768 */
00043 #define DEBUG_CONVERSATION    0x00010000  /* 65536 */
00044 #define DEBUG_FRAG            0x00020000  /* 131072 */
00045 #define DEBUG_HTTP_DECODE     0x00040000  /* 262144 */
00046 #define DEBUG_PORTSCAN2       0x00080000  /* 524288 / (+ conv2 ) 589824 */
00047 #define DEBUG_RPC             0x00100000  /* 1048576 */
00048 #define DEBUG_FLOWSYS         0x00200000  /* 2097152 */
00049 #define DEBUG_HTTPINSPECT     0x00400000  /* 4194304 */
00050 #define DEBUG_STREAM_STATE    0x00800000  /* 8388608 */
00051 #define DEBUG_ASN1            0x01000000  /* 16777216 */
00052 #define DEBUG_STICKYDROP      0x02000000  /* 33554432 */
00053 #define DEBUG_CLAMAV          0x04000000  /* 67108864 */
00054 #define DEBUG_BAITANDSWITCH   0x08000000  /* 134217728 */
00055 
00056 #ifdef DEBUG
00057 
00058     extern char *DebugMessageFile;
00059     extern int DebugMessageLine;
00060 
00061     #define    DebugMessage    DebugMessageFile = __FILE__; DebugMessageLine = __LINE__; DebugMessageFunc
00062 
00063     void DebugMessageFunc(int , char *, ...);
00064 
00065     int GetDebugLevel (void);
00066     int DebugThis(int level);
00067 #else 
00068 
00069 #ifdef WIN32
00070 /* Visual C++ uses the keyword "__inline" rather than "__inline__" */
00071          #define __inline__ __inline
00072 #endif
00073 
00074 #endif /* DEBUG */
00075 
00076 
00077 #ifdef DEBUG
00078 #define DEBUG_WRAP(code) code
00079 void DebugMessageFunc(int dbg,char *fmt, ...);
00080 #else
00081 #define DEBUG_WRAP(code)
00082 /* I would use DebugMessage(dbt,fmt...) but that only works with GCC */
00083 
00084 #endif
00085 
00086 #endif /* DEBUG_H */

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