Add optional structure validation code.

remotes/origin/master-1.0.x
Victor Julien 15 years ago
parent b67fb5229b
commit e685579231

@ -634,6 +634,13 @@ AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)])
CFLAGS="${CFLAGS} -DDEBUG"
])
# enable debug validation functions & macro's output
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug-validation], [Enable (debug) validation code output]),,[enable_debug_validation=no])
AS_IF([test "x$enable_debug_validation" = "xyes"], [
CFLAGS="${CFLAGS} -DDEBUG_VALIDATION"
])
#libhtp
AC_ARG_ENABLE(non-bundled-htp,
AS_HELP_STRING([--enable-non-bundled-htp], [Enable the use of an already installed version of htp]),,[enable_non_bundled_htp=no])
@ -810,6 +817,7 @@ Suricata Configuration:
Prelude support: ${enable_prelude}
Unit tests enabled: ${enable_unittests}
Debug output enabled: ${enable_debug}
Debug validation enabled: ${enable_debug_validation}
CUDA enabled: ${enable_cuda}
DAG enabled: ${enable_dag}
Profiling enabled: ${enable_profiling}

@ -2,7 +2,8 @@ noinst_HEADERS = action-globals.h \
app-layer-nbss.h app-layer-dcerpc-common.h \
debug.h decode-events.h \
flow-private.h queue.h source-nfq-prototypes.h \
suricata-common.h threadvars.h util-binsearch.h
suricata-common.h threadvars.h util-binsearch.h \
util-atomic.h util-validate.h
bin_PROGRAMS = suricata
suricata_SOURCES = suricata.c suricata.h \
runmodes.c runmodes.h \
@ -167,6 +168,7 @@ util-cuda-handlers.c util-cuda-handlers.h \
util-privs.c util-privs.h \
util-decode-asn1.c util-decode-asn1.h \
util-ringbuffer.c util-ringbuffer.h \
util-validate.h \
tm-modules.c tm-modules.h \
tm-queues.c tm-queues.h \
tm-queuehandlers.c tm-queuehandlers.h \

@ -138,12 +138,12 @@
#include "util-unittest-helper.h"
#include "util-debug.h"
#include "util-hashlist.h"
#include "util-cuda-handlers.h"
#include "util-mpm-b2g-cuda.h"
#include "util-cuda.h"
#include "util-privs.h"
#include "util-profiling.h"
#include "util-validate.h"
SigMatch *SigMatchAlloc(void);
void DetectExitPrintStats(ThreadVars *tv, void *data);
@ -1084,6 +1084,8 @@ end:
*/
TmEcode Detect(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, PacketQueue *postpq)
{
DEBUG_VALIDATE_PACKET(p);
/* No need to perform any detection on this packet, if the the given flag is set.*/
if (p->flags & PKT_NOPACKET_INSPECTION)
return 0;

Loading…
Cancel
Save