Wireshark-dev: Re: [Wireshark-dev] hadoop dissector

From: Evan Huus <eapache@xxxxxxxxx>
Date: Fri, 3 Jul 2015 17:26:28 -0400
On Fri, Jul 3, 2015 at 11:53 AM, Helge <Helge.Kruse@xxxxxxx> wrote:
> Am Fri, 3 Jul 2015 11:26:08 +0200
> schrieb Pascal Quantin <pascal.quantin@xxxxxxxxx>:
>
>> if could go into the master:
>> >
>> > 1) it is written in c++. Would it be acceptable?
>>
>> No for now we are not accepting any C++ dissector.
>>
>> > 2) it uses stl maps. Would it be acceptable or should it be
>> > replaced by
>> some "wmem maps" (maps with custom allocator)?
>>
>> It should be replaced by wmem maps, like all the other C++ code ;)
>>
>
> Well, there may be some rules for dissectors that shall be added the
> the Wireshark master branch. But I just want to note that I wrote all
> of my dissectors "in the wild" (except the first one) in C++.
> Especially the allocators one must be careful and consider the live
> time of the objects. But as long as you build maps at the load time you
> can use the standard allocators.
>
> C++ provides so many features that it would be a waste of time to
> mimic all of them in C.

It's worth noting that wmem is not a replacement for the C++ std
library and allocators, it works somewhat differently due to the
lifetimes that occur naturally in Wireshark (e.g. per-packet lifetime,
etc) and the way exceptions are handled internally to wireshark. We
would need something like wmem in order to avoid memory leaks, even if
we were to write all our dissectors in C++.

> Probably my dissectors won't get to the
> Wireshark master source code. But I can live with my plug-ins. Some of
> them implement a proprietary protocol anyway.
>
> Best regards
> Helge
>
> --
> GnuPG fingerprint: EDCE F8C8 B727 6CC5 7006  05C1 BD3F EADC 8922 1F61
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    https://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>              mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe