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: Guy Harris <gharris@xxxxxxxxx>
Date: Mon, 27 Feb 2006 12:34:45 -0800
Jasim Tariq wrote:

My source code is In C. But I am using some classes defined in C++ in my C sourse code. What changes should I make in in order to do this?

I'm not a C++ expert, so I can't offer much advice here, but the impression I have is that what you'd need to do is to have your C++ code offer C APIs that can be called by the dissector. I *assume* that a pointer to a C++ class instance could be cast to "void *", and a "void *" can be cast to a pointer to such a class, so that you could pass class instance information between C and C++ code; if so, you might have to do that.