Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
/ asnames-rs Public archive

Autonomous System (AS) names and country lookup Rust library

License

Notifications You must be signed in to change notification settings

bgpkit/asnames-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asnames-rs

Warning

This crate is deprecated, use bgpkit-commons instead.

Crates.io Docs.rs License Discord

Simple Autonomous System (AS) names and country lookup Rust library

Data source

Data definition

#[derive(Debug, Clone)]
pub struct AsName {
    pub asn: u32,
    pub name: String,
    pub country: String,
}

Usage

use std::collections::HashMap;
use asnames::{AsName, load_asnames};

let asnames: HashMap<u32, AsName> = load_asnames().unwrap();
assert_eq!(asnames.get(&3333).unwrap().name, "RIPE-NCC-AS Reseaux IP Europeens Network Coordination Centre (RIPE NCC)");
assert_eq!(asnames.get(&400644).unwrap().name, "BGPKIT-LLC");
assert_eq!(asnames.get(&400644).unwrap().country, "US");

About

Autonomous System (AS) names and country lookup Rust library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages