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

Dynamic alprotos : make SNMP totally dynamic v6 #12470

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

catenacyber
Copy link
Contributor

Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/5053

Describe changes:

  • detect: fix overflow for files protocol as reported by coverity
  • snmp: register protocol dynamically, to do so :
    • make some arrays even more dynamic
    • add an helper function AppProtoNewProtoFromString
    • have plugins be able to log flow or packet direction (update SC_PLUGIN_API_VERSION)

#12420 with needed rebase and additional commit to restrict visibility : only rs_register_snmp_parser is pub and no_mangle

CID 1640392

Would happen only if we reached 15 protocols handling files
Ticket: 5053

Do not asume that we know the number of alprotos at the end
of AppLayerNamesSetup, but make arrays allocated by later
AppLayerProtoDetectSetup dynamic so that it can be reallocated
from AppLayerParserRegisterProtocolParsers

This helps have a single entry point for a protocol like SNMP
So that we do not have to know g_alproto_max to register
dynamically a new protocol from its name
Ticket: 5053

Move enum OutputJsonLogDirection and struct
EveJsonTxLoggerRegistrationData from C to rust
and cast

and also remove unneeded mut

and rustfmt
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 84.52381% with 13 lines in your changes missing coverage. Please review.

Project coverage is 80.65%. Comparing base (d63ad75) to head (cfc4a8d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12470      +/-   ##
==========================================
+ Coverage   80.52%   80.65%   +0.13%     
==========================================
  Files         923      923              
  Lines      259176   259214      +38     
==========================================
+ Hits       208708   209080     +372     
+ Misses      50468    50134     -334     
Flag Coverage Δ
fuzzcorpus 56.47% <79.51%> (+0.41%) ⬆️
livemode 19.42% <56.62%> (+<0.01%) ⬆️
pcap 44.24% <75.90%> (+0.04%) ⬆️
suricata-verify 63.34% <85.36%> (+0.01%) ⬆️
unittests 58.47% <56.62%> (+0.02%) ⬆️

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

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 24352

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.

2 participants