/* Copyright (C) 2007-2010 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 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 * version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /** * \file * * \author Victor Julien * * Common includes, etc. */ #ifndef __SURICATA_COMMON_H__ #define __SURICATA_COMMON_H__ #ifdef DEBUG #define DBG_PERF #endif #define TRUE 1 #define FALSE 0 #define _GNU_SOURCE #define __USE_GNU #include #include #include #include #include #include #include #include #include #include #include #if HAVE_SYS_SYSCALL_H #include #endif #if HAVE_SYSCALL_H #include #endif #include /* for gettid(2) */ #include /* for sched_setaffinity(2) */ #include #if HAVE_CONFIG_H #include #endif #ifdef HAVE_SYSLOG_H #include #else #include "win32-syslog.h" #endif /* HAVE_SYSLOG_H */ #ifdef OS_WIN32 #include "win32-misc.h" #include "win32-service.h" #endif /* OS_WIN32 */ #include #if HAVE_POLL_H #include #endif #if HAVE_SYS_SIGNAL_H #include #endif #if HAVE_SIGNAL_H #include #endif #include #if HAVE_SYS_SOCKET_H #include #endif #include #if HAVE_ARPA_INET_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_NETDB_H #include #endif #ifdef HAVE_WINDOWS_H #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #include #endif #ifdef HAVE_WINSOCK2_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif #include #define BUG_ON(x) assert(!(x)) /* we need this to stringify the defines which are supplied at compiletime see: http://gcc.gnu.org/onlinedocs/gcc-3.4.1/cpp/Stringification.html#Stringification */ #define xstr(s) str(s) #define str(s) #s /** type for the internal signature id. Since it's used in the matching engine * extensively keeping this as small as possible reduces the overall memory * footprint of the engine. Set to uint32_t if the engine needs to support * more than 64k sigs. */ #define SigIntId uint16_t //#define SigIntId uint32_t /** same for pattern id's */ #define PatIntId uint16_t #include #include "threads.h" #include "util-debug.h" #include "util-error.h" #include "util-mem.h" #include "detect-engine-alert.h" size_t strlcat(char *, const char *src, size_t siz); size_t strlcpy(char *dst, const char *src, size_t siz); #endif /* __SURICATA_COMMON_H__ */