Add EnvLogger and start of trait fn for dumping routes
Some checks are pending
Rust / build (push) Waiting to run
Some checks are pending
Rust / build (push) Waiting to run
This commit is contained in:
@ -12,10 +12,12 @@ version.workspace = true
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
byteorder = "1.4.3"
|
||||
bytes.workspace = true
|
||||
eyre.workspace = true
|
||||
nom = "7.1"
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
tokio-util = { version = "0.7.10", features = ["codec"] }
|
||||
byteorder = "1.4.3"
|
||||
bytes.workspace = true
|
||||
eyre.workspace = true
|
||||
netlink-packet-route.workspace = true
|
||||
nom = "7.1"
|
||||
rtnetlink.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
tokio-util = { version = "0.7.10", features = ["codec"] }
|
||||
|
||||
@ -59,6 +59,25 @@ impl Into<Vec<u8>> for AddressFamilyIdentifier {
|
||||
}
|
||||
}
|
||||
|
||||
/// Convenience functions to convert AddressFamilyIdentifier into those used by netlink.
|
||||
impl Into<netlink_packet_route::AddressFamily> for AddressFamilyIdentifier {
|
||||
fn into(self) -> netlink_packet_route::AddressFamily {
|
||||
match self {
|
||||
AddressFamilyIdentifier::Ipv4 => netlink_packet_route::AddressFamily::Inet,
|
||||
AddressFamilyIdentifier::Ipv6 => netlink_packet_route::AddressFamily::Inet6,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<rtnetlink::IpVersion> for AddressFamilyIdentifier {
|
||||
fn into(self) -> rtnetlink::IpVersion {
|
||||
match self {
|
||||
AddressFamilyIdentifier::Ipv4 => rtnetlink::IpVersion::V4,
|
||||
AddressFamilyIdentifier::Ipv6 => rtnetlink::IpVersion::V6,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// This parser for AFI makes it easier to write the other message parsers.
|
||||
impl ReadablePacket for AddressFamilyIdentifier {
|
||||
fn from_wire<'a>(
|
||||
|
||||
Reference in New Issue
Block a user