24#ifndef SURICATA_DETECT_PARSE_H
25#define SURICATA_DETECT_PARSE_H
69 Signature *s,
const char *arg,
int sm_type,
int sm_list,
92#ifndef SURICATA_BINDGEN_H
108 int start_offset,
int options);
110 pcre2_match_data *match_data, uint32_t number, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen);
112 PCRE2_SIZE *bufflen);
int SignatureInitDataBufferCheckExpand(Signature *s)
check if buffers array still has space left, expand if not
SigMatch * DetectGetLastSMFromMpmLists(const DetectEngineCtx *de_ctx, const Signature *s)
get the last SigMatch from lists that support MPM.
void DetectRegisterAppLayerHookLists(void)
register app hooks as generic lists
SigMatch * DetectGetLastSMByListId(const Signature *s, int list_id,...)
Returns the sm with the largest index (added last) from the list passed to us as an id.
bool SigMatchStrictEnabled(const enum DetectKeywordId id)
DetectParseRegex * DetectSetupPCRE2(const char *parse_str, int opts)
SigMatch * DetectGetLastSMByListPtr(const Signature *s, SigMatch *sm_list,...)
Returns the sm with the largest index (added last) from the list passed to us as a pointer.
void DetectParseFreeRegex(DetectParseRegex *r)
int SC_Pcre2SubstringGet(pcre2_match_data *match_data, uint32_t number, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen)
void DetectParseFreeRegexes(void)
SigMatch * SCSigMatchAppendSMToList(DetectEngineCtx *, Signature *, uint16_t, SigMatchCtx *, int)
Append a SigMatch to the list type.
Signature * DetectFirewallRuleAppendNew(DetectEngineCtx *, const char *)
Parse and append a Signature into the Detection Engine Context signature list.
int WARN_UNUSED SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
SigMatchData * SigMatchList2DataArray(SigMatch *head)
convert SigMatch list to SigMatchData array
const char * DetectListToHumanString(int list)
const char * DetectListToString(int list)
void SigTableApplyStrictCommandLineOption(const char *str)
Signature * DetectEngineAppendSig(DetectEngineCtx *, const char *)
Parse and append a Signature into the Detection Engine Context signature list.
int SigMatchListSMBelongsTo(const Signature *, const SigMatch *)
int WARN_UNUSED DetectSignatureSetMultiAppProto(Signature *s, const AppProto *alprotos)
this function is used to set multiple possible app-layer protos
int DetectParseDupSigHashInit(DetectEngineCtx *)
Initializes the hash table that is used to cull duplicate sigs.
void SigFree(DetectEngineCtx *de_ctx, Signature *s)
int DetectParsePcreExec(DetectParseRegex *parse_regex, pcre2_match_data **match, const char *str, int start_offset, int options)
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *parse_regex)
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg, int sm_type, int sm_list, AppProto alproto)
void DetectParseDupSigHashFree(DetectEngineCtx *)
Frees the hash table that is used to cull duplicate sigs.
void SigMatchRemoveSMFromList(Signature *, SigMatch *, int)
void SigParseRegisterTests(void)
int SC_Pcre2SubstringCopy(pcre2_match_data *match_data, uint32_t number, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen)
SigMatch * DetectGetLastSMFromLists(const Signature *s,...)
Returns the sm with the largest index (added latest) from the lists passed to us.
Signature * SigAlloc(void)
bool DetectSetupParseRegexesOpts(const char *parse_str, DetectParseRegex *parse_regex, int opts)
Signature * SigInit(DetectEngineCtx *, const char *sigstr)
Parses a signature and adds it to the Detection Engine Context.
bool SigMatchSilentErrorEnabled(const DetectEngineCtx *de_ctx, const enum DetectKeywordId id)
void DetectParseRegexAddToFreeList(DetectParseRegex *parse_regex)
add regex and/or study to at exit free list
SigMatch * DetectGetLastSM(const Signature *)
Returns the sm with the largest index (added latest) from this sig.
main detection engine ctx
struct DetectParseRegex * next
pcre2_match_context * context
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
a single match condition for a signature