Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Why isn't libwireshark.def autogenerated?

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 17 Dec 2010 16:49:16 -0800

On Dec 17, 2010, at 3:48 PM, Gregory Seidman wrote:

I would argue that if a function is in a header file in epan or
epan/dissectors, it is part of the public API.

I wouldn't.  Some headers might be used to, for example, tie together a generated lexical analyzer and parser, with both of those being in libwireshark, and with the routines in question only being called from the parser or from the lexical analyzer.

The public API is what the Wireshark core developers define it to be.  We haven't officially defined it yet, but, if we do, Dtd_Parse_lex() is almost certainly not going to be part of it, even if including <epan/dtd_parse_lex.h> declares it.  What would be part of the public API would be the routines declared in epan/dtd.h.  There may be other cases where a routine defined in one part of libwireshark is intended only for use elsewhere in libwireshark, *not* in dissectors or in programs using libwireshark.

Is this a newly-added linker flag?

-export-symbols is a libtool flag - whether it's a recent addition to libtool or not is another matter.  It *is* a recent addition to Wireshark (2010-12-07).

What libtool does with it is linker-dependent; which linkers support a capability atop which it can be implemented, and, for those linkers, when that capability was added is another matter.  Presumably, for linkers that don't support it, libtool just ignores it, or finds some way of removing the symbols from the library after it's built.