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
*
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
int IPOnlyMatchCompatSMs(ThreadVars *tv,
DetectEngineThreadCtx *det_ctx,
* \param io_ctx Pointer to the current ip only thread detection engine
* \param p Pointer to the Packet to match against
*/
-void IPOnlyMatchPacket(ThreadVars *tv,
- const DetectEngineCtx *de_ctx,
- DetectEngineThreadCtx *det_ctx,
- const DetectEngineIPOnlyCtx *io_ctx,
- DetectEngineIPOnlyThreadCtx *io_tctx, Packet *p)
+void IPOnlyMatchPacket(ThreadVars *tv, const DetectEngineCtx *de_ctx,
+ DetectEngineThreadCtx *det_ctx, const DetectEngineIPOnlyCtx *io_ctx, Packet *p)
{
SigNumArray *src = NULL;
SigNumArray *dst = NULL;
void IPOnlyCIDRListFree(IPOnlyCIDRItem *tmphead);
int IPOnlySigParseAddress(const DetectEngineCtx *, Signature *, const char *, char);
-void IPOnlyMatchPacket(ThreadVars *tv, const DetectEngineCtx *,
- DetectEngineThreadCtx *, const DetectEngineIPOnlyCtx *,
- DetectEngineIPOnlyThreadCtx *, Packet *);
+void IPOnlyMatchPacket(ThreadVars *tv, const DetectEngineCtx *, DetectEngineThreadCtx *,
+ const DetectEngineIPOnlyCtx *, Packet *);
void IPOnlyInit(DetectEngineCtx *, DetectEngineIPOnlyCtx *);
void IPOnlyPrint(DetectEngineCtx *, DetectEngineIPOnlyCtx *);
void IPOnlyDeinit(DetectEngineCtx *, DetectEngineIPOnlyCtx *);
void IPOnlyPrepare(DetectEngineCtx *);
-void DetectEngineIPOnlyThreadInit(DetectEngineCtx *, DetectEngineIPOnlyThreadCtx *);
-void DetectEngineIPOnlyThreadDeinit(DetectEngineIPOnlyThreadCtx *);
SigIntId IPOnlyTrackSigNum(DetectEngineIPOnlyCtx *, SigIntId);
void IPOnlyAddSignature(DetectEngineCtx *, DetectEngineIPOnlyCtx *, Signature *);
void IPOnlyRegisterTests(void);
BUG_ON(det_ctx->non_pf_id_array == NULL);
}
- /* IP-ONLY */
- DetectEngineIPOnlyThreadInit(de_ctx,&det_ctx->io_ctx);
-
/* DeState */
if (de_ctx->sig_array_len > 0) {
det_ctx->match_array_len = de_ctx->sig_array_len;
SCProfilingSghThreadCleanup(det_ctx);
#endif
- DetectEngineIPOnlyThreadDeinit(&det_ctx->io_ctx);
-
/** \todo get rid of this static */
if (det_ctx->de_ctx != NULL) {
PatternMatchThreadDestroy(&det_ctx->mtc, det_ctx->de_ctx->mpm_matcher);
SCLogDebug("testing against \"ip-only\" signatures");
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);
/* save in the flow that we scanned this direction... */
/* Even without flow we should match the packet src/dst */
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);
}
}
struct DetectVarList_ *next;
} DetectVarList;
-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. */
typedef struct DetectEngineIPOnlyCtx_ {
/* Lookup trees */
* prototype held by DetectEngineCtx. */
SpmThreadCtx *spm_thread_ctx;
- /** ip only rules ctx */
- DetectEngineIPOnlyThreadCtx io_ctx;
-
/* byte_* values */
uint64_t *byte_values;