Commit Graph

17022 Commits (35d7d77ddb05bc3ba6df6e21e8fe7afe6d8aec1d)
 

Author SHA1 Message Date
Jason Ish 35d7d77ddb threads: refactor TmThreadsSlotPktAcqLoop for user threads
Refactor TmThreadsSlotPktAcqLoop for user provided thread by breaking
out the init and finish code into their own functions.

For user provided threads, Suricata should not "drive" the thread, but
the setup and finish code is the same.

The finish function is exported so it can be called by the user
application when its receive loop or equivalent is done.

Also remove obsolete comment.

Ticket: #7240
4 months ago
Jason Ish 04b29aa8d3 lib: take pointer to LiveDevice, not name
In the library capture example, show how the packet counter can be
updated.

Ticket: #7240
4 months ago
Jason Ish 60860e43ac lib: remove global worker id variable
Update ThreadVars creation in lib mode to have the worker_id provided
by the user.

Ticket: #7240
4 months ago
Jason Ish 201b3a6001 lib: rename threadvars creation function
Also use a proper return type (ThreadVars *).

Ticket: #7240
4 months ago
Jason Ish 5e94be63ce examples/lib: better command line handling
Use the more conventional "--" command line handling to separate the
arguments. The first set will be passed to Suricata, and the args
after "--" will be handled by the example. Currently this is a single
PCAP filename, but will be extended to a list of PCAP filenames.

Also hard code logging to the current directory.

Ticket: #7240
4 months ago
Jason Ish 421e0a2bf9 threads: don't attempt to join threads with an id of 0
Worker threads not created by Suricata, but instead a library user
should not be joined, as Suricata does not have access to their thread
handle, and it may in-fact be an unjoinable thread, such as the main
process.

When the thread ID is 0, assume the thread is "externally" managed,
but still mark is as dead to satisfy Suricata's view of the thread.

Ticket: #7240
4 months ago
Jason Ish 4df33c496e .gitignore: add more files
- the generated binaries for lib examples
- LSP files
- man pages
4 months ago
Jason Ish 4b715a84cf examples: rename lib capture example to custom
To keep the simple example simple, move the lib based capture method
example to its own example.

Ticket: #7240
4 months ago
Angelo Mirabella ee9714e593 libsuricata: add library runmode
Add library source and runmode modules. Reorganized
library example to create a worker thread and replay a pcap
file using the library mode.
No API layer is added at this stage.

Edits by Jason Ish:
- fix guard
- add copyright/license headers

Ticket: #7240
4 months ago
Juliana Fajardini d8c6a56a62 doc/exceptions: change stats counters names
As we've changed them for more search-friendly ones.

Related to
Task #7185
4 months ago
Juliana Fajardini 78b16a9b76 exceptions: move midstream stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185
4 months ago
Juliana Fajardini 9a3b1553cc exceptions: move reassembly memcap stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185
4 months ago
Juliana Fajardini 3e83ae9a5f exceptions: move ssn memcap stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185
4 months ago
Juliana Fajardini 0f81190d2a exceptions: move flow memcap stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185
4 months ago
Juliana Fajardini b4c216a4ba exceptions: move defrag stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185
4 months ago
Juliana Fajardini 6c484064d8 exceptions: move app_layer stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185
4 months ago
Jeff Lucovsky a8b9965f69 output: Add linktype name
Issue: 6954

This commit adds the linktype name to the output stream. The name is
determined from the pcap utility function pcap_datalink_val_to_name
4 months ago
Jeff Lucovsky 462091114e output/datalink: Use Rust-based linktype hashmap
Use the hasmap to gather linktype display names.

Issue: 6954
4 months ago
Jeff Lucovsky 8e373e46a3 decode/datalink: Add datalink value/name logic
Issue: 6954

Add Rust based logic that maintains a hash map of link type values and
their associated output names.
4 months ago
Jason Ish 6c57d85ecb github-ci: use git cli command for netmap instead of action
This action hits API limits often, however our other uses of git clone
do not seem to, so try use git clone here instead of the github
action.
4 months ago
Jason Ish bfd6c29f5a detect: SC prefix for extern pub Rust functions
Ticket: #7498
4 months ago
Jason Ish 27fd2fe74b snmp: rust naming and visibility cleanups
Ticket: #7498
4 months ago
Lukas Sismis 9272fd9d98 dpdk: adjust auto mempool calculation when no TX queues set 4 months ago
Lukas Sismis 4f2ce17dc5 dpdk: allow zero TX queues when running in IDS mode
When running in non-forwarding (IDS) mode, it is not required
to create TX queues for the interface.
This can be acheived by setting tx-descriptors configuration
field to 0.

