Ethereal-dev: Re: [Ethereal-dev] Autogenerating the Code for the DOCSIS TLV dissector

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

From: Richard Sharpe <rsharpe@xxxxxxxxxx>
Date: Wed, 17 Jul 2002 02:42:47 +0930 (CST)
On Tue, 16 Jul 2002, Anand V. Narwani wrote:

> Folks,
> After talking to others regarding this, I think there may be some value in 
> coming up with some mechanism to automagically generate the dissector for 
> DOCSIS Appendix C Type/Length/Value fields.
> One mechanism that was suggested was to use an XML document to describe the 
> fields and then generate the code based on that. Another suggestion was to 
> read the XML document at runtime.  I prefer the former solution as it 
> appears that libxml2 may not exist on all platforms (Someone, please 
> correct me if I'm mistaken).
> My questions are as follows:
> 1.  Does this sound like a reasonable solution?  Can anyone provide a 
> better one?

This sounds like a very good approach. I started down this road for 
something else (SMB) a while ago, but never finished it :-(

> 2.  Does anyone know if an XML parser is available by default in Perl or 
> Python ?  My concern is for users who attempt to build this without Perl or 
> Python on their system.  I suppose we could distribute the generated C 
> files just like we do for the generated C files for Lex/Yacc.

There is one, but, it is not, I believe, part of standard Perl libs. 

Regards
-----
Richard Sharpe, rsharpe@xxxxxxxxxx, rsharpe@xxxxxxxxx, 
sharpe@xxxxxxxxxxxx