Go to the documentation of this file.
35 static int mqtt_type_id = 0;
86 const uint8_t *
de = (
const uint8_t *)ctx;
91 return rs_mqtt_tx_has_type(
txv, *
de);
103 static uint8_t *DetectMQTTTypeParse(
const char *rawstr)
108 ret = rs_mqtt_cstr_message_code(rawstr);
111 SCLogError(
"unknown mqtt.type value %s", rawstr);
148 de = DetectMQTTTypeParse(rawstr);
194 static int MQTTTypeTestParse01 (
void)
197 de = DetectMQTTTypeParse(
"CONNECT");
202 de = DetectMQTTTypeParse(
"PINGRESP");
216 static int MQTTTypeTestParse02 (
void)
219 de = DetectMQTTTypeParse(
"auth");
233 static int MQTTTypeTestParse03 (
void)
236 de = DetectMQTTTypeParse(
"invalidopt");
242 de = DetectMQTTTypeParse(
"unassigned");
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
void SigMatchAppendSMToList(Signature *s, SigMatch *new, const int list)
Append a SigMatch to the list type.
void(* Free)(DetectEngineCtx *, void *)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
main detection engine ctx
void DetectMQTTTypeFree(DetectEngineCtx *de_ctx, void *)
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
int DetectBufferTypeGetByName(const char *name)
#define SIG_FLAG_TOSERVER
#define PASS
Pass the test.
void DetectMQTTTypeRegister(void)
Registration function for ipopts: keyword.
void DetectAppLayerInspectEngineRegister2(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr2 Callback2, InspectionBufferGetDataPtr GetData)
register inspect engine at start up time
SigMatch * SigMatchAlloc(void)
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
void MQTTTypeRegisterTests(void)
this function registers unit tests for MQTTType
uint8_t DetectEngineInspectGenericList(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct 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.
#define SCLogError(...)
Macro used to log ERROR messages.
a single match condition for a signature
void(* RegisterTests)(void)