Commit graph

50 commits

Author SHA1 Message Date
Philippe Antoine
58a71d94b0 rust/ffi: move conf_get helper to ffi crate
Ticket: 7666
2026-04-13 05:01:54 +00:00
Philippe Antoine
c53b9df5a2 rust/ffi: move detection helpers to ffi crate
Some checks failed
builds / Fedora (non-root, debug, clang, asan, wshadow, rust-strict, no-ja) (push) Has been cancelled
builds / AlmaLinux 9 (no jansson) (push) Has been cancelled
builds / AlmaLinux 9 (Minimal/Recommended Build) (push) Has been cancelled
builds / Ubuntu 24.04 (cocci) (push) Has been cancelled
builds / Ubuntu 24.04 (RUSTC+CARGO vars) (push) Has been cancelled
builds / Ubuntu 24.04 (unittests coverage) (push) Has been cancelled
builds / Ubuntu 24.04 (unix socket mode coverage) (push) Has been cancelled
builds / Ubuntu 24.04 (afpacket and dpdk coverage) (push) Has been cancelled
builds / Ubuntu 24.04 (pcap unix socket ASAN) (push) Has been cancelled
builds / Ubuntu 24.04 (afpacket IPS tests in namespaces) (push) Has been cancelled
builds / Ubuntu 24.04 (afpacket and dpdk live tests with ASAN) (push) Has been cancelled
builds / Ubuntu 24.04 (fuzz corpus coverage) (push) Has been cancelled
builds / Ubuntu 20.04 (-DNDEBUG) (push) Has been cancelled
builds / Ubuntu 20.04 (unsupported rust) (push) Has been cancelled
builds / Ubuntu 22.04 (Debug Validation) (push) Has been cancelled
builds / Ubuntu 22.04 (Fuzz) (push) Has been cancelled
builds / Ubuntu 22.04 (Netmap build) (push) Has been cancelled
builds / Ubuntu 22.04 (Minimal/Recommended Build) (push) Has been cancelled
builds / Ubuntu 22.04 (DPDK Build) (push) Has been cancelled
builds / Debian 12 (xdp) (push) Has been cancelled
builds / Debian 13 (xdp) (push) Has been cancelled
builds / Ubuntu 22.04 Dist Builder (push) Has been cancelled
builds / Debian 12 MSRV (push) Has been cancelled
builds / Debian 11 (push) Has been cancelled
builds / MacOS Latest (push) Has been cancelled
builds / Windows MSYS2 MINGW64 (NPcap) (push) Has been cancelled
builds / Windows MSYS2 MINGW64 (libpcap) (push) Has been cancelled
builds / Windows MSYS2 UCRT64 (libpcap) (push) Has been cancelled
builds / Windows MSYS2 MINGW64 (WinDivert) (push) Has been cancelled
builds / PF_RING (push) Has been cancelled
Ticket: 7666
2026-04-01 19:55:48 +00:00
Philippe Antoine
f61247e846 plugin: remove one small suricata crate dependency 2026-03-26 19:23:02 +00:00
Philippe Antoine
267c3baff7 rust/ffi: move STREAM_ constants to ffi crate
Ticket: 7666

reexport them in suricata crate
cbindgen them to C
2026-03-26 19:23:02 +00:00
Philippe Antoine
d77c43c79b rust/ffi: move build_slice macro to ffi crate
Ticket: 7666
2026-03-06 21:30:44 +00:00
Philippe Antoine
4a0143c8d4 rust/ffi: move cast_pointer macro to ffi crate
Ticket: 7666
2026-03-06 21:30:44 +00:00
Philippe Antoine
71b59f6dbe rust/ffi: move IPPROTO_TCP to ffi
and reexport in suricata

Allows to reduce dependencies to full suricata crate

Ticket: 7666
2026-02-24 05:56:40 +00:00
Philippe Antoine
2a90cef318 plugin: reduce dependency on suricata crate
Ticket: 7666

The end goal is to remove all dependencies on suricata and just
use suricata_sys or suricata_ffi

