How to Grab Packets for a Lua Dissector Using Part of a Field
I'm able to filter in wireshark for the BLE packets I'm looking for using "btcommon.eir_ad.entry.custom_uuid_128 contains" followed by the part of the custom UUID that identifies the packets I'm looking for. I'm trying to create a Lua Dissector to parse those packets. I believe I should be using:
BLE_table = DissectorTable.get("btcommon.eir_ad.entry.custom_uuid_128")
What I can't figure out is what to use in BLE_table:add() to get the correct packets.
There is no dissector table by that name. From
tshark -G dissector-tables | grep btcommon
, you'll only find (with master) thesebtcommon
-related tables:Do you mean these are the only ones that can be used with Lua? I've been able to use btcommon.eir_ad.entry.custom_uuid_128 as a filter in Wireshark. I can try using btcommon.eir_ad.entry.uuid, but what do I pass into BLE_table:add() when I only want to use part of the UUID to identify the packet?
Yes,
btcommon.eir_ad.entry.custom_uuid_128
is a valid field and thus can be used as a Wireshark display filter, but it's not a a dissector table. From your use case, I don't think registering withbtcommon.eir_ad.entry.uuid
will work for you if you're only matching a part of the UUID. You may need to implement a Wireshark Postdissector instead, where you grab thebtcommon.eir_ad.entry.custom_uuid_128
field, parse it, and only continue with your custom dissection if the portion of that field meets your criteria.That's doable. What command would I need to just grab the btcommon.eir_ad.entry.custom_uuid_128 field?
You'd just use something like:
Maybe have a look at the IPv6 Postdissector I wrote as an example? See also a couple of other PostDissectors and some listed on the Examples page. And another on the Dissectors page. And another wireshark-postdissector.
The
register_postdissector()
is documented in section 11.3.8.1. of the Wireshark Developer Guide.NOTE: There may be another solution, but I can't think of one.