Ethereal-dev: [Ethereal-dev] dissector via XML + scripting

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

From: Sergey Lyubka <devnull@xxxxxxxxxxx>
Date: Fri, 12 Dec 2003 15:14:37 +0200
Hello,

I was thinking about the way of adding the new dissector
without writing any C code, just by quick scripting.
I came up with the following idea:

o Protocol specification is written in XML. Simple protocols
  require just one XML file, more complex ones require additional
  scripts (forth,python,perl,etc) to dissect.
o  Ethereal compiles the dissector from the XML at run time.

The XML file may look like this:
  .....
  <Protocol>
    <Name>My simple proprietory protocol</Name>
    <Abbr>MSPP</Abbr>

    <!-- Higher layer protocol -->
    <OnTop>
        <Proto>UDP</Proto>
        <Port>12345</Port>
    </OnTop>


    <Field>
        <Name>Command ID</Name>
        <Type>uint32</Type>
        <Offset>0</Offset>
        <Length>4</Length>
    </Field>

    <Field>
        <Name>Data</Name>
        <Type>binary</Type>
        <Length>-1</Length>
        <Handler>show_data</Handler>
    </Field>

  </Protocol>


The protocol header is 4-byte command ID, and the payload.
User-defined script handler 'show_data' is called to render the payload.

The XML schema must be developed for the protocol description,
and it may be used for the packet injection as well. The efforts
made by print-as-XML contributors may be collaborated with this.

Comments are welcome.
-Sergey