How to automate the conversion of a C ++ file to a Wireshark Lua dissector

I have a C ++ file defining a specific protocol. The file contains structures that define the messages used in the protocol. Each structure contains fields for a specific message. An example would be the following:

struct STATS00_MESSAGE_T
{
    uint8_t  message_type
    uint16_t num_sends;
    uint8_t  num_failures;
};

What is the best or easiest way to convert a C ++ file containing many structures like these into a Lua dissector for Wireshark? Lua Dispersion should be able to parse message fields.

The C ++ file is quite complex, containing several enumerations, typedefs, Boost macros, includes, etc. Thus, writing a brute-force parsing script such as Perl to automatically convert from C ++ to a Lua parser is not so simple. Are there existing tools that we can use to facilitate the transformation process?

+4
source share

Source: https://habr.com/ru/post/1623652/


All Articles