Skip to content

Commit

Permalink
allow exporting all bogon prefixes and asns
Browse files Browse the repository at this point in the history
  • Loading branch information
digizeph committed Oct 11, 2024
1 parent f183d15 commit d7e34f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bogons/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,14 @@ impl BgpkitCommons {
pub fn bogons_match_asn(&self, asn: u32) -> Option<bool> {
self.bogons.as_ref().map(|b| b.is_bogon_asn(asn))
}

/// Get all bogon prefixes.
pub fn get_bogon_prefixes(&self) -> Option<Vec<BogonPrefix>> {
self.bogons.as_ref().map(|b| b.prefixes.clone())
}

/// Get all bogon ASNs.
pub fn get_bogon_asns(&self) -> Option<Vec<BogonAsn>> {
self.bogons.as_ref().map(|b| b.asns.clone())
}
}

0 comments on commit d7e34f5

Please sign in to comment.