Skip to content

Instantly share code, notes, and snippets.

@digizeph
Created November 1, 2021 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digizeph/9977371653f39a459ff3ae507dc3636c to your computer and use it in GitHub Desktop.
Save digizeph/9977371653f39a459ff3ae507dc3636c to your computer and use it in GitHub Desktop.
BGPKIT Parser remote file parsing example.
use bgpkit_parser::BgpkitParser;
fn main() {
let url =
"http://archive.routeviews.org/bgpdata/\
2021.10/UPDATES/updates.20211001.0000.bz2";
for elem in BgpkitParser::new(url) {
println!("{:?}|{:?}|{:?}|{:?}|{:?}",
elem.elem_type,
elem.timestamp,
elem.prefix,
elem.as_path,
elem.next_hop,
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment