Add --meas-gsmtap: cell measurements into the PCAP as GSMTAPv3 signal reports - #1
Merged
Merged
Conversation
…reports Add a --meas-gsmtap flag (Qualcomm) that writes LTE and 5G-NR serving and neighbor cell measurements into the capture as GSMTAPv3 SIGNAL_STATUS_REPORT packets, so RSRP/RSRQ/RSSI/SINR are visible in Wireshark instead of only on stdout. Previously these ML1 measurement logs were emitted as text only and never reached the PCAP. - util.build_signal_status_report(): builds a GSMTAPv3 signal-status packet with CHANNEL_NUMBER (earfcn/nrarfcn), BSIC_PSC_PCI, BAND_INDICATOR, and float metrics. NR uses the SS_RSRP/SS_RSRQ/SS_SINR tags; LTE uses RSRP/RSRQ/RSSI. - util.create_gsmtap_header(): fix v3 metadata packing so float-valued tags (RSRP/RSRQ/SINR/...) are packed as IEEE-754 floats and pre-packed bytes pass through. Previously only int values were handled, so any fractional metric raised TypeError; this path had no callers before now. - LTE/NR ML1 serving and neighbor measurement parsers emit one report per cell when --meas-gsmtap is set; the serving report reuses the RRC identity-cache join for the band indicator. Independent of --cell-kv (stdout) and default off. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
shark-fi
force-pushed
the
feat/meas-gsmtap
branch
from
September 4, 2026 22:46
674c941 to
1e53258
Compare
Owner
Author
|
Note: this shows as merged, but its base (feat/cell-kv-output) was later force-reset to keep the upstream --cell-kv PR (fgsect#150) scoped correctly. The --meas-gsmtap work is in master via #4. No action needed. |
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.
Summary
Adds a
--meas-gsmtapflag (Qualcomm) that writes LTE and 5G-NR serving and neighbor cell measurements into the capture as GSMTAPv3SIGNAL_STATUS_REPORTpackets. Previously these ML1 measurement logs (0xB193/0xB197LTE,0xB97FNR) were emitted to stdout only and never reached the PCAP, so RSRP/RSRQ/RSSI were invisible in Wireshark.What it does
util.build_signal_status_report()— builds a GSMTAPv3SIGNAL_STATUS_REPORT(header + metadata, no payload):CHANNEL_NUMBER= earfcn/nrarfcn,BSIC_PSC_PCI= PCI,BAND_INDICATORfrom the RRC identity join, and float metric tags. NR usesSS_RSRP/SS_RSRQ/SS_SINR; LTE usesRSRP/RSRQ/RSSI.--meas-gsmtapis set (onecppacket per detected cell). Independent of--cell-kv(stdout) and default off.util.create_gsmtap_header— the GSMTAPv3 metadata packer only handledtype(v) == int, so the float metric tags (RSRP/RSRQ/SINR/…) raisedTypeErrorfor any fractional value and pre-packedbyteswere the only non-int path. Reworked to pack floats as IEEE-754 and passbytesthrough. This code path had no callers before this PR.Example (decoded back out of a capture vector)
Notes
-3flag, sinceSIGNAL_STATUS_REPORThas no v2 form. Mixing v2 (RRC) and v3 (signal reports) in one capture is fine — Wireshark dissects each GSMTAP packet by its version byte.FREQUENCYmetadata tag is intentionally omitted (the writer packs unknown tags as uint32, which overflows for NR mmWave Hz);CHANNEL_NUMBERidentifies the carrier.Tests
tests/test_meas_gsmtap.pydecodes the emitted GSMTAPv3 packets and asserts the tags/values for LTE serving, LTE neighbor, and NR serving+neighbor, plus the float-packing helper and the default-off behavior. Full suite: 102 passing.🤖 Generated with Claude Code