-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[WIP] Feature: Wireshark Dissector Generator #8576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
…y working copy of 00_wireshark.lua back into the repo folder
Found a small bug when the payload doesn't start at the beginning of the buffer, and another small issue with parse_struct. Additionally, loading is a little weird on Wireshark < 4.0. Will address these later today. |
1. if offset is nonzero, the parse function failed 2. struct and table name lookup now done by member_list
Currently tracking a limitation where you can only have one dissector present in the plugins directory at a time. Wireshark doesn't like you sharing common ProtoFields apparently. |
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