feat(parse): support route-views sh ip bgp snapshots#146
Merged
Conversation
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 support for route-views
sh ip bgpsnapshots (e.g.oix-full-snapshot-2026-07-01-0000.bz2) tomonocle parse. Closes #145.Route-views dumps use the same fixed-width column layout as PCH Cisco dumps but omit the
BGP table version/local ASpreamble and use a different filename timestamp format.Changes
detect_text_dumpalso matches dumps opening withStatus codes:(route-views dumps have noBGP tableline, andNext Hopsits beyond the 128-byte sniff window).peer_ip/peer_asndefault to the unspecified sentinels0.0.0.0and AS0 instead of erroring out. The fixed-width column parsing itself is unchanged — it already derives positions from the column header, so the 3-space-indent route-views layout parses as-is.infer_timestamp_from_pathnow recognizesYYYY-MM-DD-HHMM(route-views snapshot filenames) and uses the embedded time of day. PCH-styleYYYY.MM.DD(noon UTC) behavior is unchanged.Testing
oix-full-snapshot-2026-07-01-0000(first 200k lines): 78,976/78,976 route lines parsed, timestamp inferred as1782864000(2026-07-01 00:00 UTC) from the filename.MrtRibEncodercollapses multiple paths per (peer, prefix) into one RIB entry, so a multi-peer-flattened oix dump exports as 5,336 unique prefixes — expected for a single-peer TABLE_DUMP_V2 encoding.cargo fmt --check,cargo clippy --all-features -- -D warnings, andcargo test --all-features(318 tests) all pass.