Is there some way to create a dissector from XML file? I have few messages which are defined in XML files. I'd like to use some generic dissector so that one will have to use only the XML file in order to define the packet (all messages are based on UDP), the dissector will read all the XML files and will parse the data based on it. asked 27 Jul '17, 22:24 BMWE |
One Answer:
You may want to have a look at this project. It is not fed by xml directly but you may use a script to convert your xml descriptions into the syntax required by this project. Other approach would be to somewhat duplicate that project by using Lua to read your xml description of the protocol and create protocol fields at startup, but I am not really sure you can read from a file during the initialisation phase. In Lua, you can use constructs like
and then, for each protocol field description extracted from XML:
choosing the right ProtoField type (uint8 in this case) and base (base.HEX in this case) which I suspect must be literals, and then probably (I've never tested it so a different syntax may be necessary) you can use
The tables for translation of numeric values to text strings must be complete before you use them to create a ProtoField as for some reason they are copied, not referred to. answered 28 Jul '17, 03:07 sindy |
This project seems to be very useful. Thank you