Ethereal-dev: Re: [Ethereal-dev] H235 & ASN1 compiler

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: Tue, 25 May 2004 11:23:54 -0700
On Tue, May 25, 2004 at 04:49:03PM +1000, Ronnie Sahlberg wrote:
> (To get this to work, i had to upgrade python from 1.5 to 2.2     bloody
> bleading edge requirements :-)

What happens with Python 1.5?  Does the ASN.1-to-dissector translator
not work at all?

BTW, is that why the generated source was checked in - so that people
don't need to upgrade Python in order to build from CVS?

> Tomas,   I still get some warnings from packet-h235.h   which is generated
> by your compiler.
> It warns about:
>    const value_string AuthenticationMechanism_vals[];
>    const value_string CryptoToken_vals[];
> 
> Should not these constructs be declared as:
>   const value_string *AuthenticationMechanism_vals;
>   const value_string *CryptoToken_vals;
> in the machine generated header files instead?

No, because they're defined as

	const value_string AuthenticationMechanism_vals[] = {
		...
	};

and

	const value_string CryptoToken_vals[] = {
		...
	};

in "packet-h235.c", so they should be declared as arrays, not pointers.

They should be declared as

	extern const value_string AuthenticationMechanism_vals[];
	extern const value_string CryptoToken_vals[];

which at least appears to squelch the GNU *linker* warning I got about
the size changing.  (I think Joerg Mayer did a bunch of similar changes
for the shared libethereal stuff, so this is more of the same.)

I get a flood of other warnings, many of which are from initializing
members of a "per_sequence_t" array with structures that include a
dissector pointer to a function that returns "guint32", not "int" - the
translator should generate dissectors that return "int", not "guint32",
offset values.

(Unfortunately, this isn't helped by some "guint32" offsets and, I
suspect, offset return values in some of the PER dissection routines.)

The other warnings (I'm assuming all the "initialization from
incompatible pointer type" warnings are due to that problem) are:

../packet-h235.c: In function `dissect_xxx_ToBeSigned':
../packet-h235.c:182: warning: unused parameter `hf_index'

That one might as well remain, as it's a "not decoded yet" item
(dissect_xxx_ToBeSigned).

../packet-h235.c: In function `dissect_h235_TimeStamp':
../packet-h235.c:215: warning: decimal constant is so large that it is unsigned

The constant in question is 4294967295 - it should probably be
4294967295U, instead.

../packet-h235.c: In function `dissect_h235_NULL':
../packet-h235.c:556: warning: unused parameter `pinfo'
../packet-h235.c:530: warning: `dissect_h235_ECGDSASignature' defined but not used
../packet-h235.c:876: warning: `dissect_h235_PwdCertToken' defined but not used
../packet-h235.c:970: warning: `dissect_h235_KeySignedMaterial' defined but not used
../packet-h235.c:986: warning: `dissect_h235_H235CertificateSignature' defined but not used
../packet-h235.c:1002: warning: `dissect_h235_ReturnSig' defined but not used
../packet-h235.c:1016: warning: `dissect_h235_KeySyncMaterial' defined but not used