Go to the documentation of this file.
43 #include "rust-bindings.h"
58 static int g_mqtt_subscribe_topic_buffer_id = 0;
60 static uint32_t subscribe_topic_match_limit = 100;
82 if (rs_mqtt_tx_get_subscribe_topic(cbdata->
txv, cbdata->
local_id, &data, &data_len) == 0) {
96 uint32_t local_id = 0;
103 while ((subscribe_topic_match_limit == 0) || local_id < subscribe_topic_match_limit) {
106 MQTTSubscribeTopicGetData(det_ctx, transforms, f, &cbdata, engine->
sm_list);
107 if (buffer == NULL || buffer->
inspect == NULL)
143 const int list_id = ctx->
list_id;
145 uint32_t local_id = 0;
146 while ((subscribe_topic_match_limit == 0) || local_id < subscribe_topic_match_limit) {
149 MQTTSubscribeTopicGetData(det_ctx, ctx->
transforms, f, &cbdata, list_id);
162 static void PrefilterMpmMQTTSubscribeTopicFree(
void *ptr)
179 mpm_reg->
app_v2.alproto, mpm_reg->
app_v2.tx_min_progress,
180 pectx, PrefilterMpmMQTTSubscribeTopicFree, mpm_reg->
pname);
196 if (
ConfGetInt(
"app-layer.protocols.mqtt.subscribe-topic-match-limit", &val)) {
197 subscribe_topic_match_limit = val;
199 if (subscribe_topic_match_limit <= 0) {
200 SCLogDebug(
"Using unrestricted MQTT SUBSCRIBE topic matching");
202 SCLogDebug(
"Using MQTT SUBSCRIBE topic match-limit setting of: %u",
203 subscribe_topic_match_limit);
207 PrefilterMpmMQTTSubscribeTopicRegister, NULL,
212 DetectEngineInspectMQTTSubscribeTopic, NULL);
215 "subscribe topic query");
int ConfGetInt(const char *name, intmax_t *val)
Retrieve a configuration value as an integer.
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
void DetectAppLayerMpmRegister2(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register a MPM engine
#define SIGMATCH_INFO_STICKY_BUFFER
Container for matching data for a signature group.
void DetectMQTTSubscribeTopicRegister(void)
Registration function for keyword: mqtt.subscribe.topic.
int DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
main detection engine ctx
void DetectBufferTypeSupportsMultiInstance(const char *name)
one time registration of keywords at start up
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
DetectEngineTransforms transforms
int DetectBufferTypeGetByName(const char *name)
#define SIG_FLAG_TOSERVER
void InspectionBufferSetupMultiEmpty(InspectionBuffer *buffer)
setup the buffer empty
struct PrefilterMpmMQTTSubscribeTopic PrefilterMpmMQTTSubscribeTopic
#define DETECT_ENGINE_INSPECT_SIG_MATCH
@ DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE
@ DETECT_AL_MQTT_SUBSCRIBE_TOPIC
void DetectAppLayerInspectEngineRegister2(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr2 Callback2, InspectionBufferGetDataPtr GetData)
register inspect engine at start up time
#define SCReturnPtr(x, type)
uint32_t(* Search)(const struct MpmCtx_ *, struct MpmThreadCtx_ *, PrefilterRuleStore *, const uint8_t *, uint32_t)
const DetectEngineTransforms * transforms
struct AppLayerTxData AppLayerTxData
#define PREFILTER_PROFILING_ADD_BYTES(det_ctx, bytes)
#define DETECT_CI_FLAGS_SINGLE
struct DetectBufferMpmRegistry_::@86::@88 app_v2
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
void InspectionBufferSetupMulti(InspectionBuffer *buffer, const DetectEngineTransforms *transforms, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
int PrefilterAppendTxEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterTxFn PrefilterTxFunc, AppProto alproto, int tx_min_progress, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
#define DETECT_ENGINE_INSPECT_SIG_NO_MATCH
struct DetectEngineAppInspectionEngine_::@83 v2
const DetectEngineTransforms * transforms
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
InspectionBuffer * InspectionBufferMultipleForListGet(DetectEngineThreadCtx *det_ctx, const int list_id, const uint32_t local_id)
for a InspectionBufferMultipleForList get a InspectionBuffer
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
bool DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Packet *p, Flow *f, const uint8_t *buffer, const uint32_t buffer_len, const uint32_t stream_start_offset, const uint8_t flags, const enum DetectContentInspectionType inspection_mode)
wrapper around DetectEngineContentInspectionInternal to return true/false only