Skip to content

Add snapshot function#87

Merged
digizeph merged 3 commits intomainfrom
feat/snapshot-func
Dec 2, 2025
Merged

Add snapshot function#87
digizeph merged 3 commits intomainfrom
feat/snapshot-func

Conversation

@digizeph
Copy link
Member

@digizeph digizeph commented Dec 2, 2025

This pull request introduces a new feature to the SDK for reconstructing BGP routing table snapshots at a specific point in time, along with related documentation and tests. The main addition is the get_snapshot_files() method, which makes it easier for users to fetch the exact MRT files (RIB and updates) needed for routing table reconstruction. Additional changes include documentation updates, a new data structure, and comprehensive tests for the new functionality.

SDK Feature: Routing Table Snapshot Reconstruction

  • Added the get_snapshot_files() method to the BgpkitBroker struct, allowing users to retrieve the RIB dump and all updates files needed to reconstruct the routing table state for specified collectors at a target timestamp. The method supports multiple timestamp formats and returns a vector of SnapshotFiles structs, each containing the collector ID, RIB URL, and a chronologically ordered list of updates URLs.

  • Introduced the SnapshotFiles struct (with Debug, Clone, Serialize, Deserialize, Eq, and PartialEq traits) to encapsulate the data needed for snapshot reconstruction, and implemented Display for convenient printing.

Documentation and Examples

  • Updated the CHANGELOG.md to document the new SDK feature and its use case.
  • Added detailed documentation and usage examples for get_snapshot_files() in both the Rust doc comments and the project README. [1] [2]

Testing

  • Added comprehensive unit tests for the new get_snapshot_files() method, covering single and multiple collectors, invalid timestamps, empty collectors, and the Display implementation of SnapshotFiles.

Exports

  • Made SnapshotFiles publicly available via the crate root for easier access by users.

digizeph and others added 3 commits December 1, 2025 19:22
- Introduced `get_snapshot_files()` to fetch RIB and updates MRT files for specific collectors and timestamps.
- Enabled precise routing table snapshot reconstruction by replaying updates over RIB data.
- Added `SnapshotFiles` struct and enhanced documentation with examples.
- Updated tests to validate functionality and edge cases.
- Included CHANGELOG updates.
@digizeph digizeph enabled auto-merge (rebase) December 2, 2025 03:24
@digizeph digizeph merged commit ee517a9 into main Dec 2, 2025
1 check passed
@digizeph digizeph deleted the feat/snapshot-func branch December 2, 2025 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add function to return MRT files needed to construct routing table snapshots based on given timestamp and collectors

1 participant