From 6e2a1ec5d6a86b89c6ed25854a69952756243285 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Fri, 24 May 2024 16:45:10 -0600 Subject: [PATCH] misc: move prototypes to correct header Move prototypes for functions that exist in util-port-interval-tree.c from detect-engine-port.h to util-port-interval-tree.h. Fix header guard names while there. --- src/detect-engine-port.h | 17 +++-------------- src/util-port-interval-tree.h | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/detect-engine-port.h b/src/detect-engine-port.h index a9a1f997ba..5f197bbe03 100644 --- a/src/detect-engine-port.h +++ b/src/detect-engine-port.h @@ -21,8 +21,8 @@ * \author Victor Julien */ -#ifndef SURICATA_DETECT_PORT_H -#define SURICATA_DETECT_PORT_H +#ifndef SURICATA_DETECT_ENGINE_PORT_H +#define SURICATA_DETECT_ENGINE_PORT_H #include "interval-tree.h" #include "detect.h" @@ -41,17 +41,6 @@ IRB_HEAD(PI, SCPortIntervalNode); /* head of the interval tree */ IRB_PROTOTYPE(PI, SCPortIntervalNode, irb, SCPortIntervalCompare); /* prototype definition of the interval tree */ -typedef struct SCPortIntervalTree_ { - struct PI tree; - SCPortIntervalNode *head; -} SCPortIntervalTree; - -SCPortIntervalTree *SCPortIntervalTreeInit(void); -void SCPortIntervalTreeFree(DetectEngineCtx *, SCPortIntervalTree *); -int SCPortIntervalInsert(DetectEngineCtx *, SCPortIntervalTree *, const DetectPort *); -void SCPortIntervalFindOverlappingRanges( - DetectEngineCtx *, const uint16_t, const uint16_t, const struct PI *, DetectPort **); - /* prototypes */ int DetectPortParse(const DetectEngineCtx *, DetectPort **head, const char *str); @@ -80,4 +69,4 @@ int DetectPortHashInit(DetectEngineCtx *de_ctx); void DetectPortTests(void); #endif -#endif /* SURICATA_DETECT_PORT_H */ +#endif /* SURICATA_DETECT_ENGINE_PORT_H */ diff --git a/src/util-port-interval-tree.h b/src/util-port-interval-tree.h index d84c3527bb..03baa75e69 100644 --- a/src/util-port-interval-tree.h +++ b/src/util-port-interval-tree.h @@ -21,9 +21,20 @@ * \author Shivani Bhardwaj */ -#ifndef SURICATA_UTIL_INTERVAL_TREE_H -#define SURICATA_UTIL_INTERVAL_TREE_H +#ifndef SURICATA_UTIL_PORT_INTERVAL_TREE_H +#define SURICATA_UTIL_PORT_INTERVAL_TREE_H #include "detect-engine-port.h" -#endif /* SURICATA_UTIL_INTERVAL_TREE_H */ +typedef struct SCPortIntervalTree_ { + struct PI tree; + SCPortIntervalNode *head; +} SCPortIntervalTree; + +SCPortIntervalTree *SCPortIntervalTreeInit(void); +void SCPortIntervalTreeFree(DetectEngineCtx *, SCPortIntervalTree *); +int SCPortIntervalInsert(DetectEngineCtx *, SCPortIntervalTree *, const DetectPort *); +void SCPortIntervalFindOverlappingRanges( + DetectEngineCtx *, const uint16_t, const uint16_t, const struct PI *, DetectPort **); + +#endif /* SURICATA_UTIL_PORT_INTERVAL_TREE_H */ -- 2.47.2