mirror of
https://gitlab.com/bauen1/dn42-roagen
synced 2024-05-11 05:55:36 +00:00
improve output format
This commit is contained in:
+9
-5
@@ -84,11 +84,15 @@ struct ROA {
|
||||
impl fmt::Display for ROA {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
for origin in &self.origins {
|
||||
write!(f, "route {} max {} as {};\n", self.route, self.maxlen, origin)?;
|
||||
/* we want /32 and /128 */
|
||||
write!(f, "route {}/{} max {} as {};\n",
|
||||
self.route.first_address(),
|
||||
self.route.network_length(),
|
||||
self.maxlen,
|
||||
origin)?;
|
||||
}
|
||||
|
||||
// return a fmt::Result
|
||||
write!(f, "")
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,6 +230,6 @@ fn main() {
|
||||
print!("# commit: {}", String::from_utf8_lossy(&Command::new("git").arg("-C").arg(args.registry_path).arg("log").arg("-1").arg("--format=%H").output().expect("failed to determine git commit").stdout));
|
||||
println!("#");
|
||||
|
||||
println!("{}\n", roa_to_output(roa_filter(roa_ip4, roa_filter_ip4)));
|
||||
println!("{}\n", roa_to_output(roa_filter(roa_ip6, roa_filter_ip6)));
|
||||
println!("{}", roa_to_output(roa_filter(roa_ip4, roa_filter_ip4)));
|
||||
println!("{}", roa_to_output(roa_filter(roa_ip6, roa_filter_ip6)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user