|
|
|
@ -1169,17 +1169,17 @@ static inline void DetectMpmPrefilter(DetectEngineCtx *de_ctx,
|
|
|
|
|
if (alproto == ALPROTO_HTTP && alstate != NULL) {
|
|
|
|
|
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_URI) {
|
|
|
|
|
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_URI);
|
|
|
|
|
DetectUricontentInspectMpm(det_ctx, p->flow, alstate);
|
|
|
|
|
DetectUricontentInspectMpm(det_ctx, p->flow, alstate, flags);
|
|
|
|
|
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_MPM_URI);
|
|
|
|
|
}
|
|
|
|
|
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HCBD) {
|
|
|
|
|
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_HCBD);
|
|
|
|
|
DetectEngineRunHttpClientBodyMpm(de_ctx, det_ctx, p->flow, alstate);
|
|
|
|
|
DetectEngineRunHttpClientBodyMpm(de_ctx, det_ctx, p->flow, alstate, flags);
|
|
|
|
|
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_MPM_HCBD);
|
|
|
|
|
}
|
|
|
|
|
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HSBD) {
|
|
|
|
|
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_HSBD);
|
|
|
|
|
DetectEngineRunHttpServerBodyMpm(de_ctx, det_ctx, p->flow, alstate);
|
|
|
|
|
DetectEngineRunHttpServerBodyMpm(de_ctx, det_ctx, p->flow, alstate, flags);
|
|
|
|
|
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_MPM_HSBD);
|
|
|
|
|
}
|
|
|
|
|
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HHD) {
|
|
|
|
@ -1194,17 +1194,17 @@ static inline void DetectMpmPrefilter(DetectEngineCtx *de_ctx,
|
|
|
|
|
}
|
|
|
|
|
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HMD) {
|
|
|
|
|
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_HMD);
|
|
|
|
|
DetectEngineRunHttpMethodMpm(det_ctx, p->flow, alstate);
|
|
|
|
|
DetectEngineRunHttpMethodMpm(det_ctx, p->flow, alstate, flags);
|
|
|
|
|
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_MPM_HMD);
|
|
|
|
|
}
|
|
|
|
|
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HCD) {
|
|
|
|
|
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_HCD);
|
|
|
|
|
DetectEngineRunHttpCookieMpm(det_ctx, p->flow, alstate);
|
|
|
|
|
DetectEngineRunHttpCookieMpm(det_ctx, p->flow, alstate, flags);
|
|
|
|
|
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_MPM_HCD);
|
|
|
|
|
}
|
|
|
|
|
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HRUD) {
|
|
|
|
|
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_HRUD);
|
|
|
|
|
DetectEngineRunHttpRawUriMpm(det_ctx, p->flow, alstate);
|
|
|
|
|
DetectEngineRunHttpRawUriMpm(det_ctx, p->flow, alstate, flags);
|
|
|
|
|
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_MPM_HRUD);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -3183,43 +3183,43 @@ int BuildDestinationAddressHeads(DetectEngineCtx *de_ctx, DetectAddressHead *hea
|
|
|
|
|
printf("PatternMatchPrepareGroup failed\n");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
if (sgr->sh->mpm_proto_tcp_ctx != NULL) {
|
|
|
|
|
if (de_ctx->mpm_max_patcnt < sgr->sh->mpm_proto_tcp_ctx->pattern_cnt)
|
|
|
|
|
de_ctx->mpm_max_patcnt = sgr->sh->mpm_proto_tcp_ctx->pattern_cnt;
|
|
|
|
|
|
|
|
|
|
de_ctx->mpm_tot_patcnt += sgr->sh->mpm_proto_tcp_ctx->pattern_cnt;
|
|
|
|
|
}
|
|
|
|
|
if (sgr->sh->mpm_proto_udp_ctx != NULL) {
|
|
|
|
|
if (de_ctx->mpm_max_patcnt < sgr->sh->mpm_proto_udp_ctx->pattern_cnt)
|
|
|
|
|
de_ctx->mpm_max_patcnt = sgr->sh->mpm_proto_udp_ctx->pattern_cnt;
|
|
|
|
|
|
|
|
|
|
de_ctx->mpm_tot_patcnt += sgr->sh->mpm_proto_udp_ctx->pattern_cnt;
|
|
|
|
|
}
|
|
|
|
|
if (sgr->sh->mpm_proto_other_ctx != NULL) {
|
|
|
|
|
if (de_ctx->mpm_max_patcnt < sgr->sh->mpm_proto_other_ctx->pattern_cnt)
|
|
|
|
|
de_ctx->mpm_max_patcnt = sgr->sh->mpm_proto_other_ctx->pattern_cnt;
|
|
|
|
|
|
|
|
|
|
de_ctx->mpm_tot_patcnt += sgr->sh->mpm_proto_other_ctx->pattern_cnt;
|
|
|
|
|
}
|
|
|
|
|
if (sgr->sh->mpm_uri_ctx != NULL) {
|
|
|
|
|
if (de_ctx->mpm_uri_max_patcnt < sgr->sh->mpm_uri_ctx->pattern_cnt)
|
|
|
|
|
de_ctx->mpm_uri_max_patcnt = sgr->sh->mpm_uri_ctx->pattern_cnt;
|
|
|
|
|
|
|
|
|
|
de_ctx->mpm_uri_tot_patcnt += sgr->sh->mpm_uri_ctx->pattern_cnt;
|
|
|
|
|
}
|
|
|
|
|
/* dbg */
|
|
|
|
|
if (!(sgr->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && sgr->sh->mpm_proto_tcp_ctx) {
|
|
|
|
|
de_ctx->mpm_memory_size += sgr->sh->mpm_proto_tcp_ctx->memory_size;
|
|
|
|
|
}
|
|
|
|
|
if (!(sgr->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && sgr->sh->mpm_proto_udp_ctx) {
|
|
|
|
|
de_ctx->mpm_memory_size += sgr->sh->mpm_proto_udp_ctx->memory_size;
|
|
|
|
|
}
|
|
|
|
|
if (!(sgr->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && sgr->sh->mpm_proto_other_ctx) {
|
|
|
|
|
de_ctx->mpm_memory_size += sgr->sh->mpm_proto_other_ctx->memory_size;
|
|
|
|
|
}
|
|
|
|
|
if (!(sgr->sh->flags & SIG_GROUP_HEAD_MPM_URI_COPY) && sgr->sh->mpm_uri_ctx) {
|
|
|
|
|
de_ctx->mpm_memory_size += sgr->sh->mpm_uri_ctx->memory_size;
|
|
|
|
|
}
|
|
|
|
|
//if (sgr->sh->mpm_proto_tcp_ctx != NULL) {
|
|
|
|
|
// if (de_ctx->mpm_max_patcnt < sgr->sh->mpm_proto_tcp_ctx->pattern_cnt)
|
|
|
|
|
// de_ctx->mpm_max_patcnt = sgr->sh->mpm_proto_tcp_ctx->pattern_cnt;
|
|
|
|
|
//
|
|
|
|
|
// de_ctx->mpm_tot_patcnt += sgr->sh->mpm_proto_tcp_ctx->pattern_cnt;
|
|
|
|
|
//}
|
|
|
|
|
//if (sgr->sh->mpm_proto_udp_ctx != NULL) {
|
|
|
|
|
// if (de_ctx->mpm_max_patcnt < sgr->sh->mpm_proto_udp_ctx->pattern_cnt)
|
|
|
|
|
// de_ctx->mpm_max_patcnt = sgr->sh->mpm_proto_udp_ctx->pattern_cnt;
|
|
|
|
|
//
|
|
|
|
|
// de_ctx->mpm_tot_patcnt += sgr->sh->mpm_proto_udp_ctx->pattern_cnt;
|
|
|
|
|
//}
|
|
|
|
|
//if (sgr->sh->mpm_proto_other_ctx != NULL) {
|
|
|
|
|
// if (de_ctx->mpm_max_patcnt < sgr->sh->mpm_proto_other_ctx->pattern_cnt)
|
|
|
|
|
// de_ctx->mpm_max_patcnt = sgr->sh->mpm_proto_other_ctx->pattern_cnt;
|
|
|
|
|
//
|
|
|
|
|
// de_ctx->mpm_tot_patcnt += sgr->sh->mpm_proto_other_ctx->pattern_cnt;
|
|
|
|
|
//}
|
|
|
|
|
//if (sgr->sh->mpm_uri_ctx != NULL) {
|
|
|
|
|
// if (de_ctx->mpm_uri_max_patcnt < sgr->sh->mpm_uri_ctx->pattern_cnt)
|
|
|
|
|
// de_ctx->mpm_uri_max_patcnt = sgr->sh->mpm_uri_ctx->pattern_cnt;
|
|
|
|
|
//
|
|
|
|
|
// de_ctx->mpm_uri_tot_patcnt += sgr->sh->mpm_uri_ctx->pattern_cnt;
|
|
|
|
|
//}
|
|
|
|
|
///* dbg */
|
|
|
|
|
//if (!(sgr->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && sgr->sh->mpm_proto_tcp_ctx) {
|
|
|
|
|
// de_ctx->mpm_memory_size += sgr->sh->mpm_proto_tcp_ctx->memory_size;
|
|
|
|
|
//}
|
|
|
|
|
//if (!(sgr->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && sgr->sh->mpm_proto_udp_ctx) {
|
|
|
|
|
// de_ctx->mpm_memory_size += sgr->sh->mpm_proto_udp_ctx->memory_size;
|
|
|
|
|
//}
|
|
|
|
|
//if (!(sgr->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && sgr->sh->mpm_proto_other_ctx) {
|
|
|
|
|
// de_ctx->mpm_memory_size += sgr->sh->mpm_proto_other_ctx->memory_size;
|
|
|
|
|
//}
|
|
|
|
|
//if (!(sgr->sh->flags & SIG_GROUP_HEAD_MPM_URI_COPY) && sgr->sh->mpm_uri_ctx) {
|
|
|
|
|
// de_ctx->mpm_memory_size += sgr->sh->mpm_uri_ctx->memory_size;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
SigGroupHeadHashAdd(de_ctx, sgr->sh);
|
|
|
|
|
SigGroupHeadStore(de_ctx, sgr->sh);
|
|
|
|
@ -3452,43 +3452,43 @@ int BuildDestinationAddressHeadsWithBothPorts(DetectEngineCtx *de_ctx, DetectAdd
|
|
|
|
|
printf("PatternMatchPrepareGroup failed\n");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
if (dp->sh->mpm_proto_tcp_ctx != NULL) {
|
|
|
|
|
if (de_ctx->mpm_max_patcnt < dp->sh->mpm_proto_tcp_ctx->pattern_cnt)
|
|
|
|
|
de_ctx->mpm_max_patcnt = dp->sh->mpm_proto_tcp_ctx->pattern_cnt;
|
|
|
|
|
|
|
|
|
|
de_ctx->mpm_tot_patcnt += dp->sh->mpm_proto_tcp_ctx->pattern_cnt;
|
|
|
|
|
}
|
|
|
|
|
if (dp->sh->mpm_proto_udp_ctx != NULL) {
|
|
|
|
|
if (de_ctx->mpm_max_patcnt < dp->sh->mpm_proto_udp_ctx->pattern_cnt)
|
|
|
|
|
de_ctx->mpm_max_patcnt = dp->sh->mpm_proto_udp_ctx->pattern_cnt;
|
|
|
|
|
|
|
|
|
|
de_ctx->mpm_tot_patcnt += dp->sh->mpm_proto_udp_ctx->pattern_cnt;
|
|
|
|
|
}
|
|
|
|
|
if (dp->sh->mpm_proto_other_ctx != NULL) {
|
|
|
|
|
if (de_ctx->mpm_max_patcnt < dp->sh->mpm_proto_other_ctx->pattern_cnt)
|
|
|
|
|
de_ctx->mpm_max_patcnt = dp->sh->mpm_proto_other_ctx->pattern_cnt;
|
|
|
|
|
|
|
|
|
|
de_ctx->mpm_tot_patcnt += dp->sh->mpm_proto_other_ctx->pattern_cnt;
|
|
|
|
|
}
|
|
|
|
|
if (dp->sh->mpm_uri_ctx != NULL) {
|
|
|
|
|
if (de_ctx->mpm_uri_max_patcnt < dp->sh->mpm_uri_ctx->pattern_cnt)
|
|
|
|
|
de_ctx->mpm_uri_max_patcnt = dp->sh->mpm_uri_ctx->pattern_cnt;
|
|
|
|
|
|
|
|
|
|
de_ctx->mpm_uri_tot_patcnt += dp->sh->mpm_uri_ctx->pattern_cnt;
|
|
|
|
|
}
|
|
|
|
|
/* dbg */
|
|
|
|
|
if (!(dp->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && dp->sh->mpm_proto_tcp_ctx) {
|
|
|
|
|
de_ctx->mpm_memory_size += dp->sh->mpm_proto_tcp_ctx->memory_size;
|
|
|
|
|
}
|
|
|
|
|
if (!(dp->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && dp->sh->mpm_proto_udp_ctx) {
|
|
|
|
|
de_ctx->mpm_memory_size += dp->sh->mpm_proto_udp_ctx->memory_size;
|
|
|
|
|
}
|
|
|
|
|
if (!(dp->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && dp->sh->mpm_proto_other_ctx) {
|
|
|
|
|
de_ctx->mpm_memory_size += dp->sh->mpm_proto_other_ctx->memory_size;
|
|
|
|
|
}
|
|
|
|
|
if (!(dp->sh->flags & SIG_GROUP_HEAD_MPM_URI_COPY) && dp->sh->mpm_uri_ctx) {
|
|
|
|
|
de_ctx->mpm_memory_size += dp->sh->mpm_uri_ctx->memory_size;
|
|
|
|
|
}
|
|
|
|
|
//if (dp->sh->mpm_proto_tcp_ctx != NULL) {
|
|
|
|
|
// if (de_ctx->mpm_max_patcnt < dp->sh->mpm_proto_tcp_ctx->pattern_cnt)
|
|
|
|
|
// de_ctx->mpm_max_patcnt = dp->sh->mpm_proto_tcp_ctx->pattern_cnt;
|
|
|
|
|
//
|
|
|
|
|
// de_ctx->mpm_tot_patcnt += dp->sh->mpm_proto_tcp_ctx->pattern_cnt;
|
|
|
|
|
//}
|
|
|
|
|
//if (dp->sh->mpm_proto_udp_ctx != NULL) {
|
|
|
|
|
// if (de_ctx->mpm_max_patcnt < dp->sh->mpm_proto_udp_ctx->pattern_cnt)
|
|
|
|
|
// de_ctx->mpm_max_patcnt = dp->sh->mpm_proto_udp_ctx->pattern_cnt;
|
|
|
|
|
//
|
|
|
|
|
// de_ctx->mpm_tot_patcnt += dp->sh->mpm_proto_udp_ctx->pattern_cnt;
|
|
|
|
|
//}
|
|
|
|
|
//if (dp->sh->mpm_proto_other_ctx != NULL) {
|
|
|
|
|
// if (de_ctx->mpm_max_patcnt < dp->sh->mpm_proto_other_ctx->pattern_cnt)
|
|
|
|
|
// de_ctx->mpm_max_patcnt = dp->sh->mpm_proto_other_ctx->pattern_cnt;
|
|
|
|
|
//
|
|
|
|
|
// de_ctx->mpm_tot_patcnt += dp->sh->mpm_proto_other_ctx->pattern_cnt;
|
|
|
|
|
//}
|
|
|
|
|
//if (dp->sh->mpm_uri_ctx != NULL) {
|
|
|
|
|
// if (de_ctx->mpm_uri_max_patcnt < dp->sh->mpm_uri_ctx->pattern_cnt)
|
|
|
|
|
// de_ctx->mpm_uri_max_patcnt = dp->sh->mpm_uri_ctx->pattern_cnt;
|
|
|
|
|
//
|
|
|
|
|
// de_ctx->mpm_uri_tot_patcnt += dp->sh->mpm_uri_ctx->pattern_cnt;
|
|
|
|
|
//}
|
|
|
|
|
///* dbg */
|
|
|
|
|
//if (!(dp->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && dp->sh->mpm_proto_tcp_ctx) {
|
|
|
|
|
// de_ctx->mpm_memory_size += dp->sh->mpm_proto_tcp_ctx->memory_size;
|
|
|
|
|
//}
|
|
|
|
|
//if (!(dp->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && dp->sh->mpm_proto_udp_ctx) {
|
|
|
|
|
// de_ctx->mpm_memory_size += dp->sh->mpm_proto_udp_ctx->memory_size;
|
|
|
|
|
//}
|
|
|
|
|
//if (!(dp->sh->flags & SIG_GROUP_HEAD_MPM_COPY) && dp->sh->mpm_proto_other_ctx) {
|
|
|
|
|
// de_ctx->mpm_memory_size += dp->sh->mpm_proto_other_ctx->memory_size;
|
|
|
|
|
//}
|
|
|
|
|
//if (!(dp->sh->flags & SIG_GROUP_HEAD_MPM_URI_COPY) && dp->sh->mpm_uri_ctx) {
|
|
|
|
|
// de_ctx->mpm_memory_size += dp->sh->mpm_uri_ctx->memory_size;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
SigGroupHeadDPortHashAdd(de_ctx, dp->sh);
|
|
|
|
|
SigGroupHeadStore(de_ctx, dp->sh);
|
|
|
|
@ -3883,13 +3883,13 @@ int SigAddressPrepareStage5(DetectEngineCtx *de_ctx) {
|
|
|
|
|
for ( ; dp != NULL; dp = dp->next) {
|
|
|
|
|
printf(" 4 Dst port(range): "); DetectPortPrint(dp);
|
|
|
|
|
printf(" (sigs %" PRIu32 ", sgh %p, maxlen %" PRIu32 ")", dp->sh->sig_cnt, dp->sh, dp->sh->mpm_content_maxlen);
|
|
|
|
|
printf(" mpm_proto_tcp_ctx %p, mpm_prooto_udp_ctx "
|
|
|
|
|
"%p, mpm_proto_other_ctx %p mpm_stream_ctx "
|
|
|
|
|
"%p",
|
|
|
|
|
dp->sh->mpm_proto_tcp_ctx,
|
|
|
|
|
dp->sh->mpm_proto_udp_ctx,
|
|
|
|
|
dp->sh->mpm_proto_other_ctx,
|
|
|
|
|
dp->sh->mpm_stream_ctx);
|
|
|
|
|
//printf(" mpm_proto_tcp_ctx %p, mpm_prooto_udp_ctx "
|
|
|
|
|
// "%p, mpm_proto_other_ctx %p mpm_stream_ctx "
|
|
|
|
|
// "%p",
|
|
|
|
|
// dp->sh->mpm_proto_tcp_ctx,
|
|
|
|
|
// dp->sh->mpm_proto_udp_ctx,
|
|
|
|
|
// dp->sh->mpm_proto_other_ctx,
|
|
|
|
|
// dp->sh->mpm_stream_ctx);
|
|
|
|
|
#ifdef PRINTSIGS
|
|
|
|
|
printf(" - ");
|
|
|
|
|
for (u = 0; u < dp->sh->sig_cnt; u++) {
|
|
|
|
@ -4206,67 +4206,107 @@ int SigGroupBuild (DetectEngineCtx *de_ctx) {
|
|
|
|
|
|
|
|
|
|
if (de_ctx->sgh_mpm_context == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE) {
|
|
|
|
|
MpmCtx *mpm_ctx = NULL;
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_proto_tcp_packet);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_proto_tcp_packet, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_proto_tcp_packet, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("packet- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_proto_udp_packet);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_proto_udp_packet, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_proto_udp_packet, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("packet- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_proto_other_packet);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_proto_other_packet, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("packet- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_uri);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_uri, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_uri, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("uri- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hcbd);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hcbd, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hcbd, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("hcbd- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hhd);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hhd, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hhd, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("hhd- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hrhd);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hrhd, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hrhd, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("hrhd- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hmd);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hmd, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hmd, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("hmd- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hcd);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hcd, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hcd, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("hcd- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hrud);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hrud, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_hrud, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
//printf("hrud- %d\n", mpm_ctx->pattern_cnt);
|
|
|
|
|
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_stream);
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_stream, 0);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
|
mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_stream, 1);
|
|
|
|
|
if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) {
|
|
|
|
|
mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx);
|
|
|
|
|
}
|
|
|
|
@ -9354,21 +9394,22 @@ static int SigTestSgh05 (void) {
|
|
|
|
|
goto end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sgh->mpm_proto_tcp_ctx != NULL ||
|
|
|
|
|
sgh->mpm_proto_udp_ctx != NULL || sgh->mpm_proto_other_ctx != NULL) {
|
|
|
|
|
printf("sgh->mpm_proto_tcp_ctx != NULL || "
|
|
|
|
|
"sgh->mpm_proto_udp_ctx != NULL || "
|
|
|
|
|
if (sgh->mpm_proto_tcp_ctx_ts != NULL || sgh->mpm_proto_tcp_ctx_tc != NULL ||
|
|
|
|
|
sgh->mpm_proto_udp_ctx_ts != NULL || sgh->mpm_proto_udp_ctx_tc != NULL ||
|
|
|
|
|
sgh->mpm_proto_other_ctx != NULL) {
|
|
|
|
|
printf("sgh->mpm_proto_tcp_ctx_ts != NULL || sgh->mpm_proto_tcp_ctx_tc != NULL"
|
|
|
|
|
"sgh->mpm_proto_udp_ctx_ts != NULL || sgh->mpm_proto_udp_ctx_tc != NULL"
|
|
|
|
|
"sgh->mpm_proto_other_ctx != NULL: ");
|
|
|
|
|
goto end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sgh->mpm_stream_ctx == NULL) {
|
|
|
|
|
printf("sgh->mpm_stream_ctx == NULL: ");
|
|
|
|
|
if (sgh->mpm_stream_ctx_ts == NULL || sgh->mpm_stream_ctx_tc == NULL) {
|
|
|
|
|
printf("sgh->mpm_stream_ctx == NULL || sgh->mpm_stream_ctx_tc == NULL: ");
|
|
|
|
|
goto end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sgh->mpm_stream_ctx->mpm_type != MPM_WUMANBER) {
|
|
|
|
|
printf("sgh->mpm_type != MPM_WUMANBER, expected %d, got %d: ", MPM_WUMANBER, sgh->mpm_stream_ctx->mpm_type);
|
|
|
|
|
if (sgh->mpm_stream_ctx_ts->mpm_type != MPM_WUMANBER) {
|
|
|
|
|
printf("sgh->mpm_type != MPM_WUMANBER, expected %d, got %d: ", MPM_WUMANBER, sgh->mpm_stream_ctx_ts->mpm_type);
|
|
|
|
|
goto end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|