replace all Signature->amatch instances in the engine with Signature->sm_lists[DETECT_SM_LIST_AMATCH]

remotes/origin/master-1.1.x
Anoop Saldanha 15 years ago committed by Victor Julien
parent e0476242c6
commit a7353be20d

@ -411,11 +411,11 @@ static int DetectDceIfaceTestParse01(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC") == 0);
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
SCReturnInt(0); SCReturnInt(0);
} }
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
if (did == NULL) { if (did == NULL) {
SCReturnInt(0); SCReturnInt(0);
@ -451,11 +451,11 @@ static int DetectDceIfaceTestParse02(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,>1") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,>1") == 0);
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
SCReturnInt(0); SCReturnInt(0);
} }
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
if (did == NULL) { if (did == NULL) {
SCReturnInt(0); SCReturnInt(0);
@ -491,11 +491,11 @@ static int DetectDceIfaceTestParse03(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,<10") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,<10") == 0);
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
SCReturnInt(0); SCReturnInt(0);
} }
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
result &= 1; result &= 1;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
@ -527,11 +527,11 @@ static int DetectDceIfaceTestParse04(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,!10") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,!10") == 0);
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
SCReturnInt(0); SCReturnInt(0);
} }
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
if (did == NULL) { if (did == NULL) {
SCReturnInt(0); SCReturnInt(0);
@ -567,11 +567,11 @@ static int DetectDceIfaceTestParse05(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,=10") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,=10") == 0);
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
SCReturnInt(0); SCReturnInt(0);
} }
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
if (did == NULL) { if (did == NULL) {
SCReturnInt(0); SCReturnInt(0);
@ -607,11 +607,11 @@ static int DetectDceIfaceTestParse06(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,any_frag") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,any_frag") == 0);
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
SCReturnInt(0); SCReturnInt(0);
} }
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
if (did == NULL) { if (did == NULL) {
SCReturnInt(0); SCReturnInt(0);
@ -647,11 +647,11 @@ static int DetectDceIfaceTestParse07(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,>1,any_frag") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,>1,any_frag") == 0);
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
SCReturnInt(0); SCReturnInt(0);
} }
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
if (did == NULL) { if (did == NULL) {
SCReturnInt(0); SCReturnInt(0);
@ -685,11 +685,11 @@ static int DetectDceIfaceTestParse08(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,<1,any_frag") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,<1,any_frag") == 0);
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
SCReturnInt(0); SCReturnInt(0);
} }
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
if (did == NULL) { if (did == NULL) {
SCReturnInt(0); SCReturnInt(0);
@ -725,7 +725,7 @@ static int DetectDceIfaceTestParse09(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,=1,any_frag") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,=1,any_frag") == 0);
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
if (did == NULL) { if (did == NULL) {
SCReturnInt(0); SCReturnInt(0);
@ -761,11 +761,11 @@ static int DetectDceIfaceTestParse10(void)
result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,!1,any_frag") == 0); result = (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,!1,any_frag") == 0);
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
SCReturnInt(0); SCReturnInt(0);
} }
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
did = temp->ctx; did = temp->ctx;
if (did == NULL) { if (did == NULL) {
SCReturnInt(0); SCReturnInt(0);

@ -380,7 +380,7 @@ static int DetectDceOpnumTestParse01(void)
result &= (DetectDceOpnumSetup(NULL, s, "12,26,62,61,6513--") == -1); result &= (DetectDceOpnumSetup(NULL, s, "12,26,62,61,6513--") == -1);
result &= (DetectDceOpnumSetup(NULL, s, "12-14,12,121,62-8") == -1); result &= (DetectDceOpnumSetup(NULL, s, "12-14,12,121,62-8") == -1);
if (s->amatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
SigFree(s); SigFree(s);
result &= 1; result &= 1;
} }
@ -400,8 +400,8 @@ static int DetectDceOpnumTestParse02(void)
result = (DetectDceOpnumSetup(NULL, s, "12") == 0); result = (DetectDceOpnumSetup(NULL, s, "12") == 0);
if (s->amatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
dod = temp->ctx; dod = temp->ctx;
if (dod == NULL) if (dod == NULL)
goto end; goto end;
@ -429,8 +429,8 @@ static int DetectDceOpnumTestParse03(void)
result = (DetectDceOpnumSetup(NULL, s, "12-24") == 0); result = (DetectDceOpnumSetup(NULL, s, "12-24") == 0);
if (s->amatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
dod = temp->ctx; dod = temp->ctx;
if (dod == NULL) if (dod == NULL)
goto end; goto end;
@ -458,8 +458,8 @@ static int DetectDceOpnumTestParse04(void)
result = (DetectDceOpnumSetup(NULL, s, "12-24,24,62-72,623-635,62,25,213-235") == 0); result = (DetectDceOpnumSetup(NULL, s, "12-24,24,62-72,623-635,62,25,213-235") == 0);
if (s->amatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
dod = temp->ctx; dod = temp->ctx;
if (dod == NULL) if (dod == NULL)
goto end; goto end;
@ -524,8 +524,8 @@ static int DetectDceOpnumTestParse05(void)
result = (DetectDceOpnumSetup(NULL, s, "1,2,3,4,5,6,7") == 0); result = (DetectDceOpnumSetup(NULL, s, "1,2,3,4,5,6,7") == 0);
if (s->amatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
dod = temp->ctx; dod = temp->ctx;
if (dod == NULL) if (dod == NULL)
goto end; goto end;
@ -590,8 +590,8 @@ static int DetectDceOpnumTestParse06(void)
result = (DetectDceOpnumSetup(NULL, s, "1-2,3-4,5-6,7-8") == 0); result = (DetectDceOpnumSetup(NULL, s, "1-2,3-4,5-6,7-8") == 0);
if (s->amatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
dod = temp->ctx; dod = temp->ctx;
if (dod == NULL) if (dod == NULL)
goto end; goto end;
@ -638,8 +638,8 @@ static int DetectDceOpnumTestParse07(void)
result = (DetectDceOpnumSetup(NULL, s, "1-2,3-4,5-6,7-8,9") == 0); result = (DetectDceOpnumSetup(NULL, s, "1-2,3-4,5-6,7-8,9") == 0);
if (s->amatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
temp = s->amatch; temp = s->sm_lists[DETECT_SM_LIST_AMATCH];
dod = temp->ctx; dod = temp->ctx;
if (dod == NULL) if (dod == NULL)
goto end; goto end;

@ -161,7 +161,7 @@ static int DetectDceStubDataTestParse01(void)
result = (DetectDceStubDataSetup(NULL, &s, NULL) == 0); result = (DetectDceStubDataSetup(NULL, &s, NULL) == 0);
if (s.amatch != NULL) { if (s.sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
result = 1; result = 1;
} else { } else {
result = 0; result = 0;

@ -85,9 +85,9 @@ static int DetectDistanceSetup (DetectEngineCtx *de_ctx, Signature *s,
SigMatch *pm2_ots = NULL; SigMatch *pm2_ots = NULL;
dcem = SigMatchGetLastSMFromLists(s, 6, dcem = SigMatchGetLastSMFromLists(s, 6,
DETECT_DCE_IFACE, s->amatch_tail, DETECT_DCE_IFACE, s->sm_lists_tail[DETECT_SM_LIST_AMATCH],
DETECT_DCE_OPNUM, s->amatch_tail, DETECT_DCE_OPNUM, s->sm_lists_tail[DETECT_SM_LIST_AMATCH],
DETECT_DCE_STUB_DATA, s->amatch_tail); DETECT_DCE_STUB_DATA, s->sm_lists_tail[DETECT_SM_LIST_AMATCH]);
dm_ots = SigMatchGetLastSMFromLists(s, 6, dm_ots = SigMatchGetLastSMFromLists(s, 6,
DETECT_CONTENT, s->dmatch_tail, DETECT_CONTENT, s->dmatch_tail,

@ -288,7 +288,7 @@ int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
{ {
SCEnter(); SCEnter();
SigMatch *sm = s->amatch; SigMatch *sm = s->sm_lists[DETECT_SM_LIST_AMATCH];
int match = 0; int match = 0;
int r = 0; int r = 0;
char umatch = 0; char umatch = 0;
@ -353,7 +353,7 @@ int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
appinspect = uinspect + dinspect; appinspect = uinspect + dinspect;
appmatch = umatch + dmatch; appmatch = umatch + dmatch;
if (s->amatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
for ( ; sm != NULL; sm = sm->next) { for ( ; sm != NULL; sm = sm->next) {
SCLogDebug("sm %p, sm->next %p", sm, sm->next); SCLogDebug("sm %p, sm->next %p", sm, sm->next);

@ -297,7 +297,7 @@ int DetectFtpbounceTestSetup01(void)
/* ftpbounce doesn't accept options so the str is NULL */ /* ftpbounce doesn't accept options so the str is NULL */
res = !DetectFtpbounceSetup(de_ctx, s, NULL); res = !DetectFtpbounceSetup(de_ctx, s, NULL);
res &= s->amatch != NULL && s->amatch->type & DETECT_FTPBOUNCE; res &= s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL && s->sm_lists[DETECT_SM_LIST_AMATCH]->type & DETECT_FTPBOUNCE;
SigFree(s); SigFree(s);
return res; return res;

@ -1793,13 +1793,13 @@ int DetectHttpClientBodyTest16(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpClientBodyData *hcbd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpClientBodyData *hcbd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id == hcbd->id) if (cd->id == hcbd->id)
goto end; goto end;
@ -1832,13 +1832,13 @@ int DetectHttpClientBodyTest17(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpClientBodyData *hcbd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpClientBodyData *hcbd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id == hcbd->id) if (cd->id == hcbd->id)
goto end; goto end;
@ -1871,13 +1871,13 @@ int DetectHttpClientBodyTest18(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpClientBodyData *hcbd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpClientBodyData *hcbd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id != 0 || hcbd->id != 1) if (cd->id != 0 || hcbd->id != 1)
goto end; goto end;
@ -1910,13 +1910,13 @@ int DetectHttpClientBodyTest19(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpClientBodyData *hcbd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpClientBodyData *hcbd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id != 1 || hcbd->id != 0) if (cd->id != 1 || hcbd->id != 0)
goto end; goto end;
@ -1950,14 +1950,14 @@ int DetectHttpClientBodyTest20(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpClientBodyData *hcbd1 = de_ctx->sig_list->amatch_tail->ctx; DetectHttpClientBodyData *hcbd1 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
DetectHttpClientBodyData *hcbd2 = de_ctx->sig_list->amatch_tail->prev->ctx; DetectHttpClientBodyData *hcbd2 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->prev->ctx;
if (cd->id != 1 || hcbd1->id != 0 || hcbd2->id != 0) if (cd->id != 1 || hcbd1->id != 0 || hcbd2->id != 0)
goto end; goto end;
@ -1991,14 +1991,14 @@ int DetectHttpClientBodyTest21(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpClientBodyData *hcbd1 = de_ctx->sig_list->amatch_tail->ctx; DetectHttpClientBodyData *hcbd1 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
DetectHttpClientBodyData *hcbd2 = de_ctx->sig_list->amatch_tail->prev->ctx; DetectHttpClientBodyData *hcbd2 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->prev->ctx;
if (cd->id != 2 || hcbd1->id != 0 || hcbd2->id != 0) if (cd->id != 2 || hcbd1->id != 0 || hcbd2->id != 0)
goto end; goto end;

@ -364,7 +364,7 @@ int DetectHttpCookieTest03(void)
} }
result = 0; result = 0;
sm = de_ctx->sig_list->amatch; sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH];
if (sm == NULL) { if (sm == NULL) {
printf("no sigmatch(es): "); printf("no sigmatch(es): ");
goto end; goto end;
@ -457,9 +457,9 @@ int DetectHttpCookieTest06(void)
Signature *s = de_ctx->sig_list; Signature *s = de_ctx->sig_list;
BUG_ON(s->amatch == NULL); BUG_ON(s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL);
if (s->amatch->type != DETECT_AL_HTTP_COOKIE) if (s->sm_lists[DETECT_SM_LIST_AMATCH]->type != DETECT_AL_HTTP_COOKIE)
goto end; goto end;
if (s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL) { if (s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL) {
@ -500,13 +500,13 @@ int DetectHttpCookieTest07(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpCookieData *hcd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpCookieData *hcd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id == hcd->id) if (cd->id == hcd->id)
goto end; goto end;
@ -539,13 +539,13 @@ int DetectHttpCookieTest08(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpCookieData *hcd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpCookieData *hcd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id == hcd->id) if (cd->id == hcd->id)
goto end; goto end;
@ -578,13 +578,13 @@ int DetectHttpCookieTest09(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpCookieData *hcd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpCookieData *hcd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id != 0 || hcd->id != 1) if (cd->id != 0 || hcd->id != 1)
goto end; goto end;
@ -617,13 +617,13 @@ int DetectHttpCookieTest10(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpCookieData *hcd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpCookieData *hcd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id != 1 || hcd->id != 0) if (cd->id != 1 || hcd->id != 0)
goto end; goto end;
@ -657,14 +657,14 @@ int DetectHttpCookieTest11(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpCookieData *hcd1 = de_ctx->sig_list->amatch_tail->ctx; DetectHttpCookieData *hcd1 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
DetectHttpCookieData *hcd2 = de_ctx->sig_list->amatch_tail->prev->ctx; DetectHttpCookieData *hcd2 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->prev->ctx;
if (cd->id != 1 || hcd1->id != 0 || hcd2->id != 0) if (cd->id != 1 || hcd1->id != 0 || hcd2->id != 0)
goto end; goto end;
@ -698,14 +698,14 @@ int DetectHttpCookieTest12(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpCookieData *hcd1 = de_ctx->sig_list->amatch_tail->ctx; DetectHttpCookieData *hcd1 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
DetectHttpCookieData *hcd2 = de_ctx->sig_list->amatch_tail->prev->ctx; DetectHttpCookieData *hcd2 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->prev->ctx;
if (cd->id != 2 || hcd1->id != 0 || hcd2->id != 0) if (cd->id != 2 || hcd1->id != 0 || hcd2->id != 0)
goto end; goto end;

@ -1355,13 +1355,13 @@ int DetectHttpHeaderTest14(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpHeaderData *hhd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpHeaderData *hhd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id == hhd->id) if (cd->id == hhd->id)
goto end; goto end;
@ -1394,13 +1394,13 @@ int DetectHttpHeaderTest15(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpHeaderData *hhd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpHeaderData *hhd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id == hhd->id) if (cd->id == hhd->id)
goto end; goto end;
@ -1433,13 +1433,13 @@ int DetectHttpHeaderTest16(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpHeaderData *hhd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpHeaderData *hhd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id != 0 || hhd->id != 1) if (cd->id != 0 || hhd->id != 1)
goto end; goto end;
@ -1472,13 +1472,13 @@ int DetectHttpHeaderTest17(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpHeaderData *hhd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpHeaderData *hhd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id != 1 || hhd->id != 0) if (cd->id != 1 || hhd->id != 0)
goto end; goto end;
@ -1512,14 +1512,14 @@ int DetectHttpHeaderTest18(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpHeaderData *hhd1 = de_ctx->sig_list->amatch_tail->ctx; DetectHttpHeaderData *hhd1 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
DetectHttpHeaderData *hhd2 = de_ctx->sig_list->amatch_tail->prev->ctx; DetectHttpHeaderData *hhd2 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->prev->ctx;
if (cd->id != 1 || hhd1->id != 0 || hhd2->id != 0) if (cd->id != 1 || hhd1->id != 0 || hhd2->id != 0)
goto end; goto end;
@ -1553,14 +1553,14 @@ int DetectHttpHeaderTest19(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpHeaderData *hhd1 = de_ctx->sig_list->amatch_tail->ctx; DetectHttpHeaderData *hhd1 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
DetectHttpHeaderData *hhd2 = de_ctx->sig_list->amatch_tail->prev->ctx; DetectHttpHeaderData *hhd2 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->prev->ctx;
if (cd->id != 2 || hhd1->id != 0 || hhd2->id != 0) if (cd->id != 2 || hhd1->id != 0 || hhd2->id != 0)
goto end; goto end;

@ -420,13 +420,13 @@ int DetectHttpMethodTest06(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpMethodData *hmd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpMethodData *hmd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id == hmd->id) if (cd->id == hmd->id)
goto end; goto end;
@ -459,13 +459,13 @@ int DetectHttpMethodTest07(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpMethodData *hmd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpMethodData *hmd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id == hmd->id) if (cd->id == hmd->id)
goto end; goto end;
@ -498,13 +498,13 @@ int DetectHttpMethodTest08(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpMethodData *hmd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpMethodData *hmd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id != 0 || hmd->id != 1) if (cd->id != 0 || hmd->id != 1)
goto end; goto end;
@ -537,13 +537,13 @@ int DetectHttpMethodTest09(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpMethodData *hmd = de_ctx->sig_list->amatch_tail->ctx; DetectHttpMethodData *hmd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (cd->id != 1 || hmd->id != 0) if (cd->id != 1 || hmd->id != 0)
goto end; goto end;
@ -577,14 +577,14 @@ int DetectHttpMethodTest10(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpMethodData *hmd1 = de_ctx->sig_list->amatch_tail->ctx; DetectHttpMethodData *hmd1 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
DetectHttpMethodData *hmd2 = de_ctx->sig_list->amatch_tail->prev->ctx; DetectHttpMethodData *hmd2 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->prev->ctx;
if (cd->id != 1 || hmd1->id != 0 || hmd2->id != 0) if (cd->id != 1 || hmd1->id != 0 || hmd2->id != 0)
goto end; goto end;
@ -618,14 +618,14 @@ int DetectHttpMethodTest11(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL\n"); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL\n");
goto end; goto end;
} }
DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx; DetectContentData *cd = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx;
DetectHttpMethodData *hmd1 = de_ctx->sig_list->amatch_tail->ctx; DetectHttpMethodData *hmd1 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
DetectHttpMethodData *hmd2 = de_ctx->sig_list->amatch_tail->prev->ctx; DetectHttpMethodData *hmd2 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->prev->ctx;
if (cd->id != 2 || hmd1->id != 0 || hmd2->id != 0) if (cd->id != 2 || hmd1->id != 0 || hmd2->id != 0)
goto end; goto end;
@ -659,13 +659,13 @@ static int DetectHttpMethodTest12(void)
goto end; goto end;
} }
if (de_ctx->sig_list->amatch == NULL) { if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
printf("de_ctx->sig_list->amatch == NULL: "); printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_AMATCH] == NULL: ");
goto end; goto end;
} }
DetectHttpMethodData *hmd1 = de_ctx->sig_list->amatch_tail->ctx; DetectHttpMethodData *hmd1 = de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
DetectHttpMethodData *hmd2 = de_ctx->sig_list->next->amatch_tail->ctx; DetectHttpMethodData *hmd2 = de_ctx->sig_list->next->sm_lists_tail[DETECT_SM_LIST_AMATCH]->ctx;
if (!(hmd1->flags & DETECT_AL_HTTP_METHOD_NOCASE)) { if (!(hmd1->flags & DETECT_AL_HTTP_METHOD_NOCASE)) {
printf("nocase flag not set on sig 1: "); printf("nocase flag not set on sig 1: ");

@ -73,13 +73,13 @@ static SigMatch *SigMatchGetLastNocasePattern(Signature *s) {
SigMatch *co_sm = DetectContentGetLastPattern(s->sm_lists_tail[DETECT_SM_LIST_PMATCH]); SigMatch *co_sm = DetectContentGetLastPattern(s->sm_lists_tail[DETECT_SM_LIST_PMATCH]);
SigMatch *ur_sm = SigMatchGetLastSM(s->sm_lists_tail[DETECT_SM_LIST_UMATCH], DETECT_URICONTENT); SigMatch *ur_sm = SigMatchGetLastSM(s->sm_lists_tail[DETECT_SM_LIST_UMATCH], DETECT_URICONTENT);
/* http client body SigMatch */ /* http client body SigMatch */
SigMatch *hcbd_sm = SigMatchGetLastSM(s->amatch_tail, DETECT_AL_HTTP_CLIENT_BODY); SigMatch *hcbd_sm = SigMatchGetLastSM(s->sm_lists_tail[DETECT_SM_LIST_AMATCH], DETECT_AL_HTTP_CLIENT_BODY);
/* http cookie SigMatch */ /* http cookie SigMatch */
SigMatch *hcd_sm = SigMatchGetLastSM(s->amatch_tail, DETECT_AL_HTTP_COOKIE); SigMatch *hcd_sm = SigMatchGetLastSM(s->sm_lists_tail[DETECT_SM_LIST_AMATCH], DETECT_AL_HTTP_COOKIE);
/* http header SigMatch */ /* http header SigMatch */
SigMatch *hhd_sm = SigMatchGetLastSM(s->amatch_tail, DETECT_AL_HTTP_HEADER); SigMatch *hhd_sm = SigMatchGetLastSM(s->sm_lists_tail[DETECT_SM_LIST_AMATCH], DETECT_AL_HTTP_HEADER);
/* http method SigMatch */ /* http method SigMatch */
SigMatch *hmd_sm = SigMatchGetLastSM(s->amatch_tail, DETECT_AL_HTTP_METHOD); SigMatch *hmd_sm = SigMatchGetLastSM(s->sm_lists_tail[DETECT_SM_LIST_AMATCH], DETECT_AL_HTTP_METHOD);
SigMatch *temp_sm = NULL; SigMatch *temp_sm = NULL;

@ -152,17 +152,17 @@ SigTableElmt *SigTableGet(char *name) {
* \param new pointer to the SigMatch of type uricontent to be appended * \param new pointer to the SigMatch of type uricontent to be appended
*/ */
void SigMatchAppendAppLayer(Signature *s, SigMatch *new) { void SigMatchAppendAppLayer(Signature *s, SigMatch *new) {
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
s->amatch = new; s->sm_lists[DETECT_SM_LIST_AMATCH] = new;
s->amatch_tail = new; s->sm_lists_tail[DETECT_SM_LIST_AMATCH] = new;
new->next = NULL; new->next = NULL;
new->prev = NULL; new->prev = NULL;
} else { } else {
SigMatch *cur = s->amatch_tail; SigMatch *cur = s->sm_lists_tail[DETECT_SM_LIST_AMATCH];
cur->next = new; cur->next = new;
new->prev = cur; new->prev = cur;
new->next = NULL; new->next = NULL;
s->amatch_tail = new; s->sm_lists_tail[DETECT_SM_LIST_AMATCH] = new;
} }
new->idx = s->sm_cnt; new->idx = s->sm_cnt;
@ -324,20 +324,20 @@ void SigMatchReplaceContent(Signature *s, SigMatch *old, SigMatch *new) {
/* finally append the "new" sig match to the app layer list */ /* finally append the "new" sig match to the app layer list */
/** \todo if the app layer gets it's own list, adapt this code */ /** \todo if the app layer gets it's own list, adapt this code */
if (s->amatch == NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] == NULL) {
s->amatch = new; s->sm_lists[DETECT_SM_LIST_AMATCH] = new;
s->amatch_tail = new; s->sm_lists_tail[DETECT_SM_LIST_AMATCH] = new;
new->next = NULL; new->next = NULL;
new->prev = NULL; new->prev = NULL;
} else { } else {
SigMatch *cur = s->amatch; SigMatch *cur = s->sm_lists[DETECT_SM_LIST_AMATCH];
for ( ; cur->next != NULL; cur = cur->next); for ( ; cur->next != NULL; cur = cur->next);
cur->next = new; cur->next = new;
new->next = NULL; new->next = NULL;
new->prev = cur; new->prev = cur;
s->amatch_tail = new; s->sm_lists_tail[DETECT_SM_LIST_AMATCH] = new;
} }
/* move over the idx */ /* move over the idx */
@ -1065,7 +1065,7 @@ void SigFree(Signature *s) {
sm = nsm; sm = nsm;
} }
sm = s->amatch; sm = s->sm_lists[DETECT_SM_LIST_AMATCH];
while (sm != NULL) { while (sm != NULL) {
nsm = sm->next; nsm = sm->next;
SigMatchFree(sm); SigMatchFree(sm);
@ -1359,7 +1359,7 @@ Signature *SigInit(DetectEngineCtx *de_ctx, char *sigstr) {
sig->flags |= SIG_FLAG_UMATCH; sig->flags |= SIG_FLAG_UMATCH;
if (sig->dmatch) if (sig->dmatch)
sig->flags |= SIG_FLAG_AMATCH; sig->flags |= SIG_FLAG_AMATCH;
if (sig->amatch) if (sig->sm_lists[DETECT_SM_LIST_AMATCH])
sig->flags |= SIG_FLAG_AMATCH; sig->flags |= SIG_FLAG_AMATCH;
SCLogDebug("sig %"PRIu32" SIG_FLAG_APPLAYER: %s, SIG_FLAG_PACKET: %s", SCLogDebug("sig %"PRIu32" SIG_FLAG_APPLAYER: %s, SIG_FLAG_PACKET: %s",
@ -1551,7 +1551,7 @@ Signature *SigInitReal(DetectEngineCtx *de_ctx, char *sigstr) {
sig->flags |= SIG_FLAG_UMATCH; sig->flags |= SIG_FLAG_UMATCH;
if (sig->dmatch) if (sig->dmatch)
sig->flags |= SIG_FLAG_AMATCH; sig->flags |= SIG_FLAG_AMATCH;
if (sig->amatch) if (sig->sm_lists[DETECT_SM_LIST_AMATCH])
sig->flags |= SIG_FLAG_AMATCH; sig->flags |= SIG_FLAG_AMATCH;
SigBuildAddressMatchArray(sig); SigBuildAddressMatchArray(sig);

@ -88,9 +88,9 @@ static int DetectWithinSetup (DetectEngineCtx *de_ctx, Signature *s, char *withi
SigMatch *pm2_ots = NULL; SigMatch *pm2_ots = NULL;
dcem = SigMatchGetLastSMFromLists(s, 6, dcem = SigMatchGetLastSMFromLists(s, 6,
DETECT_DCE_IFACE, s->amatch_tail, DETECT_DCE_IFACE, s->sm_lists_tail[DETECT_SM_LIST_AMATCH],
DETECT_DCE_OPNUM, s->amatch_tail, DETECT_DCE_OPNUM, s->sm_lists_tail[DETECT_SM_LIST_AMATCH],
DETECT_DCE_STUB_DATA, s->amatch_tail); DETECT_DCE_STUB_DATA, s->sm_lists_tail[DETECT_SM_LIST_AMATCH]);
dm_ots = SigMatchGetLastSMFromLists(s, 6, dm_ots = SigMatchGetLastSMFromLists(s, 6,
DETECT_CONTENT, s->dmatch_tail, DETECT_CONTENT, s->dmatch_tail,

@ -1141,10 +1141,10 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh
} }
} }
SCLogDebug("s->amatch %p, s->sm_lists[DETECT_SM_LIST_UMATCH] %p, s->dmatch %p", SCLogDebug("s->sm_lists[DETECT_SM_LIST_AMATCH] %p, s->sm_lists[DETECT_SM_LIST_UMATCH] %p, s->dmatch %p",
s->amatch, s->sm_lists[DETECT_SM_LIST_UMATCH], s->dmatch); s->sm_lists[DETECT_SM_LIST_AMATCH], s->sm_lists[DETECT_SM_LIST_UMATCH], s->dmatch);
if (s->amatch != NULL || s->sm_lists[DETECT_SM_LIST_UMATCH] != NULL || s->dmatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL || s->sm_lists[DETECT_SM_LIST_UMATCH] != NULL || s->dmatch != NULL) {
if (alstate == NULL) { if (alstate == NULL) {
SCLogDebug("state matches but no state, we can't match"); SCLogDebug("state matches but no state, we can't match");
goto next; goto next;
@ -1451,7 +1451,7 @@ int SignatureIsIPOnly(DetectEngineCtx *de_ctx, Signature *s) {
if (s->sm_lists[DETECT_SM_LIST_UMATCH] != NULL) if (s->sm_lists[DETECT_SM_LIST_UMATCH] != NULL)
return 0; return 0;
if (s->amatch != NULL) if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL)
return 0; return 0;
SigMatch *sm = s->sm_lists[DETECT_SM_LIST_MATCH]; SigMatch *sm = s->sm_lists[DETECT_SM_LIST_MATCH];
@ -1519,7 +1519,7 @@ static int SignatureIsDEOnly(DetectEngineCtx *de_ctx, Signature *s) {
if (s->sm_lists[DETECT_SM_LIST_UMATCH] != NULL) if (s->sm_lists[DETECT_SM_LIST_UMATCH] != NULL)
return 0; return 0;
if (s->amatch != NULL) if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL)
return 0; return 0;
SigMatch *sm = s->sm_lists[DETECT_SM_LIST_MATCH]; SigMatch *sm = s->sm_lists[DETECT_SM_LIST_MATCH];
@ -1610,7 +1610,7 @@ static int SignatureCreateMask(Signature *s) {
} }
SigMatch *sm; SigMatch *sm;
for (sm = s->amatch ; sm != NULL; sm = sm->next) { for (sm = s->sm_lists[DETECT_SM_LIST_AMATCH] ; sm != NULL; sm = sm->next) {
switch(sm->type) { switch(sm->type) {
case DETECT_AL_HTTP_COOKIE: case DETECT_AL_HTTP_COOKIE:
case DETECT_AL_HTTP_METHOD: case DETECT_AL_HTTP_METHOD:
@ -1656,7 +1656,7 @@ static int SignatureCreateMask(Signature *s) {
SCLogDebug("sig requires flow"); SCLogDebug("sig requires flow");
} }
if (s->amatch != NULL) { if (s->sm_lists[DETECT_SM_LIST_AMATCH] != NULL) {
s->mask |= SIG_MASK_REQUIRE_FLOW; s->mask |= SIG_MASK_REQUIRE_FLOW;
SCLogDebug("sig requires flow"); SCLogDebug("sig requires flow");
} }

@ -360,7 +360,7 @@ typedef struct Signature_ {
/** ptr to the SigMatch lists */ /** ptr to the SigMatch lists */
//struct SigMatch_ *pmatch; /* payload matches */ //struct SigMatch_ *pmatch; /* payload matches */
//struct SigMatch_ *umatch; /* uricontent payload matches */ //struct SigMatch_ *umatch; /* uricontent payload matches */
struct SigMatch_ *amatch; /* general app layer matches */ //struct SigMatch_ *amatch; /* general app layer matches */
struct SigMatch_ *dmatch; /* dce app layer matches */ struct SigMatch_ *dmatch; /* dce app layer matches */
//struct SigMatch_ *match; /* non-payload matches */ //struct SigMatch_ *match; /* non-payload matches */
struct SigMatch_ *tmatch; /* list of tags matches */ struct SigMatch_ *tmatch; /* list of tags matches */
@ -414,7 +414,7 @@ typedef struct Signature_ {
//struct SigMatch_ *match_tail; /* non-payload matches, tail of the list */ //struct SigMatch_ *match_tail; /* non-payload matches, tail of the list */
//struct SigMatch_ *pmatch_tail; /* payload matches, tail of the list */ //struct SigMatch_ *pmatch_tail; /* payload matches, tail of the list */
//struct SigMatch_ *umatch_tail; /* uricontent payload matches, tail of the list */ //struct SigMatch_ *umatch_tail; /* uricontent payload matches, tail of the list */
struct SigMatch_ *amatch_tail; /* general app layer matches, tail of the list */ //struct SigMatch_ *amatch_tail; /* general app layer matches, tail of the list */
struct SigMatch_ *dmatch_tail; /* dce app layer matches, tail of the list */ struct SigMatch_ *dmatch_tail; /* dce app layer matches, tail of the list */
struct SigMatch_ *tmatch_tail; /* tag matches, tail of the list */ struct SigMatch_ *tmatch_tail; /* tag matches, tail of the list */

Loading…
Cancel
Save