Wireshark-dev: Re: [Wireshark-dev] How can I use preferences from other dissectors?
Alex Lindberg wrote:
I am building a heuristic dissector that shares a common tcp port used
by other dissectors. This same port is used in my dissector and thus
must be checked as part of the heuristic testing. This port can be
changed in other modules. Is there a method to read the configuration
data from another module into my dissector?
Sure: make the variable non-static and import it into your dissector.
(This assumes you can/don't mind modifying the other dissectors.) For
example, the "mtp3_standard" preference variable is used by quite a few
different dissectors.
(Also: this might not work--at least easily--if you're doing it in a
plugin on Windows.)