For now, make usage of what is already available
2026-02-24 05:56:40 +00:00
Jason Ish
d230a760e6 examples/altemplate: update to use jsonbuilder from ffi crate
Some checks failed
builds / AlmaLinux 9 (no jansson) (push) Has been cancelled
builds / AlmaLinux 9 (Minimal/Recommended Build) (push) Has been cancelled
builds / Ubuntu 24.04 (cocci) (push) Has been cancelled
builds / Ubuntu 24.04 (RUSTC+CARGO vars) (push) Has been cancelled
builds / Ubuntu 24.04 (unittests coverage) (push) Has been cancelled
builds / Ubuntu 22.04 (unix socket mode coverage) (push) Has been cancelled
builds / Ubuntu 22.04 (afpacket and dpdk coverage) (push) Has been cancelled
builds / Ubuntu 24.04 (pcap unix socket ASAN) (push) Has been cancelled
builds / Ubuntu 24.04 (afpacket IPS tests in namespaces) (push) Has been cancelled
builds / Ubuntu 24.04 (afpacket and dpdk live tests with ASAN) (push) Has been cancelled
builds / Ubuntu 22.04 (fuzz corpus coverage) (push) Has been cancelled
builds / Ubuntu 20.04 (-DNDEBUG) (push) Has been cancelled
builds / Ubuntu 20.04 (unsupported rust) (push) Has been cancelled
builds / Ubuntu 22.04 (Debug Validation) (push) Has been cancelled
builds / Ubuntu 22.04 (Fuzz) (push) Has been cancelled
builds / Ubuntu 22.04 (Netmap build) (push) Has been cancelled
builds / Ubuntu 22.04 (Minimal/Recommended Build) (push) Has been cancelled
builds / Ubuntu 22.04 (DPDK Build) (push) Has been cancelled
builds / Debian 12 (xdp) (push) Has been cancelled
builds / Debian 13 (xdp) (push) Has been cancelled
builds / Ubuntu 22.04 Dist Builder (push) Has been cancelled
builds / Debian 12 MSRV (push) Has been cancelled
builds / Debian 11 (push) Has been cancelled
builds / MacOS Latest (push) Has been cancelled
builds / Windows MSYS2 MINGW64 (NPcap) (push) Has been cancelled
builds / Windows MSYS2 MINGW64 (libpcap) (push) Has been cancelled
builds / Windows MSYS2 UCRT64 (libpcap) (push) Has been cancelled
builds / Windows MSYS2 MINGW64 (WinDivert) (push) Has been cancelled
builds / PF_RING (push) Has been cancelled
docs / Ubuntu 22.04 Dist Builder (push) Has been cancelled
2026-02-13 13:34:27 +00:00
Jason Ish
f79158ae55 rust/sys: generate jsonbuilder bindings in sys
Bindgen the Rust bindings to the C JsonBuilder API along with the rest
of the Rust bindings to C. Breaking it out was probably the wrong
idea.

This should make it easier, and more correct to bindgen C functions
that use SCJsonBuilder types.
2026-02-13 13:34:27 +00:00
Jason Ish
8e3bd1ca55 examples/altemplate: use suricata-ffi for logging macros 2026-02-13 13:34:26 +00:00
Philippe Antoine
364d2c077d rust: bindgen SCAppLayerRegisterParser
Ticket: 7662
2026-02-05 21:11:16 +00:00
Philippe Antoine
c960b7d7c1 app-layer: AppLayerParserFPtr uses a mut pointer to local storage
So, fix the fn prototype in rust ParseFn
2026-01-16 21:07:38 +00:00
Philippe Antoine
455b7d1b3b rust: use snake case for applayer_register_protocol_detection 2025-12-11 04:30:43 +00:00
Victor Julien
46203de0e9 doc: adjust for master to main rename 2025-09-16 17:20:56 +02:00
Philippe Antoine
6dbc421825 rust: bindgen AppLayerParserConfParserEnabled
Ticket: 7667
2025-06-10 22:13:53 +02:00
Philippe Antoine
49b2a2be5d rust: bindgen SCAppLayerParserRegisterLogger
Ticket: 7667
2025-06-10 22:13:53 +02:00
Philippe Antoine
b29d46d81f rust: bindgen SCAppLayerParserStateIssetFlag
Ticket: 7667
2025-06-10 22:13:53 +02:00
Jason Ish
25e32f4f7a output: delayed initialization for custom loggers
When a plugin is first initialized, it is too early to register
transaction loggers. Instead, a plugin can register a callback to be
called when Suricata is ready for outputs like transaction loggers to
be registered.

