Commit Graph

11462 Commits (665328b29ef87468433bc215c2ae0d8768a98a41)
 

Author SHA1 Message Date
Jason Ish 665328b29e plugins: require registration function SCPluginRegister
Instead of looking for a symbol, "PluginSpec" look for a function
named SCPluginRegister that returns a SCPlugin.

This makes it much easier to create Rust plugins without having
to deal with dlopen constructors and such, which is rather
straight forward in C, but a bit of advanced boilerplate in Rust
that can be eliminated by simply calling a registration function.
5 years ago
Jason Ish 647e304f4b rust/log: minor cleanup
Group functions for setting and getting the log level
together.
5 years ago
Jason Ish ea1338b464 rust: function macro now returns the function name
Borrow a macro from https://github.com/popzxc/stdext-rs that
will give us the Rust function name in SCLog messages in Rust.

As this trick only works on Rust 1.38 and newer, keep the old
macro around and set a feature based on a Rust version test
done during ./configure.
5 years ago
Jason Ish bac8016d17 rust: plugin bootstrap function
Functions written in Rust will need to suricata::plugin::init()
to bootstrap themselves. This bootstrap process sets the log level
within the Rust address space, and hooks up function pointers
that are expected to be set during normal runs of Suricata.
5 years ago
Jason Ish 3de98b3595 rust/log: set the log level with a pure Rust function
Make sure the log level is setup with a pure Rust function, so
when it is set, its set within the address space of the caller.

