detect/mpm: remove unused max_id param from API

pull/1978/head
Victor Julien 11 years ago
parent 0d3f671b55
commit 14d9ce7b2e

@ -1690,7 +1690,7 @@ AppLayerProtoDetectThreadCtx *AppLayerProtoDetectGetCtxThread(void)
for (j = 0; j < 2; j++) {
mpm_ctx = &alpd_ctx.ctx_ipp[i].ctx_pm[j].mpm_ctx;
mpm_tctx = &alpd_tctx->mpm_tctx[i][j];
mpm_table[mpm_ctx->mpm_type].InitThreadCtx(mpm_ctx, mpm_tctx, 0);
mpm_table[mpm_ctx->mpm_type].InitThreadCtx(mpm_ctx, mpm_tctx);
}
}

@ -1437,7 +1437,7 @@ static void SMTPSetMpmState(void)
exit(EXIT_FAILURE);
}
memset(smtp_mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitThreadCtx(smtp_mpm_thread_ctx, SMTP_MPM, 0);
MpmInitThreadCtx(smtp_mpm_thread_ctx, SMTP_MPM);
uint32_t i = 0;
for (i = 0; i < sizeof(smtp_reply_map)/sizeof(SCEnumCharMap) - 1; i++) {

@ -813,10 +813,10 @@ void PatternMatchThreadDestroy(MpmThreadCtx *mpm_thread_ctx, uint16_t mpm_matche
if (mpm_table[mpm_matcher].DestroyThreadCtx != NULL)
mpm_table[mpm_matcher].DestroyThreadCtx(NULL, mpm_thread_ctx);
}
void PatternMatchThreadPrepare(MpmThreadCtx *mpm_thread_ctx, uint16_t mpm_matcher, uint32_t max_id)
void PatternMatchThreadPrepare(MpmThreadCtx *mpm_thread_ctx, uint16_t mpm_matcher)
{
SCLogDebug("mpm_thread_ctx %p, type %"PRIu16", max_id %"PRIu32"", mpm_thread_ctx, mpm_matcher, max_id);
MpmInitThreadCtx(mpm_thread_ctx, mpm_matcher, max_id);
SCLogDebug("mpm_thread_ctx %p, type %"PRIu16, mpm_thread_ctx, mpm_matcher);
MpmInitThreadCtx(mpm_thread_ctx, mpm_matcher);
}

@ -58,7 +58,7 @@ void PacketPatternCleanup(ThreadVars *, DetectEngineThreadCtx *);
void StreamPatternCleanup(ThreadVars *t, DetectEngineThreadCtx *det_ctx, StreamMsg *smsg);
void PatternMatchPrepare(MpmCtx *, uint16_t);
void PatternMatchThreadPrepare(MpmThreadCtx *, uint16_t type, uint32_t max_id);
void PatternMatchThreadPrepare(MpmThreadCtx *, uint16_t type);
void PatternMatchDestroy(MpmCtx *, uint16_t);
void PatternMatchThreadDestroy(MpmThreadCtx *mpm_thread_ctx, uint16_t);

@ -1455,15 +1455,9 @@ static TmEcode ThreadCtxDoInit (DetectEngineCtx *de_ctx, DetectEngineThreadCtx *
{
int i;
/** \todo we still depend on the global mpm_ctx here
*
* Initialize the thread pattern match ctx with the max size
* of the content and uricontent id's so our match lookup
* table is always big enough
*/
PatternMatchThreadPrepare(&det_ctx->mtc, de_ctx->mpm_matcher, DetectContentMaxId(de_ctx));
PatternMatchThreadPrepare(&det_ctx->mtcs, de_ctx->mpm_matcher, DetectContentMaxId(de_ctx));
PatternMatchThreadPrepare(&det_ctx->mtcu, de_ctx->mpm_matcher, DetectUricontentMaxId(de_ctx));
PatternMatchThreadPrepare(&det_ctx->mtc, de_ctx->mpm_matcher);
PatternMatchThreadPrepare(&det_ctx->mtcs, de_ctx->mpm_matcher);
PatternMatchThreadPrepare(&det_ctx->mtcu, de_ctx->mpm_matcher);
PmqSetup(&det_ctx->pmq, de_ctx->max_fp_id);
for (i = 0; i < DETECT_SMSG_PMQ_NUM; i++) {

@ -61,7 +61,7 @@
#include "util-memcpy.h"
void SCACBSInitCtx(MpmCtx *);
void SCACBSInitThreadCtx(MpmCtx *, MpmThreadCtx *, uint32_t);
void SCACBSInitThreadCtx(MpmCtx *, MpmThreadCtx *);
void SCACBSDestroyCtx(MpmCtx *);
void SCACBSDestroyThreadCtx(MpmCtx *, MpmThreadCtx *);
int SCACBSAddPatternCI(MpmCtx *, uint8_t *, uint16_t, uint16_t, uint16_t,
@ -1252,7 +1252,7 @@ error:
* \param mpm_thread_ctx Pointer to the mpm thread context.
* \param matchsize We don't need this.
*/
void SCACBSInitThreadCtx(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, uint32_t matchsize)
void SCACBSInitThreadCtx(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx)
{
memset(mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
@ -1713,7 +1713,7 @@ static int SCACBSTest01(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -1747,7 +1747,7 @@ static int SCACBSTest02(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0);
@ -1780,7 +1780,7 @@ static int SCACBSTest03(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -1817,7 +1817,7 @@ static int SCACBSTest04(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0);
@ -1851,7 +1851,7 @@ static int SCACBSTest05(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
@ -1885,7 +1885,7 @@ static int SCACBSTest06(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 1);
@ -1917,7 +1917,7 @@ static int SCACBSTest07(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* should match 30 times */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0);
@ -1962,7 +1962,7 @@ static int SCACBSTest08(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -1994,7 +1994,7 @@ static int SCACBSTest09(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0);
@ -2026,7 +2026,7 @@ static int SCACBSTest10(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0);
@ -2063,7 +2063,7 @@ static int SCACBSTest11(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1)
goto end;
@ -2110,7 +2110,7 @@ static int SCACBSTest12(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0);
@ -2145,7 +2145,7 @@ static int SCACBSTest13(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCD";
@ -2179,7 +2179,7 @@ static int SCACBSTest14(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDE";
@ -2213,7 +2213,7 @@ static int SCACBSTest15(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF";
@ -2247,7 +2247,7 @@ static int SCACBSTest16(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABC";
@ -2281,7 +2281,7 @@ static int SCACBSTest17(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzAB";
@ -2315,7 +2315,7 @@ static int SCACBSTest18(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z";
@ -2349,7 +2349,7 @@ static int SCACBSTest19(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
@ -2382,7 +2382,7 @@ static int SCACBSTest20(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA";
@ -2416,7 +2416,7 @@ static int SCACBSTest21(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
@ -2448,7 +2448,7 @@ static int SCACBSTest22(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -2483,7 +2483,7 @@ static int SCACBSTest23(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
@ -2515,7 +2515,7 @@ static int SCACBSTest24(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
@ -2547,7 +2547,7 @@ static int SCACBSTest25(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
@ -2581,7 +2581,7 @@ static int SCACBSTest26(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0);
@ -2614,7 +2614,7 @@ static int SCACBSTest27(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 0 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0);
@ -2647,7 +2647,7 @@ static int SCACBSTest28(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 0 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0);
@ -2680,7 +2680,7 @@ static int SCACBSTest29(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdef", 5, 0, 0, 1, 0, 0);

@ -81,7 +81,7 @@
#include "util-mpm-ac-tile.h"
void SCACTileInitCtx(MpmCtx *);
void SCACTileInitThreadCtx(MpmCtx *, MpmThreadCtx *, uint32_t);
void SCACTileInitThreadCtx(MpmCtx *, MpmThreadCtx *);
void SCACTileDestroyCtx(MpmCtx *);
void SCACTileDestroyThreadCtx(MpmCtx *, MpmThreadCtx *);
int SCACTileAddPatternCI(MpmCtx *, uint8_t *, uint16_t, uint16_t, uint16_t,
@ -1289,10 +1289,8 @@ error:
*
* \param mpm_ctx Pointer to the mpm context.
* \param mpm_thread_ctx Pointer to the mpm thread context.
* \param matchsize We don't need this.
*/
void SCACTileInitThreadCtx(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx,
uint32_t matchsize)
void SCACTileInitThreadCtx(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx)
{
memset(mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
@ -1850,7 +1848,7 @@ static int SCACTileTest01(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -1884,7 +1882,7 @@ static int SCACTileTest02(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0);
@ -1917,7 +1915,7 @@ static int SCACTileTest03(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -1954,7 +1952,7 @@ static int SCACTileTest04(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0);
@ -1988,7 +1986,7 @@ static int SCACTileTest05(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
@ -2022,7 +2020,7 @@ static int SCACTileTest06(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 1);
@ -2054,7 +2052,7 @@ static int SCACTileTest07(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* should match 30 times */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0);
@ -2099,7 +2097,7 @@ static int SCACTileTest08(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -2131,7 +2129,7 @@ static int SCACTileTest09(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0);
@ -2163,7 +2161,7 @@ static int SCACTileTest10(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0);
@ -2200,7 +2198,7 @@ static int SCACTileTest11(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1)
goto end;
@ -2247,7 +2245,7 @@ static int SCACTileTest12(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0);
@ -2282,7 +2280,7 @@ static int SCACTileTest13(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCD";
@ -2316,7 +2314,7 @@ static int SCACTileTest14(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDE";
@ -2350,7 +2348,7 @@ static int SCACTileTest15(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF";
@ -2384,7 +2382,7 @@ static int SCACTileTest16(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABC";
@ -2418,7 +2416,7 @@ static int SCACTileTest17(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzAB";
@ -2452,7 +2450,7 @@ static int SCACTileTest18(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z";
@ -2486,7 +2484,7 @@ static int SCACTileTest19(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
@ -2520,7 +2518,7 @@ static int SCACTileTest20(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA";
@ -2554,7 +2552,7 @@ static int SCACTileTest21(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
@ -2586,7 +2584,7 @@ static int SCACTileTest22(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -2621,7 +2619,7 @@ static int SCACTileTest23(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
@ -2653,7 +2651,7 @@ static int SCACTileTest24(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
@ -2685,7 +2683,7 @@ static int SCACTileTest25(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
@ -2719,7 +2717,7 @@ static int SCACTileTest26(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0);
@ -2752,7 +2750,7 @@ static int SCACTileTest27(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 0 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0);
@ -2785,7 +2783,7 @@ static int SCACTileTest28(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 0 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0);

@ -70,7 +70,7 @@
#endif /* __SC_CUDA_SUPPORT__ */
void SCACInitCtx(MpmCtx *);
void SCACInitThreadCtx(MpmCtx *, MpmThreadCtx *, uint32_t);
void SCACInitThreadCtx(MpmCtx *, MpmThreadCtx *);
void SCACDestroyCtx(MpmCtx *);
void SCACDestroyThreadCtx(MpmCtx *, MpmThreadCtx *);
int SCACAddPatternCI(MpmCtx *, uint8_t *, uint16_t, uint16_t, uint16_t,
@ -1144,7 +1144,7 @@ error:
* \param mpm_thread_ctx Pointer to the mpm thread context.
* \param matchsize We don't need this.
*/
void SCACInitThreadCtx(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, uint32_t matchsize)
void SCACInitThreadCtx(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx)
{
memset(mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
@ -2288,7 +2288,7 @@ static int SCACTest01(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -2322,7 +2322,7 @@ static int SCACTest02(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0);
@ -2355,7 +2355,7 @@ static int SCACTest03(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -2392,7 +2392,7 @@ static int SCACTest04(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0);
@ -2426,7 +2426,7 @@ static int SCACTest05(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
@ -2460,7 +2460,7 @@ static int SCACTest06(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 1);
@ -2492,7 +2492,7 @@ static int SCACTest07(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* should match 30 times */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0);
@ -2537,7 +2537,7 @@ static int SCACTest08(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -2569,7 +2569,7 @@ static int SCACTest09(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0);
@ -2601,7 +2601,7 @@ static int SCACTest10(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0);
@ -2638,7 +2638,7 @@ static int SCACTest11(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1)
goto end;
@ -2685,7 +2685,7 @@ static int SCACTest12(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0);
@ -2720,7 +2720,7 @@ static int SCACTest13(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCD";
@ -2754,7 +2754,7 @@ static int SCACTest14(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDE";
@ -2788,7 +2788,7 @@ static int SCACTest15(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF";
@ -2822,7 +2822,7 @@ static int SCACTest16(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABC";
@ -2856,7 +2856,7 @@ static int SCACTest17(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzAB";
@ -2890,7 +2890,7 @@ static int SCACTest18(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z";
@ -2924,7 +2924,7 @@ static int SCACTest19(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
@ -2958,7 +2958,7 @@ static int SCACTest20(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA";
@ -2992,7 +2992,7 @@ static int SCACTest21(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
@ -3024,7 +3024,7 @@ static int SCACTest22(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
@ -3059,7 +3059,7 @@ static int SCACTest23(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
@ -3091,7 +3091,7 @@ static int SCACTest24(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 1 */
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
@ -3123,7 +3123,7 @@ static int SCACTest25(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
@ -3157,7 +3157,7 @@ static int SCACTest26(void)
memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0);
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0);
@ -3190,7 +3190,7 @@ static int SCACTest27(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 0 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0);
@ -3223,7 +3223,7 @@ static int SCACTest28(void)
memset(&mpm_ctx, 0, sizeof(MpmCtx));
memset(&mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
/* 0 match */
MpmAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0);

@ -46,7 +46,7 @@
#include <hs.h>
void SCHSInitCtx(MpmCtx *);
void SCHSInitThreadCtx(MpmCtx *, MpmThreadCtx *, uint32_t);
void SCHSInitThreadCtx(MpmCtx *, MpmThreadCtx *);
void SCHSDestroyCtx(MpmCtx *);
void SCHSDestroyThreadCtx(MpmCtx *, MpmThreadCtx *);
int SCHSAddPatternCI(MpmCtx *, uint8_t *, uint16_t, uint16_t, uint16_t,
@ -761,10 +761,8 @@ error:
*
* \param mpm_ctx Pointer to the mpm context.
* \param mpm_thread_ctx Pointer to the mpm thread context.
* \param matchsize We don't need this.
*/
void SCHSInitThreadCtx(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx,
uint32_t matchsize)
void SCHSInitThreadCtx(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx)
{
memset(mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
@ -1124,7 +1122,7 @@ static int SCHSTest01(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghjiklmnopqrstuvwxyz";
@ -1158,7 +1156,7 @@ static int SCHSTest02(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghjiklmnopqrstuvwxyz";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1195,7 +1193,7 @@ static int SCHSTest03(void)
PmqSetup(&pmq, 3);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghjiklmnopqrstuvwxyz";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1229,7 +1227,7 @@ static int SCHSTest04(void)
PmqSetup(&pmq, 3);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghjiklmnopqrstuvwxyz";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1263,7 +1261,7 @@ static int SCHSTest05(void)
PmqSetup(&pmq, 3);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghjiklmnopqrstuvwxyz";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1295,7 +1293,7 @@ static int SCHSTest06(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcd";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1339,7 +1337,7 @@ static int SCHSTest07(void)
PmqSetup(&pmq, 6);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1372,7 +1370,7 @@ static int SCHSTest08(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
uint32_t cnt =
SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)"a", 1);
@ -1404,7 +1402,7 @@ static int SCHSTest09(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
uint32_t cnt =
SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)"ab", 2);
@ -1436,7 +1434,7 @@ static int SCHSTest10(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "01234567890123456789012345678901234567890123456789"
"01234567890123456789012345678901234567890123456789"
@ -1481,7 +1479,7 @@ static int SCHSTest11(void)
if (SCHSPreparePatterns(&mpm_ctx) == -1)
goto end;
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
result = 1;
@ -1523,7 +1521,7 @@ static int SCHSTest12(void)
PmqSetup(&pmq, 2);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghijklmnopqrstuvwxyz";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1557,7 +1555,7 @@ static int SCHSTest13(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghijklmnopqrstuvwxyzABCD";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1591,7 +1589,7 @@ static int SCHSTest14(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghijklmnopqrstuvwxyzABCDE";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1625,7 +1623,7 @@ static int SCHSTest15(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghijklmnopqrstuvwxyzABCDEF";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1659,7 +1657,7 @@ static int SCHSTest16(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghijklmnopqrstuvwxyzABC";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1693,7 +1691,7 @@ static int SCHSTest17(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghijklmnopqrstuvwxyzAB";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1732,7 +1730,7 @@ static int SCHSTest18(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcde"
"fghij"
@ -1771,7 +1769,7 @@ static int SCHSTest19(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1811,7 +1809,7 @@ static int SCHSTest20(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "AAAAA"
"AAAAA"
@ -1850,7 +1848,7 @@ static int SCHSTest21(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
uint32_t cnt =
SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)"AA", 2);
@ -1884,7 +1882,7 @@ static int SCHSTest22(void)
PmqSetup(&pmq, 2);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "abcdefghijklmnopqrstuvwxyz";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -1917,7 +1915,7 @@ static int SCHSTest23(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
uint32_t cnt =
SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)"aa", 2);
@ -1949,7 +1947,7 @@ static int SCHSTest24(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
uint32_t cnt =
SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)"aa", 2);
@ -1982,7 +1980,7 @@ static int SCHSTest25(void)
PmqSetup(&pmq, 3);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -2015,7 +2013,7 @@ static int SCHSTest26(void)
PmqSetup(&pmq, 2);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "works";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -2048,7 +2046,7 @@ static int SCHSTest27(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "tone";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,
@ -2081,7 +2079,7 @@ static int SCHSTest28(void)
PmqSetup(&pmq, 1);
SCHSPreparePatterns(&mpm_ctx);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCHSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx);
char *buf = "tONE";
uint32_t cnt = SCHSSearch(&mpm_ctx, &mpm_thread_ctx, &pmq, (uint8_t *)buf,

@ -612,9 +612,9 @@ void PmqFree(PatternMatcherQueue *pmq)
PmqCleanup(pmq);
}
void MpmInitThreadCtx(MpmThreadCtx *mpm_thread_ctx, uint16_t matcher, uint32_t max_id)
void MpmInitThreadCtx(MpmThreadCtx *mpm_thread_ctx, uint16_t matcher)
{
mpm_table[matcher].InitThreadCtx(NULL, mpm_thread_ctx, max_id);
mpm_table[matcher].InitThreadCtx(NULL, mpm_thread_ctx);
}
void MpmInitCtx (MpmCtx *mpm_ctx, uint16_t matcher)

@ -138,7 +138,7 @@ typedef struct MpmTableElmt_ {
char *name;
uint8_t max_pattern_length;
void (*InitCtx)(struct MpmCtx_ *);
void (*InitThreadCtx)(struct MpmCtx_ *, struct MpmThreadCtx_ *, uint32_t);
void (*InitThreadCtx)(struct MpmCtx_ *, struct MpmThreadCtx_ *);
void (*DestroyCtx)(struct MpmCtx_ *);
void (*DestroyThreadCtx)(struct MpmCtx_ *, struct MpmThreadCtx_ *);
@ -220,7 +220,7 @@ void MpmTableSetup(void);
void MpmRegisterTests(void);
void MpmInitCtx(MpmCtx *mpm_ctx, uint16_t matcher);
void MpmInitThreadCtx(MpmThreadCtx *mpm_thread_ctx, uint16_t, uint32_t);
void MpmInitThreadCtx(MpmThreadCtx *mpm_thread_ctx, uint16_t);
int MpmAddPatternCS(struct MpmCtx_ *mpm_ctx, uint8_t *pat, uint16_t patlen,
uint16_t offset, uint16_t depth,

Loading…
Cancel
Save