Ethereal-dev: Re: [Ethereal-dev] C++ plugins

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Fri, 24 Feb 2006 22:38:05 +0100
Jasim Tariq wrote:
I have written a dissector for Ethereal in C which works fine. My question is that what changes I have to make in in the C dissector file in order to use it as a C++ plugin. I want other classes to be included as well and that is why I want to add it as a C++ plugin. Also what other changes should I make to other files, if there are any, to achieve my target?

First of all, using C++ in a dissector isn't accepted for plugins (and core dissectors) for the official Ethereal sources. If you start to use C++ you can't include it in the official Ethereal sources later. Of course, this may not be your goal, so you may be ok with this restriction. The main reason for this is that the platforms Ethereal supports have quite different C++ dialects, so maintenance for all would be quite cumbersome (other reasons may also exist).

The changes needed basically boils down to the usual steps to mix C and C++, have a look at a good C++ book.

The last time I had to do this is long ago, so no advise from me on this topic :-)

I would only advise to use C++ if you really have to, e.g. if you have a huge code base in C++ to use.

Regards, ULFL