rust/sys: stub in suricata-sys crate for Rust bindings to C

Follow Rust convention of using a "sys" crate for bindings to C
functions. The bindings don't exist yet, but will be generated by
bindgen and put into this crate.

Ticket: #7341
pull/12590/head
Jason Ish 10 months ago committed by Victor Julien
parent 19debb7382
commit 8f22e55678

@ -2536,6 +2536,7 @@ AC_SUBST(enable_non_bundled_htp)
AM_CONDITIONAL([BUILD_SHARED_LIBRARY], [test "x$enable_shared" = "xyes"] && [test "x$can_build_shared_library" = "xyes"])
AC_CONFIG_FILES(Makefile src/Makefile rust/Makefile rust/Cargo.lock rust/Cargo.toml rust/derive/Cargo.toml rust/.cargo/config.toml)
AC_CONFIG_FILES(rust/sys/Makefile rust/sys/Cargo.toml)
AC_CONFIG_FILES(qa/Makefile qa/coccinelle/Makefile)
AC_CONFIG_FILES(rules/Makefile doc/Makefile doc/userguide/Makefile)
AC_CONFIG_FILES(contrib/Makefile contrib/file_processor/Makefile contrib/file_processor/Action/Makefile contrib/file_processor/Processor/Makefile)

@ -1010,6 +1010,7 @@ dependencies = [
"snmp-parser",
"suricata-derive",
"suricata-lua-sys",
"suricata-sys",
"test-case",
"time",
"tls-parser",
@ -1037,6 +1038,10 @@ dependencies = [
"fs_extra",
]
[[package]]
name = "suricata-sys"
version = "8.0.0-dev"
[[package]]
name = "syn"
version = "1.0.109"

@ -7,7 +7,7 @@ edition = "2021"
rust-version = "1.67.1"
[workspace]
members = [".", "./derive"]
members = [".", "./derive", "sys"]
[lib]
crate-type = ["staticlib", "rlib"]
@ -68,6 +68,7 @@ hex = "~0.4.3"
time = "~0.3.36"
suricata-derive = { path = "./derive", version = "@PACKAGE_VERSION@" }
suricata-sys = { path = "./sys", version = "@PACKAGE_VERSION@" }
suricata-lua-sys = { version = "0.1.0-alpha.6" }

@ -1,10 +1,14 @@
SUBDIRS = sys
EXTRA_DIST = src derive \
.cargo/config.toml.in \
cbindgen.toml \
dist/rust-bindings.h \
vendor \
Cargo.toml Cargo.lock \
derive/Cargo.toml
derive/Cargo.toml \
sys \
sys/Cargo.toml
if !DEBUG
RELEASE = --release

@ -0,0 +1,6 @@
[package]
name = "suricata-sys"
version = "@PACKAGE_VERSION@"
edition = "2021"
license = "GPL-2.0-only"
description = "Bindings to Suricata C interface"

@ -0,0 +1,3 @@
EXTRA_DIST = Cargo.toml
all-local: Cargo.toml

@ -0,0 +1,16 @@
/* Copyright (C) 2025 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
Loading…
Cancel
Save