Likewise for library users, there is a window in SuricataInit where
transaction loggers can be registered that library users don't have
access to. So a lifecycle callback useful here as well.

Ticket #7236
2025-06-07 10:36:46 +02:00
Philippe Antoine
7bb0c94ae9 rust: bindgen app-layer-detect-proto.h
Ticket: 7667
2025-06-05 19:14:33 +02:00
Philippe Antoine
f2e7309bbb rust: use bindgened Flow definition
Ticket: 7667
2025-05-27 21:43:50 +02:00
Philippe Antoine
78034b218d rust: bindgen SCDetectSignatureSetAppProto
Ticket: 7667
2025-05-21 09:37:22 +02:00
Philippe Antoine
dc20129195 rust: bindgen SCDetectHelperBufferMpmRegister
Ticket: 7667
2025-05-16 21:33:55 +02:00
Philippe Antoine
e2603fa820 detect/single-buf: new simple wrapper
Introduce DetectGetSingleData which does the generic wrapping,
including the transforms, using a new callback prototype
DetectTxGetBufferPtr

The goal is to replace most InspectionBufferGetDataPtr.
For this commit, we do not change every callback to keep the
change relatively small.

Focus here is to remove DetectHelperGetData as its functionality is
provided more directly by the new DetectTxGetBufferPtr.
2025-05-16 21:33:55 +02:00
Jason Ish
14864d49ac examples/altemplate: remove rs_ naming 2025-05-05 21:41:03 +02:00
Philippe Antoine
033e0480cf detect/single-buf: helper with more explicit direction 2025-04-28 20:06:09 +02:00
Philippe Antoine
dadf9012fc rust: bindgen detect-engine-buffer.h
Ticket: 7667

And prefix SCDetectBufferSetActiveList to be exported

Allows less use of suricata crate in plugin as we get the functions
prototypes from suricata_sys and they are more correct.
2025-04-28 20:06:08 +02:00
Philippe Antoine
a6392ac5d4 rust: use pure rust helper for registering sticky buffers
Mark sdp and sip keywords with flags SIGMATCH_INFO_STICKY_BUFFER
as a side effect.
2025-04-22 22:43:03 +02:00
Philippe Antoine
9c8ec0d3a9 plugin: applayer: do not use suricata JsonError
We do not need a specific error type
2025-04-22 22:43:03 +02:00
Philippe Antoine
96afdce283 detect: rename SCSigTableElmt to SCSigTableAppLiteElmt 2025-04-19 18:20:02 +02:00
Philippe Antoine
5e87b6bd51 plugin: add in-tree app-layer template plugin for testing
Ticket: 7151
Ticket: 7152
Ticket: 7154
2025-04-07 15:25:04 -06:00
Jason Ish
22b77b0c56 conf: prefix conf API with SC 2025-04-01 21:11:14 +02:00
Jason Ish
461e9110b6 examples/lib: use packet setter functions
Instead of direct field access.

Ticket: #7240
2025-04-01 10:17:05 +02:00
Philippe Antoine
c164cfcf6b plugins: check version for all plugins 2025-03-29 06:38:00 +01:00
Jason Ish
83b1e40028 examples/plugin: update to find generated rust header
Needed for changes to output-eve.h.
2024-11-13 10:53:59 +01:00
Jason Ish
1f63e7b7c0 examples: add tx logger to custom logger example
However, its disabled due to issue
https://redmine.openinfosecfoundation.org/issues/7236.

Ticket: #7227
2024-08-31 10:53:59 +02:00
Jason Ish
a2779ac916 output-flow: rename register function and document
Rename OutputRegisterFlowLogger to SCOutputRegisterFlowLogger and
document in the header file.

