-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 v3 #12408
Conversation
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
and cast and also remove unneeded mut and rustfmt
Ticket: 5053
The rust cleanup has its own PR #12409 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12408 +/- ##
==========================================
+ Coverage 80.63% 80.79% +0.15%
==========================================
Files 917 917
Lines 258687 258725 +38
==========================================
+ Hits 208601 209028 +427
+ Misses 50086 49697 -389
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -159,8 +159,7 @@ int SCPluginRegisterAppLayer(SCAppLayerPlugin *plugin) | |||
if (plugin->version != SC_PLUGIN_API_VERSION) { | |||
return 1; | |||
} | |||
AppProto alproto = g_alproto_max; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So with this method not just for plugins now, where would a sensible place be to move it, and rename to something more like SCRegisterAppLayer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SCPluginRegisterAppLayer
is still just for plugins.
Or did you talk about another thing with this method
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm... thought it may have been used by snmp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plugins call SCPluginRegisterAppLayer
which registers the name, pre-register the parser, the logger and the detection, using the logic that was there
Dynamic SNMP only uses the parser registration where it now starts by registering the name, pre-registering the logger and the detection, and does the parser registration as usual
Information: QA ran without warnings. Pipeline 24240 |
Next in #12414 |
Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/5053
Describe changes:
#12406 with clean history and removed the rust cleanups
@jasonish what do you think about commit aa32e81 ?
Already quite a few things going on here, so stopping here before adding the example of a template plugin