BGPKIT Commons

This readme is generated from the library's doc comments using cargo-readme. Please refer to the Rust docs website for the full documentation

Crates.io Docs.rs License Discord

Overview

BGPKIT-Commons is a library for common BGP-related data and functions.

Categories

MRT Collectors

This crate provides three functions to retrive the full list of MRT collectors from RouteViews and RIPE RIS: - get_routeviews_collectors() - get_riperis_collectors() - get_all_collectors()

The collectors is abstract to the following struct: ```rust use chrono::NaiveDateTime; use bgpkit_commons::collectors::MrtCollectorProject; /// MRT collector meta information

[derive(Debug, Clone, Eq, PartialEq)]

pub struct MrtCollector { /// name of the collector pub name: String, /// collector project pub project: MrtCollectorProject, /// MRT data files root URL pub dataurl: String, /// collector activation timestamp pub activatedon: NaiveDateTime, /// collector deactivation timestamp (None for active collectors) pub deactivated_on: Option, /// country where the collect runs in pub country: String, } where `MrtCollectorProject` is defined as: rust

[derive(Debug, Copy, Clone, Eq, PartialEq)]

pub enum MrtCollectorProject { RouteViews, RipeRis, } ```

See the following example for usage: rust use bgpkit_commons::collectors::get_routeviews_collectors; fn main() { println!("get route views collectors"); let mut routeviews_collectors = get_routeviews_collectors().unwrap(); routeviews_collectors.sort(); let earliest = routeviews_collectors.first().unwrap(); let latest = routeviews_collectors.last().unwrap(); println!("\t total of {} collectors", routeviews_collectors.len()); println!( "\t earliest collector: {} (activated on {})", earliest.name, earliest.activated_on ); println!( "\t latest collector: {} (activated on {})", latest.name, latest.activated_on ); }

Built with ❤️ by BGPKIT Team

https://bgpkit.com/favicon.ico

License

MIT