detect: use detect list passed to generic funcs

Until now the GenericList users used hardcoded list id's.
pull/2559/head
Victor Julien 9 years ago
parent bd456076a8
commit f281481b67

@ -166,8 +166,8 @@ static int DetectEngineInspectDNP3(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd,
Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
{
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags,
alstate, txv, tx_id, DETECT_SM_LIST_DNP3_MATCH);
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
f, flags, alstate, txv, tx_id);
}
/**

@ -140,20 +140,18 @@ int PrefilterTxDnsQueryRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectDnsRequest(ThreadVars *tv,
DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
const Signature *s, const SigMatch *sm,
const Signature *s, const SigMatchData *smd,
Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
{
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags,
alstate, txv, tx_id,
DETECT_SM_LIST_DNSREQUEST_MATCH);
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
f, flags, alstate, txv, tx_id);
}
int DetectEngineInspectDnsResponse(ThreadVars *tv,
DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
const Signature *s, const SigMatch *sm,
const Signature *s, const SigMatchData *smd,
Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
{
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags,
alstate, txv, tx_id,
DETECT_SM_LIST_DNSRESPONSE_MATCH);
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
f, flags, alstate, txv, tx_id);
}

@ -277,7 +277,6 @@ int DetectEngineInspectTlsValidity(ThreadVars *tv,
Flow *f, uint8_t flags, void *alstate,
void *txv, uint64_t tx_id)
{
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags,
alstate, txv, tx_id,
DETECT_SM_LIST_TLSVALIDITY_MATCH);
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
f, flags, alstate, txv, tx_id);
}

@ -192,13 +192,13 @@ int DetectEngineAppInspectionEngine2Signature(Signature *s)
case DETECT_SM_LIST_FILEMATCH:
case DETECT_SM_LIST_DNSQUERYNAME_MATCH:
//case DETECT_SM_LIST_DNSRESPONSE_MATCH:
//case DETECT_SM_LIST_DNSRESPONSE_MATCH:
case DETECT_SM_LIST_DNSREQUEST_MATCH:
case DETECT_SM_LIST_DNSRESPONSE_MATCH:
case DETECT_SM_LIST_TLSSNI_MATCH:
case DETECT_SM_LIST_TLSISSUER_MATCH:
case DETECT_SM_LIST_TLSSUBJECT_MATCH:
//case DETECT_SM_LIST_TLSVALIDITY_MATCH:
case DETECT_SM_LIST_TLSVALIDITY_MATCH:
case DETECT_SM_LIST_APP_EVENT:
@ -352,13 +352,10 @@ int DetectEngineReloadIsDone(void)
int DetectEngineInspectGenericList(ThreadVars *tv,
const DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
const Signature *s, Flow *f, const uint8_t flags,
void *alstate, void *txv, uint64_t tx_id, const int list)
const Signature *s, const SigMatchData *smd,
Flow *f, const uint8_t flags,
void *alstate, void *txv, uint64_t tx_id)
{
#ifdef PROFILING
KEYWORD_PROFILING_SET_LIST(det_ctx, list);
#endif
SigMatchData *smd = s->sm_arrays[list];
SCLogDebug("running match functions, sm %p", smd);
if (smd != NULL) {
while (1) {

@ -70,9 +70,10 @@ int DetectEngineTentantRegisterPcapFile(uint32_t tenant_id);
int DetectEngineTentantUnregisterPcapFile(uint32_t tenant_id);
int DetectEngineInspectGenericList(ThreadVars *, const DetectEngineCtx *,
DetectEngineThreadCtx *, const Signature *,
DetectEngineThreadCtx *,
const Signature *, const SigMatchData *,
Flow *, const uint8_t, void *, void *,
uint64_t, const int);
uint64_t);
/**
* \brief Registers an app inspection engine.

Loading…
Cancel
Save