Go to the documentation of this file.
64 const char *
name,
void (*FreeFunc)(
void *));
68 static inline void QuickSortSigIntId(
SigIntId *sids, uint32_t n)
88 QuickSortSigIntId(sids, (uint32_t)(r - sids) + 1);
89 QuickSortSigIntId(l, (uint32_t)(sids + n - l));
98 const uint8_t ipproto,
99 const uint8_t flow_flags,
114 if (tx_ptr == NULL) {
136 SCLogDebug(
"tx already marked progress as beyond engine: %u > %u",
140 SCLogDebug(
"tx->tx_progress %u > engine->ctx.tx_min_progress %d: "
141 "tx->detect_progress %u",
152 SCLogDebug(
"engine %p min_progress %d %s:%s: results %u", engine,
164 SCLogDebug(
"tx->tx_progress %d engine->ctx.tx_min_progress %d "
165 "engine->is_last_for_progress %d => tx->detect_progress updated to %02x",
242 if (((engine->
ctx.
pkt.mask & mask) == engine->
ctx.
pkt.mask) &&
289 if (sgh == NULL || PrefilterFunc == NULL || pectx == NULL)
295 memset(e, 0x00,
sizeof(*e));
310 while (t->
next != NULL) {
324 PrefilterPktFn PrefilterFunc,
void *pectx,
void (*FreeFunc)(
void *pectx),
const char *
name)
326 if (sgh == NULL || PrefilterFunc == NULL || pectx == NULL)
332 memset(e, 0x00,
sizeof(*e));
342 while (t->
next != NULL) {
357 void (*FreeFunc)(
void *pectx),
const char *
name)
359 if (sgh == NULL || PrefilterTxFunc == NULL || pectx == NULL)
365 memset(e, 0x00,
sizeof(*e));
379 while (t->
next != NULL) {
394 void (*FreeFunc)(
void *pectx),
const char *
name)
396 if (sgh == NULL || PrefilterFrameFunc == NULL || pectx == NULL)
402 memset(e, 0x00,
sizeof(*e));
414 while (t->
next != NULL) {
428 void (*PrefilterPostRuleFunc)(
430 void *pectx,
void (*FreeFunc)(
void *pectx),
const char *
name)
432 if (sgh == NULL || PrefilterPostRuleFunc == NULL || pectx == NULL)
438 memset(e, 0x00,
sizeof(*e));
447 while (t->
next != NULL) {
474 PrefilterFreeEngineList(t);
520 static int PrefilterSetupRuleGroupSortHelper(
const void *a,
const void *b)
568 static void PrefilterNonPFDataFree(
void *data)
578 PrefilterAddSids(&det_ctx->
pmq, data->
array, data->
size);
581 #ifdef NONPF_PKT_STATS
582 static thread_local uint64_t prefilter_pkt_nonpf_called = 0;
583 static thread_local uint64_t prefilter_pkt_nonpf_mask_fail = 0;
584 static thread_local uint64_t prefilter_pkt_nonpf_alproto_fail = 0;
585 static thread_local uint64_t prefilter_pkt_nonpf_dsize_fail = 0;
586 static thread_local uint64_t prefilter_pkt_nonpf_dport_fail = 0;
587 static thread_local uint64_t prefilter_pkt_nonpf_sids = 0;
588 #define NONPF_PKT_STATS_INCR(s) (s)++
590 #define NONPF_PKT_STATS_INCR(s)
595 #ifdef NONPF_PKT_STATS
596 SCLogDebug(
"prefilter non-pf: called:%" PRIu64
", mask_fail:%" PRIu64
", alproto fail:%" PRIu64
597 ", dport fail:%" PRIu64
", dsize fail:%" PRIu64
", sids:%" PRIu64
598 ", avg sids:%" PRIu64,
599 prefilter_pkt_nonpf_called, prefilter_pkt_nonpf_mask_fail,
600 prefilter_pkt_nonpf_alproto_fail, prefilter_pkt_nonpf_dport_fail,
601 prefilter_pkt_nonpf_dsize_fail, prefilter_pkt_nonpf_sids,
602 prefilter_pkt_nonpf_called ? prefilter_pkt_nonpf_sids / prefilter_pkt_nonpf_called : 0);
613 for (uint32_t i = 0; i < data->
size; i++) {
616 if ((rule_mask & mask) == rule_mask) {
620 const uint32_t
sid = ds->
sid;
621 PrefilterAddSids(&det_ctx->
pmq, &
sid, 1);
629 const uint32_t
sid = ds->
sid;
630 PrefilterAddSids(&det_ctx->
pmq, &
sid, 1);
638 const uint32_t
sid = ds->
sid;
639 PrefilterAddSids(&det_ctx->
pmq, &
sid, 1);
652 static void PrefilterPktNonPFHookFlowStart(
656 PrefilterPktNonPF(det_ctx, p, pectx);
671 for (uint32_t i = 0; i < data->
size; i++) {
675 const uint32_t
sid = ds->
sid;
676 PrefilterAddSids(&det_ctx->
pmq, &
sid, 1);
683 static uint32_t NonPFNamesHash(
HashTable *h,
void *data, uint16_t _len)
685 const char *
str = data;
689 static char NonPFNamesCompare(
void *data1, uint16_t _len1,
void *data2, uint16_t len2)
691 const char *s1 = data1;
692 const char *s2 = data2;
696 static void NonPFNamesFree(
void *data)
714 static uint32_t TxNonPFHash(
HashListTable *h,
void *data, uint16_t _len)
720 static char TxNonPFCompare(
void *data1, uint16_t _len1,
void *data2, uint16_t len2)
728 static void TxNonPFFree(
void *data)
754 for (uint32_t y = 0; y < e->
sigs_cnt; y++) {
778 if (add->
sigs == NULL) {
789 dir == 0 ?
"toserver" :
"toclient");
791 if (engine_name_heap == NULL) {
805 SCLogDebug(
"engine_name_heap %s", engine_name_heap);
829 if (pkt_non_pf_array == NULL) {
832 uint32_t pkt_non_pf_array_size = 0;
834 SCCalloc(max_sids,
sizeof(*frame_non_pf_array));
835 if (frame_non_pf_array == NULL) {
839 uint32_t frame_non_pf_array_size = 0;
842 SCCalloc(max_sids,
sizeof(*pkt_hook_flow_start_non_pf_array));
843 if (pkt_hook_flow_start_non_pf_array == NULL) {
845 SCFree(frame_non_pf_array);
848 uint32_t pkt_hook_flow_start_non_pf_array_size = 0;
850 bool pkt_hook_flow_start_mask_init =
false;
854 if (tx_engines_hash == NULL) {
856 SCFree(pkt_hook_flow_start_non_pf_array);
857 SCFree(frame_non_pf_array);
863 HashTableInit(512, NonPFNamesHash, NonPFNamesCompare, NonPFNamesFree);
866 SCFree(pkt_hook_flow_start_non_pf_array);
867 SCFree(frame_non_pf_array);
874 bool pkt_mask_init =
false;
875 #ifdef NONPF_PKT_STATS
876 uint32_t nonpf_pkt_alproto = 0;
877 uint32_t nonpf_pkt_dsize = 0;
878 uint32_t nonpf_pkt_dport = 0;
881 SCLogDebug(
"app_events_list_id %d", app_events_list_id);
883 SCLogDebug(
"app_state_list_id %d", app_state_list_id);
884 for (uint32_t sig = 0; sig < sgh->
init->
sig_cnt; sig++) {
895 SCLogDebug(
"setting up sid %u for non-prefilter", s->
id);
897 uint8_t frame_type = 0;
898 bool tx_non_pf =
false;
899 bool frame_non_pf =
false;
900 bool pkt_non_pf =
false;
921 pkt_hook_flow_start_non_pf_array[pkt_hook_flow_start_non_pf_array_size].
sid = s->
iid;
922 pkt_hook_flow_start_non_pf_array[pkt_hook_flow_start_non_pf_array_size].
value =
value;
923 pkt_hook_flow_start_non_pf_array[pkt_hook_flow_start_non_pf_array_size].
type =
type;
924 pkt_hook_flow_start_non_pf_array[pkt_hook_flow_start_non_pf_array_size].
pkt.sig_mask =
926 pkt_hook_flow_start_non_pf_array_size++;
928 if (pkt_hook_flow_start_mask_init) {
929 pkt_hook_flow_start_mask &= s->
mask;
931 pkt_hook_flow_start_mask = s->
mask;
932 pkt_hook_flow_start_mask_init =
true;
946 SCLogDebug(
"list_id %d buf %p", list_id, buf);
947 if (list_id == app_events_list_id)
953 }
else if (buf->
frame) {
955 f != NULL; f = f->
next) {
958 list_id == (
int)f->sm_list &&
963 frame_type = f->
type;
966 frame_non_pf_array[frame_non_pf_array_size].
sid = s->
iid;
967 frame_non_pf_array[frame_non_pf_array_size].
value = s->
alproto;
968 frame_non_pf_array[frame_non_pf_array_size].
frame.type = frame_type;
969 frame_non_pf_array_size++;
987 list_id == (
int)
app->sm_list &&
993 if (list_id == app_state_list_id)
994 sig_list = app_state_list_id;
995 if (TxNonPFAddSig(
de_ctx, tx_engines_hash,
app->alproto,
app->dir,
996 app->progress, sig_list, buf->
name, s) != 0) {
1008 dir == 0 ? STREAM_TOSERVER : STREAM_TOCLIENT);
1022 if (!(tx_non_pf || frame_non_pf)) {
1029 SCLogDebug(
"setting up sid %u for non-prefilter: %s", s->
id,
1030 tx_non_pf ?
"tx engine" : (frame_non_pf ?
"frame engine" :
"pkt engine"));
1041 #ifdef NONPF_PKT_STATS
1047 #ifdef NONPF_PKT_STATS
1053 #ifdef NONPF_PKT_STATS
1054 nonpf_pkt_alproto++;
1058 pkt_non_pf_array[pkt_non_pf_array_size].
sid = s->
iid;
1059 pkt_non_pf_array[pkt_non_pf_array_size].
value =
value;
1060 pkt_non_pf_array[pkt_non_pf_array_size].
type =
type;
1061 pkt_non_pf_array[pkt_non_pf_array_size].
pkt.sig_mask = s->
mask;
1062 pkt_non_pf_array_size++;
1064 if (pkt_mask_init) {
1065 pkt_mask &= s->
mask;
1068 pkt_mask_init =
true;
1077 SCLogDebug(
"%s engine for %s hook %d has %u non-pf sigs",
1089 if (t->
sig_list == app_state_list_id) {
1091 engine_progress = -1;
1099 for (uint32_t i = 0; i < t->
sigs_cnt; i++) {
1103 (
void *)data, PrefilterNonPFDataFree, t->
engine_name) < 0) {
1109 tx_engines_hash = NULL;
1111 if (pkt_non_pf_array_size) {
1113 SCCalloc(1,
sizeof(*data) + pkt_non_pf_array_size *
sizeof(data->
array[0]));
1116 data->
size = pkt_non_pf_array_size;
1117 memcpy((uint8_t *)&data->
array, pkt_non_pf_array,
1118 pkt_non_pf_array_size *
sizeof(data->
array[0]));
1121 PrefilterNonPFDataFree,
"packet:non_pf") < 0) {
1126 if (pkt_hook_flow_start_non_pf_array_size) {
1128 1,
sizeof(*data) + pkt_hook_flow_start_non_pf_array_size *
sizeof(data->
array[0]));
1131 data->
size = pkt_hook_flow_start_non_pf_array_size;
1132 memcpy((uint8_t *)&data->
array, pkt_hook_flow_start_non_pf_array,
1133 pkt_hook_flow_start_non_pf_array_size *
sizeof(data->
array[0]));
1134 SCLogDebug(
"packet:flow_start:non_pf added with %u rules", data->
size);
1137 PrefilterPktNonPFHookFlowStart,
1139 pkt_hook_flow_start_mask, hook, (
void *)data, PrefilterNonPFDataFree,
1140 "packet:flow_start:non_pf") < 0) {
1145 if (frame_non_pf_array_size) {
1146 SCLogDebug(
"%u frame non-pf sigs", frame_non_pf_array_size);
1148 SCCalloc(1,
sizeof(*data) + frame_non_pf_array_size *
sizeof(data->
array[0]));
1151 data->
size = frame_non_pf_array_size;
1152 memcpy((uint8_t *)&data->
array, frame_non_pf_array,
1153 frame_non_pf_array_size *
sizeof(data->
array[0]));
1155 FRAME_ANY_TYPE, (
void *)data, PrefilterNonPFDataFree,
"frame:non_pf") < 0) {
1161 SCFree(pkt_hook_flow_start_non_pf_array);
1162 pkt_hook_flow_start_non_pf_array = NULL;
1163 SCFree(pkt_non_pf_array);
1164 pkt_non_pf_array = NULL;
1165 SCFree(frame_non_pf_array);
1166 frame_non_pf_array = NULL;
1170 if (tx_engines_hash) {
1173 SCFree(pkt_hook_flow_start_non_pf_array);
1174 SCFree(pkt_non_pf_array);
1175 SCFree(frame_non_pf_array);
1183 FatalError(
"failed to set up pattern matching");
1197 if (SetupNonPrefilter(
de_ctx, sgh) != 0) {
1227 if (el->
next == NULL) {
1256 if (el->
next == NULL) {
1273 uint16_t local_id = 0;
1288 PrefilterSetupRuleGroupSortHelper);
1297 int last_tx_progress = 0;
1298 bool last_tx_progress_set =
false;
1311 last_tx_progress_set =
true;
1312 prev_engine = engine;
1328 SCLogDebug(
"engine: gid %u alproto %s tx_min_progress %d is_last %s "
1329 "is_last_for_progress %s",
1331 engine->
is_last ?
"true" :
"false",
1359 if (el->
next == NULL) {
1377 uint16_t local_id = 0;
1388 SCLogDebug(
"sgh %p max local_id %u", sgh, local_id);
1396 static uint32_t PrefilterStoreHashFunc(
HashListTable *ht,
void *data, uint16_t datalen)
1400 uint32_t hash = (uint32_t)strlen(
ctx->name);
1402 for (
size_t u = 0; u < strlen(
ctx->name); u++) {
1403 hash +=
ctx->name[u];
1410 static char PrefilterStoreCompareFunc(
void *data1, uint16_t len1,
1411 void *data2, uint16_t len2)
1415 return (strcmp(ctx1->
name, ctx2->
name) == 0);
1418 static void PrefilterStoreFreeFunc(
void *ptr)
1435 PrefilterStoreHashFunc,
1436 PrefilterStoreCompareFunc,
1437 PrefilterStoreFreeFunc);
1442 const char *
name,
void (*FreeFunc)(
void *))
1485 if (
ctx->id ==
id) {
1524 det_ctx,
ctx->transforms, f,
flags, txv,
ctx->list_id,
ctx->GetDataSingle);
1529 const uint8_t *data = buffer->
inspect;
1534 if (data != NULL && data_len >= mpm_ctx->
minlen) {
1536 mpm_ctx, &det_ctx->
mtc, &det_ctx->
pmq, data, data_len);
1563 const uint8_t *data = buffer->
inspect;
1568 if (data != NULL && data_len >= mpm_ctx->
minlen) {
1570 mpm_ctx, &det_ctx->
mtc, &det_ctx->
pmq, data, data_len);
1575 static void PrefilterGenericMpmFree(
void *ptr)
1593 mpm_reg->
app_v2.alproto, mpm_reg->
app_v2.tx_min_progress,
1594 pectx, PrefilterGenericMpmFree, mpm_reg->
pname);
1614 mpm_reg->
app_v2.tx_min_progress, pectx, PrefilterGenericMpmFree, mpm_reg->
pname);
1621 static void PrefilterMultiGenericMpmFree(
void *ptr)
1635 uint32_t local_id = 0;
1640 det_ctx,
ctx->transforms, f,
flags, txv,
ctx->list_id, local_id,
ctx->GetData);
1667 mpm_reg->
app_v2.tx_min_progress, pectx, PrefilterMultiGenericMpmFree, mpm_reg->
pname);
1692 Packet *p,
const void *pectx)
1706 const uint8_t *data = buffer->
inspect;
1711 if (data != NULL && data_len >= mpm_ctx->
minlen) {
1713 mpm_ctx, &det_ctx->
mtc, &det_ctx->
pmq, data, data_len);
1718 static void PrefilterMpmPktFree(
void *ptr)
1737 de_ctx, sgh, PrefilterMpmPkt, 0, hook, pectx, PrefilterMpmPktFree, mpm_reg->
pname);
1744 #define QUEUE_STEP 16
#define HashListTableGetListData(hb)
int PrefilterGenericMpmPktRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
PrefilterEngine * tx_engines
InspectionBuffer * DetectGetMultiData(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv, const int list_id, uint32_t index, InspectionMultiBufferGetDataPtr GetBuf)
struct AppLayerTxData * tx_data_ptr
void(* PrefilterPostRule)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f)
InspectionBuffer * DetectGetSingleData(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv, const int list_id, InspectionSingleBufferGetDataPtr GetBuf)
SigTableElmt * sigmatch_table
void PostRuleMatchWorkQueueAppend(DetectEngineThreadCtx *det_ctx, const Signature *s, const int type, const uint32_t value)
const char * AppLayerParserGetStateNameById(uint8_t ipproto, AppProto alproto, const int id, const uint8_t direction)
int PatternMatchPrepareGroup(DetectEngineCtx *de_ctx, SigGroupHead *sh)
Prepare the pattern matcher ctx in a sig group head.
struct PrefilterMpmPktCtx PrefilterMpmPktCtx
#define PREFILTER_PROFILING_END(ctx, profile_id)
uint32_t rule_id_array_cnt
Container for matching data for a signature group.
uint64_t PcapPacketCntGet(const Packet *p)
struct HtpBodyChunk_ * next
struct SignatureHook_::@87::@88 app
struct DetectBufferMpmRegistry_::@90::@92 app_v2
int PrefilterSingleMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
InspectionBufferGetDataPtr GetData
union SignatureHook_::@87 t
int PrefilterAppendEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterPktFn PrefilterFunc, SignatureMask mask, enum SignatureHookPkt hook, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
#define PREFILTER_PROFILING_START(det_ctx)
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
main detection engine ctx
@ SIGNATURE_HOOK_PKT_NOT_SET
HashListTableBucket * HashListTableGetListHead(HashListTable *ht)
InspectionBuffer *(* InspectionBufferGetPktDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Packet *p, const int list_id)
union PrefilterEngine_::@105 cb
void PrefilterDeinit(DetectEngineCtx *de_ctx)
void DetectEngineSetEvent(DetectEngineThreadCtx *det_ctx, uint8_t e)
one time registration of keywords at start up
struct DetectPort_ * next
PrefilterEngine * payload_engines
enum DetectEnginePrefilterSetting prefilter_setting
#define PKT_NOPAYLOAD_INSPECTION
struct PrefilterNonPFDataSig array[]
#define PACKET_PROFILING_DETECT_END(p, id)
void * HashListTableLookup(HashListTable *ht, void *data, uint16_t datalen)
void(* Free)(void *pectx)
char StringHashCompareFunc(void *data1, uint16_t datalen1, void *data2, uint16_t datalen2)
#define SIG_FLAG_TOCLIENT
int PrefilterAppendFrameEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterFrameFn PrefilterFrameFunc, AppProto alproto, uint8_t frame_type, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
DetectEngineTransforms transforms
HashTable * non_pf_engine_names
int PrefilterMultiGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
int DetectBufferTypeGetByName(const char *name)
int HashListTableAdd(HashListTable *ht, void *data, uint16_t datalen)
struct DetectBufferMpmRegistry_::@90::@93 pkt_v1
bool is_last_for_progress
struct PrefilterEngineList_ * next
int(* SetupPrefilter)(DetectEngineCtx *de_ctx, struct SigGroupHead_ *sgh)
@ SIGNATURE_HOOK_TYPE_APP
AppLayerParserState * alparser
#define HashListTableGetListNext(hb)
HashListTable * prefilter_hash_table
#define SIG_FLAG_TOSERVER
HashListTable * HashListTableInit(uint32_t size, uint32_t(*Hash)(struct HashListTable_ *, void *, uint16_t), char(*Compare)(void *, uint16_t, void *, uint16_t), void(*Free)(void *))
char pname[DETECT_PROFILE_NAME_LEN]
enum SignatureHookPkt pkt_hook
void Prefilter(DetectEngineThreadCtx *det_ctx, const SigGroupHead *sgh, Packet *p, const uint8_t flags, const SignatureMask mask)
PrefilterEngineList * tx_engines
#define DetectEngineGetMaxSigId(de_ctx)
PrefilterFrameFn PrefilterFrame
union PrefilterEngine_::@104 ctx
PrefilterTxFn PrefilterTx
bool * sm_types_prefilter
InspectionBufferGetPktDataPtr GetData
#define PKT_DETECT_HAS_STREAMDATA
bool(* InspectionSingleBufferGetDataPtr)(const void *txv, const uint8_t flow_flags, const uint8_t **buf, uint32_t *buf_len)
#define FLOW_PKT_TOCLIENT_FIRST
struct PrefilterMpmCtx PrefilterMpmCtx
#define NONPF_PKT_STATS_INCR(s)
DetectEngineFrameInspectionEngine * frame_inspect_engines
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
void(* PrefilterFrameFn)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, const struct Frames *frames, const struct Frame *frame)
int HashTableAdd(HashTable *ht, void *data, uint16_t datalen)
SigGroupHeadInitData * init
struct SignatureHook_::@87::@89 pkt
const DetectEngineTransforms * transforms
struct PrefilterEngine_::@104::@106 pkt
const DetectBufferType * DetectEngineBufferTypeGetById(const DetectEngineCtx *de_ctx, const int id)
PrefilterFrameFn PrefilterFrame
SignatureInitData * init_data
void(* PrefilterTxFn)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f, void *tx, const uint64_t tx_id, const AppLayerTxData *tx_data, const uint8_t flags)
uint32_t(* Search)(const struct MpmCtx_ *, struct MpmThreadCtx_ *, PrefilterRuleStore *, const uint8_t *, uint32_t)
PrefilterEngine * frame_engines
int PrefilterAppendPayloadEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterPktFn PrefilterFunc, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
#define SCRealloc(ptr, sz)
PrefilterEngineList * pkt_engines
PrefilterEngine * post_rule_match_engines
#define PREFILTER_PROFILING_ADD_BYTES(det_ctx, bytes)
PrefilterEngineList * frame_engines
PrefilterEngineList * payload_engines
void HashListTableFree(HashListTable *ht)
#define SCMallocAligned(size, align)
DetectEnginePrefilterSetting
enum SignatureHookType type
void(* PrefilterPostRule)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f)
void PrefilterCleanupRuleGroup(const DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PostRuleMatchWorkQueueItem * q
struct PrefilterNonPFDataSig::@53::@57 app
@ SIGNATURE_HOOK_TYPE_PKT
const DetectEngineTransforms * transforms
int PrefilterAppendTxEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterTxFn PrefilterTxFunc, AppProto alproto, int tx_min_progress, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
void(* PrefilterPktFn)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx)
InspectionMultiBufferGetDataPtr GetData
SignatureInitDataBuffer * buffers
DetectEngineAppInspectionEngine * app_inspect_engines
int PrefilterAppendPostRuleEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, void(*PrefilterPostRuleFunc)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f), void *pectx, void(*FreeFunc)(void *pectx), const char *name)
void PrefilterInit(DetectEngineCtx *de_ctx)
#define PACKET_PROFILING_DETECT_START(p, id)
const DetectEngineTransforms * transforms
PrefilterEngineList * post_rule_match_engines
HashTable * HashTableInit(uint32_t size, uint32_t(*Hash)(struct HashTable_ *, void *, uint16_t), char(*Compare)(void *, uint16_t, void *, uint16_t), void(*Free)(void *))
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
int PrefilterSetupRuleGroup(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ SIGNATURE_HOOK_PKT_FLOW_START
InspectionBuffer *(* InspectionBufferGetDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv, const int list_id)
void PrefilterPostRuleMatch(DetectEngineThreadCtx *det_ctx, const SigGroupHead *sgh, Packet *p, Flow *f)
invoke post-rule match "prefilter" engines
void * DetectGetInnerTx(void *tx_ptr, AppProto alproto, AppProto engine_alproto, uint8_t flow_flags)
struct PrefilterNonPFDataSig::@53::@55 pkt
InspectionSingleBufferGetDataPtr GetDataSingle
struct PrefilterMpm PrefilterMpm
PrefilterEngine * pkt_engines
PrefilterTxFn PrefilterTx
AppProto alproto
application level protocol
struct PrefilterNonPFDataSig::@53::@56 frame
void PrefilterFreeEnginesList(PrefilterEngineList *list)
#define FLOW_PKT_TOSERVER_FIRST
#define DEBUG_VALIDATE_BUG_ON(exp)
#define SIG_FLAG_PREFILTER
void DetectRunPrefilterTx(DetectEngineThreadCtx *det_ctx, const SigGroupHead *sgh, Packet *p, const uint8_t ipproto, const uint8_t flow_flags, const AppProto alproto, void *alstate, DetectTransaction *tx)
run prefilter engines on a transaction
PostRuleMatchWorkQueue post_rule_work_queue
uint32_t StringHashDjb2(const uint8_t *data, uint32_t datalen)
@ DETECT_EVENT_POST_MATCH_QUEUE_FAILED
void PrefilterPktNonPFStatsDump(void)
struct PrefilterNonPFDataSig * sigs