| Crates.io | mrt_ingester |
| lib.rs | mrt_ingester |
| version | 0.1.0 |
| created_at | 2026-01-10 18:41:34.583535+00 |
| updated_at | 2026-01-10 18:41:34.583535+00 |
| description | High-performance parser for MRT (Multi-threaded Routing Toolkit) routing data files |
| homepage | |
| repository | https://github.com/nuclearcat/mrt-ingester |
| max_upload_size | |
| id | 2034536 |
| size | 337,080 |
High-performance parser for MRT (Multi-threaded Routing Toolkit) routing data files.
This library parses MRT-formatted binary streams containing BGP routing information, as specified in RFC 6396 and RFC 8050.
mrt-rs crate| Type | Name | Description |
|---|---|---|
| 5 | BGP | Legacy BGP records (IPv4, 16-bit ASN) |
| 6 | RIP | RIP protocol records |
| 8 | RIPNG | RIPng protocol records |
| 9-10 | BGP4PLUS | Legacy BGP records (IPv6, 16-bit ASN) |
| 11 | OSPFv2 | OSPFv2 protocol records |
| 12 | TABLE_DUMP | RIB dump (one entry per record) |
| 13 | TABLE_DUMP_V2 | RIB dump v2 (multiple entries per record) |
| 16-17 | BGP4MP | Modern BGP records (IPv4/IPv6, 16/32-bit ASN) |
| 32-33 | ISIS | IS-IS protocol records |
| 48-49 | OSPFv3 | OSPFv3 protocol records |
use std::fs::File;
use std::io::BufReader;
fn main() -> std::io::Result<()> {
let file = File::open("updates.mrt")?;
let mut reader = BufReader::new(file);
while let Some((header, record)) = mrt_ingester::read(&mut reader)? {
println!("Timestamp: {}, Type: {}", header.timestamp, header.record_type);
match record {
mrt_ingester::Record::BGP4MP(bgp4mp) => {
// Handle BGP4MP record
}
mrt_ingester::Record::TABLE_DUMP_V2(table_dump) => {
// Handle TABLE_DUMP_V2 record
}
_ => {}
}
}
Ok(())
}
MRT files are available from:
Licensed under either of:
at your option.