Ethereal-dev: Re: [Ethereal-dev] Variable redefinition in epan/dissectors/packet-ocsp.c

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

From: Tomas Kukosa <tomas.kukosa@xxxxxxxxxxx>
Date: Mon, 03 Jan 2005 14:03:15 +0100
The change for asn2eth compiler was released.
The default name for value_string table is with protocol prefix.

It can be changed to the old form for exported table with new NO_PROT_PREFIX parameter.
E.g.:

#.EXPORTS
RasMessage	ETH_VAR
FacilityReason	ONLY_VALS ETH_VAR NO_PROT_PREFIX

will generate

ETH_VAR_IMPORT const value_string h225_RasMessage_vals[];
ETH_VAR_IMPORT const value_string FacilityReason_vals[];


When dissector are regenerated it will require to change hardcoded table names.


ronnie sahlberg wrote:

On Fri, 31 Dec 2004 03:35:58 +0100, Joerg Mayer <jmayer@xxxxxxxxx> wrote:

On Wed, Dec 29, 2004 at 02:14:00PM -0600, Albert Chin wrote:

The IBM v6 compiler on AIX 4.3.3 doesn't like it when a variable is
redefined. Version_vals is defined in epan/dissectors/packet-x509af.h:
 extern const value_string Version_vals[];

I just tried to look at it and it's currently over my head how to fix
this properly as:
a) both files (packet-ocsd.c and packet-x509af.h are generated files
b) Their spec files contain variables of the same name.

Ronnie: Would prefixing all static vars with the name of the protocol
(e.g. OCSD) make sense (e.g. Version -> OCSDVersion)? If so, could someone
who knows the asn2eth.py script fix this?
Hmm, maybe prefixing non-static Vars would be useful too??


Yes that would be the best solution,   making sure that all symbols
are prefixed by the protocol name.
This would get rid of a whole bunch of warning messages when compiling
the ASN files due to  x509 and pkix1 both exporting essentially the
same symbols.

So that the variables would then be  ocsd_Version_vals

I am on vacation now and travelling so I wont be able to look into it
until i get back.  Maybe Tomas can look into it?
Such a change to the asn2eth compiler would also likely require all
the asn1/ dissectors to be regenerated  (and those things that break
to be fixed).