This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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>,
|
||||
|
||||
@ -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>,
|
||||
}
|
||||
|
||||
@ -568,7 +568,6 @@ where
|
||||
self.hold_timer_expired().await?;
|
||||
}
|
||||
PeerTimerEvent::KeepaliveTimerExpire() => {
|
||||
trace!("Keepalive timer expired");
|
||||
self.send_keepalive().await?;
|
||||
}
|
||||
},
|
||||
@ -867,7 +866,6 @@ where
|
||||
/// keepalive message.
|
||||
/// Takes a lock on the peer object.
|
||||
async fn send_keepalive(&mut self) -> Result<(), std::io::Error> {
|
||||
info!("Sending keepalive");
|
||||
match self.tcp_stream.as_mut() {
|
||||
Some(conn) => {
|
||||
let keepalive = BGPMessage {
|
||||
|
||||
Reference in New Issue
Block a user