/* * Paglo Crawler * Copyright (C) 2006-2008 Paglo Labs Inc. All rights reserved. * www.paglo.com * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef DebugH #define DebugH #include #ifdef WIN32 #define __func__ __FUNC__ #endif #define DEBUG_PACKET 0x0001 /* 1 */ #define DEBUG_PACKETQUEUE 0x0002 /* 2 */ #define DEBUG_SNIFFTHREAD 0x0004 /* 4 */ #define DEBUG_ANALYSISMANAGER 0x0008 /* 8 */ #define DEBUG_ANALYZERTHREAD 0x0010 /* 16 */ #define DEBUG_NETWORKDEVICE 0x0020 /* 32 */ #define DEBUG_DEVICEMANAGER 0x0040 /* 64 */ #define DEBUG_AGENTCONFIG 0x0080 /* 128 */ #define DEBUG_EVENTS 0x0100 /* 256 */ #define DEBUG_EVENTQUEUE 0x0200 /* 512 */ #define DEBUG_FINGERPRINT 0x0400 /* 1024 */ #define DEBUG_FINGERPRINTMGR 0x0800 /* 2048 */ #define DEBUG_PARSER 0x1000 /* 4096 */ #define DEBUG_SIGNATURE 0x2000 /* 8192 */ #define DEBUG_SCANTHREAD 0x4000 /* 16384 */ #define DEBUG_SCANAGENT 0x8000 /* 32768 */ #define DEBUG_ROUTETABLE 0x10000 /* 65536 */ #define DEBUG_ARPTABLE 0x20000 /* 131072 */ #define DEBUG_SNMPSWITCH 0x40000 /* 262144 */ #define DEBUG_CLASSIFICATION 0x80000 #define DEBUG_SCANSCHEDULE 0x100000 #define DEBUG_SCHEDULERTHREAD 0x200000 #define DEBUG_SCANWMI 0x400000 #define DEBUG_SCANDHCP 0x800000 #define DEBUG_SFLOW 0x1000000 #define DEBUG_SERVERCMD 0x2000000 #define DEBUG_SUBMITCACHE 0x4000000 #define DEBUG_COMMTHREAD 0x8000000 #define DEBUG_PLUGINS 0x10000000 #ifdef DebugC //unsigned int _DebugEnv; unsigned int _DebugConf; unsigned int _DebugLevel; pthread_mutex_t _DebugMutex = PTHREAD_MUTEX_INITIALIZER; char *_DebugFile; int _DebugLine; #else //extern unsigned int _DebugEnv; extern unsigned int _DebugConf; extern unsigned int _DebugLevel; extern pthread_mutex_t _DebugMutex; extern char *_DebugFile; extern int _DebugLine; #endif #ifdef __cplusplus extern "C" { #endif void DebugInit(void); void DebugMesg(char *, ...); #ifdef __cplusplus } #endif #define DEBUG_MESSAGE(Level, Message) \ pthread_mutex_lock(&_DebugMutex); \ _DebugFile = __FILE__; \ _DebugLine = __LINE__; \ _DebugLevel = Level; \ DebugMesg Message; \ pthread_mutex_unlock(&_DebugMutex) #endif // !DebugH