pub struct BgpRibEntry<P: Prefix> {
pub route: BgpRoute<P>,
pub from_type: BgpSessionType,
pub from_id: RouterId,
pub to_id: Option<RouterId>,
pub igp_cost: Option<NotNan<LinkWeight>>,
pub weight: u32,
}Expand description
BGP RIB Table entry
Fields§
§route: BgpRoute<P>the actual bgp route
from_type: BgpSessionTypethe type of session, from which the route was learned
from_id: RouterIdthe client from which the route was learned
to_id: Option<RouterId>the client to which the route is distributed (only in RibOut)
igp_cost: Option<NotNan<LinkWeight>>the igp cost to the next_hop
weight: u32Local weight of that route, which is the most preferred metric of the entire route.
Implementations§
Source§impl<P: Prefix> BgpRibEntry<P>
impl<P: Prefix> BgpRibEntry<P>
Sourcepub fn best_route(routes: impl IntoIterator<Item = Self>) -> Option<Self>
pub fn best_route(routes: impl IntoIterator<Item = Self>) -> Option<Self>
Select the best route according to RFC 4271. The algorithm first finds the best routes up to the MED step, then removes those routes that have a lower MED than others (learned from the same peer), and then gets the best route according to all steps after MED.
Trait Implementations§
Source§impl<P: Clone + Prefix> Clone for BgpRibEntry<P>
impl<P: Clone + Prefix> Clone for BgpRibEntry<P>
Source§fn clone(&self) -> BgpRibEntry<P>
fn clone(&self) -> BgpRibEntry<P>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, P> Deserialize<'de> for BgpRibEntry<P>where
P: for<'a> Deserialize<'a> + Prefix,
impl<'de, P> Deserialize<'de> for BgpRibEntry<P>where
P: for<'a> Deserialize<'a> + Prefix,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'n, P: Prefix, Q, Ospf: OspfImpl> NetworkFormatter<'n, P, Q, Ospf> for BgpRibEntry<P>
impl<'n, P: Prefix, Q, Ospf: OspfImpl> NetworkFormatter<'n, P, Q, Ospf> for BgpRibEntry<P>
Source§impl<P: Prefix> PartialEq<Option<&BgpRibEntry<P>>> for BgpRibEntry<P>
impl<P: Prefix> PartialEq<Option<&BgpRibEntry<P>>> for BgpRibEntry<P>
Source§impl<P: Prefix> PartialEq for BgpRibEntry<P>
impl<P: Prefix> PartialEq for BgpRibEntry<P>
Source§impl<P> Serialize for BgpRibEntry<P>
impl<P> Serialize for BgpRibEntry<P>
impl<P: Eq + Prefix> Eq for BgpRibEntry<P>
Auto Trait Implementations§
impl<P> Freeze for BgpRibEntry<P>where
P: Freeze,
impl<P> RefUnwindSafe for BgpRibEntry<P>where
P: RefUnwindSafe,
impl<P> Send for BgpRibEntry<P>
impl<P> Sync for BgpRibEntry<P>
impl<P> Unpin for BgpRibEntry<P>where
P: Unpin,
impl<P> UnsafeUnpin for BgpRibEntry<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for BgpRibEntry<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more