Go to the documentation of this file.
43 #include "rust-bindings.h"
58 static int g_mqtt_unsubscribe_topic_buffer_id = 0;
60 static uint32_t unsubscribe_topic_match_limit = 100;
82 if (rs_mqtt_tx_get_unsubscribe_topic(cbdata->
txv, cbdata->
local_id, &data, &data_len) == 0) {
95 uint32_t local_id = 0;
102 while ((unsubscribe_topic_match_limit == 0) || local_id < unsubscribe_topic_match_limit) {
105 MQTTUnsubscribeTopicGetData(det_ctx, transforms, f, &cbdata, engine->
sm_list);
106 if (buffer == NULL || buffer->
inspect == NULL)
149 const int list_id = ctx->
list_id;
151 uint32_t local_id = 0;
152 while ((unsubscribe_topic_match_limit == 0) || local_id < unsubscribe_topic_match_limit) {
155 MQTTUnsubscribeTopicGetData(det_ctx, ctx->
transforms, f, &cbdata, list_id);
169 static void PrefilterMpmMQTTUnsubscribeTopicFree(
void *ptr)
187 mpm_reg->
app_v2.alproto, mpm_reg->
app_v2.tx_min_progress,
188 pectx, PrefilterMpmMQTTUnsubscribeTopicFree, mpm_reg->
pname);
204 if (
ConfGetInt(
"app-layer.protocols.mqtt.unsubscribe-topic-match-limit", &val)) {
205 unsubscribe_topic_match_limit = val;
207 if (unsubscribe_topic_match_limit <= 0) {
208 SCLogDebug(
"Using unrestricted MQTT UNSUBSCRIBE topic matching");
210 SCLogDebug(
"Using MQTT UNSUBSCRIBE topic match-limit setting of: %i",
211 unsubscribe_topic_match_limit);
215 PrefilterMpmMQTTUnsubscribeTopicRegister, NULL,
220 DetectEngineInspectMQTTUnsubscribeTopic, NULL);
223 "unsubscribe topic query");
int ConfGetInt(const char *name, intmax_t *val)
Retrieve a configuration value as an integer.
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
@ DETECT_AL_MQTT_UNSUBSCRIBE_TOPIC
#define SIGMATCH_INFO_STICKY_BUFFER
@ DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE
Container for matching data for a signature group.
DetectEngineTransforms transforms
struct DetectBufferMpmRegistery_::@87::@89 app_v2
void DetectMQTTUnsubscribeTopicRegister(void)
Registration function for keyword: mqtt.unsubscribe.topic.
main detection engine ctx
struct PrefilterMpmMQTTUnsubscribeTopic PrefilterMpmMQTTUnsubscribeTopic
one time registration of keywords at start up
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
struct DetectEngineAppInspectionEngine_::@84 v2
int DetectBufferTypeGetByName(const char *name)
#define SIG_FLAG_TOSERVER
#define DETECT_ENGINE_INSPECT_SIG_MATCH
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)
uint16_t discontinue_matching
uint8_t DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Packet *p, Flow *f, const uint8_t *buffer, uint32_t buffer_len, uint32_t stream_start_offset, uint8_t flags, uint8_t inspection_mode)
Run the actual payload match functions.
void DetectAppLayerMpmRegister2(const char *name, int direction, int priority, int(*PrefilterRegister)(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id), InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register a MPM engine
struct AppLayerTxData AppLayerTxData
#define PREFILTER_PROFILING_ADD_BYTES(det_ctx, bytes)
#define DETECT_CI_FLAGS_SINGLE
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
int inspection_recursion_counter
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
const DetectEngineTransforms * transforms
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
const DetectEngineTransforms * transforms
InspectionBuffer * InspectionBufferMultipleForListGet(DetectEngineThreadCtx *det_ctx, const int list_id, const uint32_t local_id)
for a InspectionBufferMultipleForList get a InspectionBuffer
int DetectBufferSetActiveList(Signature *s, const int list)
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)