detect/iponly: remove DetectEngineIPOnlyThreadCtx

This is unused.

Issue: 4578
pull/8713/head
Justin Azoff 3 years ago committed by Victor Julien
parent dfbc3da0eb
commit aacb7dc291

@ -895,25 +895,6 @@ SigIntId IPOnlyTrackSigNum(DetectEngineIPOnlyCtx *io_ctx, SigIntId signum)
return loc; return loc;
} }
/**
* \brief Setup the IP Only thread detection engine context
*
* \param de_ctx Pointer to the current detection engine
* \param io_ctx Pointer to the current ip only thread detection engine
*/
void DetectEngineIPOnlyThreadInit(DetectEngineCtx *de_ctx,
DetectEngineIPOnlyThreadCtx *io_tctx)
{
/* initialize the signature bitarray */
io_tctx->sig_match_size = de_ctx->io_ctx.max_idx / 8 + 1;
io_tctx->sig_match_array = SCMalloc(io_tctx->sig_match_size);
if (io_tctx->sig_match_array == NULL) {
exit(EXIT_FAILURE);
}
memset(io_tctx->sig_match_array, 0, io_tctx->sig_match_size);
}
/** /**
* \brief Print stats of the IP Only engine * \brief Print stats of the IP Only engine
* *
@ -958,17 +939,6 @@ void IPOnlyDeinit(DetectEngineCtx *de_ctx, DetectEngineIPOnlyCtx *io_ctx)
io_ctx->sig_mapping = NULL; io_ctx->sig_mapping = NULL;
} }
/**
* \brief Deinitialize the IP Only thread detection engine context
*
* \param de_ctx Pointer to the current detection engine
* \param io_ctx Pointer to the current ip only detection engine
*/
void DetectEngineIPOnlyThreadDeinit(DetectEngineIPOnlyThreadCtx *io_tctx)
{
SCFree(io_tctx->sig_match_array);
}
static inline static inline
int IPOnlyMatchCompatSMs(ThreadVars *tv, int IPOnlyMatchCompatSMs(ThreadVars *tv,
DetectEngineThreadCtx *det_ctx, DetectEngineThreadCtx *det_ctx,
@ -1002,11 +972,8 @@ int IPOnlyMatchCompatSMs(ThreadVars *tv,
* \param io_ctx Pointer to the current ip only thread detection engine * \param io_ctx Pointer to the current ip only thread detection engine
* \param p Pointer to the Packet to match against * \param p Pointer to the Packet to match against
*/ */
void IPOnlyMatchPacket(ThreadVars *tv, void IPOnlyMatchPacket(ThreadVars *tv, const DetectEngineCtx *de_ctx,
const DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineIPOnlyCtx *io_ctx, Packet *p)
DetectEngineThreadCtx *det_ctx,
const DetectEngineIPOnlyCtx *io_ctx,
DetectEngineIPOnlyThreadCtx *io_tctx, Packet *p)
{ {
SigNumArray *src = NULL; SigNumArray *src = NULL;
SigNumArray *dst = NULL; SigNumArray *dst = NULL;

@ -26,15 +26,12 @@
void IPOnlyCIDRListFree(IPOnlyCIDRItem *tmphead); void IPOnlyCIDRListFree(IPOnlyCIDRItem *tmphead);
int IPOnlySigParseAddress(const DetectEngineCtx *, Signature *, const char *, char); int IPOnlySigParseAddress(const DetectEngineCtx *, Signature *, const char *, char);
void IPOnlyMatchPacket(ThreadVars *tv, const DetectEngineCtx *, void IPOnlyMatchPacket(ThreadVars *tv, const DetectEngineCtx *, DetectEngineThreadCtx *,
DetectEngineThreadCtx *, const DetectEngineIPOnlyCtx *, const DetectEngineIPOnlyCtx *, Packet *);
DetectEngineIPOnlyThreadCtx *, Packet *);
void IPOnlyInit(DetectEngineCtx *, DetectEngineIPOnlyCtx *); void IPOnlyInit(DetectEngineCtx *, DetectEngineIPOnlyCtx *);
void IPOnlyPrint(DetectEngineCtx *, DetectEngineIPOnlyCtx *); void IPOnlyPrint(DetectEngineCtx *, DetectEngineIPOnlyCtx *);
void IPOnlyDeinit(DetectEngineCtx *, DetectEngineIPOnlyCtx *); void IPOnlyDeinit(DetectEngineCtx *, DetectEngineIPOnlyCtx *);
void IPOnlyPrepare(DetectEngineCtx *); void IPOnlyPrepare(DetectEngineCtx *);
void DetectEngineIPOnlyThreadInit(DetectEngineCtx *, DetectEngineIPOnlyThreadCtx *);
void DetectEngineIPOnlyThreadDeinit(DetectEngineIPOnlyThreadCtx *);
SigIntId IPOnlyTrackSigNum(DetectEngineIPOnlyCtx *, SigIntId); SigIntId IPOnlyTrackSigNum(DetectEngineIPOnlyCtx *, SigIntId);
void IPOnlyAddSignature(DetectEngineCtx *, DetectEngineIPOnlyCtx *, Signature *); void IPOnlyAddSignature(DetectEngineCtx *, DetectEngineIPOnlyCtx *, Signature *);
void IPOnlyRegisterTests(void); void IPOnlyRegisterTests(void);

@ -3046,9 +3046,6 @@ static TmEcode ThreadCtxDoInit (DetectEngineCtx *de_ctx, DetectEngineThreadCtx *
BUG_ON(det_ctx->non_pf_id_array == NULL); BUG_ON(det_ctx->non_pf_id_array == NULL);
} }
/* IP-ONLY */
DetectEngineIPOnlyThreadInit(de_ctx,&det_ctx->io_ctx);
/* DeState */ /* DeState */
if (de_ctx->sig_array_len > 0) { if (de_ctx->sig_array_len > 0) {
det_ctx->match_array_len = de_ctx->sig_array_len; det_ctx->match_array_len = de_ctx->sig_array_len;
@ -3277,8 +3274,6 @@ static void DetectEngineThreadCtxFree(DetectEngineThreadCtx *det_ctx)
SCProfilingSghThreadCleanup(det_ctx); SCProfilingSghThreadCleanup(det_ctx);
#endif #endif
DetectEngineIPOnlyThreadDeinit(&det_ctx->io_ctx);
/** \todo get rid of this static */ /** \todo get rid of this static */
if (det_ctx->de_ctx != NULL) { if (det_ctx->de_ctx != NULL) {
PatternMatchThreadDestroy(&det_ctx->mtc, det_ctx->de_ctx->mpm_matcher); PatternMatchThreadDestroy(&det_ctx->mtc, det_ctx->de_ctx->mpm_matcher);

@ -562,7 +562,7 @@ static void DetectRunInspectIPOnly(ThreadVars *tv, const DetectEngineCtx *de_ctx
SCLogDebug("testing against \"ip-only\" signatures"); SCLogDebug("testing against \"ip-only\" signatures");
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_IPONLY); PACKET_PROFILING_DETECT_START(p, PROF_DETECT_IPONLY);
IPOnlyMatchPacket(tv, de_ctx, det_ctx, &de_ctx->io_ctx, &det_ctx->io_ctx, p); IPOnlyMatchPacket(tv, de_ctx, det_ctx, &de_ctx->io_ctx, p);
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_IPONLY); PACKET_PROFILING_DETECT_END(p, PROF_DETECT_IPONLY);
/* save in the flow that we scanned this direction... */ /* save in the flow that we scanned this direction... */
@ -573,8 +573,7 @@ static void DetectRunInspectIPOnly(ThreadVars *tv, const DetectEngineCtx *de_ctx
/* Even without flow we should match the packet src/dst */ /* Even without flow we should match the packet src/dst */
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_IPONLY); PACKET_PROFILING_DETECT_START(p, PROF_DETECT_IPONLY);
IPOnlyMatchPacket(tv, de_ctx, det_ctx, &de_ctx->io_ctx, IPOnlyMatchPacket(tv, de_ctx, det_ctx, &de_ctx->io_ctx, p);
&det_ctx->io_ctx, p);
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_IPONLY); PACKET_PROFILING_DETECT_END(p, PROF_DETECT_IPONLY);
} }
} }

@ -704,11 +704,6 @@ typedef struct SCFPSupportSMList_ {
struct SCFPSupportSMList_ *next; struct SCFPSupportSMList_ *next;
} SCFPSupportSMList; } SCFPSupportSMList;
typedef struct DetectEngineIPOnlyThreadCtx_ {
uint8_t *sig_match_array; /* bit array of sig nums */
uint32_t sig_match_size; /* size in bytes of the array */
} DetectEngineIPOnlyThreadCtx;
/** \brief IP only rules matching ctx. */ /** \brief IP only rules matching ctx. */
typedef struct DetectEngineIPOnlyCtx_ { typedef struct DetectEngineIPOnlyCtx_ {
/* Lookup trees */ /* Lookup trees */
@ -1144,9 +1139,6 @@ typedef struct DetectEngineThreadCtx_ {
* prototype held by DetectEngineCtx. */ * prototype held by DetectEngineCtx. */
SpmThreadCtx *spm_thread_ctx; SpmThreadCtx *spm_thread_ctx;
/** ip only rules ctx */
DetectEngineIPOnlyThreadCtx io_ctx;
/* byte_* values */ /* byte_* values */
uint64_t *byte_values; uint64_t *byte_values;

Loading…
Cancel
Save