Code cleanup.

Use the MpmAddPattern[CS|CI] wrapper to add patterns to the mpm context.

Also use MpmInitCtx() to init the mpm context.
pull/321/merge
Anoop Saldanha 12 years ago committed by Victor Julien
parent 9c0456ebbe
commit a49cbf8a49

@ -41,6 +41,7 @@
#include "detect-engine-mpm.h" #include "detect-engine-mpm.h"
#include "detect-engine-state.h" #include "detect-engine-state.h"
#include "util-mpm.h"
#include "util-print.h" #include "util-print.h"
#include "util-pool.h" #include "util-pool.h"
#include "util-unittest.h" #include "util-unittest.h"
@ -251,13 +252,13 @@ void AlpProtoAddPattern(AlpProtoDetectCtx *ctx, char *name, uint16_t ip_proto,
if (ci == 1) { if (ci == 1) {
cd->flags |= DETECT_CONTENT_NOCASE; cd->flags |= DETECT_CONTENT_NOCASE;
mpm_table[dir->mpm_ctx.mpm_type]. MpmAddPatternCI(&dir->mpm_ctx, cd->content, cd->content_len,
AddPatternNocase(&dir->mpm_ctx, cd->content, cd->content_len, cd->offset, cd->depth,
cd->offset, cd->depth, cd->id, cd->id, 0); cd->id, cd->id, 0);
} else { } else {
mpm_table[dir->mpm_ctx.mpm_type]. MpmAddPatternCS(&dir->mpm_ctx, cd->content, cd->content_len,
AddPattern(&dir->mpm_ctx, cd->content, cd->content_len, cd->offset, cd->depth,
cd->offset, cd->depth, cd->id, cd->id, 0); cd->id, cd->id, 0);
} }
BUG_ON(dir->id == ALP_DETECT_MAX); BUG_ON(dir->id == ALP_DETECT_MAX);

@ -36,6 +36,7 @@
#include "app-layer-parser.h" #include "app-layer-parser.h"
#include "app-layer-smtp.h" #include "app-layer-smtp.h"
#include "util-mpm.h"
#include "util-debug.h" #include "util-debug.h"
#include "util-byte.h" #include "util-byte.h"
#include "util-unittest.h" #include "util-unittest.h"
@ -808,27 +809,22 @@ static void SMTPSetMpmState(void)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
memset(smtp_mpm_ctx, 0, sizeof(MpmCtx)); memset(smtp_mpm_ctx, 0, sizeof(MpmCtx));
MpmInitCtx(smtp_mpm_ctx, SMTP_MPM);
smtp_mpm_thread_ctx = SCMalloc(sizeof(MpmThreadCtx)); smtp_mpm_thread_ctx = SCMalloc(sizeof(MpmThreadCtx));
if (unlikely(smtp_mpm_thread_ctx == NULL)) { if (unlikely(smtp_mpm_thread_ctx == NULL)) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
memset(smtp_mpm_thread_ctx, 0, sizeof(MpmThreadCtx)); memset(smtp_mpm_thread_ctx, 0, sizeof(MpmThreadCtx));
MpmInitThreadCtx(smtp_mpm_thread_ctx, SMTP_MPM, 0);
mpm_table[SMTP_MPM].InitCtx(smtp_mpm_ctx);
mpm_table[SMTP_MPM].InitThreadCtx(smtp_mpm_ctx, smtp_mpm_thread_ctx, 0);
uint32_t i = 0; uint32_t i = 0;
for (i = 0; i < sizeof(smtp_reply_map)/sizeof(SCEnumCharMap) - 1; i++) { for (i = 0; i < sizeof(smtp_reply_map)/sizeof(SCEnumCharMap) - 1; i++) {
SCEnumCharMap *map = &smtp_reply_map[i]; SCEnumCharMap *map = &smtp_reply_map[i];
mpm_table[SMTP_MPM].AddPatternNocase(smtp_mpm_ctx, /* The third argument is 3, because reply code is always 3 bytes. */
(uint8_t *)map->enum_name, MpmAddPatternCI(smtp_mpm_ctx, (uint8_t *)map->enum_name, 3,
3 /* reply codes always 3 bytes */, 0 /* defunct */, 0 /* defunct */,
0 /* now defunct option */, i /* pattern id */, 0, 0 /* no flags */);
0 /* now defunct option */,
i /* pattern id */,
0 /* no sid */,
0 /* no flags */);
} }
mpm_table[SMTP_MPM].Prepare(smtp_mpm_ctx); mpm_table[SMTP_MPM].Prepare(smtp_mpm_ctx);

@ -1189,31 +1189,27 @@ static void PopulateMpmHelperAddPatternToPktCtx(MpmCtx *mpm_ctx,
{ {
if (cd->flags & DETECT_CONTENT_NOCASE) { if (cd->flags & DETECT_CONTENT_NOCASE) {
if (chop) { if (chop) {
mpm_table[mpm_ctx->mpm_type]. MpmAddPatternCI(mpm_ctx,
AddPatternNocase(mpm_ctx, cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->content + cd->fp_chop_offset, 0, 0,
cd->fp_chop_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} else { } else {
mpm_table[mpm_ctx->mpm_type]. MpmAddPatternCI(mpm_ctx,
AddPatternNocase(mpm_ctx, cd->content, cd->content_len,
cd->content, 0, 0,
cd->content_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
} else { } else {
if (chop) { if (chop) {
mpm_table[mpm_ctx->mpm_type]. MpmAddPatternCS(mpm_ctx,
AddPattern(mpm_ctx, cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->content + cd->fp_chop_offset, 0, 0,
cd->fp_chop_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} else { } else {
mpm_table[mpm_ctx->mpm_type]. MpmAddPatternCS(mpm_ctx,
AddPattern(mpm_ctx, cd->content, cd->content_len,
cd->content, 0, 0,
cd->content_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
} }
@ -1295,33 +1291,29 @@ static void PopulateMpmAddPatternToMpm(DetectEngineCtx *de_ctx,
if (SignatureHasStreamContent(s)) { if (SignatureHasStreamContent(s)) {
if (cd->flags & DETECT_CONTENT_NOCASE) { if (cd->flags & DETECT_CONTENT_NOCASE) {
if (s->flags & SIG_FLAG_TOSERVER) { if (s->flags & SIG_FLAG_TOSERVER) {
mpm_table[sgh->mpm_stream_ctx_ts->mpm_type]. MpmAddPatternCI(sgh->mpm_stream_ctx_ts,
AddPatternNocase(sgh->mpm_stream_ctx_ts, cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->content + cd->fp_chop_offset, 0, 0,
cd->fp_chop_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
if (s->flags & SIG_FLAG_TOCLIENT) { if (s->flags & SIG_FLAG_TOCLIENT) {
mpm_table[sgh->mpm_stream_ctx_tc->mpm_type]. MpmAddPatternCI(sgh->mpm_stream_ctx_tc,
AddPatternNocase(sgh->mpm_stream_ctx_tc, cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->content + cd->fp_chop_offset, 0, 0,
cd->fp_chop_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
} else { } else {
if (s->flags & SIG_FLAG_TOSERVER) { if (s->flags & SIG_FLAG_TOSERVER) {
mpm_table[sgh->mpm_stream_ctx_ts->mpm_type]. MpmAddPatternCS(sgh->mpm_stream_ctx_ts,
AddPattern(sgh->mpm_stream_ctx_ts, cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->content + cd->fp_chop_offset, 0, 0,
cd->fp_chop_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
if (s->flags & SIG_FLAG_TOCLIENT) { if (s->flags & SIG_FLAG_TOCLIENT) {
mpm_table[sgh->mpm_stream_ctx_tc->mpm_type]. MpmAddPatternCS(sgh->mpm_stream_ctx_tc,
AddPattern(sgh->mpm_stream_ctx_tc, cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->content + cd->fp_chop_offset, 0, 0,
cd->fp_chop_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
} }
/* tell matcher we are inspecting stream */ /* tell matcher we are inspecting stream */
@ -1385,29 +1377,29 @@ static void PopulateMpmAddPatternToMpm(DetectEngineCtx *de_ctx,
/* add the content to the "packet" mpm */ /* add the content to the "packet" mpm */
if (cd->flags & DETECT_CONTENT_NOCASE) { if (cd->flags & DETECT_CONTENT_NOCASE) {
if (s->flags & SIG_FLAG_TOSERVER) { if (s->flags & SIG_FLAG_TOSERVER) {
mpm_table[sgh->mpm_stream_ctx_ts->mpm_type]. MpmAddPatternCI(sgh->mpm_stream_ctx_ts,
AddPatternNocase(sgh->mpm_stream_ctx_ts, cd->content, cd->content_len,
cd->content, cd->content_len, 0, 0,
0, 0, cd->id, s->num, flags); cd->id, s->num, flags);
} }
if (s->flags & SIG_FLAG_TOCLIENT) { if (s->flags & SIG_FLAG_TOCLIENT) {
mpm_table[sgh->mpm_stream_ctx_tc->mpm_type]. MpmAddPatternCI(sgh->mpm_stream_ctx_tc,
AddPatternNocase(sgh->mpm_stream_ctx_tc, cd->content, cd->content_len,
cd->content, cd->content_len, 0, 0,
0, 0, cd->id, s->num, flags); cd->id, s->num, flags);
} }
} else { } else {
if (s->flags & SIG_FLAG_TOSERVER) { if (s->flags & SIG_FLAG_TOSERVER) {
mpm_table[sgh->mpm_stream_ctx_ts->mpm_type]. MpmAddPatternCS(sgh->mpm_stream_ctx_ts,
AddPattern(sgh->mpm_stream_ctx_ts, cd->content, cd->content_len,
cd->content, cd->content_len, 0, 0,
0, 0, cd->id, s->num, flags); cd->id, s->num, flags);
} }
if (s->flags & SIG_FLAG_TOCLIENT) { if (s->flags & SIG_FLAG_TOCLIENT) {
mpm_table[sgh->mpm_stream_ctx_tc->mpm_type]. MpmAddPatternCS(sgh->mpm_stream_ctx_tc,
AddPattern(sgh->mpm_stream_ctx_tc, cd->content, cd->content_len,
cd->content, cd->content_len, 0, 0,
0, 0, cd->id, s->num, flags); cd->id, s->num, flags);
} }
} }
/* tell matcher we are inspecting stream */ /* tell matcher we are inspecting stream */
@ -1569,33 +1561,29 @@ static void PopulateMpmAddPatternToMpm(DetectEngineCtx *de_ctx,
/* add the content to the mpm */ /* add the content to the mpm */
if (cd->flags & DETECT_CONTENT_NOCASE) { if (cd->flags & DETECT_CONTENT_NOCASE) {
if (mpm_ctx_ts != NULL) { if (mpm_ctx_ts != NULL) {
mpm_table[mpm_ctx_ts->mpm_type]. MpmAddPatternCI(mpm_ctx_ts,
AddPatternNocase(mpm_ctx_ts, cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->content + cd->fp_chop_offset, 0, 0,
cd->fp_chop_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
if (mpm_ctx_tc != NULL) { if (mpm_ctx_tc != NULL) {
mpm_table[mpm_ctx_tc->mpm_type]. MpmAddPatternCI(mpm_ctx_tc,
AddPatternNocase(mpm_ctx_tc, cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->content + cd->fp_chop_offset, 0, 0,
cd->fp_chop_len, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
} else { } else {
if (mpm_ctx_ts != NULL) { if (mpm_ctx_ts != NULL) {
mpm_table[mpm_ctx_ts->mpm_type]. MpmAddPatternCS(mpm_ctx_ts,
AddPattern(mpm_ctx_ts, cd->content + cd->fp_chop_offset,
cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->fp_chop_len, 0, 0, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
if (mpm_ctx_tc != NULL) { if (mpm_ctx_tc != NULL) {
mpm_table[mpm_ctx_tc->mpm_type]. MpmAddPatternCS(mpm_ctx_tc,
AddPattern(mpm_ctx_tc, cd->content + cd->fp_chop_offset,
cd->content + cd->fp_chop_offset, cd->fp_chop_len,
cd->fp_chop_len, 0, 0, cd->id, s->num, flags);
0, 0, cd->id, s->num, flags);
} }
} }
} else { } else {
@ -1608,29 +1596,29 @@ static void PopulateMpmAddPatternToMpm(DetectEngineCtx *de_ctx,
/* add the content to the "uri" mpm */ /* add the content to the "uri" mpm */
if (cd->flags & DETECT_CONTENT_NOCASE) { if (cd->flags & DETECT_CONTENT_NOCASE) {
if (mpm_ctx_ts != NULL) { if (mpm_ctx_ts != NULL) {
mpm_table[mpm_ctx_ts->mpm_type]. MpmAddPatternCI(mpm_ctx_ts,
AddPatternNocase(mpm_ctx_ts, cd->content, cd->content_len,
cd->content, cd->content_len, 0, 0,
0, 0, cd->id, s->num, flags); cd->id, s->num, flags);
} }
if (mpm_ctx_tc != NULL) { if (mpm_ctx_tc != NULL) {
mpm_table[mpm_ctx_tc->mpm_type]. MpmAddPatternCI(mpm_ctx_tc,
AddPatternNocase(mpm_ctx_tc, cd->content, cd->content_len,
cd->content, cd->content_len, 0, 0,
0, 0, cd->id, s->num, flags); cd->id, s->num, flags);
} }
} else { } else {
if (mpm_ctx_ts != NULL) { if (mpm_ctx_ts != NULL) {
mpm_table[mpm_ctx_ts->mpm_type]. MpmAddPatternCS(mpm_ctx_ts,
AddPattern(mpm_ctx_ts, cd->content, cd->content_len,
cd->content, cd->content_len, 0, 0,
0, 0, cd->id, s->num, flags); cd->id, s->num, flags);
} }
if (mpm_ctx_tc != NULL) { if (mpm_ctx_tc != NULL) {
mpm_table[mpm_ctx_tc->mpm_type]. MpmAddPatternCS(mpm_ctx_tc,
AddPattern(mpm_ctx_tc, cd->content, cd->content_len,
cd->content, cd->content_len, 0, 0,
0, 0, cd->id, s->num, flags); cd->id, s->num, flags);
} }
} }
} }

@ -1717,7 +1717,7 @@ static int SCACBSTest01(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -1751,7 +1751,7 @@ static int SCACBSTest02(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -1784,11 +1784,11 @@ static int SCACBSTest03(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -1820,9 +1820,9 @@ static int SCACBSTest04(void)
MpmInitCtx(&mpm_ctx, MPM_AC_BS); MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0);
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -1854,9 +1854,9 @@ static int SCACBSTest05(void)
MpmInitCtx(&mpm_ctx, MPM_AC_BS); MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
SCACBSAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
SCACBSAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -1888,7 +1888,7 @@ static int SCACBSTest06(void)
MpmInitCtx(&mpm_ctx, MPM_AC_BS); MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -1921,17 +1921,17 @@ static int SCACBSTest07(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* should match 30 times */ /* should match 30 times */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0);
/* should match 29 times */ /* should match 29 times */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0);
/* should match 28 times */ /* should match 28 times */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0);
/* 26 */ /* 26 */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0);
/* 21 */ /* 21 */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0);
/* 1 */ /* 1 */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
30, 0, 0, 5, 0, 0); 30, 0, 0, 5, 0, 0);
PmqSetup(&pmq, 0, 6); PmqSetup(&pmq, 0, 6);
/* total matches: 135 */ /* total matches: 135 */
@ -1966,7 +1966,7 @@ static int SCACBSTest08(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -1998,7 +1998,7 @@ static int SCACBSTest09(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2030,7 +2030,7 @@ static int SCACBSTest10(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2066,13 +2066,13 @@ static int SCACBSTest11(void)
MpmInitCtx(&mpm_ctx, MPM_AC_BS); MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
if (SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1)
goto end; goto end;
if (SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"she", 3, 0, 0, 2, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"she", 3, 0, 0, 2, 0, 0) == -1)
goto end; goto end;
if (SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"his", 3, 0, 0, 3, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"his", 3, 0, 0, 3, 0, 0) == -1)
goto end; goto end;
if (SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"hers", 4, 0, 0, 4, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"hers", 4, 0, 0, 4, 0, 0) == -1)
goto end; goto end;
PmqSetup(&pmq, 0, 5); PmqSetup(&pmq, 0, 5);
@ -2114,9 +2114,9 @@ static int SCACBSTest12(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2150,7 +2150,7 @@ static int SCACBSTest13(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCD"; char *pat = "abcdefghijklmnopqrstuvwxyzABCD";
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2184,7 +2184,7 @@ static int SCACBSTest14(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDE"; char *pat = "abcdefghijklmnopqrstuvwxyzABCDE";
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2218,7 +2218,7 @@ static int SCACBSTest15(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF"; char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF";
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2252,7 +2252,7 @@ static int SCACBSTest16(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABC"; char *pat = "abcdefghijklmnopqrstuvwxyzABC";
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2286,7 +2286,7 @@ static int SCACBSTest17(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzAB"; char *pat = "abcdefghijklmnopqrstuvwxyzAB";
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2320,7 +2320,7 @@ static int SCACBSTest18(void)
/* 1 match */ /* 1 match */
char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z"; char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z";
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2354,7 +2354,7 @@ static int SCACBSTest19(void)
/* 1 */ /* 1 */
char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2387,7 +2387,7 @@ static int SCACBSTest20(void)
/* 1 */ /* 1 */
char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA"; char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA";
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2420,7 +2420,7 @@ static int SCACBSTest21(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2452,9 +2452,9 @@ static int SCACBSTest22(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2487,7 +2487,7 @@ static int SCACBSTest23(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2519,7 +2519,7 @@ static int SCACBSTest24(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACBSAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2550,9 +2550,9 @@ static int SCACBSTest25(void)
MpmInitCtx(&mpm_ctx, MPM_AC_BS); MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
SCACBSAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
SCACBSAddPatternCI(&mpm_ctx, (uint8_t *)"fghiJkl", 7, 0, 0, 2, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghiJkl", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2584,8 +2584,8 @@ static int SCACBSTest26(void)
MpmInitCtx(&mpm_ctx, MPM_AC_BS); MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0);
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2618,7 +2618,7 @@ static int SCACBSTest27(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 0 match */ /* 0 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2651,7 +2651,7 @@ static int SCACBSTest28(void)
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 0 match */ /* 0 match */
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);
@ -2683,10 +2683,10 @@ static int SCACBSTest29(void)
MpmInitCtx(&mpm_ctx, MPM_AC_BS); MpmInitCtx(&mpm_ctx, MPM_AC_BS);
SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACBSInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0);
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"bcdef", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdef", 5, 0, 0, 1, 0, 0);
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"cdefg", 5, 0, 0, 3, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"cdefg", 5, 0, 0, 3, 0, 0);
SCACBSAddPatternCS(&mpm_ctx, (uint8_t *)"defgh", 5, 0, 0, 4, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"defgh", 5, 0, 0, 4, 0, 0);
PmqSetup(&pmq, 0, 4); PmqSetup(&pmq, 0, 4);
SCACBSPreparePatterns(&mpm_ctx); SCACBSPreparePatterns(&mpm_ctx);

@ -1675,7 +1675,7 @@ static int SCACGfbsTest01(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -1708,7 +1708,7 @@ static int SCACGfbsTest02(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -1741,11 +1741,11 @@ static int SCACGfbsTest03(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -1777,9 +1777,9 @@ static int SCACGfbsTest04(void)
MpmInitCtx(&mpm_ctx, MPM_AC_GFBS); MpmInitCtx(&mpm_ctx, MPM_AC_GFBS);
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0);
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -1811,9 +1811,9 @@ static int SCACGfbsTest05(void)
MpmInitCtx(&mpm_ctx, MPM_AC_GFBS); MpmInitCtx(&mpm_ctx, MPM_AC_GFBS);
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACGfbsAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
SCACGfbsAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
SCACGfbsAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -1845,7 +1845,7 @@ static int SCACGfbsTest06(void)
MpmInitCtx(&mpm_ctx, MPM_AC_GFBS); MpmInitCtx(&mpm_ctx, MPM_AC_GFBS);
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -1878,17 +1878,17 @@ static int SCACGfbsTest07(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* should match 30 times */ /* should match 30 times */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0);
/* should match 29 times */ /* should match 29 times */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0);
/* should match 28 times */ /* should match 28 times */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0);
/* 26 */ /* 26 */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0);
/* 21 */ /* 21 */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0);
/* 1 */ /* 1 */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
30, 0, 0, 5, 0, 0); 30, 0, 0, 5, 0, 0);
/* total matches: 135 */ /* total matches: 135 */
PmqSetup(&pmq, 0, 6); PmqSetup(&pmq, 0, 6);
@ -1923,7 +1923,7 @@ static int SCACGfbsTest08(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -1955,7 +1955,7 @@ static int SCACGfbsTest09(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -1987,7 +1987,7 @@ static int SCACGfbsTest10(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2023,13 +2023,13 @@ static int SCACGfbsTest11(void)
MpmInitCtx(&mpm_ctx, MPM_AC_GFBS); MpmInitCtx(&mpm_ctx, MPM_AC_GFBS);
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
if (SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1)
goto end; goto end;
if (SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"she", 3, 0, 0, 2, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"she", 3, 0, 0, 2, 0, 0) == -1)
goto end; goto end;
if (SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"his", 3, 0, 0, 3, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"his", 3, 0, 0, 3, 0, 0) == -1)
goto end; goto end;
if (SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"hers", 4, 0, 0, 4, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"hers", 4, 0, 0, 4, 0, 0) == -1)
goto end; goto end;
PmqSetup(&pmq, 0, 4); PmqSetup(&pmq, 0, 4);
@ -2071,9 +2071,9 @@ static int SCACGfbsTest12(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2107,7 +2107,7 @@ static int SCACGfbsTest13(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCD"; char *pat = "abcdefghijklmnopqrstuvwxyzABCD";
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2141,7 +2141,7 @@ static int SCACGfbsTest14(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDE"; char *pat = "abcdefghijklmnopqrstuvwxyzABCDE";
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2175,7 +2175,7 @@ static int SCACGfbsTest15(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF"; char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF";
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2209,7 +2209,7 @@ static int SCACGfbsTest16(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABC"; char *pat = "abcdefghijklmnopqrstuvwxyzABC";
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2243,7 +2243,7 @@ static int SCACGfbsTest17(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzAB"; char *pat = "abcdefghijklmnopqrstuvwxyzAB";
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2277,7 +2277,7 @@ static int SCACGfbsTest18(void)
/* 1 match */ /* 1 match */
char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z"; char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z";
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2311,7 +2311,7 @@ static int SCACGfbsTest19(void)
/* 1 */ /* 1 */
char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2345,7 +2345,7 @@ static int SCACGfbsTest20(void)
/* 1 */ /* 1 */
char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA"; char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA";
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2378,7 +2378,7 @@ static int SCACGfbsTest21(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2410,9 +2410,9 @@ static int SCACGfbsTest22(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2445,7 +2445,7 @@ static int SCACGfbsTest23(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2477,7 +2477,7 @@ static int SCACGfbsTest24(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACGfbsAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2508,9 +2508,9 @@ static int SCACGfbsTest25(void)
MpmInitCtx(&mpm_ctx, MPM_AC_GFBS); MpmInitCtx(&mpm_ctx, MPM_AC_GFBS);
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACGfbsAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
SCACGfbsAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
SCACGfbsAddPatternCI(&mpm_ctx, (uint8_t *)"fghiJkl", 7, 0, 0, 2, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghiJkl", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2542,8 +2542,8 @@ static int SCACGfbsTest26(void)
MpmInitCtx(&mpm_ctx, MPM_AC_GFBS); MpmInitCtx(&mpm_ctx, MPM_AC_GFBS);
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACGfbsAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0);
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2575,7 +2575,7 @@ static int SCACGfbsTest27(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 0 match */ /* 0 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);
@ -2607,7 +2607,7 @@ static int SCACGfbsTest28(void)
SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACGfbsInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 0 match */ /* 0 match */
SCACGfbsAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACGfbsPreparePatterns(&mpm_ctx); SCACGfbsPreparePatterns(&mpm_ctx);

@ -1571,7 +1571,7 @@ static int SCACTileTest01(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -1605,7 +1605,7 @@ static int SCACTileTest02(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -1638,11 +1638,11 @@ static int SCACTileTest03(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -1674,9 +1674,9 @@ static int SCACTileTest04(void)
MpmInitCtx(&mpm_ctx, MPM_AC_TILE); MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0);
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -1708,9 +1708,9 @@ static int SCACTileTest05(void)
MpmInitCtx(&mpm_ctx, MPM_AC_TILE); MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
SCACTileAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
SCACTileAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -1742,7 +1742,7 @@ static int SCACTileTest06(void)
MpmInitCtx(&mpm_ctx, MPM_AC_TILE); MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -1775,17 +1775,17 @@ static int SCACTileTest07(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* should match 30 times */ /* should match 30 times */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0);
/* should match 29 times */ /* should match 29 times */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0);
/* should match 28 times */ /* should match 28 times */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0);
/* 26 */ /* 26 */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0);
/* 21 */ /* 21 */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0);
/* 1 */ /* 1 */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
30, 0, 0, 5, 0, 0); 30, 0, 0, 5, 0, 0);
PmqSetup(&pmq, 0, 6); PmqSetup(&pmq, 0, 6);
/* total matches: 135 */ /* total matches: 135 */
@ -1820,7 +1820,7 @@ static int SCACTileTest08(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -1852,7 +1852,7 @@ static int SCACTileTest09(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -1884,7 +1884,7 @@ static int SCACTileTest10(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -1920,13 +1920,13 @@ static int SCACTileTest11(void)
MpmInitCtx(&mpm_ctx, MPM_AC_TILE); MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
if (SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1)
goto end; goto end;
if (SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"she", 3, 0, 0, 2, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"she", 3, 0, 0, 2, 0, 0) == -1)
goto end; goto end;
if (SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"his", 3, 0, 0, 3, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"his", 3, 0, 0, 3, 0, 0) == -1)
goto end; goto end;
if (SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"hers", 4, 0, 0, 4, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"hers", 4, 0, 0, 4, 0, 0) == -1)
goto end; goto end;
PmqSetup(&pmq, 0, 5); PmqSetup(&pmq, 0, 5);
@ -1968,9 +1968,9 @@ static int SCACTileTest12(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2004,7 +2004,7 @@ static int SCACTileTest13(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCD"; char *pat = "abcdefghijklmnopqrstuvwxyzABCD";
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2038,7 +2038,7 @@ static int SCACTileTest14(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDE"; char *pat = "abcdefghijklmnopqrstuvwxyzABCDE";
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2072,7 +2072,7 @@ static int SCACTileTest15(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF"; char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF";
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2106,7 +2106,7 @@ static int SCACTileTest16(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABC"; char *pat = "abcdefghijklmnopqrstuvwxyzABC";
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2140,7 +2140,7 @@ static int SCACTileTest17(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzAB"; char *pat = "abcdefghijklmnopqrstuvwxyzAB";
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2174,7 +2174,7 @@ static int SCACTileTest18(void)
/* 1 match */ /* 1 match */
char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z"; char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z";
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2208,7 +2208,7 @@ static int SCACTileTest19(void)
/* 1 */ /* 1 */
char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2242,7 +2242,7 @@ static int SCACTileTest20(void)
/* 1 */ /* 1 */
char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA"; char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA";
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2275,7 +2275,7 @@ static int SCACTileTest21(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2307,9 +2307,9 @@ static int SCACTileTest22(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2342,7 +2342,7 @@ static int SCACTileTest23(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2374,7 +2374,7 @@ static int SCACTileTest24(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACTileAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2405,9 +2405,9 @@ static int SCACTileTest25(void)
MpmInitCtx(&mpm_ctx, MPM_AC_TILE); MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
SCACTileAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
SCACTileAddPatternCI(&mpm_ctx, (uint8_t *)"fghiJkl", 7, 0, 0, 2, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghiJkl", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2439,8 +2439,8 @@ static int SCACTileTest26(void)
MpmInitCtx(&mpm_ctx, MPM_AC_TILE); MpmInitCtx(&mpm_ctx, MPM_AC_TILE);
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACTileAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0);
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2473,7 +2473,7 @@ static int SCACTileTest27(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 0 match */ /* 0 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);
@ -2506,7 +2506,7 @@ static int SCACTileTest28(void)
SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACTileInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 0 match */ /* 0 match */
SCACTileAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACTilePreparePatterns(&mpm_ctx); SCACTilePreparePatterns(&mpm_ctx);

@ -2211,7 +2211,7 @@ static int SCACTest01(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2245,7 +2245,7 @@ static int SCACTest02(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2278,11 +2278,11 @@ static int SCACTest03(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2314,9 +2314,9 @@ static int SCACTest04(void)
MpmInitCtx(&mpm_ctx, MPM_AC); MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0);
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2348,9 +2348,9 @@ static int SCACTest05(void)
MpmInitCtx(&mpm_ctx, MPM_AC); MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
SCACAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
SCACAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2382,7 +2382,7 @@ static int SCACTest06(void)
MpmInitCtx(&mpm_ctx, MPM_AC); MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2415,17 +2415,17 @@ static int SCACTest07(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* should match 30 times */ /* should match 30 times */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0);
/* should match 29 times */ /* should match 29 times */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0);
/* should match 28 times */ /* should match 28 times */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0);
/* 26 */ /* 26 */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0);
/* 21 */ /* 21 */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0);
/* 1 */ /* 1 */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
30, 0, 0, 5, 0, 0); 30, 0, 0, 5, 0, 0);
PmqSetup(&pmq, 0, 6); PmqSetup(&pmq, 0, 6);
/* total matches: 135 */ /* total matches: 135 */
@ -2460,7 +2460,7 @@ static int SCACTest08(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2492,7 +2492,7 @@ static int SCACTest09(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2524,7 +2524,7 @@ static int SCACTest10(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2560,13 +2560,13 @@ static int SCACTest11(void)
MpmInitCtx(&mpm_ctx, MPM_AC); MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
if (SCACAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"he", 2, 0, 0, 1, 0, 0) == -1)
goto end; goto end;
if (SCACAddPatternCS(&mpm_ctx, (uint8_t *)"she", 3, 0, 0, 2, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"she", 3, 0, 0, 2, 0, 0) == -1)
goto end; goto end;
if (SCACAddPatternCS(&mpm_ctx, (uint8_t *)"his", 3, 0, 0, 3, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"his", 3, 0, 0, 3, 0, 0) == -1)
goto end; goto end;
if (SCACAddPatternCS(&mpm_ctx, (uint8_t *)"hers", 4, 0, 0, 4, 0, 0) == -1) if (MpmAddPatternCS(&mpm_ctx, (uint8_t *)"hers", 4, 0, 0, 4, 0, 0) == -1)
goto end; goto end;
PmqSetup(&pmq, 0, 5); PmqSetup(&pmq, 0, 5);
@ -2608,9 +2608,9 @@ static int SCACTest12(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2644,7 +2644,7 @@ static int SCACTest13(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCD"; char *pat = "abcdefghijklmnopqrstuvwxyzABCD";
SCACAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2678,7 +2678,7 @@ static int SCACTest14(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDE"; char *pat = "abcdefghijklmnopqrstuvwxyzABCDE";
SCACAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2712,7 +2712,7 @@ static int SCACTest15(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF"; char *pat = "abcdefghijklmnopqrstuvwxyzABCDEF";
SCACAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2746,7 +2746,7 @@ static int SCACTest16(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzABC"; char *pat = "abcdefghijklmnopqrstuvwxyzABC";
SCACAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2780,7 +2780,7 @@ static int SCACTest17(void)
/* 1 match */ /* 1 match */
char *pat = "abcdefghijklmnopqrstuvwxyzAB"; char *pat = "abcdefghijklmnopqrstuvwxyzAB";
SCACAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2814,7 +2814,7 @@ static int SCACTest18(void)
/* 1 match */ /* 1 match */
char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z"; char *pat = "abcde""fghij""klmno""pqrst""uvwxy""z";
SCACAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2848,7 +2848,7 @@ static int SCACTest19(void)
/* 1 */ /* 1 */
char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; char *pat = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
SCACAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2882,7 +2882,7 @@ static int SCACTest20(void)
/* 1 */ /* 1 */
char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA"; char *pat = "AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA";
SCACAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)pat, strlen(pat), 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2915,7 +2915,7 @@ static int SCACTest21(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2947,9 +2947,9 @@ static int SCACTest22(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
/* 1 match */ /* 1 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -2982,7 +2982,7 @@ static int SCACTest23(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -3014,7 +3014,7 @@ static int SCACTest24(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 1 */ /* 1 */
SCACAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -3045,9 +3045,9 @@ static int SCACTest25(void)
MpmInitCtx(&mpm_ctx, MPM_AC); MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0);
SCACAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0);
SCACAddPatternCI(&mpm_ctx, (uint8_t *)"fghiJkl", 7, 0, 0, 2, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghiJkl", 7, 0, 0, 2, 0, 0);
PmqSetup(&pmq, 0, 3); PmqSetup(&pmq, 0, 3);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -3079,8 +3079,8 @@ static int SCACTest26(void)
MpmInitCtx(&mpm_ctx, MPM_AC); MpmInitCtx(&mpm_ctx, MPM_AC);
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
SCACAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 0, 0, 0);
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"Works", 5, 0, 0, 1, 0, 0);
PmqSetup(&pmq, 0, 2); PmqSetup(&pmq, 0, 2);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -3113,7 +3113,7 @@ static int SCACTest27(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 0 match */ /* 0 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ONE", 3, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);
@ -3146,7 +3146,7 @@ static int SCACTest28(void)
SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0); SCACInitThreadCtx(&mpm_ctx, &mpm_thread_ctx, 0);
/* 0 match */ /* 0 match */
SCACAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"one", 3, 0, 0, 0, 0, 0);
PmqSetup(&pmq, 0, 1); PmqSetup(&pmq, 0, 1);
SCACPreparePatterns(&mpm_ctx); SCACPreparePatterns(&mpm_ctx);

@ -1258,7 +1258,7 @@ static int B2gTestInit01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
@ -1278,7 +1278,7 @@ static int B2gTestS0Init01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
@ -1297,8 +1297,8 @@ static int B2gTestS0Init02 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"cdef", 4, 0, 0, 1, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"cdef", 4, 0, 0, 1, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
@ -1317,8 +1317,8 @@ static int B2gTestS0Init03 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
@ -1337,7 +1337,7 @@ static int B2gTestS0Init04 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abab", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abab", 4, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
@ -1356,7 +1356,7 @@ static int B2gTestS0Init05 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcab", 5, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcab", 5, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
@ -1378,7 +1378,7 @@ static int B2gTestSearch01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1403,7 +1403,7 @@ static int B2gTestSearch02 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1428,9 +1428,9 @@ static int B2gTestSearch03 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); /* 1 match */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1456,9 +1456,9 @@ static int B2gTestSearch04 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); /* 1 match */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1484,9 +1484,9 @@ static int B2gTestSearch05 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */
B2gAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1511,12 +1511,12 @@ static int B2gTestSearch05a (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */
B2gAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abCD", 4, 0, 0, 3, 0, 0); /* no match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abCD", 4, 0, 0, 3, 0, 0); /* no match */
B2gAddPatternCI(&mpm_ctx, (uint8_t *)"abcD", 4, 0, 0, 4, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abcD", 4, 0, 0, 4, 0, 0); /* 1 match */
B2gAddPatternCI(&mpm_ctx, (uint8_t *)"abCd", 4, 0, 0, 5, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abCd", 4, 0, 0, 5, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 6 /* 6 patterns */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 6 /* 6 patterns */);
@ -1541,7 +1541,7 @@ static int B2gTestSearch06 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1566,12 +1566,12 @@ static int B2gTestSearch07 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */
/* total matches: 135 */ /* total matches: 135 */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
@ -1597,7 +1597,7 @@ static int B2gTestSearch08 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1622,7 +1622,7 @@ static int B2gTestSearch09 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1647,7 +1647,7 @@ static int B2gTestSearch10 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1677,8 +1677,8 @@ static int B2gTestSearch11 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */);
@ -1703,8 +1703,8 @@ static int B2gTestSearch12 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */);
@ -1729,7 +1729,7 @@ static int B2gTestSearch13 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCD", 30, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCD", 30, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1754,7 +1754,7 @@ static int B2gTestSearch14 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDE", 31, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDE", 31, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1779,7 +1779,7 @@ static int B2gTestSearch15 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDEF", 32, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDEF", 32, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1804,7 +1804,7 @@ static int B2gTestSearch16 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABC", 29, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABC", 29, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1829,7 +1829,7 @@ static int B2gTestSearch17 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzAB", 28, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzAB", 28, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1854,7 +1854,7 @@ static int B2gTestSearch18 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"abcde""fghij""klmno""pqrst""uvwxy""z", 26, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde""fghij""klmno""pqrst""uvwxy""z", 26, 0, 0, 0, 0, 0); /* 1 match */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1879,7 +1879,7 @@ static int B2gTestSearch19 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 0, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 0, 0, 0); /* 1 */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */);
@ -1904,8 +1904,8 @@ static int B2gTestSearch20 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA", 32, 0, 0, 0, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA", 32, 0, 0, 0, 0, 0); /* 1 */
//B2gAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 32, 0, 0, 0, 0, 0); /* 1 */ //MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 32, 0, 0, 0, 0, 0); /* 1 */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */);
@ -1931,7 +1931,7 @@ static int B2gTestSearch21 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2G); MpmInitCtx(&mpm_ctx, MPM_B2G);
B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx; B2gCtx *ctx = (B2gCtx *)mpm_ctx.ctx;
B2gAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); /* 1 */
B2gPreparePatterns(&mpm_ctx); B2gPreparePatterns(&mpm_ctx);
B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */); B2gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */);
@ -1969,7 +1969,7 @@ static int B2gTestSearchXX (void) {
while((word = fgets(line, sizeof(line), fp)) != NULL) { while((word = fgets(line, sizeof(line), fp)) != NULL) {
word[strlen(word) - 1] = '\0'; word[strlen(word) - 1] = '\0';
B2gAddPatternCS(&mpm_ctx, (uint8_t *)word, strlen(word), 0, 0, (uint32_t)w, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)word, strlen(word), 0, 0, (uint32_t)w, 0, 0);
w++; w++;

@ -1291,7 +1291,7 @@ static int B2gcTestInit01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
@ -1311,7 +1311,7 @@ static int B2gcTestS0Init01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
@ -1330,8 +1330,8 @@ static int B2gcTestS0Init02 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"cdef", 4, 0, 0, 1, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"cdef", 4, 0, 0, 1, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
@ -1350,8 +1350,8 @@ static int B2gcTestS0Init03 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
@ -1370,7 +1370,7 @@ static int B2gcTestS0Init04 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abab", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abab", 4, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
@ -1389,7 +1389,7 @@ static int B2gcTestS0Init05 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcab", 5, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcab", 5, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
@ -1411,7 +1411,7 @@ static int B2gcTestSearch01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1436,7 +1436,7 @@ static int B2gcTestSearch02 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1461,9 +1461,9 @@ static int B2gcTestSearch03 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1489,9 +1489,9 @@ static int B2gcTestSearch04 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1517,9 +1517,9 @@ static int B2gcTestSearch05 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1544,12 +1544,12 @@ static int B2gcTestSearch05a (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abCD", 4, 0, 0, 3, 0, 0); /* no match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abCD", 4, 0, 0, 3, 0, 0); /* no match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"abcD", 4, 0, 0, 4, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abcD", 4, 0, 0, 4, 0, 0); /* 1 match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"abCd", 4, 0, 0, 5, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abCd", 4, 0, 0, 5, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 6 /* 6 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 6 /* 6 patterns */);
@ -1574,12 +1574,12 @@ static int B2gcTestSearch05b (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1, 0, 0); /* 1 match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"abcD", 4, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abcD", 4, 0, 0, 2, 0, 0); /* 1 match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"abCd", 4, 0, 0, 3, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abCd", 4, 0, 0, 3, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 4, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 4, 0, 0); /* 1 match */
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"abXD", 4, 0, 0, 5, 0, 0); /* 0 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abXD", 4, 0, 0, 5, 0, 0); /* 0 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 6 /* 6 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 6 /* 6 patterns */);
@ -1604,8 +1604,8 @@ static int B2gcTestSearch05c (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 6 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 6 patterns */);
@ -1630,8 +1630,8 @@ static int B2gcTestSearch05d (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCI(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 1, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 6 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 6 patterns */);
@ -1656,7 +1656,7 @@ static int B2gcTestSearch06 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1681,7 +1681,7 @@ static int B2gcTestSearch06a (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1706,12 +1706,12 @@ static int B2gcTestSearch07 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */
/* total matches: 135 */ /* total matches: 135 */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
@ -1740,7 +1740,7 @@ static int B2gcTestSearch07a (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 6 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 6 patterns */);
@ -1765,7 +1765,7 @@ static int B2gcTestSearch08 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1790,7 +1790,7 @@ static int B2gcTestSearch09 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1815,7 +1815,7 @@ static int B2gcTestSearch10 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1845,8 +1845,8 @@ static int B2gcTestSearch11 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 1, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */);
@ -1871,8 +1871,8 @@ static int B2gcTestSearch12 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 1, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */);
@ -1897,7 +1897,7 @@ static int B2gcTestSearch13 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCD", 30, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCD", 30, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1922,7 +1922,7 @@ static int B2gcTestSearch14 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDE", 31, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDE", 31, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1947,7 +1947,7 @@ static int B2gcTestSearch15 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDEF", 32, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDEF", 32, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1972,7 +1972,7 @@ static int B2gcTestSearch16 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABC", 29, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABC", 29, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1997,7 +1997,7 @@ static int B2gcTestSearch17 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzAB", 28, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzAB", 28, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -2022,7 +2022,7 @@ static int B2gcTestSearch18 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"abcde""fghij""klmno""pqrst""uvwxy""z", 26, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde""fghij""klmno""pqrst""uvwxy""z", 26, 0, 0, 0, 0, 0); /* 1 match */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -2047,7 +2047,7 @@ static int B2gcTestSearch19 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 0, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 0, 0, 0); /* 1 */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */);
@ -2072,8 +2072,8 @@ static int B2gcTestSearch20 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA", 32, 0, 0, 0, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA", 32, 0, 0, 0, 0, 0); /* 1 */
//B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 32, 0, 0, 0, 0, 0); /* 1 */ //MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 32, 0, 0, 0, 0, 0); /* 1 */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */);
@ -2099,7 +2099,7 @@ static int B2gcTestSearch21 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GC); MpmInitCtx(&mpm_ctx, MPM_B2GC);
B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx; B2gcCtx *ctx = (B2gcCtx *)mpm_ctx.ctx;
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); /* 1 */
B2gcPreparePatterns(&mpm_ctx); B2gcPreparePatterns(&mpm_ctx);
B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */); B2gcThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */);
@ -2137,7 +2137,7 @@ static int B2gcTestSearchXX (void) {
while((word = fgets(line, sizeof(line), fp)) != NULL) { while((word = fgets(line, sizeof(line), fp)) != NULL) {
word[strlen(word) - 1] = '\0'; word[strlen(word) - 1] = '\0';
B2gcAddPatternCS(&mpm_ctx, (uint8_t *)word, strlen(word), 0, 0, (uint32_t)w, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)word, strlen(word), 0, 0, (uint32_t)w, 0, 0);
w++; w++;

@ -1191,7 +1191,7 @@ static int B2gmTestInit01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
@ -1211,7 +1211,7 @@ static int B2gmTestS0Init01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
@ -1230,8 +1230,8 @@ static int B2gmTestS0Init02 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"cdef", 4, 0, 0, 1, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"cdef", 4, 0, 0, 1, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
@ -1250,8 +1250,8 @@ static int B2gmTestS0Init03 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
@ -1270,7 +1270,7 @@ static int B2gmTestS0Init04 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abab", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abab", 4, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
@ -1289,7 +1289,7 @@ static int B2gmTestS0Init05 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcab", 5, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcab", 5, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
@ -1311,7 +1311,7 @@ static int B2gmTestSearch01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1336,7 +1336,7 @@ static int B2gmTestSearch02 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1361,7 +1361,7 @@ static int B2gmTestSearch02a (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1386,7 +1386,7 @@ static int B2gmTestSearch02b (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCI(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1411,9 +1411,9 @@ static int B2gmTestSearch03 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1438,9 +1438,9 @@ static int B2gmTestSearch03a (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"b", 1, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"b", 1, 0, 0, 1, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"f", 1, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"f", 1, 0, 0, 2, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1466,9 +1466,9 @@ static int B2gmTestSearch04 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1494,9 +1494,9 @@ static int B2gmTestSearch05 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */
B2gmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1521,12 +1521,12 @@ static int B2gmTestSearch05a (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */
B2gmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abCD", 4, 0, 0, 3, 0, 0); /* no match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abCD", 4, 0, 0, 3, 0, 0); /* no match */
B2gmAddPatternCI(&mpm_ctx, (uint8_t *)"abcD", 4, 0, 0, 4, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abcD", 4, 0, 0, 4, 0, 0); /* 1 match */
B2gmAddPatternCI(&mpm_ctx, (uint8_t *)"abCd", 4, 0, 0, 5, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abCd", 4, 0, 0, 5, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 6 /* 6 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 6 /* 6 patterns */);
@ -1551,7 +1551,7 @@ static int B2gmTestSearch06 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1576,12 +1576,12 @@ static int B2gmTestSearch07 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */
/* total matches: 135 */ /* total matches: 135 */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
@ -1610,7 +1610,7 @@ static int B2gmTestSearch08 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1635,7 +1635,7 @@ static int B2gmTestSearch09 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1660,7 +1660,7 @@ static int B2gmTestSearch10 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1690,8 +1690,8 @@ static int B2gmTestSearch11 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */);
@ -1716,8 +1716,8 @@ static int B2gmTestSearch12 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); /* 1 match */
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */);
@ -1742,7 +1742,7 @@ static int B2gmTestSearch13 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCD", 30, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCD", 30, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1767,7 +1767,7 @@ static int B2gmTestSearch14 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDE", 31, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDE", 31, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1792,7 +1792,7 @@ static int B2gmTestSearch15 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDEF", 32, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABCDEF", 32, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1817,7 +1817,7 @@ static int B2gmTestSearch16 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABC", 29, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzABC", 29, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1842,7 +1842,7 @@ static int B2gmTestSearch17 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzAB", 28, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefghijklmnopqrstuvwxyzAB", 28, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1867,7 +1867,7 @@ static int B2gmTestSearch18 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde""fghij""klmno""pqrst""uvwxy""z", 26, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde""fghij""klmno""pqrst""uvwxy""z", 26, 0, 0, 0, 0, 0); /* 1 match */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1892,7 +1892,7 @@ static int B2gmTestSearch19 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 0, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 0, 0, 0); /* 1 */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */);
@ -1917,8 +1917,8 @@ static int B2gmTestSearch20 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA", 32, 0, 0, 0, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AAAAA""AA", 32, 0, 0, 0, 0, 0); /* 1 */
//B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 32, 0, 0, 0, 0, 0); /* 1 */ //MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 32, 0, 0, 0, 0, 0); /* 1 */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */);
@ -1944,7 +1944,7 @@ static int B2gmTestSearch21 (void) {
MpmInitCtx(&mpm_ctx, MPM_B2GM); MpmInitCtx(&mpm_ctx, MPM_B2GM);
B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx; B2gmCtx *ctx = (B2gmCtx *)mpm_ctx.ctx;
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 0, 0, 0); /* 1 */
B2gmPreparePatterns(&mpm_ctx); B2gmPreparePatterns(&mpm_ctx);
B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */); B2gmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 patterns */);
@ -1982,7 +1982,7 @@ static int B2gmTestSearchXX (void) {
while((word = fgets(line, sizeof(line), fp)) != NULL) { while((word = fgets(line, sizeof(line), fp)) != NULL) {
word[strlen(word) - 1] = '\0'; word[strlen(word) - 1] = '\0';
B2gmAddPatternCS(&mpm_ctx, (uint8_t *)word, strlen(word), 0, 0, (uint32_t)w, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)word, strlen(word), 0, 0, (uint32_t)w, 0, 0);
w++; w++;

@ -1233,7 +1233,7 @@ static int B3gTestInit01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
@ -1254,7 +1254,7 @@ static int B3gTestS0Init01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
@ -1274,8 +1274,8 @@ static int B3gTestS0Init02 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"cdef", 4, 0, 0, 1, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"cdef", 4, 0, 0, 1, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
@ -1295,8 +1295,8 @@ static int B3gTestS0Init03 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0); /* 1 match */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
@ -1316,7 +1316,7 @@ static int B3gTestS0Init04 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abab", 4, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abab", 4, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
@ -1336,7 +1336,7 @@ static int B3gTestS0Init05 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcab", 5, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcab", 5, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
@ -1358,7 +1358,7 @@ static int B3gTestSearch01 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1383,7 +1383,7 @@ static int B3gTestSearch02 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abce", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1408,9 +1408,9 @@ static int B3gTestSearch03 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); /* 1 match */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghj", 4, 0, 0, 2, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1436,9 +1436,9 @@ static int B3gTestSearch04 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcdegh", 6, 0, 0, 1, 0, 0); /* 1 match */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"fghjxyz", 7, 0, 0, 2, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1464,9 +1464,9 @@ static int B3gTestSearch05 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"ABCD", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"bCdEfG", 6, 0, 0, 1, 0, 0); /* 1 match */
B3gAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */ MpmAddPatternCI(&mpm_ctx, (uint8_t *)"fghJikl", 7, 0, 0, 2, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3 /* 3 patterns */);
@ -1491,7 +1491,7 @@ static int B3gTestSearch06 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1516,12 +1516,12 @@ static int B3gTestSearch07 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */
/* total matches: 135 */ /* total matches: 135 */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
@ -1547,7 +1547,7 @@ static int B3gTestSearch08 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1572,7 +1572,7 @@ static int B3gTestSearch09 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1597,7 +1597,7 @@ static int B3gTestSearch10 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcdefgh", 8, 0, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1 /* 1 pattern */);
@ -1627,8 +1627,8 @@ static int B3gTestSearch11 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */);
@ -1653,8 +1653,8 @@ static int B3gTestSearch12 (void) {
MpmInitCtx(&mpm_ctx, MPM_B3G); MpmInitCtx(&mpm_ctx, MPM_B3G);
B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx; B3gCtx *ctx = (B3gCtx *)mpm_ctx.ctx;
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"wxyz", 4, 0, 0, 0, 0, 0); /* 1 match */
B3gAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 0, 0, 0); /* 1 match */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"vwxyz", 5, 0, 0, 0, 0, 0); /* 1 match */
B3gPreparePatterns(&mpm_ctx); B3gPreparePatterns(&mpm_ctx);
B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */); B3gThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2 /* 2 patterns */);

@ -1551,7 +1551,7 @@ int WmTestInitAddPattern01 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
int ret = WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0); int ret = MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0);
if (ret == 0) if (ret == 0)
result = 1; result = 1;
@ -1570,7 +1570,7 @@ int WmTestInitAddPattern02 (void) {
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0);
if (ctx->init_hash != NULL) if (ctx->init_hash != NULL)
result = 1; result = 1;
@ -1589,7 +1589,7 @@ int WmTestInitAddPattern03 (void) {
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0);
WmPattern *pat = WmInitHashLookup(ctx, (uint8_t *)"abcd", 4, 0); WmPattern *pat = WmInitHashLookup(ctx, (uint8_t *)"abcd", 4, 0);
if (pat != NULL) { if (pat != NULL) {
if (pat->len == 4) if (pat->len == 4)
@ -1611,7 +1611,7 @@ int WmTestInitAddPattern04 (void) {
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, MPM_PATTERN_FLAG_NOCASE); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0);
WmPattern *pat = WmInitHashLookup(ctx, (uint8_t *)"abcd", 4, MPM_PATTERN_FLAG_NOCASE); WmPattern *pat = WmInitHashLookup(ctx, (uint8_t *)"abcd", 4, MPM_PATTERN_FLAG_NOCASE);
if (pat != NULL) { if (pat != NULL) {
if (pat->flags & MPM_PATTERN_FLAG_NOCASE) if (pat->flags & MPM_PATTERN_FLAG_NOCASE)
@ -1633,7 +1633,7 @@ int WmTestInitAddPattern05 (void) {
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0);
WmPattern *pat = WmInitHashLookup(ctx, (uint8_t *)"abcd", 4, 0); WmPattern *pat = WmInitHashLookup(ctx, (uint8_t *)"abcd", 4, 0);
if (pat != NULL) { if (pat != NULL) {
if (!(pat->flags & MPM_PATTERN_FLAG_NOCASE)) if (!(pat->flags & MPM_PATTERN_FLAG_NOCASE))
@ -1655,7 +1655,7 @@ int WmTestInitAddPattern06 (void) {
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 1234, 0, 0);
WmPattern *pat = WmInitHashLookup(ctx, (uint8_t *)"abcd", 4, 0); WmPattern *pat = WmInitHashLookup(ctx, (uint8_t *)"abcd", 4, 0);
if (pat != NULL) { if (pat != NULL) {
if (memcmp(pat->cs, "abcd", 4) == 0) if (memcmp(pat->cs, "abcd", 4) == 0)
@ -1674,7 +1674,7 @@ int WmTestPrepare01 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
if (ctx->Search == WmSearch1) if (ctx->Search == WmSearch1)
@ -1690,7 +1690,7 @@ int WmTestPrepare02 (void) {
memset(&mpm_ctx, 0x00, sizeof(MpmCtx)); memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
@ -1707,7 +1707,7 @@ int WmTestPrepare03 (void) {
memset(&mpm_ctx, 0x00, sizeof(MpmCtx)); memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
@ -1727,7 +1727,7 @@ int WmTestPrepare04 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
if (ctx->Search == WmSearch1) if (ctx->Search == WmSearch1)
@ -1743,7 +1743,7 @@ int WmTestPrepare05 (void) {
memset(&mpm_ctx, 0x00, sizeof(MpmCtx)); memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
@ -1760,7 +1760,7 @@ int WmTestPrepare06 (void) {
memset(&mpm_ctx, 0x00, sizeof(MpmCtx)); memset(&mpm_ctx, 0x00, sizeof(MpmCtx));
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
@ -1782,7 +1782,7 @@ int WmTestSearch01 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
//mpm_ctx.PrintCtx(&mpm_ctx); //mpm_ctx.PrintCtx(&mpm_ctx);
@ -1808,7 +1808,7 @@ int WmTestSearch01Hash12 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
ctx->hash_size = HASH12_SIZE; ctx->hash_size = HASH12_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
@ -1836,7 +1836,7 @@ int WmTestSearch01Hash14 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
ctx->hash_size = HASH14_SIZE; ctx->hash_size = HASH14_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
@ -1864,7 +1864,7 @@ int WmTestSearch01Hash15 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
ctx->hash_size = HASH15_SIZE; ctx->hash_size = HASH15_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
@ -1892,7 +1892,7 @@ int WmTestSearch01Hash16 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
ctx->hash_size = HASH16_SIZE; ctx->hash_size = HASH16_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
@ -1919,7 +1919,7 @@ int WmTestSearch02 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -1941,7 +1941,7 @@ int WmTestSearch03 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -1964,7 +1964,7 @@ int WmTestSearch04 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -1986,7 +1986,7 @@ int WmTestSearch05 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"efgh", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"efgh", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2008,7 +2008,7 @@ int WmTestSearch06 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"eFgH", 4, 0, 0, 0, 0, MPM_PATTERN_FLAG_NOCASE); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"eFgH", 4, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2030,8 +2030,8 @@ int WmTestSearch07 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcd", 4, 0, 0, 0, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"eFgH", 4, 0, 0, 1, 0, MPM_PATTERN_FLAG_NOCASE); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"eFgH", 4, 0, 0, 1, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2);
@ -2053,8 +2053,8 @@ int WmTestSearch08 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"abcde", 5, 0, 0, 0, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bcde", 4, 0, 0, 1, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2);
@ -2076,7 +2076,7 @@ int WmTestSearch09 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"ab", 2, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2097,8 +2097,8 @@ int WmTestSearch10 (void) {
MpmThreadCtx mpm_thread_ctx; MpmThreadCtx mpm_thread_ctx;
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmAddPattern(&mpm_ctx, (uint8_t *)"bc", 2, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"bc", 2, 0, 0, 0, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"gh", 2, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"gh", 2, 0, 0, 1, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 2);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
@ -2120,9 +2120,9 @@ int WmTestSearch11 (void) {
MpmThreadCtx mpm_thread_ctx; MpmThreadCtx mpm_thread_ctx;
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmAddPattern(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"d", 1, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"d", 1, 0, 0, 1, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"h", 1, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"h", 1, 0, 0, 2, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
@ -2145,9 +2145,9 @@ int WmTestSearch12 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, MPM_PATTERN_FLAG_NOCASE); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"d", 1, 0, 0, 1, 0, MPM_PATTERN_FLAG_NOCASE); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"d", 1, 0, 0, 1, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"Z", 1, 0, 0, 2, 0, MPM_PATTERN_FLAG_NOCASE); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Z", 1, 0, 0, 2, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3);
@ -2171,9 +2171,9 @@ int WmTestSearch13 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"a", 1, 0, 0, 0, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"de",2, 0, 0, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"de",2, 0, 0, 1, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"h", 1, 0, 0, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"h", 1, 0, 0, 2, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3);
@ -2197,9 +2197,9 @@ int WmTestSearch14 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, MPM_PATTERN_FLAG_NOCASE); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"de",2, 0, 0, 1, 0, MPM_PATTERN_FLAG_NOCASE); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"de",2, 0, 0, 1, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"Z", 1, 0, 0, 2, 0, MPM_PATTERN_FLAG_NOCASE); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"Z", 1, 0, 0, 2, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3);
@ -2223,9 +2223,9 @@ int WmTestSearch15 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 1, 1, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 1, 1, 0, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"de",2, 0, 0, 1, 1, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"de",2, 0, 0, 1, 1, 1, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"Z", 1, 0, 0, 1, 1, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"Z", 1, 0, 0, 1, 1, 2, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3);
@ -2250,9 +2250,9 @@ int WmTestSearch16 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPattern(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 1, 1, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 1, 1, 0, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"de",2, 0, 0, 1, 1, 1, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"de",2, 0, 0, 1, 1, 1, 0, 0);
WmAddPattern(&mpm_ctx, (uint8_t *)"Z", 1, 0, 0, 1, 1, 2, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"Z", 1, 0, 0, 1, 1, 2, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 3);
@ -2277,7 +2277,7 @@ int WmTestSearch17 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2302,7 +2302,7 @@ int WmTestSearch18Hash12 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH12_SIZE; ctx->hash_size = HASH12_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2327,7 +2327,7 @@ int WmTestSearch18Hash14 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH14_SIZE; ctx->hash_size = HASH14_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2352,7 +2352,7 @@ int WmTestSearch18Hash15 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH15_SIZE; ctx->hash_size = HASH15_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2377,7 +2377,7 @@ int WmTestSearch18 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH16_SIZE; ctx->hash_size = HASH16_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2403,7 +2403,7 @@ int WmTestSearch18Hash16 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH16_SIZE; ctx->hash_size = HASH16_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2429,7 +2429,7 @@ int WmTestSearch19 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2454,7 +2454,7 @@ int WmTestSearch19Hash12 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH12_SIZE; ctx->hash_size = HASH12_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2480,7 +2480,7 @@ int WmTestSearch19Hash14 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH14_SIZE; ctx->hash_size = HASH14_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2506,7 +2506,7 @@ int WmTestSearch19Hash15 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH15_SIZE; ctx->hash_size = HASH15_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2532,7 +2532,7 @@ int WmTestSearch19Hash16 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCI(&mpm_ctx, (uint8_t *)"/VideoAccessCodecInstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH16_SIZE; ctx->hash_size = HASH16_SIZE;
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2558,7 +2558,7 @@ int WmTestSearch20 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2583,7 +2583,7 @@ int WmTestSearch20Hash12 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH12_SIZE; /* force hash12 */ ctx->hash_size = HASH12_SIZE; /* force hash12 */
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2608,7 +2608,7 @@ int WmTestSearch20Hash14 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH14_SIZE; /* force hash14 */ ctx->hash_size = HASH14_SIZE; /* force hash14 */
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2634,7 +2634,7 @@ int WmTestSearch20Hash15 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH15_SIZE; /* force hash15 */ ctx->hash_size = HASH15_SIZE; /* force hash15 */
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2660,7 +2660,7 @@ int WmTestSearch20Hash16 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH16_SIZE; /* force hash16 */ ctx->hash_size = HASH16_SIZE; /* force hash16 */
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2686,7 +2686,7 @@ int WmTestSearch21 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2711,7 +2711,7 @@ static int WmTestSearch21Hash12 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH12_SIZE; /* force hash16 */ ctx->hash_size = HASH12_SIZE; /* force hash16 */
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2737,7 +2737,7 @@ static int WmTestSearch21Hash14 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH14_SIZE; /* force hash16 */ ctx->hash_size = HASH14_SIZE; /* force hash16 */
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2763,7 +2763,7 @@ static int WmTestSearch21Hash15 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH15_SIZE; /* force hash16 */ ctx->hash_size = HASH15_SIZE; /* force hash16 */
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2789,7 +2789,7 @@ static int WmTestSearch21Hash16 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0); MpmAddPatternCS(&mpm_ctx, (uint8_t *)"/videoaccesscodecinstall.exe", 28, 0, 0, 0, 0, 0);
ctx->hash_size = HASH16_SIZE; /* force hash16 */ ctx->hash_size = HASH16_SIZE; /* force hash16 */
WmPreparePatterns(&mpm_ctx); WmPreparePatterns(&mpm_ctx);
WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1); WmThreadInitCtx(&mpm_ctx, &mpm_thread_ctx, 1);
@ -2815,12 +2815,12 @@ static int WmTestSearch22Hash9 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */
/* total matches: 135 */ /* total matches: 135 */
ctx->hash_size = HASH9_SIZE; /* force hash size */ ctx->hash_size = HASH9_SIZE; /* force hash size */
@ -2848,12 +2848,12 @@ static int WmTestSearch22Hash12 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */
/* total matches: 135 */ /* total matches: 135 */
ctx->hash_size = HASH12_SIZE; /* force hash size */ ctx->hash_size = HASH12_SIZE; /* force hash size */
@ -2881,12 +2881,12 @@ static int WmTestSearch22Hash14 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */
/* total matches: 135 */ /* total matches: 135 */
ctx->hash_size = HASH14_SIZE; /* force hash size */ ctx->hash_size = HASH14_SIZE; /* force hash size */
@ -2914,12 +2914,12 @@ static int WmTestSearch22Hash15 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */
/* total matches: 135 */ /* total matches: 135 */
ctx->hash_size = HASH15_SIZE; /* force hash size */ ctx->hash_size = HASH15_SIZE; /* force hash size */
@ -2947,12 +2947,12 @@ static int WmTestSearch22Hash16 (void) {
MpmInitCtx(&mpm_ctx, MPM_WUMANBER); MpmInitCtx(&mpm_ctx, MPM_WUMANBER);
WmCtx *ctx = (WmCtx *)mpm_ctx.ctx; WmCtx *ctx = (WmCtx *)mpm_ctx.ctx;
WmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"A", 1, 0, 0, 0, 0, 0); /* should match 30 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AA", 2, 0, 0, 1, 0, 0); /* should match 29 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAA", 3, 0, 0, 2, 0, 0); /* should match 28 times */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAA", 5, 0, 0, 3, 0, 0); /* 26 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAA", 10, 0, 0, 4, 0, 0); /* 21 */
WmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */ MpmAddPatternCS(&mpm_ctx, (uint8_t *)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 30, 0, 0, 5, 0, 0); /* 1 */
/* total matches: 135 */ /* total matches: 135 */
ctx->hash_size = HASH16_SIZE; /* force hash size */ ctx->hash_size = HASH16_SIZE; /* force hash size */

@ -639,6 +639,26 @@ uint32_t MpmGetBloomSize(const char *conf_val)
SCReturnInt(bloom_value); SCReturnInt(bloom_value);
} }
int MpmAddPatternCS(struct MpmCtx_ *mpm_ctx, uint8_t *pat, uint16_t patlen,
uint16_t offset, uint16_t depth,
uint32_t pid, uint32_t sid, uint8_t flags)
{
return mpm_table[mpm_ctx->mpm_type].AddPattern(mpm_ctx, pat, patlen,
offset, depth,
pid, sid, flags);
}
int MpmAddPatternCI(struct MpmCtx_ *mpm_ctx, uint8_t *pat, uint16_t patlen,
uint16_t offset, uint16_t depth,
uint32_t pid, uint32_t sid, uint8_t flags)
{
return mpm_table[mpm_ctx->mpm_type].AddPatternNocase(mpm_ctx, pat, patlen,
offset, depth,
pid, sid, flags);
}
/************************************Unittests*********************************/ /************************************Unittests*********************************/
#ifdef UNITTESTS #ifdef UNITTESTS

@ -249,4 +249,11 @@ void MpmInitThreadCtx(MpmThreadCtx *mpm_thread_ctx, uint16_t, uint32_t);
uint32_t MpmGetHashSize(const char *); uint32_t MpmGetHashSize(const char *);
uint32_t MpmGetBloomSize(const char *); uint32_t MpmGetBloomSize(const char *);
int MpmAddPatternCS(struct MpmCtx_ *mpm_ctx, uint8_t *pat, uint16_t patlen,
uint16_t offset, uint16_t depth,
uint32_t pid, uint32_t sid, uint8_t flags);
int MpmAddPatternCI(struct MpmCtx_ *mpm_ctx, uint8_t *pat, uint16_t patlen,
uint16_t offset, uint16_t depth,
uint32_t pid, uint32_t sid, uint8_t flags);
#endif /* __UTIL_MPM_H__ */ #endif /* __UTIL_MPM_H__ */

Loading…
Cancel
Save