Skip to content

Commit

Permalink
fix mrt to elems error for meta bgp messages
Browse files Browse the repository at this point in the history
meta messages such as Open, Notification, KeepAlive will be discarded when converting to BgpElem.
  • Loading branch information
digizeph committed Oct 25, 2021
1 parent 28e7841 commit 109af30
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bgpkit-parser"
version = "0.4.0"
version = "0.4.1"
authors = ["Mingwei Zhang <[email protected]>"]
edition = "2021"
readme = "README.md"
Expand Down
4 changes: 3 additions & 1 deletion src/parser/mrt/messages/table_dump_v2_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ pub fn parse_table_dump_v2_message<T: Read>(
TableDumpV2Type::RibIpv6UnicastAddPath | TableDumpV2Type::RibIpv6MulticastAddPath => {
TableDumpV2Message::RibAfiEntries(parse_rib_afi_entries(input, v2_type)?)
},
TableDumpV2Type::RibGeneric| TableDumpV2Type::RibGenericAddPath| TableDumpV2Type::GeoPeerTable => { todo!()}
TableDumpV2Type::RibGeneric| TableDumpV2Type::RibGenericAddPath| TableDumpV2Type::GeoPeerTable => {
return Err(ParserError::Unsupported("TableDumpV2 RibGeneric and GeoPeerTable is not currently supported".to_string()))
}
};

Ok(msg)
Expand Down
13 changes: 4 additions & 9 deletions src/parser/mrt/mrt_elem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::collections::HashMap;
use std::fmt::{Display, Formatter};
use std::net::IpAddr;
use itertools::Itertools;
use log::warn;

/// Element type.
///
Expand Down Expand Up @@ -304,7 +305,7 @@ impl Elementor {
}
}
TableDumpV2Message::RibGenericEntries(_t) => {
todo!()
warn!("to_elem for TableDumpV2Message::RibGenericEntries not yet implemented");
}
}
}
Expand All @@ -319,9 +320,6 @@ impl Elementor {
let peer_ip = v.peer_ip.clone();
let peer_asn = v.peer_asn.clone();
match v.bgp_message {
BgpMessage::Open(_) => {
todo!()
}
BgpMessage::Update(e) => {
let (
as_path,
Expand Down Expand Up @@ -442,11 +440,8 @@ impl Elementor {
}));
}
}
BgpMessage::Notification(_) => {
todo!()
}
BgpMessage::KeepAlive(_) => {
todo!()
BgpMessage::Open(_) | BgpMessage::Notification(_) | BgpMessage::KeepAlive(_) => {
// ignore Open Notification, and KeepAlive messages
}
}
}
Expand Down

0 comments on commit 109af30

Please sign in to comment.