Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ dateparser = { version = "0.2", optional = true }
humantime = { version = "2.1", optional = true }
bgpkit-broker = { version = "0.10.1", optional = true }
bgpkit-parser = { version = "0.15.0", features = ["serde"], optional = true }
bgpkit-commons = { version = "0.10.2", features = ["asinfo", "rpki", "countries"], optional = true }
bgpkit-commons = { version = "0.10.3", features = ["asinfo", "rpki", "countries"], optional = true }
itertools = { version = "0.14", optional = true }
radar-rs = { version = "0.1.0", optional = true }
rayon = { version = "1.8", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ Options:
--date <DATE> Load historical data for this date (YYYY-MM-DD)
--debug Print debug information
--source <SOURCE> Historical data source: ripe, rpkiviews (default: ripe) [default: ripe]
--collector <COLLECTOR> RPKIviews collector: soborost, massars, attn, kerfuffle (default: soborost) [default: soborost]
--collector <COLLECTOR> RPKIviews collector: sobornost, massars, attn, kerfuffle (default: sobornost) [default: sobornost]
--format <FORMAT> Output format: table, markdown, json, json-pretty, json-line, psv (default varies by command)
--json Output as JSON objects (shortcut for --format json-pretty)
-r, --refresh Force refresh the RPKI cache (only applies to current data)
Expand Down Expand Up @@ -1295,7 +1295,7 @@ Options:
--format <FORMAT> Output format: table, markdown, json, json-pretty, json-line, psv (default varies by command)
--json Output as JSON objects (shortcut for --format json-pretty)
--source <SOURCE> Historical data source: ripe, rpkiviews (default: ripe) [default: ripe]
--collector <COLLECTOR> RPKIviews collector: soborost, massars, attn, kerfuffle (default: soborost) [default: soborost]
--collector <COLLECTOR> RPKIviews collector: sobornost, massars, attn, kerfuffle (default: sobornost) [default: sobornost]
--no-update Disable automatic database updates (use existing cached data only)
-r, --refresh Force refresh the RPKI cache (only applies to current data)
-h, --help Print help
Expand Down
10 changes: 5 additions & 5 deletions src/bin/commands/rpki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub enum RpkiCommands {
#[clap(long, default_value = "ripe")]
source: String,

/// RPKIviews collector: soborost, massars, attn, kerfuffle (default: soborost)
#[clap(long, default_value = "soborost")]
/// RPKIviews collector: sobornost, massars, attn, kerfuffle (default: sobornost)
#[clap(long, default_value = "sobornost")]
collector: String,

/// Force refresh the RPKI cache (only applies to current data)
Expand All @@ -67,8 +67,8 @@ pub enum RpkiCommands {
#[clap(long, default_value = "ripe")]
source: String,

/// RPKIviews collector: soborost, massars, attn, kerfuffle (default: soborost)
#[clap(long, default_value = "soborost")]
/// RPKIviews collector: sobornost, massars, attn, kerfuffle (default: sobornost)
#[clap(long, default_value = "sobornost")]
collector: String,

/// Force refresh the RPKI cache (only applies to current data)
Expand Down Expand Up @@ -425,7 +425,7 @@ fn parse_data_source(source: &str) -> RpkiDataSource {

fn parse_collector(collector: &str) -> Option<RpkiViewsCollectorOption> {
match collector.to_lowercase().as_str() {
"soborost" => Some(RpkiViewsCollectorOption::Soborost),
"sobornost" => Some(RpkiViewsCollectorOption::Sobornost),
"massars" => Some(RpkiViewsCollectorOption::Massars),
"attn" => Some(RpkiViewsCollectorOption::Attn),
"kerfuffle" => Some(RpkiViewsCollectorOption::Kerfuffle),
Expand Down
16 changes: 9 additions & 7 deletions src/lens/rpki/commons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ impl From<&RpkiAspaEntry> for RpkiAspaTableEntry {
/// Parse RPKIviews collector from string
pub fn parse_rpkiviews_collector(collector: &str) -> Result<RpkiViewsCollector> {
match collector.to_lowercase().as_str() {
"soborost" | "soborostnet" => Ok(RpkiViewsCollector::SoborostNet),
"sobornost" | "sobornostnet" => Ok(RpkiViewsCollector::SobornostNet),
"massars" | "massarsnet" => Ok(RpkiViewsCollector::MassarsNet),
"attn" | "attnjp" => Ok(RpkiViewsCollector::AttnJp),
"kerfuffle" | "kerfufflenet" => Ok(RpkiViewsCollector::KerfuffleNet),
_ => Err(anyhow!(
"Unknown RPKIviews collector: {}. Valid options: soborost, massars, attn, kerfuffle",
"Unknown RPKIviews collector: {}. Valid options: sobornost, massars, attn, kerfuffle",
collector
)),
}
Expand All @@ -99,7 +99,7 @@ pub fn parse_historical_source(
match source.to_lowercase().as_str() {
"ripe" => Ok(HistoricalRpkiSource::Ripe),
"rpkiviews" => {
let collector = collector.unwrap_or("soborost");
let collector = collector.unwrap_or("sobornost");
let rpkiviews_collector = parse_rpkiviews_collector(collector)?;
Ok(HistoricalRpkiSource::RpkiViews(rpkiviews_collector))
}
Expand All @@ -122,6 +122,8 @@ pub fn load_historical_rpki(date: NaiveDate, source: HistoricalRpkiSource) -> Re
.map_err(|e| anyhow!("Failed to load RIPE historical RPKI data: {}", e)),
HistoricalRpkiSource::RpkiViews(collector) => RpkiTrie::from_rpkiviews(collector, date)
.map_err(|e| anyhow!("Failed to load RPKIviews RPKI data: {}", e)),
HistoricalRpkiSource::RpkiSpools(collector) => RpkiTrie::from_rpkispools(collector, date)
.map_err(|e| anyhow!("Failed to load RPKISpools RPKI data: {}", e)),
}
}

Expand Down Expand Up @@ -260,8 +262,8 @@ mod tests {
#[test]
fn test_parse_rpkiviews_collector() {
assert!(matches!(
parse_rpkiviews_collector("soborost").unwrap(),
RpkiViewsCollector::SoborostNet
parse_rpkiviews_collector("sobornost").unwrap(),
RpkiViewsCollector::SobornostNet
));
assert!(matches!(
parse_rpkiviews_collector("kerfuffle").unwrap(),
Expand All @@ -277,8 +279,8 @@ mod tests {
HistoricalRpkiSource::Ripe
));
assert!(matches!(
parse_historical_source("rpkiviews", Some("soborost")).unwrap(),
HistoricalRpkiSource::RpkiViews(RpkiViewsCollector::SoborostNet)
parse_historical_source("rpkiviews", Some("sobornost")).unwrap(),
HistoricalRpkiSource::RpkiViews(RpkiViewsCollector::SobornostNet)
));
}
}
6 changes: 3 additions & 3 deletions src/lens/rpki/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ pub enum RpkiDataSource {
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[cfg_attr(feature = "cli", derive(clap::ValueEnum))]
pub enum RpkiViewsCollectorOption {
/// SoborostNet collector (default)
/// SobornostNet collector (default)
#[default]
Soborost,
Sobornost,
/// MassarsNet collector
Massars,
/// AttnJp collector
Expand Down Expand Up @@ -814,7 +814,7 @@ impl<'a> RpkiLens<'a> {
};

let collector_str = collector.map(|c| match c {
RpkiViewsCollectorOption::Soborost => "soborost",
RpkiViewsCollectorOption::Sobornost => "sobornost",
RpkiViewsCollectorOption::Massars => "massars",
RpkiViewsCollectorOption::Attn => "attn",
RpkiViewsCollectorOption::Kerfuffle => "kerfuffle",
Expand Down
Loading