From d7e34f5d964fd032746909b8f5df2d5722dbce6c Mon Sep 17 00:00:00 2001 From: Mingwei Zhang Date: Fri, 11 Oct 2024 11:37:09 -0700 Subject: [PATCH] allow exporting all bogon prefixes and asns --- src/bogons/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bogons/mod.rs b/src/bogons/mod.rs index 378d0a6..1419627 100644 --- a/src/bogons/mod.rs +++ b/src/bogons/mod.rs @@ -79,4 +79,14 @@ impl BgpkitCommons { pub fn bogons_match_asn(&self, asn: u32) -> Option { self.bogons.as_ref().map(|b| b.is_bogon_asn(asn)) } + + /// Get all bogon prefixes. + pub fn get_bogon_prefixes(&self) -> Option> { + self.bogons.as_ref().map(|b| b.prefixes.clone()) + } + + /// Get all bogon ASNs. + pub fn get_bogon_asns(&self) -> Option> { + self.bogons.as_ref().map(|b| b.asns.clone()) + } }