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: "Ronnie Sahlberg" <ronnie_sahlberg@xxxxxxxxxxxxxx>
Date: Sat, 29 May 2004 12:35:38 +1000
----- 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. ?