return rs_dns_opcode_match(txv, (void *)ctx, flags);
}
-static int DetectEngineInspectRequestGenericDnsOpcode(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)
+static int DetectEngineInspectRequestGenericDnsOpcode(DetectEngineCtx *de_ctx,
+ DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
+ const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
{
- return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
- f, flags, alstate, txv, tx_id);
+ return DetectEngineInspectGenericList(
+ NULL, de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
}
void DetectDnsOpcodeRegister(void)
sigmatch_table[DETECT_AL_DNS_OPCODE].AppLayerTxMatch =
DetectDnsOpcodeMatch;
- DetectAppLayerInspectEngineRegister("dns.opcode",
- ALPROTO_DNS, SIG_FLAG_TOSERVER, 0,
- DetectEngineInspectRequestGenericDnsOpcode);
+ DetectAppLayerInspectEngineRegister2("dns.opcode", ALPROTO_DNS, SIG_FLAG_TOSERVER, 0,
+ DetectEngineInspectRequestGenericDnsOpcode, NULL);
- DetectAppLayerInspectEngineRegister("dns.opcode",
- ALPROTO_DNS, SIG_FLAG_TOCLIENT, 0,
- DetectEngineInspectRequestGenericDnsOpcode);
+ DetectAppLayerInspectEngineRegister2("dns.opcode", ALPROTO_DNS, SIG_FLAG_TOCLIENT, 0,
+ DetectEngineInspectRequestGenericDnsOpcode, NULL);
dns_opcode_list_id = DetectBufferTypeGetByName("dns.opcode");
}
g_dns_query_buffer_id = DetectBufferTypeGetByName("dns_query");
/* register these generic engines from here for now */
- DetectAppLayerInspectEngineRegister("dns_request",
- ALPROTO_DNS, SIG_FLAG_TOSERVER, 1,
- DetectEngineInspectDnsRequest);
- DetectAppLayerInspectEngineRegister("dns_response",
- ALPROTO_DNS, SIG_FLAG_TOCLIENT, 1,
- DetectEngineInspectDnsResponse);
+ DetectAppLayerInspectEngineRegister2(
+ "dns_request", ALPROTO_DNS, SIG_FLAG_TOSERVER, 1, DetectEngineInspectDnsRequest, NULL);
+ DetectAppLayerInspectEngineRegister2("dns_response", ALPROTO_DNS, SIG_FLAG_TOCLIENT, 1,
+ DetectEngineInspectDnsResponse, NULL);
DetectBufferTypeSetDescriptionByName("dns_request",
"dns requests");
#include "util-unittest-helper.h"
#include "util-validate.h"
-int DetectEngineInspectDnsRequest(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)
+int DetectEngineInspectDnsRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+ const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
+ uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
{
- return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
- f, flags, alstate, txv, tx_id);
+ return DetectEngineInspectGenericList(
+ NULL, de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
}
-int DetectEngineInspectDnsResponse(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)
+int DetectEngineInspectDnsResponse(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+ const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
+ uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
{
- return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
- f, flags, alstate, txv, tx_id);
+ return DetectEngineInspectGenericList(
+ NULL, de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
}
#ifndef __DETECT_ENGINE_DNS_H__
#define __DETECT_ENGINE_DNS_H__
-int DetectEngineInspectDnsRequest(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);
-int DetectEngineInspectDnsResponse(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);
+int DetectEngineInspectDnsRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+ const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
+ uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
+int DetectEngineInspectDnsResponse(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+ const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
+ uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
#endif /* __DETECT_ENGINE_DNS_H__ */