Go to the documentation of this file.
24 #ifndef SURICATA_DETECT_PARSE_H
25 #define SURICATA_DETECT_PARSE_H
31 #define MAX_DETECT_ALPROTO_CNT 10
85 Signature *s,
const char *arg,
int sm_type,
int sm_list,
117 int start_offset,
int options);
119 pcre2_match_data *match_data, uint32_t number, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen);
120 int SC_Pcre2SubstringGet(pcre2_match_data *match_data, uint32_t number, PCRE2_UCHAR **bufferptr,
121 PCRE2_SIZE *bufflen);
void SigMatchRemoveSMFromList(Signature *, SigMatch *, int)
DetectParseRegex * DetectSetupPCRE2(const char *parse_str, int opts)
pcre2_match_context * context
InspectionBuffer *(* InspectionBufferGetDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv, const int list_id)
void DetectParseFreeRegex(DetectParseRegex *r)
main detection engine ctx
void DetectParseRegexAddToFreeList(DetectParseRegex *parse_regex)
add regex and/or study to at exit free list
void SigTableApplyStrictCommandLineOption(const char *str)
struct DetectFileHandlerTableElmt_ DetectFileHandlerTableElmt
DetectFileHandlerTableElmt filehandler_table[DETECT_TBLSIZE_STATIC]
int DetectParseDupSigHashInit(DetectEngineCtx *)
Initializes the hash table that is used to cull duplicate sigs.
void DetectParseFreeRegexes(void)
struct DetectParseRegex * next
InspectionBufferGetDataPtr GetData
int SC_Pcre2SubstringCopy(pcre2_match_data *match_data, uint32_t number, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen)
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.
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *parse_regex)
SigMatch * DetectGetLastSMFromLists(const Signature *s,...)
Returns the sm with the largest index (added latest) from the lists passed to us.
SigMatch * DetectGetLastSM(const Signature *)
Returns the sm with the largest index (added latest) from this sig.
const char * DetectListToHumanString(int list)
struct DetectParseRegex DetectParseRegex
int WARN_UNUSED DetectSignatureSetAppProto(Signature *s, AppProto alproto)
SigMatch * SigMatchAppendSMToList(DetectEngineCtx *, Signature *, uint16_t, SigMatchCtx *, int)
Append a SigMatch to the list type.
int al_protocols[MAX_DETECT_ALPROTO_CNT]
int(* PrefilterRegisterFunc)(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
bool SigMatchStrictEnabled(const enum DetectKeywordId id)
void SigFree(DetectEngineCtx *de_ctx, Signature *s)
SigMatch * DetectGetLastSMFromMpmLists(const DetectEngineCtx *de_ctx, const Signature *s)
get the last SigMatch from lists that support MPM.
Signature * SigInit(DetectEngineCtx *, const char *sigstr)
Parses a signature and adds it to the Detection Engine Context.
int DetectParsePcreExec(DetectParseRegex *parse_regex, pcre2_match_data **match, const char *str, int start_offset, int options)
int SigMatchListSMBelongsTo(const Signature *, const SigMatch *)
SigMatchData * SigMatchList2DataArray(SigMatch *head)
convert SigMatch list to SigMatchData array
#define MAX_DETECT_ALPROTO_CNT
int DetectSignatureAddTransform(Signature *s, int transform, void *options)
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
bool DetectSetupParseRegexesOpts(const char *parse_str, DetectParseRegex *parse_regex, 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.
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg, int sm_type, int sm_list, AppProto alproto)
uint8_t(* InspectEngineFuncPtr)(struct DetectEngineCtx_ *de_ctx, struct DetectEngineThreadCtx_ *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const struct Signature_ *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
int SignatureInitDataBufferCheckExpand(Signature *s)
check if buffers array still has space left, expand if not
bool SigMatchSilentErrorEnabled(const DetectEngineCtx *de_ctx, const enum DetectKeywordId id)
PrefilterRegisterFunc PrefilterFn
void DetectFileRegisterFileProtocols(DetectFileHandlerTableElmt *entry)
Signature * SigAlloc(void)
void SigParseRegisterTests(void)
a single match condition for a signature
int SC_Pcre2SubstringGet(pcre2_match_data *match_data, uint32_t number, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen)
const char * DetectListToString(int list)
InspectEngineFuncPtr Callback
void DetectParseDupSigHashFree(DetectEngineCtx *)
Frees the hash table that is used to cull duplicate sigs.
Signature * DetectEngineAppendSig(DetectEngineCtx *, const char *)
Parse and append a Signature into the Detection Engine Context signature list.