From: Philippe Antoine Date: Wed, 19 Feb 2025 20:15:09 +0000 (+0100) Subject: plugins: bind constant SC_PLUGIN_API_VERSION X-Git-Tag: suricata-8.0.0-beta1~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5742df3783d4284c8a65b2f150203f6de693e646;p=thirdparty%2Fsuricata.git plugins: bind constant SC_PLUGIN_API_VERSION --- diff --git a/rust/Makefile.am b/rust/Makefile.am index c1250a81c0..cb9158fc63 100644 --- a/rust/Makefile.am +++ b/rust/Makefile.am @@ -130,6 +130,7 @@ if HAVE_BINDGEN --allowlist-function 'AppProto.*' \ --allowlist-type 'SC.*' \ --allowlist-function 'SC.*' \ + --allowlist-var 'SC.*' \ $(abs_top_srcdir)/src/bindgen.h \ -- \ -DHAVE_CONFIG_H -I../src -I../rust/gen $(CPPFLAGS) diff --git a/rust/sys/src/sys.rs b/rust/sys/src/sys.rs index 99341dbbec..057d566f18 100644 --- a/rust/sys/src/sys.rs +++ b/rust/sys/src/sys.rs @@ -105,6 +105,7 @@ pub type SCCapturePlugin = SCCapturePlugin_; extern "C" { pub fn SCPluginRegisterCapture(arg1: *mut SCCapturePlugin) -> ::std::os::raw::c_int; } +pub const SC_PLUGIN_API_VERSION: u64 = 8; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct SCAppLayerPlugin_ { diff --git a/src/suricata-plugin.h b/src/suricata-plugin.h index 4db7cc4d3a..fbc4979611 100644 --- a/src/suricata-plugin.h +++ b/src/suricata-plugin.h @@ -53,7 +53,7 @@ typedef struct SCCapturePlugin_ { int SCPluginRegisterCapture(SCCapturePlugin *); // Every change in the API used by plugins should change this number -#define SC_PLUGIN_API_VERSION 8 +static const uint64_t SC_PLUGIN_API_VERSION = 8; typedef struct SCAppLayerPlugin_ { // versioning to check suricata/plugin API compatibility