diff --git a/src/alert-debuglog.c b/src/alert-debuglog.c index a37551f9ae..3da91edf0c 100644 --- a/src/alert-debuglog.c +++ b/src/alert-debuglog.c @@ -8,18 +8,6 @@ * - maybe by accessing it just and hoping threading doesn't hurt */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "eidps-common.h" #include "debug.h" #include "detect.h" diff --git a/src/alert-fastlog.c b/src/alert-fastlog.c index 042491d44e..b0769ca571 100644 --- a/src/alert-fastlog.c +++ b/src/alert-fastlog.c @@ -12,18 +12,6 @@ * - Print [drop] as well if appropriate */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "eidps-common.h" #include "debug.h" #include "detect.h" diff --git a/src/alert-unified-alert.c b/src/alert-unified-alert.c index 68449de991..5e2ba2f64e 100644 --- a/src/alert-unified-alert.c +++ b/src/alert-unified-alert.c @@ -12,18 +12,6 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "eidps-common.h" #include "debug.h" #include "detect.h" diff --git a/src/alert-unified-log.c b/src/alert-unified-log.c index 4971091c6f..11fe9d6543 100644 --- a/src/alert-unified-log.c +++ b/src/alert-unified-log.c @@ -12,18 +12,6 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "eidps-common.h" #include "debug.h" #include "detect.h" diff --git a/src/alert-unified2-alert.c b/src/alert-unified2-alert.c index b2936a3f56..1c6f1b9c73 100644 --- a/src/alert-unified2-alert.c +++ b/src/alert-unified2-alert.c @@ -4,18 +4,6 @@ * \author Breno Silva */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "eidps-common.h" #include "debug.h" #include "detect.h" diff --git a/src/conf-yaml-loader.c b/src/conf-yaml-loader.c index 4cce058721..299b9fe2db 100644 --- a/src/conf-yaml-loader.c +++ b/src/conf-yaml-loader.c @@ -8,10 +8,7 @@ * YAML configuration loader. */ -#include -#include -#include -#include +#include "eidps-common.h" #include diff --git a/src/conf.c b/src/conf.c index 7b27e81f46..0a4fd23fbb 100644 --- a/src/conf.c +++ b/src/conf.c @@ -14,12 +14,6 @@ * \todo Consider using HashListTable to allow easy dumping of all data. */ -#include -#include -#include -#include -#include - #include "eidps-common.h" #include "conf.h" #include "util-hash.h" diff --git a/src/conf.h b/src/conf.h index 52020be3ed..623bbaf659 100644 --- a/src/conf.h +++ b/src/conf.h @@ -7,8 +7,6 @@ #ifndef __CONF_H__ #define __CONF_H__ -#include - /** * The default log directory. */ diff --git a/src/counters.c b/src/counters.c index 0f033a1b3c..ac8dc104bb 100644 --- a/src/counters.c +++ b/src/counters.c @@ -1,9 +1,5 @@ -#include -#include -#include -#include -#include -#include +#include "eidps-common.h" + #include "time.h" #include "eidps.h" diff --git a/src/decode-ethernet.c b/src/decode-ethernet.c index 80b9c2a60f..967e5871bf 100644 --- a/src/decode-ethernet.c +++ b/src/decode-ethernet.c @@ -1,5 +1,6 @@ /* Copyright (c) 2009 Victor Julien */ +#include "eidps-common.h" #include "decode.h" #include "decode-ethernet.h" #include "decode-events.h" diff --git a/src/decode-gre.c b/src/decode-gre.c index 49a1e5fcea..0aedac1ae9 100644 --- a/src/decode-gre.c +++ b/src/decode-gre.c @@ -3,7 +3,7 @@ * \author Breno Silva */ - +#include "eidps-common.h" #include "eidps.h" #include "decode.h" #include "decode-events.h" diff --git a/src/decode-ipv4.h b/src/decode-ipv4.h index 612aab2245..99c2530dba 100644 --- a/src/decode-ipv4.h +++ b/src/decode-ipv4.h @@ -3,12 +3,6 @@ #ifndef __DECODE_IPV4_H__ #define __DECODE_IPV4_H__ -#include -#include -#include -#include -#include - #define IPV4_HEADER_LEN 20 /**< Header length */ #define IPV4_OPTMAX 40 /**< Max options length */ #define IPV4_MAXPACKET_LEN 65535 /**< Maximum packet size */ diff --git a/src/decode-ipv6.h b/src/decode-ipv6.h index 15a52cf64c..cd6d7fb525 100644 --- a/src/decode-ipv6.h +++ b/src/decode-ipv6.h @@ -3,12 +3,6 @@ #ifndef __DECODE_IPV6_H__ #define __DECODE_IPV6_H__ -#include -#include -#include -#include -#include - #define IPV6_HEADER_LEN 40 #define IPV6_MAXPACKET 65535 /* maximum packet size */ #define IPV6_MAX_OPT 40 diff --git a/src/decode-ppp.c b/src/decode-ppp.c index fb64588f9b..8ea17c8414 100644 --- a/src/decode-ppp.c +++ b/src/decode-ppp.c @@ -2,7 +2,6 @@ * \author Breno Silva Pinto */ #include "eidps-common.h" - #include "decode.h" #include "decode-ppp.h" #include "decode-events.h" diff --git a/src/decode-pppoe.h b/src/decode-pppoe.h index 22025d6cf0..f732e4b14b 100644 --- a/src/decode-pppoe.h +++ b/src/decode-pppoe.h @@ -8,12 +8,6 @@ #ifndef __DECODE_PPPOE_H__ #define __DECODE_PPPOE_H__ -#include -#include -#include -#include -#include - #include "decode.h" #include "threadvars.h" diff --git a/src/decode-sll.c b/src/decode-sll.c index 74ad9e58b5..80476373dd 100644 --- a/src/decode-sll.c +++ b/src/decode-sll.c @@ -1,5 +1,6 @@ /* Copyright (c) 2009 Victor Julien */ +#include "eidps-common.h" #include "decode.h" #include "decode-sll.h" #include "decode-events.h" diff --git a/src/decode-tcp.h b/src/decode-tcp.h index 165e13172f..2c9476f979 100644 --- a/src/decode-tcp.h +++ b/src/decode-tcp.h @@ -6,12 +6,6 @@ #ifndef __DECODE_TCP_H__ #define __DECODE_TCP_H__ -#include -#include -#include -#include -#include - #define TCP_HEADER_LEN 20 #define TCP_OPTLENMAX 40 #define TCP_OPTMAX 20 /* every opt is at least 2 bytes diff --git a/src/decode.h b/src/decode.h index b6a34b6153..302b2609c2 100644 --- a/src/decode.h +++ b/src/decode.h @@ -13,17 +13,6 @@ //#define DBG_THREADS #define COUNTERS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "threadvars.h" #include "source-nfq.h" @@ -449,5 +438,10 @@ Packet *TunnelPktSetup(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, ui #define IPPROTO_DCCP 33 #endif +/* pcap provides this, but we don't want to depend on libpcap */ +#ifndef DLT_EN10MB +#define DLT_EN10MB 1 +#endif + #endif /* __DECODE_H__ */ diff --git a/src/detect-bytejump.c b/src/detect-bytejump.c index 7eb112a764..b5ae584119 100644 --- a/src/detect-bytejump.c +++ b/src/detect-bytejump.c @@ -3,9 +3,6 @@ * \author Brian Rectanus */ -#include -#include - #include "eidps-common.h" #include "debug.h" #include "decode.h" diff --git a/src/detect-bytetest.c b/src/detect-bytetest.c index cd4df7efde..c8ea705b7d 100644 --- a/src/detect-bytetest.c +++ b/src/detect-bytetest.c @@ -3,9 +3,6 @@ * \author Brian Rectanus */ -#include -#include - #include "eidps-common.h" #include "debug.h" #include "decode.h" diff --git a/src/detect-classtype.c b/src/detect-classtype.c index e502a06f29..948fd18134 100644 --- a/src/detect-classtype.c +++ b/src/detect-classtype.c @@ -1,5 +1,6 @@ /* CLASSTYPE part of the detection engine. */ +#include "eidps-common.h" #include "decode.h" #include "detect.h" #include "flow-var.h" diff --git a/src/detect-content.c b/src/detect-content.c index d0ef0a252a..c94ca4eccf 100644 --- a/src/detect-content.c +++ b/src/detect-content.c @@ -26,23 +26,18 @@ * */ -#include +#include "eidps-common.h" #include "decode.h" #include "detect.h" #include "detect-content.h" #include "detect-uricontent.h" - -#include "eidps-common.h" #include "detect-engine-mpm.h" #include "util-mpm.h" - #include "flow.h" #include "flow-var.h" #include "detect-flow.h" - #include "util-unittest.h" #include "util-print.h" - #include "threads.h" int DetectContentMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, SigMatch *); diff --git a/src/detect-csum.c b/src/detect-csum.c index ad3125e383..0d99491265 100644 --- a/src/detect-csum.c +++ b/src/detect-csum.c @@ -5,8 +5,6 @@ * Checksum keyword for the the detection engine. */ -#include - #include "eidps-common.h" #include "debug.h" #include "decode.h" diff --git a/src/detect-decode-event.c b/src/detect-decode-event.c index 7af99a7847..b18b09cf12 100644 --- a/src/detect-decode-event.c +++ b/src/detect-decode-event.c @@ -3,24 +3,19 @@ * \author Breno Silva */ +#include "eidps-common.h" +#include "eidps.h" #include "decode.h" #include "detect.h" #include "flow-var.h" - -#include "eidps.h" - #include "decode-events.h" /* Need to get the DEvents[] array */ #define DETECT_EVENTS #include "detect-decode-event.h" - #include "util-unittest.h" -#include -#include - #define PARSE_REGEX "\\S[0-9A-z_]+[.][A-z+]+$" static pcre *parse_regex; diff --git a/src/detect-depth.c b/src/detect-depth.c index 6c806fc673..93a9eb3ee9 100644 --- a/src/detect-depth.c +++ b/src/detect-depth.c @@ -1,10 +1,9 @@ /* DEPTH part of the detection engine. */ +#include "eidps-common.h" #include "decode.h" #include "detect.h" #include "flow-var.h" - -#include #include "detect-content.h" #include "detect-pcre.h" diff --git a/src/detect-distance.c b/src/detect-distance.c index 919f720abf..fc482a85a3 100644 --- a/src/detect-distance.c +++ b/src/detect-distance.c @@ -1,10 +1,9 @@ /* DISTANCE part of the detection engine. */ +#include "eidps-common.h" #include "decode.h" #include "detect.h" #include "flow-var.h" - -#include #include "detect-content.h" #include "detect-uricontent.h" #include "detect-pcre.h" diff --git a/src/detect-dsize.c b/src/detect-dsize.c index 4f6358d268..ea0f4b5bb9 100644 --- a/src/detect-dsize.c +++ b/src/detect-dsize.c @@ -9,8 +9,6 @@ #include "util-unittest.h" -#include - #define PARSE_REGEX "^(?:\\\")?(<|>)?([0-9]+)(?:(<>)([0-9]+))?(?:\\\")?$" static pcre *parse_regex; static pcre_extra *parse_regex_study; diff --git a/src/detect-engine-address-ipv4.c b/src/detect-engine-address-ipv4.c index 78fa0fdeac..975165e42b 100644 --- a/src/detect-engine-address-ipv4.c +++ b/src/detect-engine-address-ipv4.c @@ -5,6 +5,8 @@ * XXX we need to unit test the hell out of this code */ +#include "eidps-common.h" + #include "decode.h" #include "detect.h" #include "flow-var.h" diff --git a/src/detect-engine-address-ipv6.c b/src/detect-engine-address-ipv6.c index 5259814448..928fd4c1db 100644 --- a/src/detect-engine-address-ipv6.c +++ b/src/detect-engine-address-ipv6.c @@ -5,6 +5,8 @@ * XXX unit test the join code */ +#include "eidps-common.h" + #include "decode.h" #include "detect.h" #include "flow-var.h" diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index a0487188a9..1f067243c7 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -1,9 +1,6 @@ /* Multi pattern matcher */ -#include -#include -#include -#include +#include "eidps-common.h" #include "decode.h" #include "detect.h" diff --git a/src/detect-engine-proto.c b/src/detect-engine-proto.c index e14a905c68..10456aa06f 100644 --- a/src/detect-engine-proto.c +++ b/src/detect-engine-proto.c @@ -4,6 +4,8 @@ * * TODO move this out of the detection plugin structure */ +#include "eidps-common.h" + #include "decode.h" #include "detect.h" #include "flow-var.h" diff --git a/src/detect-flow.c b/src/detect-flow.c index bf2b5a9d76..e418a0370f 100644 --- a/src/detect-flow.c +++ b/src/detect-flow.c @@ -5,8 +5,6 @@ * FLOW part of the detection engine. */ -#include - #include "eidps-common.h" #include "debug.h" #include "decode.h" diff --git a/src/detect-flowbits.c b/src/detect-flowbits.c index 0b299c7afb..6ce13ab755 100644 --- a/src/detect-flowbits.c +++ b/src/detect-flowbits.c @@ -18,9 +18,6 @@ * */ -#include -#include - #include "eidps-common.h" #include "decode.h" #include "detect.h" diff --git a/src/detect-flowvar.c b/src/detect-flowvar.c index cdbdfdee90..c40eb6d213 100644 --- a/src/detect-flowvar.c +++ b/src/detect-flowvar.c @@ -2,9 +2,6 @@ * * Copyright (C) 2008 by Victor Julien */ -#include -#include - #include "eidps-common.h" #include "decode.h" #include "detect.h" diff --git a/src/detect-isdataat.c b/src/detect-isdataat.c index d0bc274ef5..071b2041e8 100644 --- a/src/detect-isdataat.c +++ b/src/detect-isdataat.c @@ -5,8 +5,6 @@ * ISDATAAT part of the detection engine. */ -#include - #include "eidps-common.h" #include "debug.h" #include "decode.h" diff --git a/src/detect-metadata.c b/src/detect-metadata.c index 0348a2fac7..0fd20f679d 100644 --- a/src/detect-metadata.c +++ b/src/detect-metadata.c @@ -1,8 +1,7 @@ /* METADATA part of the detection engine. */ -#include "decode.h" +#include "eidps-common.h" #include "detect.h" -#include "flow-var.h" int DetectMetadataSetup (DetectEngineCtx *, Signature *s, SigMatch *m, char *str); diff --git a/src/detect-msg.c b/src/detect-msg.c index be388c46d3..d782bb887e 100644 --- a/src/detect-msg.c +++ b/src/detect-msg.c @@ -1,8 +1,7 @@ /* MSG part of the detection engine. */ -#include "decode.h" +#include "eidps-common.h" #include "detect.h" -#include "flow-var.h" int DetectMsgSetup (DetectEngineCtx *de_ctx, Signature *s, SigMatch *m, char *msgstr); diff --git a/src/detect-noalert.c b/src/detect-noalert.c index 2cb49330c3..474293c640 100644 --- a/src/detect-noalert.c +++ b/src/detect-noalert.c @@ -1,10 +1,7 @@ /* NOALERT part of the detection engine. */ -#include "decode.h" +#include "eidps-common.h" #include "detect.h" -#include "flow-var.h" - -#include int DetectNoalertSetup (DetectEngineCtx *, Signature *, SigMatch *, char *); diff --git a/src/detect-nocase.c b/src/detect-nocase.c index 5b164a3eb5..be455f7c44 100644 --- a/src/detect-nocase.c +++ b/src/detect-nocase.c @@ -5,7 +5,6 @@ #include "detect.h" #include "flow-var.h" -#include #include "detect-content.h" #include "detect-uricontent.h" #include "detect-pcre.h" diff --git a/src/detect-offset.c b/src/detect-offset.c index e1a13467e2..b4c2bec377 100644 --- a/src/detect-offset.c +++ b/src/detect-offset.c @@ -1,10 +1,11 @@ /* OFFSET part of the detection engine. */ +#include "eidps-common.h" + #include "decode.h" #include "detect.h" #include "flow-var.h" -#include #include "detect-content.h" #include "detect-pcre.h" diff --git a/src/detect-parse.c b/src/detect-parse.c index 3fd563c2c0..2cc9272be0 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -1,7 +1,5 @@ /* signature parser */ -#include - #include "eidps-common.h" #include "debug.h" diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 6cdfd4400a..8768b41e71 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -1,7 +1,5 @@ /* PCRE part of the detection engine. */ -#include - #include "eidps-common.h" #include "debug.h" #include "decode.h" diff --git a/src/detect-pktvar.c b/src/detect-pktvar.c index f439131c7d..afa299cc09 100644 --- a/src/detect-pktvar.c +++ b/src/detect-pktvar.c @@ -2,9 +2,6 @@ * * Copyright (C) 2008 by Victor Julien */ -#include -#include - #include "eidps-common.h" #include "decode.h" #include "detect.h" diff --git a/src/detect-priority.c b/src/detect-priority.c index f963b0e1aa..c5c698fb06 100644 --- a/src/detect-priority.c +++ b/src/detect-priority.c @@ -1,8 +1,7 @@ /* PRIORITY part of the detection engine. */ -#include "decode.h" +#include "eidps-common.h" #include "detect.h" -#include "flow-var.h" int DetectPrioritySetup (DetectEngineCtx *, Signature *s, SigMatch *m, char *sidstr); diff --git a/src/detect-rawbytes.c b/src/detect-rawbytes.c index dff6bdbdfa..cbe8f3562c 100644 --- a/src/detect-rawbytes.c +++ b/src/detect-rawbytes.c @@ -1,10 +1,11 @@ /* RAWBYTES part of the detection engine. */ +#include "eidps-common.h" + #include "decode.h" #include "detect.h" #include "flow-var.h" -#include #include "detect-content.h" #include "detect-pcre.h" diff --git a/src/detect-recursive.c b/src/detect-recursive.c index 5a437bae06..c25c6478e8 100644 --- a/src/detect-recursive.c +++ b/src/detect-recursive.c @@ -5,12 +5,11 @@ * * Note: non Snort compatible. */ +#include "eidps-common.h" #include "decode.h" #include "detect.h" #include "flow-var.h" -#include - int DetectRecursiveSetup (DetectEngineCtx *, Signature *, SigMatch *, char *); void DetectRecursiveRegister (void) { diff --git a/src/detect-reference.c b/src/detect-reference.c index 0cdae4887d..6aa38bc924 100644 --- a/src/detect-reference.c +++ b/src/detect-reference.c @@ -1,8 +1,7 @@ /* REFERENCE part of the detection engine. */ -#include "decode.h" +#include "eidps-common.h" #include "detect.h" -#include "flow-var.h" int DetectReferenceSetup (DetectEngineCtx *, Signature *s, SigMatch *m, char *str); diff --git a/src/detect-rev.c b/src/detect-rev.c index 6b86652528..426a330292 100644 --- a/src/detect-rev.c +++ b/src/detect-rev.c @@ -1,8 +1,7 @@ /* REV part of the detection engine. */ -#include "decode.h" +#include "eidps-common.h" #include "detect.h" -#include "flow-var.h" int DetectRevSetup (DetectEngineCtx *, Signature *s, SigMatch *m, char *str); diff --git a/src/detect-sid.c b/src/detect-sid.c index ea25212456..0dd39391f0 100644 --- a/src/detect-sid.c +++ b/src/detect-sid.c @@ -1,8 +1,7 @@ /* SID part of the detection engine. */ -#include "decode.h" +#include "eidps-common.h" #include "detect.h" -#include "flow-var.h" int DetectSidSetup (DetectEngineCtx *, Signature *s, SigMatch *m, char *sidstr); diff --git a/src/detect-stream_size.c b/src/detect-stream_size.c index 2cc28b336a..a0e55ef957 100644 --- a/src/detect-stream_size.c +++ b/src/detect-stream_size.c @@ -5,10 +5,7 @@ * Stream size for the engine. */ -#include -#include - -#include "eidps.h" +#include "eidps-common.h" #include "stream-tcp.h" #include "util-unittest.h" #include "detect.h" diff --git a/src/detect-threshold.c b/src/detect-threshold.c index 82b44ba109..fc1506947d 100644 --- a/src/detect-threshold.c +++ b/src/detect-threshold.c @@ -1,8 +1,7 @@ /* THRESHOLD part of the detection engine. */ -#include "decode.h" +#include "eidps-common.h" #include "detect.h" -#include "flow-var.h" int DetectThresholdSetup (DetectEngineCtx *, Signature *s, SigMatch *m, char *str); diff --git a/src/detect-uricontent.c b/src/detect-uricontent.c index 707b1e22c4..db74d6539a 100644 --- a/src/detect-uricontent.c +++ b/src/detect-uricontent.c @@ -2,8 +2,6 @@ * * Copyright (C) 2008 by Victor Julien */ -#include - #include "eidps-common.h" #include "decode.h" #include "detect.h" diff --git a/src/detect-window.c b/src/detect-window.c index c13ae7cf7b..d3a415badf 100644 --- a/src/detect-window.c +++ b/src/detect-window.c @@ -5,8 +5,6 @@ * WINDOW tcp window option, part of the detection engine. */ -#include - #include "eidps-common.h" #include "debug.h" #include "decode.h" diff --git a/src/detect-within.c b/src/detect-within.c index ea56b85d74..cfe5f86e2a 100644 --- a/src/detect-within.c +++ b/src/detect-within.c @@ -4,11 +4,10 @@ * \author Victor Julien * \todo within logic is not Snort compat atm: it is applied to pcre and uricontent as well */ +#include "eidps-common.h" #include "decode.h" #include "detect.h" #include "flow-var.h" - -#include #include "detect-content.h" #include "detect-uricontent.h" #include "detect-pcre.h" diff --git a/src/detect.c b/src/detect.c index 0f99379922..f51f312b66 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,7 +1,6 @@ /* Basic detection engine */ -#include - +#include "eidps-common.h" #include "eidps.h" #include "debug.h" #include "detect.h" diff --git a/src/eidps-common.h b/src/eidps-common.h index b6919d5f01..6ca2532df0 100644 --- a/src/eidps-common.h +++ b/src/eidps-common.h @@ -10,8 +10,37 @@ #define TRUE 1 #define FALSE 0 +#include /* for gettid(2) */ +#define _GNU_SOURCE +#define __USE_GNU +#include +#include /* for sched_setaffinity(2) */ + +#include #include +#include +#include +#include #include +#include +#include +#include + +#include +#include + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include +#include +#include #include #define BUG_ON(x) assert(!(x)) diff --git a/src/eidps.c b/src/eidps.c index ee047d027c..fb12f890e4 100644 --- a/src/eidps.c +++ b/src/eidps.c @@ -1,21 +1,9 @@ /* Copyright (c) 2008 Victor Julien */ -#if HAVE_CONFIG_H -#include -#endif +#include "eidps-common.h" -#include -#include -#include #include -/** \todo These are covered by HAVE_* macros */ -#include -#include -#include -#include -#include - #include "eidps.h" #include "decode.h" #include "detect.h" diff --git a/src/flow-bit.c b/src/flow-bit.c index 269e5d46bd..9b29b05921 100644 --- a/src/flow-bit.c +++ b/src/flow-bit.c @@ -11,7 +11,7 @@ * multiple times, we can operate on all of them. */ -#include +#include "eidps-common.h" #include "threads.h" #include "flow-bit.h" #include "flow.h" diff --git a/src/flow-hash.c b/src/flow-hash.c index fafb64f59f..4d3620a731 100644 --- a/src/flow-hash.c +++ b/src/flow-hash.c @@ -1,5 +1,6 @@ /* Copyright (c) 2008 Victor Julien */ +#include "eidps-common.h" #include "threads.h" #include "decode.h" #include "debug.h" diff --git a/src/flow-queue.c b/src/flow-queue.c index def83ac4e8..763cd562dd 100644 --- a/src/flow-queue.c +++ b/src/flow-queue.c @@ -1,8 +1,8 @@ /* Copyright (c) 2008 Victor Julien */ +#include "eidps-common.h" #include "threads.h" #include "debug.h" - #include "flow-queue.h" #include "flow-util.h" diff --git a/src/flow-var.c b/src/flow-var.c index fb4c6b68a6..8294873e34 100644 --- a/src/flow-var.c +++ b/src/flow-var.c @@ -8,8 +8,6 @@ * multiple times, we can operate on all of them. */ -#include - #include "eidps-common.h" #include "threads.h" #include "flow-var.h" diff --git a/src/host.c b/src/host.c index 43502886a6..cec9fb481f 100644 --- a/src/host.c +++ b/src/host.c @@ -1,3 +1,4 @@ +#include "eidps-common.h" #include "host.h" Host *HostAlloc(void) { diff --git a/src/host.h b/src/host.h index c2fcba7de9..037035ed39 100644 --- a/src/host.h +++ b/src/host.h @@ -2,7 +2,6 @@ #define __HOST_H__ #include "decode.h" - #include "util-hash.h" #include "util-bloomfilter-counting.h" diff --git a/src/log-httplog.c b/src/log-httplog.c index 451b87fc63..1cca706419 100644 --- a/src/log-httplog.c +++ b/src/log-httplog.c @@ -4,18 +4,6 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "eidps-common.h" #include "debug.h" #include "detect.h" diff --git a/src/pkt-var.c b/src/pkt-var.c index 522fb1b6c6..ffcdea91d7 100644 --- a/src/pkt-var.c +++ b/src/pkt-var.c @@ -8,8 +8,6 @@ * multiple times, we can operate on all of them. */ -#include - #include "eidps-common.h" #include "decode.h" #include "pkt-var.h" diff --git a/src/respond-reject-libnet11.c b/src/respond-reject-libnet11.c index fd9690ddc9..ef65a9e8b0 100644 --- a/src/respond-reject-libnet11.c +++ b/src/respond-reject-libnet11.c @@ -14,11 +14,11 @@ * to be the default in flexresp and iptables */ -#include -#include -#include #include "eidps-common.h" + +#include + #include "decode.h" #include "decode-ipv4.h" #include "decode-tcp.h" diff --git a/src/respond-reject.c b/src/respond-reject.c index 612c823aa3..ab005fd74d 100644 --- a/src/respond-reject.c +++ b/src/respond-reject.c @@ -11,10 +11,6 @@ * just return 0 always, error handling is a TODO in the threading model (VJ) */ -#include -#include -#include - #include "eidps-common.h" #include "decode.h" #include "packet-queue.h" diff --git a/src/source-nfq.c b/src/source-nfq.c index af539ee89f..5dc4528b49 100644 --- a/src/source-nfq.c +++ b/src/source-nfq.c @@ -7,9 +7,6 @@ * */ -#include -#include - #include "eidps-common.h" #include "eidps.h" #include "decode.h" diff --git a/src/source-pcap-file.c b/src/source-pcap-file.c index 5e00404099..f5ba02d07c 100644 --- a/src/source-pcap-file.c +++ b/src/source-pcap-file.c @@ -6,21 +6,13 @@ * */ -#if HAVE_CONFIG_H -#include -#endif - -#include - -/** \todo These are covered by HAVE_* macros */ -#include - #if LIBPCAP_VERSION_MAJOR == 1 #include #else #include #endif +#include "eidps-common.h" #include "eidps.h" #include "decode.h" #include "packet-queue.h" diff --git a/src/source-pcap.c b/src/source-pcap.c index 5a8d907f38..1548feacfb 100644 --- a/src/source-pcap.c +++ b/src/source-pcap.c @@ -1,20 +1,12 @@ /* Copyright (c) 2009 Victor Julien */ -#if HAVE_CONFIG_H -#include -#endif - -#include - -/** \todo These are covered by HAVE_* macros */ -#include - #if LIBPCAP_VERSION_MAJOR == 1 #include #else #include #endif +#include "eidps-common.h" #include "eidps.h" #include "decode.h" #include "packet-queue.h" diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 2d61fadaf7..f0049e53f5 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -11,20 +11,8 @@ * \todo segment insert fasttrack: most pkts are in order */ -#include "eidps.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "eidps-common.h" +#include "eidps.h" #include "debug.h" #include "detect.h" #include "flow.h" diff --git a/src/stream-tcp.c b/src/stream-tcp.c index d914aa42f6..38727c9060 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -1,19 +1,6 @@ /* Copyright (c) 2008 Victor Julien */ /* 2009 Gurvinder Singh */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "eidps-common.h" #include "decode.h" #include "debug.h" diff --git a/src/threads.c b/src/threads.c index 4f312ddc04..f7bfc4ed3f 100644 --- a/src/threads.c +++ b/src/threads.c @@ -1,34 +1,34 @@ /* Copyright (c) 2008 Victor Julien */ +#include "eidps-common.h" #include "decode.h" #ifdef DBG_THREADS -#include int mutex_lock_dbg (pthread_mutex_t *m) { int ret; - printf("%16s: (%p) locking mutex %p\n", __FUNCTION__, pthread_self(), m); + printf("%16s: (%"PRIuMAX") locking mutex %p\n", __FUNCTION__, (uintmax_t)pthread_self(), m); ret = pthread_mutex_lock(m); - printf("%16s: (%p) locked mutex %p ret %" PRId32 "\n", __FUNCTION__, pthread_self(), m, ret); + printf("%16s: (%"PRIuMAX") locked mutex %p ret %" PRId32 "\n", __FUNCTION__, (uintmax_t)pthread_self(), m, ret); return(ret); } int mutex_trylock_dbg (pthread_mutex_t *m) { int ret; - printf("%16s: (%p) trylocking mutex %p\n", __FUNCTION__, pthread_self(), m); + printf("%16s: (%"PRIuMAX") trylocking mutex %p\n", __FUNCTION__, (uintmax_t)pthread_self(), m); ret = pthread_mutex_trylock(m); - printf("%16s: (%p) trylocked mutex %p ret %" PRId32 "\n", __FUNCTION__, pthread_self(), m, ret); + printf("%16s: (%"PRIuMAX") trylocked mutex %p ret %" PRId32 "\n", __FUNCTION__, (uintmax_t)pthread_self(), m, ret); return(ret); } int mutex_unlock_dbg (pthread_mutex_t *m) { int ret; - printf("%16s: (%p) unlocking mutex %p\n", __FUNCTION__, pthread_self(), m); + printf("%16s: (%"PRIuMAX") unlocking mutex %p\n", __FUNCTION__, (uintmax_t)pthread_self(), m); ret = pthread_mutex_unlock(m); - printf("%16s: (%p) unlocked mutex %p ret %" PRId32 "\n", __FUNCTION__, pthread_self(), m, ret); + printf("%16s: (%"PRIuMAX") unlocked mutex %p ret %" PRId32 "\n", __FUNCTION__, (uintmax_t)pthread_self(), m, ret); return(ret); } diff --git a/src/tm-modules.c b/src/tm-modules.c index 6465c3283f..a97e274829 100644 --- a/src/tm-modules.c +++ b/src/tm-modules.c @@ -1,8 +1,5 @@ /* Copyright (c) 2008 Victor Julien */ -#include -#include - #include "eidps-common.h" #include "packet-queue.h" #include "tm-modules.h" diff --git a/src/tm-threads.c b/src/tm-threads.c index 2b626442d8..bbd32dc06f 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -3,12 +3,7 @@ * \author Anoop Saldanha */ -#include /* for gettid(2) */ -#define _GNU_SOURCE -#define __USE_GNU -#include -#include /* for sched_setaffinity(2) */ - +#include "eidps-common.h" #include "eidps.h" #include "stream.h" #include "threadvars.h" diff --git a/src/util-binsearch.c b/src/util-binsearch.c index 989c30e789..4170255eea 100644 --- a/src/util-binsearch.c +++ b/src/util-binsearch.c @@ -1,11 +1,6 @@ -#include -#include -#include -#include -#include -#include +#include "eidps-common.h" -/* XXX replace this by a better algo */ +/** \todo replace this by a better algo */ uint8_t nocasetable[256]; #define _nc(c) nocasetable[(c)] diff --git a/src/util-bloomfilter-counting.c b/src/util-bloomfilter-counting.c index 11c49fa9e3..9488524c9e 100644 --- a/src/util-bloomfilter-counting.c +++ b/src/util-bloomfilter-counting.c @@ -4,15 +4,8 @@ * counters. */ -#include -#include -#include -#include - #include "eidps-common.h" - #include "util-bloomfilter-counting.h" - #include "util-unittest.h" /* type: 1, 2 or 4 for 8, 16, or 32 bit counters diff --git a/src/util-bloomfilter.c b/src/util-bloomfilter.c index d7b3781743..91d4910734 100644 --- a/src/util-bloomfilter.c +++ b/src/util-bloomfilter.c @@ -2,15 +2,8 @@ /* Bitwise bloom filter implementation. */ -#include -#include -#include -#include - #include "eidps-common.h" - #include "util-bloomfilter.h" - #include "util-unittest.h" BloomFilter *BloomFilterInit(uint32_t size, uint8_t iter, uint32_t (*Hash)(void *, uint16_t, uint8_t, uint32_t)) { diff --git a/src/util-byte.c b/src/util-byte.c index 266b11c407..086a008b3c 100644 --- a/src/util-byte.c +++ b/src/util-byte.c @@ -1,9 +1,4 @@ -#include -#include -#include -#include -#include - +#include "eidps-common.h" #include "util-byte.h" #include "util-unittest.h" diff --git a/src/util-cidr.c b/src/util-cidr.c index f32afb102d..b688253678 100644 --- a/src/util-cidr.c +++ b/src/util-cidr.c @@ -1,7 +1,4 @@ -#include -#include -#include -#include +#include "eidps-common.h" static uint32_t cidrs[33]; diff --git a/src/util-hash.c b/src/util-hash.c index 5ba8bf69c8..de88551cf2 100644 --- a/src/util-hash.c +++ b/src/util-hash.c @@ -5,15 +5,8 @@ * The 'Free' pointer can be used to have the API free your * hashed data. If it's NULL it's the callers responsebility */ -#include -#include -#include -#include -#include -#include - +#include "eidps-common.h" #include "util-hash.h" - #include "util-unittest.h" HashTable* HashTableInit(uint32_t size, uint32_t (*Hash)(struct HashTable_ *, void *, uint16_t), char (*Compare)(void *, uint16_t, void *, uint16_t), void (*Free)(void *)) { diff --git a/src/util-hashlist.c b/src/util-hashlist.c index 1b585e5b6f..32de6e708a 100644 --- a/src/util-hashlist.c +++ b/src/util-hashlist.c @@ -5,15 +5,8 @@ * The 'Free' pointer can be used to have the API free your * hashed data. If it's NULL it's the callers responsebility */ -#include -#include -#include -#include -#include -#include - +#include "eidps-common.h" #include "util-hashlist.h" - #include "util-unittest.h" HashListTable* HashListTableInit(uint32_t size, uint32_t (*Hash)(struct HashListTable_ *, void *, uint16_t), char (*Compare)(void *, uint16_t, void *, uint16_t), void (*Free)(void *)) { diff --git a/src/util-mpm-b2g.c b/src/util-mpm-b2g.c index 8fbd37910e..2ad0f830cc 100644 --- a/src/util-mpm-b2g.c +++ b/src/util-mpm-b2g.c @@ -14,14 +14,7 @@ //#define PRINTMATCH -#include -#include -#include -#include -#include -#include -#include - +#include "eidps-common.h" #include "eidps.h" #include "detect.h" #include "util-bloomfilter.h" diff --git a/src/util-mpm-b3g.c b/src/util-mpm-b3g.c index 0510cbf631..8857659327 100644 --- a/src/util-mpm-b3g.c +++ b/src/util-mpm-b3g.c @@ -12,12 +12,7 @@ * */ -#include -#include -#include -#include -#include - +#include "eidps-common.h" #include "eidps.h" #include "util-bloomfilter.h" #include "util-mpm-b3g.h" diff --git a/src/util-mpm-wumanber.c b/src/util-mpm-wumanber.c index 907141cb69..f3d53ac911 100644 --- a/src/util-mpm-wumanber.c +++ b/src/util-mpm-wumanber.c @@ -15,13 +15,8 @@ * - make sure runtime counters can be disabled (at compile time) */ -#include -#include -#include -#include -#include - #include "eidps-common.h" +#include "eidps.h" #include "util-mpm.h" #include "util-mpm-wumanber.h" diff --git a/src/util-mpm.c b/src/util-mpm.c index 71dd3672c8..f8a6fe883d 100644 --- a/src/util-mpm.c +++ b/src/util-mpm.c @@ -1,10 +1,3 @@ - -#include -#include -#include -#include -#include - #include "eidps-common.h" #include "util-mpm.h" diff --git a/src/util-pool.c b/src/util-pool.c index 1b35fbd684..2aaac8125a 100644 --- a/src/util-pool.c +++ b/src/util-pool.c @@ -1,14 +1,7 @@ /* Copyright (c) 2008 by Victor Julien */ -#include -#include -#include -#include - #include "eidps-common.h" - #include "util-pool.h" - #include "util-unittest.h" Pool *PoolInit(uint32_t size, uint32_t prealloc_size, void *(*Alloc)(void *), void *AllocData, void (*Free)(void *)) diff --git a/src/util-print.c b/src/util-print.c index cc8b0d6fa9..a2482f511a 100644 --- a/src/util-print.c +++ b/src/util-print.c @@ -1,10 +1,5 @@ /* Copyright (c) 2008 by Victor Julien */ -#include -#include -#include -#include - #include "eidps-common.h" void PrintRawUriFp(FILE *fp, uint8_t *buf, uint32_t buflen) { diff --git a/src/util-unittest.c b/src/util-unittest.c index ee041c92e3..70633f4e3e 100644 --- a/src/util-unittest.c +++ b/src/util-unittest.c @@ -1,7 +1,3 @@ -#include -#include -#include - #include "eidps-common.h" #include "util-unittest.h"