]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mpm: rename internal id for ac-tile to ac-ks
authorVictor Julien <victor@inliniac.net>
Wed, 20 Feb 2019 20:11:14 +0000 (21:11 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 20 Feb 2019 20:11:14 +0000 (21:11 +0100)
src/detect-engine-mpm.c
src/detect-engine.c
src/util-mpm-ac-tile.c
src/util-mpm-ac-tile.h
src/util-mpm.c
src/util-mpm.h

index c7aa845cc39d61ef9278dc60cee0cf90f4e286f9..59c85374108ae7c9c5a92a84e3e9d38164038a4f 100644 (file)
@@ -508,7 +508,7 @@ uint16_t PatternMatchDefaultMatcher(void)
  done:
 #ifdef __tile__
     if (mpm_algo_val == MPM_AC)
-        mpm_algo_val = MPM_AC_TILE;
+        mpm_algo_val = MPM_AC_KS;
 #endif
 
     return mpm_algo_val;
index 0f753990562336be262cafa5da44e79e975d6c3a..b3cf753b951d750b4ad6d0b297a111211673a535 100644 (file)
@@ -1822,7 +1822,7 @@ static int DetectEngineCtxLoadConf(DetectEngineCtx *de_ctx)
     if (sgh_mpm_context == NULL || strcmp(sgh_mpm_context, "auto") == 0) {
         /* for now, since we still haven't implemented any intelligence into
          * understanding the patterns and distributing mpm_ctx across sgh */
-        if (de_ctx->mpm_matcher == MPM_AC || de_ctx->mpm_matcher == MPM_AC_TILE ||
+        if (de_ctx->mpm_matcher == MPM_AC || de_ctx->mpm_matcher == MPM_AC_KS ||
 #ifdef BUILD_HYPERSCAN
             de_ctx->mpm_matcher == MPM_HS ||
 #endif
index 0d8c8887af89182fe3c4f1f8b72101256538313a..22b8222b82e4f59311080747162d23c20a7355a3 100644 (file)
@@ -1495,21 +1495,21 @@ void SCACTilePrintInfo(MpmCtx *mpm_ctx)
 void MpmACTileRegister(void)
 {
 #ifdef __tile__
-    mpm_table[MPM_AC_TILE].name = "ac-tile";
+    mpm_table[MPM_AC_KS].name = "ac-tile";
 #else
-    mpm_table[MPM_AC_TILE].name = "ac-ks";
+    mpm_table[MPM_AC_KS].name = "ac-ks";
 #endif
-    mpm_table[MPM_AC_TILE].InitCtx = SCACTileInitCtx;
-    mpm_table[MPM_AC_TILE].InitThreadCtx = SCACTileInitThreadCtx;
-    mpm_table[MPM_AC_TILE].DestroyCtx = SCACTileDestroyCtx;
-    mpm_table[MPM_AC_TILE].DestroyThreadCtx = SCACTileDestroyThreadCtx;
-    mpm_table[MPM_AC_TILE].AddPattern = SCACTileAddPatternCS;
-    mpm_table[MPM_AC_TILE].AddPatternNocase = SCACTileAddPatternCI;
-    mpm_table[MPM_AC_TILE].Prepare = SCACTilePreparePatterns;
-    mpm_table[MPM_AC_TILE].Search = SCACTileSearch;
-    mpm_table[MPM_AC_TILE].PrintCtx = SCACTilePrintInfo;
-    mpm_table[MPM_AC_TILE].PrintThreadCtx = SCACTilePrintSearchStats;
-    mpm_table[MPM_AC_TILE].RegisterUnittests = SCACTileRegisterTests;
+    mpm_table[MPM_AC_KS].InitCtx = SCACTileInitCtx;
+    mpm_table[MPM_AC_KS].InitThreadCtx = SCACTileInitThreadCtx;
+    mpm_table[MPM_AC_KS].DestroyCtx = SCACTileDestroyCtx;
+    mpm_table[MPM_AC_KS].DestroyThreadCtx = SCACTileDestroyThreadCtx;
+    mpm_table[MPM_AC_KS].AddPattern = SCACTileAddPatternCS;
+    mpm_table[MPM_AC_KS].AddPatternNocase = SCACTileAddPatternCI;
+    mpm_table[MPM_AC_KS].Prepare = SCACTilePreparePatterns;
+    mpm_table[MPM_AC_KS].Search = SCACTileSearch;
+    mpm_table[MPM_AC_KS].PrintCtx = SCACTilePrintInfo;
+    mpm_table[MPM_AC_KS].PrintThreadCtx = SCACTilePrintSearchStats;
+    mpm_table[MPM_AC_KS].RegisterUnittests = SCACTileRegisterTests;
 }
 
 
@@ -1526,7 +1526,7 @@ static int SCACTileTest01(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -1560,7 +1560,7 @@ static int SCACTileTest02(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -1593,7 +1593,7 @@ static int SCACTileTest03(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -1630,7 +1630,7 @@ static int SCACTileTest04(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@@ -1664,7 +1664,7 @@ static int SCACTileTest05(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
@@ -1698,7 +1698,7 @@ static int SCACTileTest06(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@@ -1730,7 +1730,7 @@ static int SCACTileTest07(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* should match 30 times */
@@ -1775,7 +1775,7 @@ static int SCACTileTest08(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -1807,7 +1807,7 @@ static int SCACTileTest09(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -1839,7 +1839,7 @@ static int SCACTileTest10(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -1876,7 +1876,7 @@ static int SCACTileTest11(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1)
@@ -1923,7 +1923,7 @@ static int SCACTileTest12(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -1958,7 +1958,7 @@ static int SCACTileTest13(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -1992,7 +1992,7 @@ static int SCACTileTest14(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -2026,7 +2026,7 @@ static int SCACTileTest15(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -2060,7 +2060,7 @@ static int SCACTileTest16(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -2094,7 +2094,7 @@ static int SCACTileTest17(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -2128,7 +2128,7 @@ static int SCACTileTest18(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -2162,7 +2162,7 @@ static int SCACTileTest19(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 */
@@ -2196,7 +2196,7 @@ static int SCACTileTest20(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 */
@@ -2230,7 +2230,7 @@ static int SCACTileTest21(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 */
@@ -2262,7 +2262,7 @@ static int SCACTileTest22(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 match */
@@ -2297,7 +2297,7 @@ static int SCACTileTest23(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 */
@@ -2329,7 +2329,7 @@ static int SCACTileTest24(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 1 */
@@ -2361,7 +2361,7 @@ static int SCACTileTest25(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
@@ -2395,7 +2395,7 @@ static int SCACTileTest26(void)
 
     memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0);
@@ -2428,7 +2428,7 @@ static int SCACTileTest27(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 0 match */
@@ -2461,7 +2461,7 @@ static int SCACTileTest28(void)
 
     memset(&mpm_ctx, 0, sizeof(MpmCtx));
     memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
-    MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
+    MpmInitCtx(&mpm_ctx, MPM_AC_KS);
     SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
 
     /* 0 match */
index b594f63fedd700b4a7ff5e5da9e8f6a001c3254e..da2e21b407a7f323f745b722bc5a6e50a3d338c6 100644 (file)
@@ -23,8 +23,8 @@
  *
  */
 
-#ifndef __UTIL_MPM_AC_TILE__H__
-#define __UTIL_MPM_AC_TILE__H__
+#ifndef __UTIL_MPM_AC_KS__H__
+#define __UTIL_MPM_AC_KS__H__
 
 typedef struct SCACTilePatternList_ {
     uint8_t *cs;
@@ -155,4 +155,4 @@ typedef struct SCACTileThreadCtx_ {
 
 void MpmACTileRegister(void);
 
-#endif /* __UTIL_MPM_AC_TILE__H__ */
+#endif /* __UTIL_MPM_AC_KS__H__ */
index 12e9f0f32ccea5a0df0ab0ca05beadc83ddce782..88a2087c814d523853a65b617aef47a7d75b1c21 100644 (file)
@@ -269,13 +269,13 @@ void MpmInitCtx (MpmCtx *mpm_ctx, uint16_t matcher)
 #ifdef BUILD_HYPERSCAN
 # define DEFAULT_MPM     MPM_HS
 # ifdef __tile__
-#  define DEFAULT_MPM_AC MPM_AC_TILE
+#  define DEFAULT_MPM_AC MPM_AC_KS
 # else
 #  define DEFAULT_MPM_AC MPM_AC
 # endif
 #else
 # ifdef __tile__
-#  define DEFAULT_MPM    MPM_AC_TILE
+#  define DEFAULT_MPM    MPM_AC_KS
 # else
 #  define DEFAULT_MPM    MPM_AC
 # endif
index 3a48021697ae46bab8092b0cf267f9f8056e166a..e8a22cbf08b22f58c9b94b82e9198d95721719b5 100644 (file)
@@ -34,7 +34,7 @@ enum {
     /* aho-corasick */
     MPM_AC,
     MPM_AC_BS,
-    MPM_AC_TILE,
+    MPM_AC_KS,
     MPM_HS,
     /* table size */
     MPM_TABLE_SIZE,