Ethereal-dev: Re: [Ethereal-dev] ASN2ETH compiler patch

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

From: ronnie sahlberg <ronniesahlberg@xxxxxxxxx>
Date: Tue, 5 Oct 2004 18:57:22 +1000
On Tue, 05 Oct 2004 01:33:16 -0700, Guy Harris wrote:
> ronnie sahlberg wrote:
> 
> > Sometime last week I did a binary MEGACO v 2  dissector.
> 
> Is there a way to combine that with the text MEGACO dissector?
> 

Since the binary megaco dissector is autogenerated by asn2eth  
the only way would be either to
1, extend asn2eth to be able to generate output calling a text
encoding equivalent
or packet-ber/per   and to generate a dissector for both.
which would be a lot of work  and maybe more than its worth unless
there are other
protocols using the same text encoding mechanism.
2, merging the existing text dissector into the template for the binary
which would make the existing template HUGE
3, something else



something else might be:
a, massage packet-per and packet-ber to use the exact same signatures
for the helper functions.
b, setup a structure of function pointer that contains function
pointers to the ber or per helper functions.
c, pass this structure to all autogenerated structures and through all
helpers by adding another argument to the signature.
==>
one can then simplify asn2eth and make it ber/per agnostic   behaviour
is completely controlled by whatever function pointer structure passed
to the entry point.

then
d,
create a packet-xxx-text.c that contain helper functions with exactly
the same signatures as for ber/per and create a structure of function
pointers for that text encoding.

==>
asn2eth creates one single dissector,   then depending on which
structure passed to the entry point one controls whether ber/per/text
is used.  and the fields still all have the same filter names 
regardless of which encoding is used.


that would be a LOT of work.



Maybe there would be worth it to do this at least for ber/per?

Tomas, your old/new style of dissector signatures that exists in
asn2eth   is that
a preparation for merging ber/per in a way similar to what i describe above?