]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/config: add func docs
authorVictor Julien <vjulien@oisf.net>
Sat, 24 May 2025 05:44:48 +0000 (07:44 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 10 Jun 2025 06:36:36 +0000 (08:36 +0200)
src/detect-config.c

index fe6bade3e607f0c41e1378f31dd6ce0cd2c37e97..d146603dee5dee41fea99204c02ec70a85d9e91f 100644 (file)
@@ -85,6 +85,16 @@ void DetectConfigRegister(void)
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 }
 
+/**
+ * \brief Apply configuration settings to a transaction based on the provided DetectConfigData.
+ *
+ * This function applies specific configurations to a transaction. The configurations are
+ * determined by the subsystems and types specified in the DetectConfigData structure.
+ *
+ * \param f Pointer to the Flow structure that will be configured.
+ * \param tx_id Transaction ID within the flow.
+ * \param config Pointer to the DetectConfigData structure containing configuration settings.
+ */
 static void ConfigApplyTx(Flow *f,
         const uint64_t tx_id, const DetectConfigData *config)
 {
@@ -112,6 +122,15 @@ static void ConfigApplyTx(Flow *f,
     }
 }
 
+/**
+ * \brief Apply configuration settings to a packet based on the provided DetectConfigData.
+ *
+ * This function applies specific configurations to a packet. The configurations are
+ * determined by the subsystems and types specified in the DetectConfigData structure.
+ *
+ * \param p Pointer to the Packet structure that will be configured.
+ * \param config Pointer to the DetectConfigData structure containing configuration settings.
+ */
 static void ConfigApplyPacket(Packet *p, const DetectConfigData *config)
 {
     DEBUG_VALIDATE_BUG_ON(config->scope != CONFIG_SCOPE_PACKET);
@@ -134,7 +153,17 @@ static void ConfigApplyPacket(Packet *p, const DetectConfigData *config)
 }
 
 /**
- *  \brief apply the post match config with options
+ * \brief Apply configuration settings based on the scope.
+ *
+ * This function applies post-match configurations with options. It
+ * determines which logic to apply based on the scope of the configuration,
+ * whether it is packet, transaction (tx), or flow level.
+ *
+ * \param det_ctx Pointer to the detection engine thread context.
+ * \param p Pointer to the current packet being processed.
+ * \param config Pointer to the configuration data structure.
+ *
+ * \retval 0 on success.
  */
 static int ConfigApply(DetectEngineThreadCtx *det_ctx,
         Packet *p, const DetectConfigData *config)
@@ -168,6 +197,19 @@ static int ConfigApply(DetectEngineThreadCtx *det_ctx,
     SCReturnInt(0);
 }
 
+/**
+ * \brief Post-match configuration detection function.
+ *
+ * This function is called after a match has been detected. It applies the
+ * configuration settings to the packet and returns 1 indicating that the
+ * configuration was successfully applied.
+ *
+ * \param det_ctx Pointer to the detection engine thread context.
+ * \param p Pointer to the packet being processed.
+ * \param s Pointer to the signature that matched.
+ * \param ctx Pointer to the match context, which contains the configuration data.
+ * \return 1 indicating the configuration was successfully applied
+ */
 static int DetectConfigPostMatch(DetectEngineThreadCtx *det_ctx,
         Packet *p, const Signature *s, const SigMatchCtx *ctx)
 {