src: fix remaining cppclean warnings

pull/8185/head
Philippe Antoine 2 years ago committed by Victor Julien
parent 1f066cbbe8
commit 62352ad030

@ -17,12 +17,27 @@ for l in sys.stdin:
if included == "conf.h" and includer == "src/suricata-plugin.h":
# SCEveFileType structure field Init being a function pointer using a parameter ConfNode defined in conf.h
continue
if included == "util-prefilter.h" and includer == "src/util-mpm.h":
# MpmTableElmt_ structure field Search being a function pointer using a parameter PrefilterRuleStore
continue
if included == "flow.h" and includer == "src/output-tx.h":
# TxLogger type being a function pointer using a parameter Flow
continue
if included == "util-debug-filters.h" and includer == "src/util-debug.h":
# Macro SCEnter using SCLogCheckFDFilterEntry defined in util-debug-filters.h
continue
if included == "util-spm-bs.h" and includer == "src/util-spm.h":
# Macro SpmSearch using BasicSearch defined in util-spm-bs.h
continue
if included == "util-cpu.h" and includer == "src/threads-profile.h":
# Macro SCSpinLock_profile using UtilCpuGetTicks
continue
if included == "util-profiling-locks.h" and includer == "src/util-profiling.h":
# Macro SCSpinLock_profile using SCProfilingAddPacketLocks
continue
if included == "threads.h" and includer == "src/util-debug-filters.h":
# pthread_t needed on Windows
continue
print("Unnecessary include from %s for %s" % (includer, included))
retcode = 1

@ -54,6 +54,8 @@
#include "util-logopenfile.h"
#include "util-time.h"
#include "action-globals.h"
#define DEFAULT_LOG_FILENAME "fast.log"
#define MODULE_NAME "AlertFastLog"

@ -48,6 +48,7 @@
#include "util-syslog.h"
#include "util-optimize.h"
#include "util-logopenfile.h"
#include "action-globals.h"
#ifndef OS_WIN32

@ -67,6 +67,7 @@
#include "util-print.h"
#include "util-profiling.h"
#include "util-validate.h"
#include "action-globals.h"
uint32_t default_packet_size = 0;
extern bool stats_decoder_events;

