Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scapy/layers/bluetooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,13 @@ def extract_padding(self, s):
return s[:plen], s[plen:]


class EIR_PublicTargetAddress(EIR_Element):
name = "Public Target Address"
fields_desc = [
LEMACField('bd_addr', None)
]


class EIR_ServiceData32BitUUID(EIR_Element):
name = 'EIR Service Data - 32-bit UUID'
fields_desc = [
Expand Down Expand Up @@ -2342,6 +2349,7 @@ class HCI_LE_Meta_Long_Term_Key_Request(Packet):
bind_layers(EIR_Hdr, EIR_SecurityManagerOOBFlags, type=0x11)
bind_layers(EIR_Hdr, EIR_PeripheralConnectionIntervalRange, type=0x12)
bind_layers(EIR_Hdr, EIR_ServiceData16BitUUID, type=0x16)
bind_layers(EIR_Hdr, EIR_PublicTargetAddress, type=0x17)
bind_layers(EIR_Hdr, EIR_ServiceData32BitUUID, type=0x20)
bind_layers(EIR_Hdr, EIR_ServiceData128BitUUID, type=0x21)
bind_layers(EIR_Hdr, EIR_Manufacturer_Specific_Data, type=0xff)
Expand Down
5 changes: 5 additions & 0 deletions test/scapy/layers/bluetooth.uts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,11 @@ assert p[EIR_ClassOfDevice].major_service_classes == 0
assert p[EIR_ClassOfDevice].major_device_class == 5
assert p[EIR_ClassOfDevice].minor_device_class == 1

= Parse EIR_PublicTargetAddress
p = HCI_Hdr(hex_bytes('043e1402010001554433221100080717ffeeddccbbaaaa'))
assert EIR_PublicTargetAddress in p
assert p[EIR_PublicTargetAddress].bd_addr == 'aa:bb:cc:dd:ee:ff'

= Parse EIR_ServiceData32BitUUID

p = HCI_Hdr(hex_bytes('042fff01c47c80894df801000c0128a269a30c4a125d13f30196894df80c012820f61a1a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'))
Expand Down
Loading