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
Overview
BGPKIT-Commons is a library for common BGP-related data and functions.
Categories
MRT collectors
This crate provides three functions to retrieve the full list of MRT collectors from RouteViews and RIPE RIS:
get_routeviews_collectors()
get_riperis_collectors()
get_all_collectors()
Data structure
The collectors are abstract to the following struct:
use NaiveDateTime;
use MrtCollectorProject;
/// MRT collector meta information
where MrtCollectorProject
is defined as:
Usage example
See the following example for usage:
use get_routeviews_collectors;
println!;
let mut routeviews_collectors = get_routeviews_collectors.unwrap;
routeviews_collectors.sort;
let earliest = routeviews_collectors.first.unwrap;
let latest = routeviews_collectors.last.unwrap;
println!;
println!;
println!;
AS name and country
asnames
is a module for Autonomous System (AS) names and country lookup
Data sources
- RIPE NCC asnames: https://ftp.ripe.net/ripe/asnames/asn.txt
- CAIDA as-to-organization mapping: https://www.caida.org/catalog/datasets/as-organizations/
- APNIC AS population data: https://stats.labs.apnic.net/cgi-bin/aspop
Data structure
use ;
Usage example
use HashMap;
use ;
let asnames: = get_asnames.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
Countries detailed information
Data Structure
Usage Examples
use Countries;
let countries = new.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
RPKI Utilities
Data sources
Usage Examples
Check current RPKI validation using Cloudflare RPKI portal
use FromStr;
use IpNet;
use ;
let trie = from_cloudflare.unwrap;
let prefix = from_str.unwrap;
assert_eq!;
Check RPKI validation for a given date
use FromStr;
use NaiveDate;
use IpNet;
use ;
let rpki = from_ripe_historical.unwrap;
// let rpki = RpkiTrie::from_rpkiviews_historical(NaiveDate::from_ymd_opt(2023, 1, 1).unwrap()).unwrap();
let prefix = from_str.unwrap;
assert_eq!;
Bogon utilities
We provide a utility to check if an IP prefix or an ASN is a bogon.
Data sources
IANA special registries:
- IPv4: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
- IPv6: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
- ASN: https://www.iana.org/assignments/iana-as-numbers-special-registry/iana-as-numbers-special-registry.xhtml
Usage Examples
use Bogons;
let bogons = new.unwrap;
assert!;
assert!;
assert!;
assert!;
AS-level relationship
bgpkit-commons
provides access to AS-level relationship data generated by BGPKIT.
Data sources
- Raw data files available at: https://data.bgpkit.com/as2rel/
Data Structure
Usage Examples
let bgpkit = new.unwrap;
let = bgpkit.lookup_pair;
assert!;
assert!;
assert_eq!;
Feature Flags
rustls
: use rustls instead of native-tls for the underlying HTTPS requests
Commandline tool
This crate also provides a commandline tool bgpkit-commons
for easy access to the data and utilities.
Installation
On macOS:
On other platforms:
Export all data to JSON
Built with ❤️ by BGPKIT Team
License
MIT