Ticket: 7633
4 months ago
Lukas Sismis 1be1c65b6e docs: double quote technical terms in DPDK section 4 months ago
Lukas Sismis e6811c51c6 dpdk: NULL freed variables
The DPDKDeviceResourcesDeinit function now accepts second-level
reference to NULL the provided variable after deinitialization..
4 months ago
Lukas Sismis fbe5ce7a2b dpdk: document vlan stripping offload
Ticket: 5838
4 months ago
Lukas Sismis 640d0985c2 dpdk: check for link up before full startup
ICE card (Intel E810) was not receiving packets immediatelly
after startup, Suricata workers would act as processing while
it was not. This eliminates the problem by only continuing
in the initialization if the link is already up.

The setting can be turned off manually from the configuraiton
file.

Ticket: 7381
4 months ago
Lukas Sismis 31fbfc322c dpdk: use default iface-copy value if not specified
Ticket: 7374
4 months ago
Lukas Sismis cb997a64dc dpdk: replace global with per-thread mempools
It turned out that having global (interface-specific) mempool
that is shared by the threads of the interface is slower than
having individual mempools per queue for each interface.

The commit brings this change and should be user-invisible,
the config setting remains still as a number of objects of
all mempools summed (of that interface).

Ticket: 7382
4 months ago
Lukas Sismis 5e2974458d dpdk: remove mempool pointer from the thread structure 4 months ago
Lukas Sismis 2ef2a9e26f dpdk: auto configure Rx/Tx descriptors and mempool size
Ticket: 7380
Ticket: 7373
4 months ago
Philippe Antoine 3a092f3027 detect: allow rule which need both directions to match
Ticket: 5665

This is done with `alert ip any any => any any`
The => operator means that we will need both directions
4 months ago
Jason Ish 81915548de ndpi: ignore packets that have a different proto than the flow
This can happen when the flow is UDP, but an ICMP unreachable is
returned, which gets assigned to the same flow.

Reference: https://github.com/ntop/nDPI/issues/2762
4 months ago
Jason Ish 66eb29affd doc/ndpi: move ndpi docs to new plugins section
Moves the nDPI documentation to an nDPI page in the plugins
section. Remove the duplication of installation and setup
documentation.

Includes some minor cleanups.
4 months ago
Jason Ish 10ed6280ff ndpi: fix memory in keyword setup
- remove duplicate calls to ndpi_init_detection_module
- cleanup ndpi_init_detection_module when no longer needed
4 months ago
Jason Ish d3835bbb11 detect: split new keyword id from registration
Split DetectHelperKeywordRegister into 2 functions, one for acquiring
a new keyword ID, and another to perform the registration.

This makes it easier to do the traditional C keyword initialization
with a dynamic ID.
4 months ago
Jason Ish 9c522a0ac9 eve/schema: add top level ndpi object
The format is left free-form, as its controled by a plugin.
4 months ago
Jason Ish 078b7a4251 github-ci: add ndpi build to the centos-stream9 build
- Download and build nDPI
- Enable nDPI during Suricata ./configure
- Test that the plugin was built and installed
4 months ago
Alfredo Cardigliano dfd9ef5784 ndpi: initial implementation of nDPI plugin
Ticket: #7231
4 months ago
Alice Akaki ce2e7aed74 detect: add email.date keyword
email.date matches on MIME EMAIL DATE
This keyword maps to the EVE field email.date
It is a sticky buffer
Supports prefiltering

Ticket: #7591
4 months ago
Alice Akaki 7750129c65 mime/email: log date and subject fields 4 months ago
Victor Julien 834378ff88 detect: per tx detect flags to a u8 progress value
Reduce per tx space for tracking detection/prefilter progress. Instead
of a per direction u64 of flags, where each bit reflected a progress
value, use a simple u8 to track the linear progression through the
progress values. Use an offset to allow 0 to mean no value.

Add flags field as well to track "skip detect" and "inspect complete".
4 months ago
Victor Julien 1542bcdc67 app-layer: add helper for AppLayerTxData cleanup 4 months ago
Victor Julien 8c9dfafc6d doc/tls: add more detail on tls.random 4 months ago
Victor Julien 682f1aac84 detect: reorder struct 4 months ago
Lukas Sismis 4a20baa6a8 landlock: add read/write permission to MPM cache directory 4 months ago
Lukas Sismis 7dc65c2f8a hyperscan: add caching mechanism for hyperscan contexts
Cache Hyperscan serialized databases to disk to prevent compilation
of the same databases when Suricata is run again with the same
ruleset.
Hyperscan binary files are stored per rulegroup in the designated
folder, by default in the cached library folder.
Since caching is per signature group heads,
some chunk of the ruleset can change and it still can reuse part of
the unchanged signature groups.

Loading *fresh* ET Open ruleset:  19 seconds
Loading *cached* ET Open ruleset: 07 seconds

Ticket: 7170
4 months ago
Lukas Sismis 59c3b8912b util-mpm: prepare MPM codebase for ruleset caching 4 months ago
Lukas Sismis 65cfc6d926 util-mpm-hs: refactor Hyperscan Pattern DB initialization to smaller functions 4 months ago