This is important for Rust plugins where the Rust modules are not
in the address space of the Suricata main process.
5 years ago
Jason Ish 335e4e728f suricata: expose the SuricataContext with a function
Expose the "SuricataContext" required by Rust as a function. During
normal startup we register this context with the Rust code, but
plugins written in Rust will need to get the same registration
done, but to do this in a plugin, the plugin code must
call and set the context within its address space.
5 years ago
Jason Ish 87a91e6aa8 logging: expose the log level with a function
The log level needs to exposed so Rust plugins can bootstrap
themselves with the correct login to SCLogNotice!(), etc work
as expected.
5 years ago
Jason Ish ac93ab281d rust/logging: allow log macros to be used by plugins
Fix plugin macros so they can be used by external Rust crates
such as plugins.
5 years ago
Jason Ish 3672cea876 rust/Cargo: build as rlib for plugin linkage
Build Rust code as an rlib, in addition to a staticlib so plugins
can link with the Rust code.
5 years ago
Jason Ish 17776e098e rust-context: remove unused opaque type Store 5 years ago
Joshua Lumb 6dbc6d6669 runmodes: memory leak on runmode single 5 years ago
Jason Ish da3930e488 configure: fix test for rust headers for cross compile
Use "if test ..." instead of AC_CHECK_FILES which does not work
when cross compiling.
5 years ago
Jeff Lucovsky 5c725d5050 config/lua: Cross-compiling support
This commit guards the run-time check for a Lua integer so that it no
longer attempts execution in a cross-compilation environment.
5 years ago
Jeff Lucovsky 3e8db21ef3 config/pcre: Improved support for cross-compiling
This commit changes the logic used to determine if pcre_jit_exec is
available from a run-time to a compile-time check.
5 years ago
Jeff Lucovsky ff29345527 output: Remove unused output functions
This commit removes registration, initialization, and de-initialization
functions no longer needed
5 years ago
Jeff Lucovsky 15caf3eea5 log: Remove standalone output registration
Remove standalone output logger registration since eve is
multi-instance.
5 years ago
jason taylor b21160a6e3 doc: http.host keyword note for matching on port
Signed-off-by: jason taylor <jtfas90@gmail.com>
5 years ago
Victor Julien 703de67086 flow: fix multi-manager hash range calculation 5 years ago
Jason Ish 3a3a9e135a github-ci: fix building against request libhtp/sv PR
The variable name was wrong, causing the libhtp-pr and sv-pr
parameters in the commit message to not be applied.
5 years ago
Victor Julien 260a20bf91 flow: suppress noisy messages 5 years ago
Philippe Antoine b20a8de646 dns: simply skips zero-sized dns requests/responses 5 years ago
Philippe Antoine c06d8f2463 dcerpc: validate signature with dcerpc keywords
so that they do not use another protocol's keywords
5 years ago
Philippe Antoine d509a78074 http: handles gaps
ie data=NULL and len>0 from libhtp callbacks
5 years ago
Victor Julien 23c0efa2ec flowbits: convert flowbits dumping to json builder 5 years ago
Victor Julien 7facf5785f detect/analyzer: convert to jsonbuilder 5 years ago
Roland Fischer 9f1e49e863 ci: Run formatting check on pull request 5 years ago
Roland Fischer 69ed6f253f util: Add clang-format helper script 5 years ago
Roland Fischer de7c7eeff0 doc: Add dev code-style 5 years ago
Roland Fischer ce7440e296 common: Add clang-format file
clang-format allows to auto-format C code. The settings here are set
up to follow the code style, see
https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Coding_Style.
5 years ago
Victor Julien d3cf2c21df threshold: fix potential memory leak 5 years ago
Victor Julien 6444f738af reject: minor code cleanup
Use enum for direction to assist compiler.
5 years ago
Victor Julien b6fed6d431 stream: fix GAP size
Fix GAPs sizes sometimes exceeding the ACK'd data size.
5 years ago
Victor Julien 6978d8dac6 stream: fix deinit after incomplete init 5 years ago
Victor Julien a015a31073 output/flow: fix deinit after incomplete init 5 years ago
Victor Julien c39101bbec nfq: suppress debug message using info level 5 years ago
Victor Julien 797a128256 plugins: suppress coverity toctou warning 5 years ago
Victor Julien bd68bd5037 flow: work around harmless coverity warnings 5 years ago
Victor Julien 29148fb563 flow: fix spare sync incomplete counter 5 years ago
Victor Julien 50c7b0d1c3 reject: work around coverity warning 5 years ago
Vadym Malakhatko 65455208a5 plugin: fix typo in long_opts struct 5 years ago
Ilya Bakhtin c903441fe7 mqtt: fixed wrong slice access
Slice access esults in rust panic when mqtt ping is processed
5 years ago
Jeff Lucovsky cc93638d33 napatech: Style -- remove extra space 5 years ago
Jeff Lucovsky 67529bd25a napatech: Use proper parser for type
This commit uses the proper parser call for the value being parsed.
5 years ago
Jeff Lucovsky 45b055aca5 napatech: Improve configuration range handling
This commit corrects issues parsing ranges from the Napatech section of
the configuration file.
5 years ago
Jeff Lucovsky c408b15c51 napatech: Fix compiler issues w/out bypass
This commit fixes compiler errors when Napatech bypass is not configured
5 years ago
Carl Smith 81d7a7aa82 threshold: Change rule parsing to use pcre_copy_substring
Fixes memory leak when parsing threshold rules.
All parsed strings are less than 16 characters except
for the IP address which could be up to 48 characters.
Remove redefinition of MAX_SUBSTRINGS
5 years ago
Jason Ish fbc9da450d configure: fix detection of netfilter_queue with older headers
Define _GNU_SOURCE and include sys/types.h so older
netfilter_queue headers can be detected properly, as they are
using u_int_xx style integers.
5 years ago
Odin Jenseg 4549505418 doc/userguide: fix outdated xdp info 5 years ago
Jason Ish b8994cdaca plugins: track all loaded plugins in a list
Track the pointer returned from dlopen in a list to prevent a
resource leak by the pointer going out of scope.

Found by Coverity, CID 1465661.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3864
5 years ago
Jason Ish dbb5dcb1dd plugins: use closedir to close open directory (not free)
Found by Coverity, CID 1465665: ALLOC_FREE_MISMATCH.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3864
5 years ago