[WIP] Feature: Wireshark Dissector Generator #8576
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! This is an awesome project and I'm eager to share some work I think would greatly benefit the flatbuffers community.
Description
This PR is my attempt to create a full-featured Wireshark dissector generator (see #153 and #8333).
This implementation is based on
bfbs_gen_lua.h|cpp
and relies only on reflection to retrieve all the necessary data. One thing I attempted to do is put all of the actual lua logic into supporting files in thewireshark/
directory - it was much easier to iterate on the code in this way. Almost all generated code boils down to "call this generic function with these specific parameters".The reason why I built this wholly separate from the existing lua generator, is because the existing generator hides a lot of the metadata behind hard-coded locals, and I think the output of this PR could be used as a great hands-on teaching tool for flatbuffers internals for those of us curious (or masochistic) enough to dive into the details.
File naming convention is a little weird for generated/supporting files as Wireshark itself has some odd file loading quirks (see
wireshark/README.md
Output currently has two modes, regular and verbose. Regular is intended to just shows you the data you want to see:
Verbose is intended to tell you what every single byte (except for padding) in a buffer is used for:
*(both of these screenshots are of auto generated data full of gibberish - no, you aren't supposed to be seeing "real" strings)
This PR is still a WIP and I intend to edit this description down to just the relevant information once I handle the last few features/issues. I wanted to get this up now to collect feedback and get some questions answered.
Still TODO:
_type
is stillUType
not vector ofUType
bit_flags
--bfbs-builtins
nested_flatbuffer
--bfbs-builtins
require
statementsOpen Questions
Possible Future Work