Wireshark mailing list archives
Re: Registering header fields later/in other functions?
From: Andreas <AndreasSander1 () gmx net>
Date: Tue, 15 Feb 2011 07:14:02 +0100
Am 13.02.2011 18:58, schrieb Thomas Wiens:
Wireshark supports a lot of protocol. If a intrinsic dissectors would be spreader over several source files, this would require some naming scheme to identify what files belong to a protocol. Further with means of the C language you can define private variables like header fields and subtree arrays as static. That requires that the dissector is in one compilation unit.On 2/13/2011 9:36 AM, Andreas wrote:I have dissectors classes that are spreaded over a lot of source files. When Wireshark calls the function plugin_register() of my dissector, all classes' Register() functions are called. So there is no problem with making a dissector modular.This seems to be a good soulution, thanks. Most of the dissectors in the wireshark sources are only in one big file, so there is not much where I can take a look at, which way is the usually one.
Yes, I do. Usually each class dissects one block that can be added as a tree. Since this block is a logical unit it makes sense to handle this in a class. Of course the class has it's own ett member that it initializes with proto_register_subtree_array().Do you register the possible subtree arrays in the same way?
Well you need the proto-id here and there. Therefore my dissector singleton that's called by Wireshark also provides the proto-id.The proto_register_subtree_array() call doesn't need the proto-id. Seems as if I can register a new pointer-array in every file, or not?
-- Andy ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Registering header fields later/in other functions? Thomas Wiens (Feb 12)
- Re: Registering header fields later/in other functions? Andreas (Feb 13)
- Re: Registering header fields later/in other functions? Thomas Wiens (Feb 13)
- Re: Registering header fields later/in other functions? Andreas (Feb 14)
- Re: Registering header fields later/in other functions? Thomas Wiens (Feb 13)
- Re: Registering header fields later/in other functions? Andreas (Feb 13)