Go to the documentation of this file.
35 static int mqtt_type_id = 0;
65 DetectEngineInspectMQTTTypeGeneric, NULL);
98 const uint8_t *
de = (
const uint8_t *)ctx;
103 return rs_mqtt_tx_has_type(
txv, *
de);
115 static uint8_t *DetectMQTTTypeParse(
const char *rawstr)
120 ret = rs_mqtt_cstr_message_code(rawstr);
160 de = DetectMQTTTypeParse(rawstr);
206 static int MQTTTypeTestParse01 (
void)
209 de = DetectMQTTTypeParse(
"CONNECT");
214 de = DetectMQTTTypeParse(
"PINGRESP");
228 static int MQTTTypeTestParse02 (
void)
231 de = DetectMQTTTypeParse(
"auth");
245 static int MQTTTypeTestParse03 (
void)
248 de = DetectMQTTTypeParse(
"invalidopt");
254 de = DetectMQTTTypeParse(
"unassigned");
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
void(* Free)(DetectEngineCtx *, void *)
int DetectEngineInspectGenericList(const DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Flow *f, const uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Do the content inspection & validation for a signature.
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
#define SCLogError(err_code,...)
Macro used to log ERROR messages.
a single match condition for a signature
void SigMatchAppendSMToList(Signature *s, SigMatch *new, int list)
Append a SigMatch to the list type.
void(* RegisterTests)(void)