@ -79,8 +79,6 @@ enum PktSrcEnum {
#include "source-pfring.h"
#endif
#include "action-globals.h"
#include "decode-ethernet.h"
#include "decode-gre.h"
#include "decode-ppp.h"

@ -25,7 +25,6 @@
#define __DEFRAG_QUEUE_H__
#include "suricata-common.h"
#include "decode.h"
#include "defrag.h"
/** Spinlocks or Mutex for the defrag tracker queues. */

@ -26,6 +26,8 @@
#include "threads.h"
#include "util-pool.h"
#include "threadvars.h"
#include "decode.h"
/**
* A context for an instance of a fragmentation re-assembler, in case

@ -35,6 +35,8 @@
#include "util-profiling.h"
#include "util-validate.h"
#include "action-globals.h"
/** tag signature we use for tag alerts */
static Signature g_tag_signature;
/** tag packet alert structure for tag alerts */

@ -68,6 +68,8 @@
#include "util-var-name.h"
#include "tm-threads.h"
#include "action-globals.h"
static HostStorageId host_threshold_id = { .id = -1 }; /**< host storage id for thresholds */
static IPPairStorageId ippair_threshold_id = { .id = -1 }; /**< ip pair storage id for thresholds */

@ -29,7 +29,7 @@
#include "suricata-common.h"
#include "flow.h"
#include "app-layer-htp.h"
#include <htp/htp.h>
#include "detect.h"
#include "detect-parse.h"

@ -70,6 +70,8 @@
#include "detect-engine-iponly.h"
#include "app-layer-detect-proto.h"
#include "action-globals.h"
/* Table with all SigMatch registrations */
SigTableElmt sigmatch_table[DETECT_TBLSIZE];

@ -65,6 +65,8 @@
#include "util-detect.h"
#include "util-profiling.h"
#include "action-globals.h"
typedef struct DetectRunScratchpad {
const AppProto alproto;
const uint8_t flow_flags; /* flow/state flags: STREAM_* */

@ -25,6 +25,7 @@
#include "suricata-common.h"
#include "device-storage.h"
#include "util-storage.h"
#include "util-unittest.h"
unsigned int LiveDevStorageSize(void)

@ -27,7 +27,6 @@
#define __DEVICE_STORAGE_H__
#include "util-device.h"
#include "util-storage.h"
typedef struct LiveDevStorageId_ {
int id;

@ -24,7 +24,6 @@
#ifndef __FLOW_BYPASS_H__
#define __FLOW_BYPASS_H__
#include "threadvars.h"
#include "flow.h"
struct flows_stats {

@ -29,6 +29,7 @@
#include "flow-storage.h"
#include "flow-hash.h"
#include "flow-util.h"
#include "util-storage.h"
#include "util-unittest.h"
unsigned int FlowStorageSize(void)

@ -27,7 +27,6 @@
#define __FLOW_STORAGE_H__
#include "flow.h"
#include "util-storage.h"
typedef struct FlowStorageId {
int id;

@ -88,6 +88,8 @@
#include "util-buffer.h"
#include "util-validate.h"
#include "action-globals.h"
#define MODULE_NAME "JsonAlertLog"
#define LOG_JSON_PAYLOAD BIT_U16(0)

@ -56,6 +56,8 @@
#include "util-time.h"
#include "util-buffer.h"
#include "action-globals.h"
#define MODULE_NAME "JsonDropLog"
#define LOG_DROP_ALERTS 1

@ -21,6 +21,7 @@
#include "host.h"
#include "util-profiling.h"
#include "util-validate.h"
#include "action-globals.h"
/** \brief issue drop action
*

@ -26,6 +26,7 @@
*/
#include "suricata-common.h"
#include "detect.h"
#include "reputation.h"
#include "threads.h"
#include "conf.h"

@ -42,8 +42,6 @@ typedef struct SReputation_ {
uint8_t rep[SREP_MAX_CATS];
} SReputation;
#include "detect.h"
void SRepFreeHostData(Host *h);
uint8_t SRepCatGetByShortname(char *shortname);
int SRepInit(struct DetectEngineCtx_ *de_ctx);

@ -60,6 +60,7 @@
#include "runmodes.h"
#include "flow-storage.h"
#include "util-validate.h"
#include "action-globals.h"
#ifdef HAVE_AF_PACKET

@ -41,6 +41,7 @@
#include "tm-threads.h"
#include "tmqh-packetpool.h"
#include "util-privs.h"
#include "action-globals.h"
#ifndef HAVE_DPDK

@ -25,6 +25,7 @@
#include "suricata.h"
#include "stream-tcp-private.h"
#include "stream-tcp-cache.h"
#include "util-debug.h"
typedef struct TcpPoolCache {
bool cache_enabled; /**< cache should only be enabled for worker threads */

@ -24,8 +24,6 @@
#ifndef __STREAM_TCP_CACHE_H__
#define __STREAM_TCP_CACHE_H__
#include "suricata.h"
#include "flow.h"
#include "stream-tcp-private.h"
void StreamTcpThreadCacheEnable(void);

@ -78,6 +78,7 @@
#include "util-time.h"
#include "source-pcap-file.h"
#include "action-globals.h"
//#define DEBUG

@ -26,6 +26,7 @@
#ifndef __THREADS_PROFILE_H__
#define __THREADS_PROFILE_H__
// UtilCpuGetTicks
#include "util-cpu.h"
#define PROFILING_MAX_LOCKS 64

@ -33,6 +33,7 @@
#include "packet.h"
#include "util-profiling.h"
#include "util-validate.h"
#include "action-globals.h"
/* Number of freed packet to save for one pool before freeing them. */
#define MAX_PENDING_RETURN_PACKETS 32

@ -24,6 +24,7 @@
#ifndef __DEBUG_FILTERS_H__
#define __DEBUG_FILTERS_H__
// pthread_t
#include "threads.h"
/**

@ -25,6 +25,7 @@
#include "util-exception-policy.h"
#include "util-misc.h"
#include "stream-tcp-reassemble.h"
#include "action-globals.h"
void ExceptionPolicyApply(Packet *p, enum ExceptionPolicy policy, enum PacketDropReason drop_reason)
{

@ -56,6 +56,7 @@
#include "util-lua.h"
#include "util-lua-common.h"
#include "action-globals.h"
int LuaCallbackError(lua_State *luastate, const char *msg)
{

@ -24,8 +24,6 @@
#ifndef _UTIL_PRIVS_H
#define _UTIL_PRIVS_H
#include "threadvars.h"
#define SC_CAP_NONE 0x01
#define SC_CAP_SYS_ADMIN 0x02
#define SC_CAP_SYS_RAW_IO 0x04
@ -35,11 +33,9 @@
#define SC_CAP_NET_BIND_SERVICE 0x40
#define SC_CAP_NET_BROADCAST 0x80
#ifndef HAVE_LIBCAP_NG
#define SCDropCaps(...)
#define SCDropMainThreadCaps(...)
#else
#ifdef HAVE_LIBCAP_NG
#include <cap-ng.h>
#include "threadvars.h"
/**Drop the previliges of the given thread tv, based on the thread cap_flags
* which implies the capability requirement of the given thread. Initially all
@ -89,6 +85,9 @@ void SCDropCaps(ThreadVars *tv);
*/
void SCDropMainThreadCaps(uint32_t , uint32_t );
#else
#define SCDropCaps(...)
#define SCDropMainThreadCaps(...)
#endif /* HAVE_LIBCAP_NG */
int SCGetUserID(const char *, const char *, uint32_t *, uint32_t *);

@ -28,7 +28,6 @@
#ifdef PROFILING
#include "detect.h"
#include "util-cpu.h"
#include "util-profiling-locks.h"
extern int profiling_rules_enabled;

@ -25,7 +25,6 @@
#define __UTIL_UNITTEST_HELPER__
#if defined(UNITTESTS)
#include "packet.h"
#include "flow.h"
#include "detect.h"
#elif defined(FUZZ)

Loading…
Cancel
Save