Mark other functions in the header file as part of the internal API.

Ticket: #7227
2024-08-31 10:53:59 +02:00
Jason Ish
7b4271c309 output-packet: rename register function and document
Rename OutputRegisterPacketLogger to SCOutputRegisterPacketLogger as
its part of the public API and document its parameters.

Comment on the other functions in the header that they are part of the
internal API.

Ticket: #7227
2024-08-31 10:53:59 +02:00
Jason Ish
8735c02995 packet-logger: remove ThreadExitPrintStats
The ThreadExitPrintStats callback was never being used, remove.

Ticket: #7227
2024-08-31 10:53:59 +02:00
Jason Ish
cdcb395142 examples: add custom logging plugin
Add an example custom logger that hooks into the low level packet and
flow logging callbacks.

Ticket: #7227
2024-08-31 10:53:59 +02:00
Jason Ish
1173bb788e .gitignore: globally ignore .la files
With automake and libraries, these files are creeping in.
2024-07-15 14:25:34 +02:00
Jason Ish
02b019d071 examples/capture: fix the slot
Use slot->slot_next, not the slot as passed in.
2024-03-25 17:36:29 +01:00
Jason Ish
a3354e55e6 eve/filetypes: use more const 2024-03-16 09:29:34 +01:00
Jason Ish
eee9757dba eve/filetype: ThreadDeinit can return void
Change ThreadDeinit to return void instead of an int, there is nothing
to be done on success or failure.
2024-03-16 09:29:34 +01:00
Jason Ish
bd55cd4c55 eve/filetypes: common init for threaded and non-threaded
In 7.0 if EVE was non-threaded, the ThreadInit for the filetype was
not called meaning that the filetype author had to handle the threaded
and non-threaded cases.

To simplify this, if non-threaded, still call ThreadInit (and
ThreadDeinit) once with a thread_id of 0. This should simplify
authoring EVE filetype plugins.
2024-03-16 09:29:34 +01:00
Jason Ish
ead09c2497 eve/filetypes: remove from plugin context
Remove EVE filetypes from plugin context as they are not only used
from plugins. Plugins allow user code to register filetypes, but we
also have internal file types that use this api including the null
output and syslog.  Additionally library users can use this API to
register filetypes, and they are not plugins.

Ideally this code would go in "output-json.[ch]" as the "primary" eve
API, however there are currently some include circular include issues
there, so start new cleaned up EVE API in "output-eve.[ch]" which is
"clean" with respect to includes, and as we cleanup existing EVE API for
"public" use, it can be moved here.

Ticket: #6838
2024-03-16 09:29:34 +01:00
Jeff Lucovsky
3bf92bb14f example/plugin: Use ThreadId 2024-03-16 09:29:34 +01:00
Jason Ish
0dc3de332a examples: minimal example capture plugin for ci
Create a mininal capture plugin that injects one packet. While it can
also be a template, we should be able to run this in CI to test the
loading and registration of the capture plugin mechanisms.
2024-03-02 11:40:18 +01:00
Jason Ish
6d792f017b examples/plugin: simplify Makefile
Simplify the Makefile by avoiding automake and providing our own
Makefile.in that is suitable for in-tree builds of the plugin and can
also serve as an example for standalone plugins.

But the bigger benefit of this is to allow building the example plugin
even with --disable-shared provided to configure, as this is just a
phony limitation imposed by automake/libtool.
2024-02-20 13:51:25 +01:00
Jason Ish
d2b25af3f4 examples: add an example plugin of an eve filetype
This is an example of what adding plugin examples to the Suricata repo
could look like.

This plugin is an example plugin for an EVE filetype. It could be
extended to support outputs like Redis, syslog, etc.

There is one issue with adding plugins like this to an autotools
project, the project can't be built with --disable-shared, which is
more of an autotools limitation, and not really a Suricata issue.
Suricata built with --disable-shared will load plugins just fine.

Note that the examples directory was added as DIST_SUBDIRS as we don't
want normal builds to recurse into it and attempt to build the plugin,
its just an example, but we still need to keep distcheck happy.
2023-11-17 22:24:17 +01:00