36static int detect_buffer_id = 0;
37static int mdns_detect_buffer_id = 0;
87 int list_id,
bool get_rdata)
98 const uint8_t *data = NULL;
99 uint32_t data_len = 0;
105 if (!SCDnsTxGetAnswerRdata(txv, cbdata->
response_id, &data, &data_len)) {
111 if (!SCDnsTxGetAuthorityRdata(txv, cbdata->
response_id, &data, &data_len)) {
117 if (!SCDnsTxGetAdditionalRdata(txv, cbdata->
response_id, &data, &data_len)) {
130 if (!SCDnsTxGetQueryName(
131 det_ctx, txv, STREAM_TOCLIENT, cbdata->
response_id, &data, &data_len)) {
137 if (!SCDnsTxGetAnswerName(
138 det_ctx, txv, STREAM_TOCLIENT, cbdata->
response_id, &data, &data_len)) {
144 if (!SCDnsTxGetAuthorityName(
145 det_ctx, txv, 0, cbdata->
response_id, &data, &data_len)) {
151 if (!SCDnsTxGetAdditionalName(
152 det_ctx, txv, 0, cbdata->
response_id, &data, &data_len)) {
173 uint32_t response_id = 0;
181 GetBuffer(det_ctx,
flags, transforms, txv, &cbdata, engine->
sm_list,
false);
182 if (buffer == NULL || buffer->
inspect == NULL) {
201 buffer = GetBuffer(det_ctx,
flags, transforms, txv, &cbdata, engine->
sm_list,
true);
202 if (buffer == NULL || buffer->
inspect == NULL) {
223 const int list_id =
ctx->list_id;
231 GetBuffer(det_ctx,
flags,
ctx->transforms, txv, &cbdata, list_id,
false);
232 if (buffer == NULL) {
252 buffer = GetBuffer(det_ctx,
flags,
ctx->transforms, txv, &cbdata, list_id,
true);
253 if (buffer == NULL) {
271 uint8_t
flags,
void *alstate,
void *txv, uint64_t tx_id)
287 ret_match = CheckSectionRecords(
304 CheckSectionRecordsPrefilter(det_ctx, pectx, txv,
flags, &
local_id, section);
308static void DetectDnsResponsePrefilterMpmFree(
void *ptr)
326 DetectDnsResponsePrefilterMpmFree, mpm_reg->
pname);
329static void SCDetectMdnsResponseRrnameRegister(
void)
331 static const char *keyword =
"mdns.response.rrname";
335 sigmatch_table[keyword_id].
url =
"/rules/mdns-keywords.html#mdns-response-rrname";
354 static const char *keyword =
"dns.response.rrname";
373 SCDetectMdnsResponseRrnameRegister();
struct AppLayerTxData AppLayerTxData
void DetectDnsResponseRegister(void)
@ DNS_RESPONSE_ADDITIONAL
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
bool DetectEngineContentInspectionBuffer(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Packet *p, Flow *f, const InspectionBuffer *b, const enum DetectContentInspectionType inspection_mode)
wrapper around DetectEngineContentInspectionInternal to return true/false only
@ DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE
#define DETECT_CI_FLAGS_SINGLE
int SCDetectHelperNewKeywordId(void)
void InspectionBufferSetupMultiEmpty(InspectionBuffer *buffer)
setup the buffer empty
InspectionBuffer * InspectionBufferMultipleForListGet(DetectEngineThreadCtx *det_ctx, const int list_id, const uint32_t local_id)
for a InspectionBufferMultipleForList get a InspectionBuffer
void InspectionBufferSetupMulti(DetectEngineThreadCtx *det_ctx, InspectionBuffer *buffer, const DetectEngineTransforms *transforms, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
void DetectAppLayerMpmRegister(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register an app layer keyword for mpm
int PrefilterAppendTxEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterTxFn PrefilterTxFunc, AppProto alproto, int tx_min_progress, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
#define DETECT_ENGINE_INSPECT_SIG_MATCH
#define DETECT_ENGINE_INSPECT_SIG_NO_MATCH
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
void DetectBufferTypeSupportsMultiInstance(const char *name)
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
int DetectBufferTypeGetByName(const char *name)
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
SigTableElmt * sigmatch_table
#define SIG_FLAG_TOCLIENT
#define SIGMATCH_INFO_STICKY_BUFFER
#define SIG_FLAG_TOSERVER
one time registration of keywords at start up
DetectEngineTransforms transforms
struct DetectBufferMpmRegistry_::@98::@100 app_v2
const DetectEngineTransforms * transforms
struct DetectEngineAppInspectionEngine_::@90 v2
main detection engine ctx
enum DnsResponseSection response_section
uint32_t(* Search)(const struct MpmCtx_ *, struct MpmThreadCtx_ *, PrefilterRuleStore *, const uint8_t *, uint32_t)
const DetectEngineTransforms * transforms
Container for matching data for a signature group.
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
#define PREFILTER_PROFILING_ADD_BYTES(det_ctx, bytes)