Assorted cleanups.
Some checks are pending
Rust / build (push) Waiting to run

This commit is contained in:
Rayhaan Jaufeerally
2024-08-08 20:46:41 +00:00
parent 0cd3a120d0
commit 5130177bf4
8 changed files with 61 additions and 45 deletions

View File

@ -41,12 +41,11 @@ pub struct FibState<A: Address, S: SouthboundInterface> {
pub fib: IpLookupTable<A, Arc<Mutex<FibEntry>>>,
pub southbound: S,
pub af: AddressFamilyIdentifier,
pub table: u32,
}
impl<A: Address, S: SouthboundInterface> std::fmt::Debug for FibState<A, S> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "FibState af: {:?}, table: {}", self.af, self.table)
write!(f, "FibState af: {:?}", self.af)
}
}

View File

@ -65,7 +65,6 @@ fn select_best_route(ps: &proto::PathSet) -> Option<proto::Path> {
pub async fn run_connector_v4<S: SouthboundInterface>(
route_server: String,
rt_table: u32,
dry_run: bool,
southbound: S,
) -> Result<()> {
@ -74,7 +73,6 @@ pub async fn run_connector_v4<S: SouthboundInterface>(
fib: IpLookupTable::new(),
southbound,
af: AddressFamilyIdentifier::Ipv4,
table: rt_table,
};
let uri = Uri::from_str(route_server.as_str()).unwrap();
@ -135,7 +133,6 @@ pub async fn run_connector_v4<S: SouthboundInterface>(
pub async fn run_connector_v6<S: SouthboundInterface>(
route_server: String,
rt_table: u32,
dry_run: bool,
southbound: S,
) -> Result<()> {
@ -143,7 +140,6 @@ pub async fn run_connector_v6<S: SouthboundInterface>(
fib: IpLookupTable::new(),
southbound,
af: AddressFamilyIdentifier::Ipv6,
table: rt_table,
};
let uri = Uri::from_str(route_server.as_str()).unwrap();

View File

@ -17,6 +17,7 @@ use super::southbound_interface::SouthboundInterface;
/// NetlinkConnector implements methods to read/update Linux networking stuff including
/// routes and link level info.
#[derive(Clone)]
pub struct NetlinkConnector {
handle: rtnetlink::Handle,
table: Option<u32>,

View File

@ -38,6 +38,7 @@ pub trait SouthboundInterface {
/// DummyVerifier is a SouthboundInterface that checks that routes are not added more than
/// once and not removed when there are none.
#[derive(Clone)]
pub struct DummyVerifier {
route_state: HashMap<NLRI, IpAddr>,
}