Move API for disabling packet analyzers into component.

Before, that API was part of the analyzers themselves, which meant we
couldn't disable a packet analyzer before it had been instantiated.
That's different from protocol/file analyzers, where we disable them
through the corresponding component. The lack of the component-side
API prevented Spicy from replacing packet analyzers at startup.

The reason we had put this into analyzer originally was performance so
that we don't need a component lookup for every packet. This change
keeps that optimization by caching the on/off state in the analyzer
itself as well, but now with the component being the one controlling
it.
This commit is contained in:
Robin Sommer 2022-10-07 13:02:49 +02:00
parent a84d06a2c3
commit b114850283
5 changed files with 44 additions and 19 deletions

View file

@ -1,7 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
PacketDemo::Bar - Demo packet analyzers (RawLayer, LLC). (dynamic, version 1.0.0)
[Packet Analyzer] LLC_Demo (ANALYZER_LLC_DEMO)
[Packet Analyzer] Raw_Layer (ANALYZER_RAW_LAYER)
[Packet Analyzer] LLC_Demo (ANALYZER_LLC_DEMO, enabled)
[Packet Analyzer] Raw_Layer (ANALYZER_RAW_LAYER, enabled)
[Event] raw_layer_message
[Event] llc_demo_message