Fix dropped change flags + FIDI parsing
- capture.py: DirectSniffer/GsmtapListener yield (type, data, flags), CaptureManager passes flags to insert_message (change flags were previously dropped, leaving every change row with flags=0) - protocol.py: add _parse_fidi (1-byte value) — FIDI was mis-mapped to _parse_change (4-byte flags), so FIDI messages were silently dropped - database.py: pass flags into decode_sniff_msg - decode.py: decode_change(flags) reads flags directly; decode_sniff_msg gains flags parameter; change messages no longer require non-empty data - tests: fix FIDI test, add change/fidi decode tests (43 total)
This commit is contained in:
1 parent
4097bb864e
commit
2a58fec0a3
7 files changed
+52
-20
No files matched your search
@@ -85,6 +85,12 @@ def _parse_change(payload):
|
||||
consumed = 4
|
||||
return consumed, flags, b''
|
||||
|
||||
|
||||
def _parse_fidi(payload):
|
||||
if len(payload) < 1:
|
||||
return None
|
||||
return 1, 0, payload[:1]
|
||||
|
||||
_SNIFF_DATA_FMT = '<IH'
|
||||
_SNIFF_DATA_HDR_SIZE = struct.calcsize(_SNIFF_DATA_FMT) # 6 bytes
|
||||
|
||||
@@ -102,7 +108,7 @@ def _parse_data(payload):
|
||||
|
||||
_PAYLOAD_PARSERS = {
|
||||
SIMTRACE_MSGT_SNIFF_CHANGE: _parse_change,
|
||||
SIMTRACE_MSGT_SNIFF_FIDI: _parse_change,
|
||||
SIMTRACE_MSGT_SNIFF_FIDI: _parse_fidi,
|
||||
SIMTRACE_MSGT_SNIFF_ATR: _parse_data,
|
||||
SIMTRACE_MSGT_SNIFF_PPS: _parse_data,
|
||||
SIMTRACE_MSGT_SNIFF_TPDU: _parse_data,
|
||||
|
||||
Reference in new issue
Block a user