Go to the documentation of this file.
55 #define PARSE_REGEX "^([a-z]+)(?:,\\s*(.*))?"
58 #define MAX_TOKENS 100
68 static bool PrefilterFlowbitIsPrefilterable(
const Signature *s);
101 while ((token = strtok_r(arrptr,
"|", &saveptr))) {
103 while(isspace((
unsigned char)*token))
107 char *end = token + strlen(token) - 1;
108 while(end > token && isspace((
unsigned char)*end))
112 if (strchr(token,
' ') != NULL) {
113 SCLogError(
"Spaces are not allowed in flowbit names.");
119 "maximum allowed: %d.",
218 return DetectFlowbitMatchIsset(p,fd);
220 return DetectFlowbitMatchIsnotset(p,fd);
222 int r = DetectFlowbitMatchSet(p, fd);
225 SCLogDebug(
"flowbit set, appending to work queue");
231 return DetectFlowbitMatchUnset(p,fd);
233 int r = DetectFlowbitMatchToggle(p, fd);
235 SCLogDebug(
"flowbit set (by toggle), appending to work queue");
248 static int DetectFlowbitParse(
const char *
str,
char *cmd,
int cmd_len,
char *
name,
253 pcre2_match_data *match = NULL;
256 if (count != 2 && count != 3) {
257 SCLogError(
"\"%s\" is not a valid setting for flowbits.",
str);
262 rc = pcre2_substring_copy_bynumber(match, 1, (PCRE2_UCHAR8 *)cmd, &pcre2len);
264 SCLogError(
"pcre2_substring_copy_bynumber failed");
270 rc = pcre2_substring_copy_bynumber(match, 2, (PCRE2_UCHAR8 *)
name, &pcre2len);
272 SCLogError(
"pcre2_substring_copy_bynumber failed");
277 while (strlen(
name) > 0 && isblank(
name[strlen(
name) - 1])) {
281 if (strchr(
name,
'|') == NULL) {
283 for (
size_t i = 0; i < strlen(
name); i++) {
284 if (isblank(
name[i])) {
285 SCLogError(
"spaces not allowed in flowbit names");
292 pcre2_match_data_free(match);
297 pcre2_match_data_free(match);
306 char fb_cmd_str[16] =
"", fb_name[256] =
"";
308 if (!DetectFlowbitParse(rawstr, fb_cmd_str,
sizeof(fb_cmd_str), fb_name,
313 if (strcmp(fb_cmd_str,
"noalert") == 0) {
314 if (strlen(fb_name) != 0)
318 }
else if (strcmp(fb_cmd_str,
"isset") == 0) {
320 }
else if (strcmp(fb_cmd_str,
"isnotset") == 0) {
322 }
else if (strcmp(fb_cmd_str,
"set") == 0) {
324 }
else if (strcmp(fb_cmd_str,
"unset") == 0) {
326 }
else if (strcmp(fb_cmd_str,
"toggle") == 0) {
329 SCLogError(
"ERROR: flowbits action \"%s\" is not supported.", fb_cmd_str);
340 if (strlen(fb_name) == 0)
348 if (strchr(fb_name,
'|') != NULL) {
349 int retval = FlowbitOrAddData(
de_ctx, cd, fb_name);
358 cd->
idx = varname_id;
363 SCLogDebug(
"idx %" PRIu32
", cmd %s, name %s",
364 cd->
idx, fb_cmd_str, strlen(fb_name) ? fb_name :
"(none)");
451 struct FBAnalyze *array, uint32_t elements);
453 static void FBAnalyzerArrayFree(
struct FBAnalyze *array,
const uint32_t array_size)
456 for (uint32_t i = 0; i < array_size; i++) {
457 SCFree(array[i].set_sids);
458 SCFree(array[i].unset_sids);
459 SCFree(array[i].isset_sids);
460 SCFree(array[i].isnotset_sids);
461 SCFree(array[i].toggle_sids);
467 static void FBAnalyzerFree(
struct FBAnalyzer *fba)
469 if (fba && fba->
array) {
477 static bool CheckExpand(
const uint32_t sids_idx, uint32_t **sids, uint32_t *sids_size)
479 if (sids_idx >= *sids_size) {
480 const uint32_t old_size = *sids_size;
481 const uint32_t new_size =
MAX(2 * old_size,
MAX_SIDS);
483 void *ptr =
SCRealloc(*sids, new_size *
sizeof(uint32_t));
486 *sids_size = new_size;
585 SCLogError(
"Unable to allocate flowbit analyze array");
592 (uint64_t)(array_size *
sizeof(
struct FBAnalyze)));
598 int r = DetectFlowbitsAnalyzeSignature(s, &fba);
600 FBAnalyzerFree(&fba);
606 for (uint32_t i = 0; i < array_size; i++) {
611 bool to_state =
false;
619 "set. Checked in %u and %u other sigs",
625 SCLogDebug(
"flowbit %s/%u: isset in state, set not in state", varname, i);
634 SCLogDebug(
"flowbit %s/%u: isset not in state, set in state", varname, i);
638 SCLogDebug(
"ALL flowbit %s/%u: sets %u toggles %u unsets %u isnotsets %u issets %u", varname, i,
642 SCLogDebug(
"STATE flowbit %s/%u: sets %u toggles %u unsets %u isnotsets %u issets %u", varname, i,
647 SCLogDebug(
"SET flowbit %s/%u: SID %u", varname, i,
653 SCLogDebug(
"GET flowbit %s/%u: SID %u", varname, i, s->
id);
663 SCCalloc(sids_array_size,
sizeof(uint32_t));
665 SCLogError(
"Failed to allocate memory for rule_state_dependant_ids");
672 SCLogError(
"Failed to allocate memory for rule_state_variable_idx");
676 SCLogDebug(
"alloc'ed array for rule dependency and fbs idx array, sid %u, "
677 "sizes are %u and %u",
681 uint32_t new_array_size =
684 new_array_size *
sizeof(uint32_t));
685 if (tmp_ptr == NULL) {
686 SCLogError(
"Failed to allocate memory for rule_state_variable_idx");
691 SCLogDebug(
"realloc'ed array for rule dependency, sid %u, new size is %u",
695 new_fb_array_size *
sizeof(uint32_t));
698 SCLogError(
"Failed to reallocate memory for rule_state_variable_idx");
702 "realloc'ed array for flowbits ids, new size is %u", new_fb_array_size);
720 SCLogDebug(
"made SID %u stateful because it depends on "
721 "stateful rules that set flowbit %s", s->
id, varname);
727 DetectFlowbitsAnalyzeDump(
de_ctx, array, array_size);
730 FBAnalyzerFree(&fba);
733 FBAnalyzerFree(&fba);
738 static struct FBAnalyzer DetectFlowbitsAnalyzeForGroup(
750 SCLogError(
"Unable to allocate flowbit analyze array");
754 "fb analyzer array size: %" PRIu64, (uint64_t)(array_size *
sizeof(
struct FBAnalyze)));
759 for (uint32_t i = 0; i < sgh->init->sig_cnt; i++) {
760 const Signature *s = sgh->init->match_array[i];
763 int r = DetectFlowbitsAnalyzeSignature(s, &fba);
765 FBAnalyzerFree(&fba);
771 for (uint32_t i = 0; i < array_size; i++) {
776 bool to_state =
false;
779 SCLogDebug(
"flowbit %s/%u: isset in state, set not in state", varname, i);
787 SCLogDebug(
"flowbit %s/%u: isset not in state, set in state", varname, i);
791 SCLogDebug(
"ALL flowbit %s/%u: sets %u toggles %u unsets %u isnotsets %u issets %u",
796 SCLogDebug(
"STATE flowbit %s/%u: sets %u toggles %u unsets %u isnotsets %u issets %u",
803 SCLogDebug(
"SET flowbit %s/%u: SID %u", varname, i,
808 SCLogDebug(
"GET flowbit %s/%u: SID %u", varname, i, s->
id);
812 SCLogDebug(
"made SID %u stateful because it depends on "
813 "stateful rules that set flowbit %s",
824 struct FBAnalyze *array, uint32_t elements)
826 SCJsonBuilder *js = SCJbNewObject();
830 SCJbOpenArray(js,
"flowbits");
831 for (uint32_t x = 0; x < elements; x++) {
839 SCJbSetString(js,
"name", varname);
840 SCJbSetUint(js,
"internal_id", x);
849 SCJbOpenArray(js,
"sets");
852 SCJbAppendUint(js, s->
id);
858 SCJbOpenArray(js,
"isset");
861 SCJbAppendUint(js, s->
id);
867 SCJbOpenArray(js,
"isnotset");
870 SCJbAppendUint(js, s->
id);
876 SCJbOpenArray(js,
"unset");
879 SCJbAppendUint(js, s->
id);
885 SCJbOpenArray(js,
"toggle");
888 SCJbAppendUint(js, s->
id);
897 const char *filename =
"flowbits.json";
899 char log_path[PATH_MAX] =
"";
900 snprintf(log_path,
sizeof(log_path),
"%s/%s", log_dir, filename);
903 FILE *fp = fopen(log_path,
"w");
905 fwrite(SCJbPtr(js), SCJbLen(js), 1, fp);
914 static bool PrefilterFlowbitIsPrefilterable(
const Signature *s)
924 SCLogDebug(
"sid:%u: FLOWBITS ISSET can prefilter", s->
id);
949 else if (a->
id < b->
id)
964 static void PrefilterFlowbitFree(
void *vctx)
969 PFB_RB_REMOVE(&
ctx->fb_tree, rec);
982 if (p->
flow == NULL) {
991 memset(&lookup, 0,
sizeof(lookup));
1012 static void PrefilterFlowbitPostRuleMatch(
1018 if (p->
flow == NULL) {
1028 memset(&lookup, 0,
sizeof(lookup));
1035 SCLogDebug(
"flowbit %u found in the tree: %u. Adding %u sids", lookup.
id, b->
id,
1050 #define BLOCK_SIZE 8
1052 static int AddBitAndSid(
1056 memset(&x, 0,
sizeof(x));
1065 add->
id = flowbit_id;
1076 SCLogDebug(
"not found, so added (res %p)", res);
1106 if (AddBitAndSid(
ctx, s, fb->
idx) < 0) {
1112 if (AddBitAndSid(
ctx, s, fb->
or_list[i]) < 0) {
1120 static uint32_t NextMultiple(
const uint32_t v,
const uint32_t
m)
1122 return v + (
m - v %
m);
1146 SCLogDebug(
"flowbit: %u => rejected sid %u (iid:%u). No prefilter or prefilter not "
1147 "flowbits (%p, %s, %d)",
1157 if (fs_fb->
idx != fb->
idx) {
1159 "flowbit: %u => rejected sid %u (iid:%u). Sig prefilters on different bit %u",
1160 fb->
idx, s->
id, sig_iid, fs_fb->
idx);
1166 if (add->
rule_id[x] == sig_iid) {
1185 SCLogDebug(
"flowbit: %u => accepted sid %u (iid:%u)", fb->
idx, s->
id, sig_iid);
1202 memset(&x, 0,
sizeof(x));
1218 if (AddIssetSidsForBit(
de_ctx, fba, fb, add) != 1) {
1225 SCLogDebug(
"not found, so added (res %p)", res);
1230 int r = AddIssetSidsForBit(
de_ctx, fba, fb, pfb);
1233 }
else if (r == 0) {
1255 SCLogDebug(
"sgh %p: setting up prefilter", sgh);
1259 struct FBAnalyzer fb_analysis = DetectFlowbitsAnalyzeForGroup(
de_ctx, sgh);
1260 if (fb_analysis.
array == NULL)
1263 for (uint32_t i = 0; i < sgh->
init->
sig_cnt; i++) {
1281 "DETECT_SM_LIST_POSTMATCH: sid %u DETECT_FLOWBITS set %u", s->
id, fb->
idx);
1283 SCLogDebug(
"DETECT_SM_LIST_POSTMATCH: sid %u DETECT_FLOWBITS toggle %u", s->
id,
1292 SCLogDebug(
"flowbit %u not supported: unset in use", fb->
idx);
1296 if (set_ctx == NULL) {
1297 set_ctx =
SCCalloc(1,
sizeof(*set_ctx));
1298 if (set_ctx == NULL)
1302 SCLogDebug(
"setting up sets/toggles for sid %u", s->
id);
1303 if (AddBitSetToggle(
de_ctx, &fb_analysis, set_ctx, fb, s) == 1) {
1318 SCLogDebug(
"no prefilter or prefilter not flowbits");
1325 SCLogDebug(
"flowbit %u not supported: toggle or unset in use", fb->
idx);
1333 if (isset_ctx == NULL) {
1334 isset_ctx =
SCCalloc(1,
sizeof(*isset_ctx));
1335 if (isset_ctx == NULL)
1338 if (AddBitsAndSid(
de_ctx, isset_ctx, fb, s) < 0) {
1344 static const char *g_prefilter_flowbits_isset =
"flowbits:isset";
1345 if (isset_ctx != NULL) {
1348 isset_ctx, PrefilterFlowbitFree, g_prefilter_flowbits_isset);
1352 static const char *g_prefilter_flowbits_set =
"flowbits:set";
1354 PrefilterFlowbitFree, g_prefilter_flowbits_set);
1355 SCLogDebug(
"set/toggle: added prefilter engine");
1358 PrefilterFlowbitFree(set_ctx);
1360 SCLogDebug(
"set/toggle: NO prefilter engine added");
1362 }
else if (set_ctx != NULL) {
1363 PrefilterFlowbitFree(set_ctx);
1365 FBAnalyzerFree(&fb_analysis);
1370 PrefilterFlowbitFree(set_ctx);
1373 PrefilterFlowbitFree(isset_ctx);
1375 FBAnalyzerFree(&fb_analysis);
1381 static int FlowBitsTestParse01(
void)
1383 char command[16] =
"",
name[16] =
"";
1386 FAIL_IF(!DetectFlowbitParse(
"noalert", command,
sizeof(command),
name,
1388 FAIL_IF(strcmp(command,
"noalert") != 0);
1391 FAIL_IF(!DetectFlowbitParse(
"set,flowbit", command,
sizeof(command),
name,
1393 FAIL_IF(strcmp(command,
"set") != 0);
1397 FAIL_IF(!DetectFlowbitParse(
"set, flowbit", command,
sizeof(command),
name,
1399 FAIL_IF(strcmp(command,
"set") != 0);
1403 FAIL_IF(!DetectFlowbitParse(
"set,flowbit ", command,
sizeof(command),
name,
1405 FAIL_IF(strcmp(command,
"set") != 0);
1409 FAIL_IF(!DetectFlowbitParse(
"set, flowbit ", command,
sizeof(command),
name,
1411 FAIL_IF(strcmp(command,
"set") != 0);
1415 FAIL_IF(DetectFlowbitParse(
"set,namewith space", command,
sizeof(command),
1428 static int FlowBitsTestSig01(
void)
1438 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"Noalert\"; flowbits:noalert,wrongusage; content:\"GET \"; sid:1;)");
1453 static int FlowBitsTestSig02(
void)
1459 memset(&th_v, 0,
sizeof(th_v));
1466 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"isset rule need an option\"; flowbits:isset; content:\"GET \"; sid:1;)");
1469 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"isnotset rule need an option\"; flowbits:isnotset; content:\"GET \"; sid:2;)");
1472 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"set rule need an option\"; flowbits:set; content:\"GET \"; sid:3;)");
1475 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"unset rule need an option\"; flowbits:unset; content:\"GET \"; sid:4;)");
1478 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"toggle rule need an option\"; flowbits:toggle; content:\"GET \"; sid:5;)");
1481 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"!set is not an option\"; flowbits:!set,myerr; content:\"GET \"; sid:6;)");
1497 static int FlowBitsTestSig03(
void)
1507 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"Unknown cmd\"; flowbits:wrongcmd; content:\"GET \"; sid:1;)");
1522 static int FlowBitsTestSig04(
void)
1532 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"isset option\"; flowbits:isset,fbt; content:\"GET \"; sid:1;)");
1550 static int FlowBitsTestSig05(
void)
1560 s =
de_ctx->
sig_list =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"Noalert\"; flowbits:noalert; content:\"GET \"; sid:1;)");
1576 static int FlowBitsTestSig06(
void)
1578 uint8_t *buf = (uint8_t *)
1579 "GET /one/ HTTP/1.1\r\n"
1580 "Host: one.example.org\r\n"
1582 uint16_t buflen = strlen((
char *)buf);
1594 memset(&th_v, 0,
sizeof(th_v));
1595 memset(&f, 0,
sizeof(
Flow));
1606 p->
proto = IPPROTO_TCP;
1627 for ( ; gv != NULL; gv = gv->
next) {
1650 static int FlowBitsTestSig07(
void)
1652 uint8_t *buf = (uint8_t *)
1653 "GET /one/ HTTP/1.1\r\n"
1654 "Host: one.example.org\r\n"
1656 uint16_t buflen = strlen((
char *)buf);
1668 memset(&th_v, 0,
sizeof(th_v));
1669 memset(&f, 0,
sizeof(
Flow));
1680 p->
proto = IPPROTO_TCP;
1690 s = s->
next =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"Flowbit unset\"; flowbits:unset,myflow2; sid:11;)");
1703 for ( ; gv != NULL; gv = gv->
next) {
1725 static int FlowBitsTestSig08(
void)
1727 uint8_t *buf = (uint8_t *)
1728 "GET /one/ HTTP/1.1\r\n"
1729 "Host: one.example.org\r\n"
1731 uint16_t buflen = strlen((
char *)buf);
1744 memset(&th_v, 0,
sizeof(th_v));
1745 memset(&f, 0,
sizeof(
Flow));
1756 p->
proto = IPPROTO_TCP;
1766 s = s->
next =
SigInit(
de_ctx,
"alert ip any any -> any any (msg:\"Flowbit unset\"; flowbits:toggle,myflow2; sid:11;)");
1779 for ( ; gv != NULL; gv = gv->
next) {
uint16_t cnts[DETECT_FLOWBITS_CMD_MAX]
uint32_t rule_state_dependant_sids_idx
uint32_t isnotset_sids_idx
SCMutex g_flowbits_dump_write_m
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
struct SigMatch_ * smlists[DETECT_SM_LIST_MAX]
#define DETECT_FLOWBITS_CMD_MAX
SigTableElmt * sigmatch_table
void PostRuleMatchWorkQueueAppend(DetectEngineThreadCtx *det_ctx, const Signature *s, const int type, const uint32_t value)
void(* Free)(DetectEngineCtx *, void *)
#define DETECT_TABLE_PACKET_FILTER_FLAG
Container for matching data for a signature group.
void FlowBitsRegisterTests(void)
this function registers unit tests for FlowBits
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
bool is_rule_state_dependant
struct HtpBodyChunk_ * next
#define DETECT_FLOWBITS_CMD_ISNOTSET
int PrefilterAppendEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterPktFn PrefilterFunc, SignatureMask mask, enum SignatureHookPkt hook, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
bool FlowBitToggle(Flow *f, uint32_t idx)
int DetectFlowbitsAnalyze(DetectEngineCtx *de_ctx)
main detection engine ctx
@ SIGNATURE_HOOK_PKT_NOT_SET
void DetectEngineCtxFree(DetectEngineCtx *)
Free a DetectEngineCtx::
#define FLOW_PKT_TOSERVER
const char * VarNameStoreSetupLookup(const uint32_t id, const enum VarTypes type)
#define DETECT_TABLE_APP_TD_FLAG
void SigMatchSignatures(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p)
wrapper for old tests
#define SCMUTEX_INITIALIZER
int DetectParsePcreExec(DetectParseRegex *parse_regex, pcre2_match_data **match, const char *str, int start_offset, int options)
#define DETECT_FLOWBITS_CMD_TOGGLE
#define DETECT_FLOWBITS_CMD_ISSET
uint32_t VarNameStoreRegister(const char *name, const enum VarTypes type)
#define SIGMATCH_SUPPORT_FIREWALL
struct PrefilterEngineFlowbits __attribute__
#define DETECT_TABLE_APP_FILTER_FLAG
RB_HEAD(PFB, PrefilterFlowbit)
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
int FlowBitSet(Flow *f, uint32_t idx)
add a flowbit to the flow
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
#define DETECT_TABLE_PACKET_TD_FLAG
int(* SetupPrefilter)(DetectEngineCtx *de_ctx, struct SigGroupHead_ *sgh)
void FlowBitUnset(Flow *f, uint32_t idx)
@ DETECT_SM_LIST_POSTMATCH
#define FLOW_INITIALIZE(f)
#define FAIL_IF_NOT_NULL(expr)
Fail a test if expression evaluates to non-NULL.
struct GenericVar_ * next
#define PASS
Pass the test.
#define SCMutexUnlock(mut)
#define SIG_MASK_REQUIRE_FLOW
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *detect_parse)
#define RB_FOREACH_SAFE(x, name, head, y)
SigMatch * SCSigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
Per thread variable structure.
uint32_t rule_state_flowbits_ids_size
TmEcode DetectEngineThreadCtxInit(ThreadVars *tv, void *initdata, void **data)
initialize thread specific detection engine context
void VarNameStoreUnregister(const uint32_t id, const enum VarTypes type)
void PacketFree(Packet *p)
Return a malloced packet.
#define SCLogWarning(...)
Macro used to log WARNING messages.
Signature * SigInit(DetectEngineCtx *de_ctx, const char *sigstr)
Parses a signature and adds it to the Detection Engine Context.
SigGroupHeadInitData * init
void DetectFlowbitFree(DetectEngineCtx *, void *)
void DetectFlowbitsRegister(void)
const char * SCConfigGetLogDirectory(void)
RB_GENERATE(PFB, PrefilterFlowbit, rb, PrefilterFlowbitCompare)
SignatureInitData * init_data
uint32_t * rule_state_dependant_sids_array
Data structures and function prototypes for keeping state for the detection engine.
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
uint32_t rule_state_dependant_sids_size
int SigGroupBuild(DetectEngineCtx *de_ctx)
Convert the signature list into the runtime match structure.
uint32_t toggle_sids_size
#define SCRealloc(ptr, sz)
#define SIG_FLAG_INIT_STATE_MATCH
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
#define FAIL_IF(expr)
Fail a test if expression evaluates to true.
uint16_t state_cnts[DETECT_FLOWBITS_CMD_MAX]
TmEcode DetectEngineThreadCtxDeinit(ThreadVars *tv, void *data)
PostRuleMatchWorkQueueItem * q
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
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)
int FlowBitIsset(Flow *f, uint32_t idx)
#define SCLogError(...)
Macro used to log ERROR messages.
#define DETECT_TABLE_PACKET_PRE_STREAM_FLAG
bool(* SupportsPrefilter)(const Signature *s)
#define DETECT_FLOWBITS_CMD_UNSET
a single match condition for a signature
uint32_t isnotset_sids_size
DetectEngineCtx * DetectEngineCtxInit(void)
int DetectFlowbitMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
uint32_t * rule_state_flowbits_ids_array
void StatsThreadCleanup(ThreadVars *tv)
#define SIGMATCH_IPONLY_COMPAT
#define FLOW_PKT_TOSERVER_FIRST
bool rule_engine_analysis_set
#define SIG_FLAG_PREFILTER
bool post_rule_match_prefilter
RB_PROTOTYPE(PFB, PrefilterFlowbit, rb, PrefilterFlowbitCompare)
PostRuleMatchWorkQueue post_rule_work_queue
int FlowBitIsnotset(Flow *f, uint32_t idx)
#define DETECT_FLOWBITS_CMD_SET
void(* RegisterTests)(void)