-
-
Save z4yx/c8038d4b4e7da42efc0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ================================================= | |
-- | |
-- ================================================= | |
proto = Proto("tible","TI BLE CC2540Dongle") | |
-- ================================================= | |
-- Read reserve other protocol fileds | |
-- ================================================= | |
usb_transtype_f = Field.new("usb.transfer_type") -- BULK=0x03 | |
usb_datalen_f = Field.new("usb.data_len") | |
usb_capdata_f = Field.new("usb.capdata") | |
-- ================================================= | |
-- fields | |
-- ================================================= | |
first_F = ProtoField.uint32("tible.first", "first byte") | |
proto.fields = { first_F } | |
-- ================================================= | |
-- dissector | |
-- ================================================= | |
function proto.dissector(buffer, pinfo, tree) | |
if usb_datalen_f() and usb_transtype_f().value == 0x03 then | |
local start = buffer:len() - usb_datalen_f().value | |
--orig_ble_dis:call(buffer(start + 8):tvb(), pinfo, tree) | |
local buflen = usb_datalen_f().value - 10 | |
if buflen > 0 then | |
pinfo.cols.info = "BLE:" | |
local blebuf = buffer(start + 8, buflen) | |
orig_ble_dis:call(blebuf():tvb(), pinfo, tree) | |
else | |
pinfo.cols.info = "BLE unknown" | |
orig_ble_dis:call(buffer(start + 8):tvb(), pinfo, tree) | |
end | |
end | |
end | |
-- BT LE LL Dissector | |
ble_table = DissectorTable.get("wtap_encap") | |
orig_ble_dis = ble_table:get_dissector(155) | |
-- ================================================= | |
-- Register | |
-- ================================================= | |
register_postdissector(proto) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment