The patches for the H235 dissector and the ASN1 compiler are attached.
Changes in the asn2eth compiler:
- limits for dissect_per_constrained_integer() are passed as unsigned if possible
- new directive NO_EMIT in conformation file - avoids emitting function body (or vals or
both) into packet-xxxx-fn.c file
- new directive USER_DEFINED in conformation file - emitting of function body (or vals
or both) in the packet-xxxx-fn.c file is replaced with external declaration
- support for SET OF type for BER
- flag WITH_VALS is default for EXPORTS, USER_DEFINED, NO_EMIT directives
- the _U_ attribute is used for pinfo parameters
- the offset parameters and return codes are changed from guint32 to int
Changes in the H235:
- unnecessary types are excluded with NO_EMIT directive
Regards,
Tom
Ronnie Sahlberg wrote:
----- Original Message -----
From: "Tomas Kukosa"
Sent: Friday, May 28, 2004 7:23 PM
Subject: Re: [Ethereal-dev] H235 & ASN1 compiler
On Tue, May 25, 2004 at 11:23:54AM -0700, Guy Harris wrote:
../packet-h235.c: In function `dissect_h235_NULL':
../packet-h235.c:556: warning: unused parameter `pinfo'
For that one, the translator could perhaps figure out whether an
argument is used and emit _U_ after it if so - but, as the dissectors
are all machine-generated, and as the argument can't be omitted as a
pointer to that function is used, the translator can probably just emit
_U_ for *all* "pinfo" arguments, and perhaps for *all* arguments.
The argument can be used with user defined code in the dissector function.
What happens if the _U_ is emitted and the parameter is used in the
function?
Hi Tomas.
I think, at least for GCC that nothing bad happens. It will still work even
if you specify _U_ and the
parameter is referenced.
(_U_ only supresses any warnings in case the parameter is unused, it does
not change anything else)
I have also tried to get the acripts to generate X509AF from your earlier
post.
It generates a call to dissect_per_ ... :
static guint32
dissect_x509af_CrossCertificates(gboolean implicit_tag, tvbuff_t *tvb,
guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index) {
offset = dissect_per_set_of_new(tvb, offset, pinfo, tree,
hf_index, item, private_data,
ett_x509af_CrossCertificates,
hf_x509af_CrossCertificates_item, dissect_x509af_Certificate);
return offset;
}
The flags i used to run the compiler were :
/* ../../tools/asn2eth.py -b -X -p x509af -c x509af.cnf -s
packet-x509af-template AuthenticationFramework.asn */
Could you have a look at this? And make it create the proper calls to the
appropriate ber function.
Can you also change the return code, offset to be int and not guint32?
Finally, would it be possible for you to have a quick go at creating X509
and CMS scripts we can check in,
at elast to dissect as much as possible and then we can put whatever can not
be handled by the compiler
as handim,plemented code in the template. ?
Attachment:
asn2eth.py.diff.gz
Description: GNU Zip compressed data
Attachment:
h235.cnf.diff.gz
Description: GNU Zip compressed data