]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: no longer a thread module
authorVictor Julien <victor@inliniac.net>
Fri, 27 May 2016 14:39:14 +0000 (16:39 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 28 May 2016 07:10:26 +0000 (09:10 +0200)
Like stream, detect is now invoked directly by the FlowWorker.

src/detect.c
src/runmode-unittests.c
src/suricata.c
src/tm-modules.c
src/tm-threads-common.h

index 860b330b3dce89711ef8d8229b2a94c5b5d4024b..9fb005fcf181bfb47055e21bed7b88cbc26709f9 100644 (file)
@@ -219,32 +219,6 @@ void DbgPrintSigs(DetectEngineCtx *, SigGroupHead *);
 void DbgPrintSigs2(DetectEngineCtx *, SigGroupHead *);
 static void PacketCreateMask(Packet *, SignatureMask *, uint16_t, int, StreamMsg *, int);
 
-/* tm module api functions */
-TmEcode Detect(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *);
-TmEcode DetectThreadInit(ThreadVars *, void *, void **);
-TmEcode DetectThreadDeinit(ThreadVars *, void *);
-
-void TmModuleDetectRegister (void)
-{
-    tmm_modules[TMM_DETECT].name = "Detect";
-    tmm_modules[TMM_DETECT].ThreadInit = DetectThreadInit;
-    tmm_modules[TMM_DETECT].Func = Detect;
-    tmm_modules[TMM_DETECT].ThreadExitPrintStats = DetectExitPrintStats;
-    tmm_modules[TMM_DETECT].ThreadDeinit = DetectThreadDeinit;
-    tmm_modules[TMM_DETECT].RegisterTests = SigRegisterTests;
-    tmm_modules[TMM_DETECT].cap_flags = 0;
-    tmm_modules[TMM_DETECT].flags = TM_FLAG_DETECT_TM;
-
-    PacketAlertTagInit();
-}
-
-void DetectExitPrintStats(ThreadVars *tv, void *data)
-{
-    DetectEngineThreadCtx *det_ctx = (DetectEngineThreadCtx *)data;
-    if (det_ctx == NULL)
-        return;
-}
-
 /**
  *  \brief Create the path if default-rule-path was specified
  *  \param sig_file The name of the file
@@ -2062,16 +2036,6 @@ error:
     return TM_ECODE_FAILED;
 }
 
-TmEcode DetectThreadInit(ThreadVars *t, void *initdata, void **data)
-{
-    return DetectEngineThreadCtxInit(t,initdata,data);
-}
-
-TmEcode DetectThreadDeinit(ThreadVars *t, void *data)
-{
-    return DetectEngineThreadCtxDeinit(t,data);
-}
-
 void SigCleanSignatures(DetectEngineCtx *de_ctx)
 {
     Signature *s = NULL, *ns;
index 74e194afc0ef2e95859dcfe570b66b0f1c907e22..b5d22bd3b19c57bf9413d71d4ab639021cab1623 100644 (file)
@@ -196,6 +196,7 @@ void RunUnittests(int list_unittests, char *regex_arg)
     UtInitialize();
     UTHRegisterTests();
     StreamTcpRegisterTests();
+    SigRegisterTests();
     SCReputationRegisterTests();
     TmModuleRegisterTests();
     SigTableRegisterTests();
index b619233ca38803ded908f381ffa4c961347bbb91..4b77edf24099e5ccddea9e9827f3bfe9e75414f8 100644 (file)
@@ -859,8 +859,6 @@ void RegisterAllModules()
 
     /* flow worker */
     TmModuleFlowWorkerRegister();
-    /* detection */
-    TmModuleDetectRegister();
     /* respond-reject */
     TmModuleRespondRejectRegister();
 
index 0b835fa3453e984bfb76e44173aeb38cf34ccf5b..6627a822a1c545b7dfb0c61900e58036bdc5e6f9 100644 (file)
@@ -211,7 +211,6 @@ const char * TmModuleTmmIdToString(TmmId id)
         CASE_CODE (TMM_DECODEPCAPFILE);
         CASE_CODE (TMM_RECEIVEPFRING);
         CASE_CODE (TMM_DECODEPFRING);
-        CASE_CODE (TMM_DETECT);
         CASE_CODE (TMM_ALERTFASTLOG);
         CASE_CODE (TMM_ALERTFASTLOG4);
         CASE_CODE (TMM_ALERTFASTLOG6);
index ed442ba8e0ac3bc35a46b9714dbc14903272790a..af04988f57419c414acc69ac715438210abe5360 100644 (file)
@@ -41,7 +41,6 @@ typedef enum {
     TMM_DECODEPCAPFILE,
     TMM_RECEIVEPFRING,
     TMM_DECODEPFRING,
-    TMM_DETECT,
     TMM_ALERTFASTLOG,
     TMM_ALERTFASTLOG4,
     TMM_ALERTFASTLOG6,