56#define KEYWORD_NAME "sip.method"
57#define KEYWORD_DOC "sip-keywords.html#sip-method"
58#define BUFFER_NAME "sip.method"
59#define BUFFER_DESC "sip request method"
60static int g_buffer_id = 0;
73static bool DetectSipMethodValidateCallback(
80 for (; sm != NULL; sm = sm->
next) {
84 if (cd->content && cd->content_len) {
85 if (cd->content[cd->content_len - 1] == 0x20) {
86 *sigerror =
"sip.method pattern with trailing space";
89 }
else if (cd->content[0] == 0x20) {
90 *sigerror =
"sip.method pattern with leading space";
93 }
else if (cd->content[cd->content_len - 1] == 0x09) {
94 *sigerror =
"sip.method pattern with trailing tab";
97 }
else if (cd->content[0] == 0x09) {
98 *sigerror =
"sip.method pattern with leading tab";
110 const uint8_t _flow_flags,
void *txv,
const int list_id)
114 const uint8_t *b = NULL;
117 if (SCSipTxGetMethod(txv, &b, &b_len) != 1)
119 if (b == NULL || b_len == 0)
146 DetectSipMethodValidateCallback);
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
void InspectionBufferSetupAndApplyTransforms(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len, const DetectEngineTransforms *transforms)
setup the buffer with our initial data
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
void DetectAppLayerMpmRegister(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register an app layer keyword for mpm
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
uint8_t DetectEngineInspectBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Do the content inspection & validation for a signature.
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror, const DetectBufferType *))
int DetectBufferTypeGetByName(const char *name)
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
SigTableElmt * sigmatch_table
void DetectSipMethodRegister(void)
#define SIG_FLAG_TOSERVER
main detection engine ctx
a single match condition for a signature
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
SignatureInitDataBuffer * buffers
SignatureInitData * init_data
#define SCLogError(...)
Macro used to log ERROR messages.