Commit 4258e3e
feat(trace-topology): PCAPNG FrameSource (v0.10.x B-2)
Implement the first real runtime-artefact parser on top of the v0.10.0
trace-topology foundation. `PcapngFrameSource` decodes pcapng captures
from tcpdump/tshark/Wireshark into typed `CapturedFrame` records
carrying mac_src, mac_dst, optional 802.1Q VLAN-ID and PCP, and a
nanosecond timestamp resolved against the per-IDB ts_resol option.
- Adds `pcap-parser = "0.16"` (Pierre Chifflier's crate) as the
PCAPNG decoder; we own only the L2-header decode + ts conversion
on top of its block iterator.
- `IngestError` grows concrete kinds (`Io`, `Truncated`,
`MalformedPcapng`, `UnsupportedLinkType`); `Unimplemented` stays
for the LLDP/Qcc/gPTP placeholders that ship in sibling commits.
- 5 unit tests (hand-built pcapng byte buffers): untagged round-trip,
802.1Q VLAN-ID + PCP extraction, truncated-frame error,
unsupported-link-type error at open(), and µs vs ns ts_resol
handling.
Per `docs/designs/v0.10.0-trace-topology.md` §"Implementation phasing"
PCAPNG entry. Maps REQ-TRACE-TOPOLOGY-003 / TEST-TRACE-TOPOLOGY-PCAPNG.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c0a8e39 commit 4258e3e
6 files changed
Lines changed: 609 additions & 34 deletions
File tree
- artifacts
- crates/spar-trace-topology
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1833 | 1833 | | |
1834 | 1834 | | |
1835 | 1835 | | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
1836 | 1852 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2388 | 2388 | | |
2389 | 2389 | | |
2390 | 2390 | | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
0 commit comments