Add 802.11 Radio Measurement action support#5039
Open
middleendian wants to merge 1 commit into
Open
Conversation
AI-Assisted: yes (Codex)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5039 +/- ##
==========================================
- Coverage 80.22% 80.22% -0.01%
==========================================
Files 387 387
Lines 96450 96473 +23
==========================================
+ Hits 77381 77395 +14
- Misses 19069 19078 +9
🚀 New features to boost your workflow:
|
polybassa
approved these changes
Jul 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds initial 802.11 Radio Measurement (Action category 5) dissection support to Scapy, focusing on Radio Measurement Request/Report actions and specializing Beacon measurement (type 5) while preserving raw bytes for unsupported measurement types.
Changes:
- Introduces
Dot11RadioMeasurementaction layer plus Request/Report body layers, with Beacon request/report specializations. - Adds layer bindings for Action category
0x05and actions0(request) /1(report). - Extends
dot11.utswith dissection + raw round-trip tests for Beacon request/report and unsupported request fallback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
scapy/layers/dot11.py |
Adds Radio Measurement action/request/report packets, Beacon specializations, and layer bindings. |
test/scapy/layers/dot11.uts |
Adds regression tests covering Beacon request/report dissection and raw fallback behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+2081
to
+2082
| def extract_padding(self, s): | ||
| return "", s |
Comment on lines
+2153
to
+2154
| def extract_padding(self, s): | ||
| return "", s |
Comment on lines
+2188
to
+2200
| ConditionalField( | ||
| StrLenField( | ||
| "measurement_report_data", | ||
| b"", | ||
| length_from=lambda p: max(p.len - 3, 0) | ||
| ), | ||
| lambda p: ( | ||
| p.measurement_report_type != 5 and | ||
| p.late == 0 and | ||
| p.incapable == 0 and | ||
| p.refused == 0 | ||
| ) | ||
| ), |
Comment on lines
+2072
to
+2079
| fields_desc = [ | ||
| ByteField("operating_class", 0), | ||
| ByteField("channel_number", 0), | ||
| LEShortField("randomization_interval", 0), | ||
| LEShortField("measurement_duration", 0), | ||
| ByteField("measurement_mode", 0), | ||
| MACField("BSSID", ETHER_ANY), | ||
| ] |
Comment on lines
+795
to
+810
| = Dot11RadioMeasurementRequest - unsupported measurement type | ||
|
|
||
| data = b"\x05\x00\x01\x00\x00\x26\x05\x02\x00\x07\xaa\xbb" | ||
| pkt = Dot11Action(data) | ||
| assert Dot11RadioMeasurementRequest in pkt | ||
|
|
||
| req = pkt[Dot11RadioMeasurementRequest] | ||
| assert req.token == 1 | ||
| assert req.repetitions == 0 | ||
| assert req.ID == 38 | ||
| assert req.len == 5 | ||
| assert req.measurement_token == 2 | ||
| assert req.measurement_request_type == 7 | ||
| assert req.measurement_request_data == b"\xaa\xbb" | ||
| assert raw(pkt) == data | ||
|
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dot11 Radio Measurement Action
Scope:
Dot11RadioMeasurementfor Action category5.0and
1.5.measurement_request_data/measurement_report_data.Beacon report, and unsupported measurement request fallback.
Spec references used in code comments:
9.6.6.1: Radio Measurement Action field values.9.6.6.2: Radio Measurement Request frame.9.6.6.3: Radio Measurement Report frame.9.4.2.20: Measurement Request element.9.4.2.20.7: Beacon request.9.4.2.21: Measurement Report element.9.4.2.21.7: Beacon report.Intentional partial support:
5is specialized in this PR.with the wrong field layout.
Test command used:
Result:
AI-Assisted: yes (Codex)