Skip to content

layers/bluetooth: Add an HCI_Event_Vendor handler registration mechanism - #5080

Open
antoniovazquezblanco wants to merge 1 commit into
secdev:masterfrom
antoniovazquezblanco:evtvendor
Open

layers/bluetooth: Add an HCI_Event_Vendor handler registration mechanism#5080
antoniovazquezblanco wants to merge 1 commit into
secdev:masterfrom
antoniovazquezblanco:evtvendor

Conversation

@antoniovazquezblanco

Copy link
Copy Markdown
Contributor

Description

Inspired by EIR_Manufacturer_Specific_Data magic payload registration.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.59%. Comparing base (1f87020) to head (1fc64d2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5080      +/-   ##
==========================================
+ Coverage   79.42%   80.59%   +1.16%     
==========================================
  Files         372      390      +18     
  Lines       96507    96877     +370     
==========================================
+ Hits        76652    78076    +1424     
+ Misses      19855    18801    -1054     
Files with missing lines Coverage Δ
scapy/layers/bluetooth.py 90.98% <100.00%> (+0.14%) ⬆️

... and 304 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@antoniovazquezblanco

Copy link
Copy Markdown
Contributor Author

Rebased for tests to pass :)

@gpotter2 gpotter2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR & sorry for the delay !

Comment thread scapy/layers/bluetooth.py
Comment on lines +2812 to +2826
def default_payload_class(self, payload):
for handler_cls, check in (
HCI_Event_Vendor.registered_handlers.items()
):
if check(payload):
return handler_cls

return Packet.default_payload_class(self, payload)

def do_dissect(self, s):
if s and self.default_payload_class(s) is not conf.raw_layer:
self.raw_packet_cache = None
self.explicit = 1
return s
return super(HCI_Event_Vendor, self).do_dissect(s)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be replaced with a dispatch_hook ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants