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.
pull/11152/head
Jason Ish 2 years ago committed by Victor Julien
parent 47d6c3a3ab
commit 6e2a1ec5d6

@ -21,8 +21,8 @@
* \author Victor Julien <victor@inliniac.net> * \author Victor Julien <victor@inliniac.net>
*/ */
#ifndef SURICATA_DETECT_PORT_H #ifndef SURICATA_DETECT_ENGINE_PORT_H
#define SURICATA_DETECT_PORT_H #define SURICATA_DETECT_ENGINE_PORT_H
#include "interval-tree.h" #include "interval-tree.h"
#include "detect.h" #include "detect.h"
@ -41,17 +41,6 @@ IRB_HEAD(PI, SCPortIntervalNode); /* head of the interval tree */
IRB_PROTOTYPE(PI, SCPortIntervalNode, irb, IRB_PROTOTYPE(PI, SCPortIntervalNode, irb,
SCPortIntervalCompare); /* prototype definition of the interval tree */ 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 */ /* prototypes */
int DetectPortParse(const DetectEngineCtx *, DetectPort **head, const char *str); int DetectPortParse(const DetectEngineCtx *, DetectPort **head, const char *str);
@ -80,4 +69,4 @@ int DetectPortHashInit(DetectEngineCtx *de_ctx);
void DetectPortTests(void); void DetectPortTests(void);
#endif #endif
#endif /* SURICATA_DETECT_PORT_H */ #endif /* SURICATA_DETECT_ENGINE_PORT_H */

@ -21,9 +21,20 @@
* \author Shivani Bhardwaj <shivani@oisf.net> * \author Shivani Bhardwaj <shivani@oisf.net>
*/ */
#ifndef SURICATA_UTIL_INTERVAL_TREE_H #ifndef SURICATA_UTIL_PORT_INTERVAL_TREE_H
#define SURICATA_UTIL_INTERVAL_TREE_H #define SURICATA_UTIL_PORT_INTERVAL_TREE_H
#include "detect-engine-port.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 */

Loading…
Cancel
Save