Skip to content

Commit 257dbac

Browse files
committed
rust/ffi: stub out a rust ffi crate
This crate is for Rust wrappers around the -sys crate which includes only raw bindings. This is the place to add nice wrappers around those bindings, however it should remain clear of dependencies on the main Suricata core crates. Ticket: OISF#7666
1 parent 1aa706a commit 257dbac

7 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/rust.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@ jobs:
112112
# does not work in other subdirectories for now
113113
- run: cargo fmt --check
114114
working-directory: rust/htp
115+
# The ffi crate is cargo fmt clean.
116+
- run: cargo fmt --check
117+
working-directory: rust/ffi

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,6 +2558,7 @@ AM_CONDITIONAL([BUILD_SHARED_LIBRARY], [test "x$enable_shared" = "xyes"] && [tes
25582558

25592559
AC_CONFIG_FILES(Makefile src/Makefile rust/Makefile rust/Cargo.lock rust/Cargo.toml rust/derive/Cargo.toml rust/.cargo/config.toml)
25602560
AC_CONFIG_FILES(rust/sys/Makefile rust/sys/Cargo.toml)
2561+
AC_CONFIG_FILES(rust/ffi/Makefile rust/ffi/Cargo.toml)
25612562
AC_CONFIG_FILES(rust/suricatactl/Makefile rust/suricatactl/Cargo.toml)
25622563
AC_CONFIG_FILES(rust/suricatasc/Makefile rust/suricatasc/Cargo.toml)
25632564
AC_CONFIG_FILES(rust/htp/Makefile rust/htp/Cargo.toml)

rust/Cargo.lock.in

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ members = [
1313
"suricatactl",
1414
"suricatasc",
1515
"sys",
16+
"ffi",
1617
"htp",
1718
]
1819

rust/ffi/Cargo.toml.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "suricata-ffi"
3+
version = "@PACKAGE_VERSION@"
4+
edition = "2021"
5+
license = "GPL-2.0-only"
6+
description = "Nice wrappers around Suricata C interface"

rust/ffi/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
EXTRA_DIST = Cargo.toml
2+
3+
all-local: Cargo.toml

rust/ffi/src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* Copyright (C) 2026 Open Information Security Foundation
2+
*
3+
* You can copy, redistribute or modify this Program under the terms of
4+
* the GNU General Public License version 2 as published by the Free
5+
* Software Foundation.
6+
*
7+
* This program is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
* GNU General Public License for more details.
11+
*
12+
* You should have received a copy of the GNU General Public License
13+
* version 2 along with this program; if not, write to the Free Software
14+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15+
* 02110-1301, USA.
16+
*/

0 commit comments

Comments
 (0)