From: Jeff Lucovsky Date: Thu, 11 Jun 2020 12:31:55 +0000 (-0400) Subject: detect/transform: Add transform "validate" function X-Git-Tag: suricata-6.0.0-beta1~292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4132d8e0f30c1f184b2e3113537afd6f9c86126;p=thirdparty%2Fsuricata.git detect/transform: Add transform "validate" function This commit adds an (optional) entry for a validation function. The validation function, if present, will be used during rule processing. Its role is to determine if the arguments are compatible with the transform. E.g., a content string of "this string has whitespace" is not compatible with the `strip_whitespace` transform. --- diff --git a/src/detect.h b/src/detect.h index 3d90519b73..71cdc458b0 100644 --- a/src/detect.h +++ b/src/detect.h @@ -1189,6 +1189,7 @@ typedef struct SigTableElmt_ { /** InspectionBuffer transformation callback */ void (*Transform)(InspectionBuffer *, void *context); + bool (*TransformValidate)(const uint8_t *content, uint16_t content_len, void *context); /** keyword setup function pointer */ int (*Setup)(DetectEngineCtx *, Signature *, const char *);