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) {
325 PrefilterPktFn PrefilterFunc,
void *pectx,
void (*FreeFunc)(
void *pectx),
const char *
name)
327 if (sgh == NULL || PrefilterFunc == NULL || pectx == NULL)
333 memset(e, 0x00,
sizeof(*e));
343 while (t->
next != NULL) {
358 void (*FreeFunc)(
void *pectx),
const char *
name)
360 if (sgh == NULL || PrefilterTxFunc == NULL || pectx == NULL)
366 memset(e, 0x00,
sizeof(*e));
378 while (t->
next != NULL) {
393 void (*FreeFunc)(
void *pectx),
const char *
name)
395 if (sgh == NULL || PrefilterFrameFunc == NULL || pectx == NULL)
401 memset(e, 0x00,
sizeof(*e));
413 while (t->
next != NULL) {
427 void (*PrefilterPostRuleFunc)(
429 void *pectx,
void (*FreeFunc)(
void *pectx),
const char *
name)
431 if (sgh == NULL || PrefilterPostRuleFunc == NULL || pectx == NULL)
437 memset(e, 0x00,
sizeof(*e));
446 while (t->
next != NULL) {
473 PrefilterFreeEngineList(t);
519 static int PrefilterSetupRuleGroupSortHelper(
const void *a,
const void *b)
567 static void PrefilterNonPFDataFree(
void *data)
577 PrefilterAddSids(&det_ctx->
pmq, data->
array, data->
size);
580 #ifdef NONPF_PKT_STATS
581 static thread_local uint64_t prefilter_pkt_nonpf_called = 0;
582 static thread_local uint64_t prefilter_pkt_nonpf_mask_fail = 0;
583 static thread_local uint64_t prefilter_pkt_nonpf_alproto_fail = 0;
584 static thread_local uint64_t prefilter_pkt_nonpf_dsize_fail = 0;
585 static thread_local uint64_t prefilter_pkt_nonpf_dport_fail = 0;
586 static thread_local uint64_t prefilter_pkt_nonpf_sids = 0;
587 #define NONPF_PKT_STATS_INCR(s) (s)++
589 #define NONPF_PKT_STATS_INCR(s)
594 #ifdef NONPF_PKT_STATS
595 SCLogDebug(
"prefilter non-pf: called:%" PRIu64
", mask_fail:%" PRIu64
", alproto fail:%" PRIu64
596 ", dport fail:%" PRIu64
", dsize fail:%" PRIu64
", sids:%" PRIu64
597 ", avg sids:%" PRIu64,
598 prefilter_pkt_nonpf_called, prefilter_pkt_nonpf_mask_fail,
599 prefilter_pkt_nonpf_alproto_fail, prefilter_pkt_nonpf_dport_fail,
600 prefilter_pkt_nonpf_dsize_fail, prefilter_pkt_nonpf_sids,
601 prefilter_pkt_nonpf_called ? prefilter_pkt_nonpf_sids / prefilter_pkt_nonpf_called : 0);
612 for (uint32_t i = 0; i < data->
size; i++) {
615 if ((rule_mask & mask) == rule_mask) {
619 const uint32_t
sid = ds->
sid;
620 PrefilterAddSids(&det_ctx->
pmq, &
sid, 1);
628 const uint32_t
sid = ds->
sid;
629 PrefilterAddSids(&det_ctx->
pmq, &
sid, 1);
637 const uint32_t
sid = ds->
sid;
638 PrefilterAddSids(&det_ctx->
pmq, &
sid, 1);
651 static void PrefilterPktNonPFHookFlowStart(
655 PrefilterPktNonPF(det_ctx,
p, pectx);
670 for (uint32_t i = 0; i < data->
size; i++) {
674 const uint32_t
sid = ds->
sid;
675 PrefilterAddSids(&det_ctx->
pmq, &
sid, 1);
682 static uint32_t NonPFNamesHash(
HashTable *h,
void *data, uint16_t _len)
684 const char *
str = data;
688 static char NonPFNamesCompare(
void *data1, uint16_t _len1,
void *data2, uint16_t len2)
690 const char *s1 = data1;
691 const char *s2 = data2;
695 static void NonPFNamesFree(
void *data)
713 static uint32_t TxNonPFHash(
HashListTable *h,
void *data, uint16_t _len)
719 static char TxNonPFCompare(
void *data1, uint16_t _len1,
void *data2, uint16_t len2)
727 static void TxNonPFFree(
void *data)
753 for (uint32_t y = 0; y < e->
sigs_cnt; y++) {
777 if (add->
sigs == NULL) {
788 dir == 0 ?
"toserver" :
"toclient");
790 if (engine_name_heap == NULL) {
804 SCLogDebug(
"engine_name_heap %s", engine_name_heap);
828 if (pkt_non_pf_array == NULL) {
831 uint32_t pkt_non_pf_array_size = 0;
833 SCCalloc(max_sids,
sizeof(*frame_non_pf_array));
834 if (frame_non_pf_array == NULL) {
838 uint32_t frame_non_pf_array_size = 0;
841 SCCalloc(max_sids,
sizeof(*pkt_hook_flow_start_non_pf_array));
842 if (pkt_hook_flow_start_non_pf_array == NULL) {
844 SCFree(frame_non_pf_array);
847 uint32_t pkt_hook_flow_start_non_pf_array_size = 0;
849 bool pkt_hook_flow_start_mask_init =
false;
853 if (tx_engines_hash == NULL) {
855 SCFree(pkt_hook_flow_start_non_pf_array);
856 SCFree(frame_non_pf_array);
862 HashTableInit(512, NonPFNamesHash, NonPFNamesCompare, NonPFNamesFree);
865 SCFree(pkt_hook_flow_start_non_pf_array);
866 SCFree(frame_non_pf_array);
873 bool pkt_mask_init =
false;
874 #ifdef NONPF_PKT_STATS
875 uint32_t nonpf_pkt_alproto = 0;
876 uint32_t nonpf_pkt_dsize = 0;
877 uint32_t nonpf_pkt_dport = 0;
880 SCLogDebug(
"app_events_list_id %d", app_events_list_id);
882 SCLogDebug(
"app_state_list_id %d", app_state_list_id);
883 for (uint32_t sig = 0; sig < sgh->
init->
sig_cnt; sig++) {
894 SCLogDebug(
"setting up sid %u for non-prefilter", s->
id);
896 uint8_t frame_type = 0;
897 bool tx_non_pf =
false;
898 bool frame_non_pf =
false;
899 bool pkt_non_pf =
false;
920 pkt_hook_flow_start_non_pf_array[pkt_hook_flow_start_non_pf_array_size].
sid = s->
iid;
921 pkt_hook_flow_start_non_pf_array[pkt_hook_flow_start_non_pf_array_size].
value =
value;
922 pkt_hook_flow_start_non_pf_array[pkt_hook_flow_start_non_pf_array_size].
type =
type;
923 pkt_hook_flow_start_non_pf_array[pkt_hook_flow_start_non_pf_array_size].
pkt.sig_mask =
925 pkt_hook_flow_start_non_pf_array_size++;
927 if (pkt_hook_flow_start_mask_init) {
928 pkt_hook_flow_start_mask &= s->
mask;
930 pkt_hook_flow_start_mask = s->
mask;
931 pkt_hook_flow_start_mask_init =
true;
947 s->
alproto, state, dir == 0 ? STREAM_TOSERVER : STREAM_TOCLIENT);
952 s->
alproto, state, dir == 0 ? STREAM_TOSERVER : STREAM_TOCLIENT);
953 if (TxNonPFAddSig(
de_ctx, tx_engines_hash, s->
alproto, dir, state, sm_list, pname,
968 SCLogDebug(
"list_id %d buf %p", list_id, buf);
969 if (list_id == app_events_list_id)
975 }
else if (buf->
frame) {
977 f != NULL; f = f->
next) {
980 list_id == (
int)f->sm_list &&
985 frame_type = f->
type;
988 frame_non_pf_array[frame_non_pf_array_size].
sid = s->
iid;
989 frame_non_pf_array[frame_non_pf_array_size].
value = s->
alproto;
990 frame_non_pf_array[frame_non_pf_array_size].
frame.type = frame_type;
991 frame_non_pf_array_size++;
1009 list_id == (
int)
app->sm_list &&
1015 if (list_id == app_state_list_id)
1016 sig_list = app_state_list_id;
1017 if (TxNonPFAddSig(
de_ctx, tx_engines_hash,
app->alproto,
app->dir,
1018 app->progress, sig_list, buf->
name, s) != 0) {
1030 dir == 0 ? STREAM_TOSERVER : STREAM_TOCLIENT);
1044 if (!(tx_non_pf || frame_non_pf)) {
1051 SCLogDebug(
"setting up sid %u for non-prefilter: %s", s->
id,
1052 tx_non_pf ?
"tx engine" : (frame_non_pf ?
"frame engine" :
"pkt engine"));
1063 #ifdef NONPF_PKT_STATS
1069 #ifdef NONPF_PKT_STATS
1075 #ifdef NONPF_PKT_STATS
1076 nonpf_pkt_alproto++;
1080 pkt_non_pf_array[pkt_non_pf_array_size].
sid = s->
iid;
1081 pkt_non_pf_array[pkt_non_pf_array_size].
value =
value;
1082 pkt_non_pf_array[pkt_non_pf_array_size].
type =
type;
1083 pkt_non_pf_array[pkt_non_pf_array_size].
pkt.sig_mask = s->
mask;
1084 pkt_non_pf_array_size++;
1086 if (pkt_mask_init) {
1087 pkt_mask &= s->
mask;
1090 pkt_mask_init =
true;
1100 SCLogDebug(
"%s engine for %s hook %d has %u non-pf sigs",
1112 int8_t engine_progress = (int8_t)t->
progress;
1113 if (t->
sig_list == app_state_list_id) {
1115 engine_progress = -1;
1123 for (uint32_t i = 0; i < t->
sigs_cnt; i++) {
1127 (
void *)data, PrefilterNonPFDataFree, t->
engine_name) < 0) {
1133 tx_engines_hash = NULL;
1135 if (pkt_non_pf_array_size) {
1136 SCLogDebug(
"pkt_non_pf_array_size %u", pkt_non_pf_array_size);
1138 SCCalloc(1,
sizeof(*data) + pkt_non_pf_array_size *
sizeof(data->
array[0]));
1141 data->
size = pkt_non_pf_array_size;
1142 memcpy((uint8_t *)&data->
array, pkt_non_pf_array,
1143 pkt_non_pf_array_size *
sizeof(data->
array[0]));
1146 PrefilterNonPFDataFree,
"packet:non_pf") < 0) {
1151 if (pkt_hook_flow_start_non_pf_array_size) {
1153 1,
sizeof(*data) + pkt_hook_flow_start_non_pf_array_size *
sizeof(data->
array[0]));
1156 data->
size = pkt_hook_flow_start_non_pf_array_size;
1157 memcpy((uint8_t *)&data->
array, pkt_hook_flow_start_non_pf_array,
1158 pkt_hook_flow_start_non_pf_array_size *
sizeof(data->
array[0]));
1159 SCLogDebug(
"packet:flow_start:non_pf added with %u rules", data->
size);
1162 PrefilterPktNonPFHookFlowStart,
1164 pkt_hook_flow_start_mask, hook, (
void *)data, PrefilterNonPFDataFree,
1165 "packet:flow_start:non_pf") < 0) {
1170 if (frame_non_pf_array_size) {
1171 SCLogDebug(
"%u frame non-pf sigs", frame_non_pf_array_size);
1173 SCCalloc(1,
sizeof(*data) + frame_non_pf_array_size *
sizeof(data->
array[0]));
1176 data->
size = frame_non_pf_array_size;
1177 memcpy((uint8_t *)&data->
array, frame_non_pf_array,
1178 frame_non_pf_array_size *
sizeof(data->
array[0]));
1180 FRAME_ANY_TYPE, (
void *)data, PrefilterNonPFDataFree,
"frame:non_pf") < 0) {
1186 SCFree(pkt_hook_flow_start_non_pf_array);
1187 pkt_hook_flow_start_non_pf_array = NULL;
1188 SCFree(pkt_non_pf_array);
1189 pkt_non_pf_array = NULL;
1190 SCFree(frame_non_pf_array);
1191 frame_non_pf_array = NULL;
1195 if (tx_engines_hash) {
1198 SCFree(pkt_hook_flow_start_non_pf_array);
1199 SCFree(pkt_non_pf_array);
1200 SCFree(frame_non_pf_array);
1208 FatalError(
"failed to set up pattern matching");
1222 if (SetupNonPrefilter(
de_ctx, sgh) != 0) {
1254 if (el->
next == NULL) {
1283 if (el->
next == NULL) {
1300 uint16_t local_id = 0;
1315 PrefilterSetupRuleGroupSortHelper);
1324 int last_tx_progress = 0;
1325 bool last_tx_progress_set =
false;
1338 last_tx_progress_set =
true;
1339 prev_engine = engine;
1355 SCLogDebug(
"engine: gid %u alproto %s tx_min_progress %d is_last %s "
1356 "is_last_for_progress %s",
1358 engine->
is_last ?
"true" :
"false",
1386 if (el->
next == NULL) {
1404 uint16_t local_id = 0;
1415 SCLogDebug(
"sgh %p max local_id %u", sgh, local_id);
1423 static uint32_t PrefilterStoreHashFunc(
HashListTable *ht,
void *data, uint16_t datalen)
1427 uint32_t hash = (uint32_t)strlen(
ctx->name);
1429 for (
size_t u = 0; u < strlen(
ctx->name); u++) {
1430 hash +=
ctx->name[u];
1437 static char PrefilterStoreCompareFunc(
void *data1, uint16_t len1,
1438 void *data2, uint16_t len2)
1442 return (strcmp(ctx1->
name, ctx2->
name) == 0);
1445 static void PrefilterStoreFreeFunc(
void *ptr)
1462 PrefilterStoreHashFunc,
1463 PrefilterStoreCompareFunc,
1464 PrefilterStoreFreeFunc);
1469 const char *
name,
void (*FreeFunc)(
void *))
1512 if (
ctx->id ==
id) {
1551 det_ctx,
ctx->transforms, f,
flags, txv,
ctx->list_id,
ctx->GetDataSingle);
1556 const uint8_t *data = buffer->
inspect;
1561 if (data != NULL && data_len >= mpm_ctx->
minlen) {
1563 mpm_ctx, &det_ctx->
mtc, &det_ctx->
pmq, data, data_len);
1590 const uint8_t *data = buffer->
inspect;
1595 if (data != NULL && data_len >= mpm_ctx->
minlen) {
1597 mpm_ctx, &det_ctx->
mtc, &det_ctx->
pmq, data, data_len);
1602 static void PrefilterGenericMpmFree(
void *ptr)
1620 mpm_reg->
app_v2.alproto, mpm_reg->
app_v2.tx_min_progress,
1621 pectx, PrefilterGenericMpmFree, mpm_reg->
pname);
1641 mpm_reg->
app_v2.tx_min_progress, pectx, PrefilterGenericMpmFree, mpm_reg->
pname);
1648 static void PrefilterMultiGenericMpmFree(
void *ptr)
1662 uint32_t local_id = 0;
1667 det_ctx,
ctx->transforms, f,
flags, txv,
ctx->list_id, local_id,
ctx->GetData);
1694 mpm_reg->
app_v2.tx_min_progress, pectx, PrefilterMultiGenericMpmFree, mpm_reg->
pname);
1733 const uint8_t *data = buffer->
inspect;
1738 if (data != NULL && data_len >= mpm_ctx->
minlen) {
1740 mpm_ctx, &det_ctx->
mtc, &det_ctx->
pmq, data, data_len);
1745 static void PrefilterMpmPktFree(
void *ptr)
1764 de_ctx, sgh, PrefilterMpmPkt, 0, hook, pectx, PrefilterMpmPktFree, mpm_reg->
pname);
1771 #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)
#define SIG_FLAG_FW_HOOK_LTE
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
int DetectEngineAppHookToSmlist(const AppProto p, const uint8_t state, const int direction)
get the sm_list for a app hook
#define PREFILTER_PROFILING_END(ctx, profile_id)
uint32_t rule_id_array_cnt
Container for matching data for a signature group.
uint8_t app_progress_hook
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
const char * DetectEngineAppHookToName(const AppProto p, const uint8_t state, const uint8_t direction)
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
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
int PrefilterAppendTxEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterTxFn PrefilterTxFunc, AppProto alproto, int8_t tx_min_progress, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
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
const uint8_t tx_progress
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