Ethereal-dev: Re: [Ethereal-dev] Re: Windows UI

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

From: Chris Waters <chris@xxxxxxxxxxxx>
Date: Mon, 04 Mar 2002 22:05:03 -0800
Hi,

I didn't mean to create a debate on the merits of different UIs. I am
certainly not advocating abandoning, or even replacing the existing GUI. I
strongly agree with the merits of cross platform functionality.

Let me try and return to my original question about making a library version
of Ethereal. I had originally thought that the best approach would be to
create a set of stub functions which translated all internal data structures
and APIs into a set of external functions and APIs. This would save any
program linking with the library from needing to include the large number of
include files used in the Ethereal code. With some experimentation however I
found that I can compile all of the Ethereal headers with Borland C++
Builder directly, so my concern is not really valid (Although needing to
include such a large number of files is still pretty ugly). I also thought
some more about the amount of work required in mapping from the internal
data-structures to the external ones and realized how huge an undertaking it
is.

Now I am working on the approach of simply linking Ethereal in a DLL and
including all header files in an application that uses the DLL. To use the
DLL the application that imports the functions needs __declspec(dllimport)
in each function declaration (at least under Windows it does). This means
going through all Ethereal header files and adding a define like:

#ifdef LIB_ETHEREAL
#define LIB_ETHEREAL_API __declspec(dllexport)
#else
#define LIB_ETHEREAL_API __declspec(dllimport)
#endif

extern LIB_ETHEREAL_API guint16 tvb_get_letohs(tvbuff_t*, gint offset);

to all functions which should be exported. Does anyone know a better way of
doing this? It appears that libtool under cygwin can generate imports
automatically, but I am not sure if this will work with a non-cygwin DLL.

Adding a library define like this would require touching a large number of
header files---would there be a strong opposition to doing it?

Regards,

Chris.


----- Original Message -----
From: "Mike Frisch" <mfrisch@xxxxxxxxxx>
To: <ethereal-dev@xxxxxxxxxxxx>
Sent: Monday, March 04, 2002 4:48 PM
Subject: Re: [Ethereal-dev] Re: Windows UI


> On Mon, Mar 04, 2002 at 07:41:17PM -0500, Ed Warnicke wrote:
> > I am strongly in favor of separating the backend ( epan + dissectors )
> > into a standalone shared library ( dll in windows ) so that the
> > functionality can be used independent of the ethereal applications.
>
> This topic has been already been addressed in this thread and understood
> to be the first step in the process.
>
> > I would also love to see the functionality of the ethereal application
> > abstracted away in a reasonable way from the gui code, so that we can
> > 'bind' the application to multiple interface types (
> > gtk/qt/curses/osX/win32) in a clean way that does not lead to having to
> > replicate a new feature or functionality in many many places.
>
> Any changes would be (theoretically) UI only.  Obviously adding new
> Ethereal core features that need a UI will require migration to other
> platforms.
>
> > We have people doing development on ethereal on a host of different
> > platforms write now.  It all works.  In fact it almost all works in
>
> No argument here.  It works.  It looks like hell on Windows, but it
> works.
>
> Mike.
>
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev@xxxxxxxxxxxx
> http://www.ethereal.com/mailman/listinfo/ethereal-dev
>