Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eve/filetypes: eve filetypes are not always plugins; API docs; simpler - v4 #10636

Closed
wants to merge 12 commits into from

Conversation

jasonish
Copy link
Member

jlucovsky and others added 12 commits March 13, 2024 13:35
Issue: 6408

Use the Suricata thread id for plugin thread initialization to give the
plugin a better correlating factor to the actual Suricata threads.
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: OISF#6838
Remove "conf.h" from suricata-plugin.h as its not needed by that
header. However, some other files became transitively dependent on
through other includes, so fix those up.
EVE filetypes are not always plugins, for example, null and syslog
that are built-in filetypes.
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.
Add documentation for the SCEveFileType in Doxygen format.
Change ThreadDeinit to return void instead of an int, there is nothing
to be done on success or failure.
Add an upgrade section to the devguide. This should cover any changes
to APIs that users might be using from plugins or as a library user.
@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 19329

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 35.52632% with 49 lines in your changes are missing coverage. Please review.

Project coverage is 82.53%. Comparing base (ece2029) to head (b5458ad).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10636      +/-   ##
==========================================
- Coverage   82.68%   82.53%   -0.15%     
==========================================
  Files         925      926       +1     
  Lines      247552   247560       +8     
==========================================
- Hits       204680   204327     -353     
- Misses      42872    43233     +361     
Flag Coverage Δ
fuzzcorpus 63.07% <28.94%> (-0.89%) ⬇️
suricata-verify 61.92% <35.52%> (+0.03%) ⬆️
unittests 62.20% <25.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@victorjulien victorjulien added this to the 8.0 milestone Mar 14, 2024
This was referenced Mar 15, 2024
@victorjulien
Copy link
Member

Merged in #10652, thanks!

@jasonish jasonish deleted the filetypes-not-plugins/v4 branch August 7, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants