pub struct OspfDomain<Ospf = GlobalOspfCoordinator> { /* private fields */ }Expand description
The OSPF network for each domain separately. A domain is all routers that belong to the same AS.
Implementations§
Source§impl<Ospf> OspfDomain<Ospf>where
Ospf: OspfCoordinator,
impl<Ospf> OspfDomain<Ospf>where
Ospf: OspfCoordinator,
Sourcepub fn has_edge(&self, a: RouterId, b: RouterId) -> bool
pub fn has_edge(&self, a: RouterId, b: RouterId) -> bool
Return true if there exists a link from a (must be part of this AS) to b.
Sourcepub fn indices(&self) -> DomainIndices<'_> ⓘ
pub fn indices(&self) -> DomainIndices<'_> ⓘ
Iterate over all router indices in that domain
Sourcepub fn graph(&self) -> StableGraph<(), (LinkWeight, OspfArea), Directed, u32>
pub fn graph(&self) -> StableGraph<(), (LinkWeight, OspfArea), Directed, u32>
Generate a graph for only the given domain.
Sourcepub fn get_weight(&self, a: RouterId, b: RouterId) -> LinkWeight
pub fn get_weight(&self, a: RouterId, b: RouterId) -> LinkWeight
Return the OSPF weight of a link (or LinkWeight::INFINITY if the link does not exist).
Sourcepub fn get_area(&self, a: RouterId, b: RouterId) -> Option<OspfArea>
pub fn get_area(&self, a: RouterId, b: RouterId) -> Option<OspfArea>
Return the OSPF area of a link.
Sourcepub fn is_reachable<P: Prefix>(
&self,
a: RouterId,
b: RouterId,
routers: &BTreeMap<RouterId, Router<P, Ospf::Process>>,
) -> bool
pub fn is_reachable<P: Prefix>( &self, a: RouterId, b: RouterId, routers: &BTreeMap<RouterId, Router<P, Ospf::Process>>, ) -> bool
Returns true if a can reach b, and vice-versa. a must be in this domain, while b can
be in another domain.
Sourcepub fn coordinator(&self) -> &Ospf
pub fn coordinator(&self) -> &Ospf
Get a reference to the OSPF coordinator struct
Sourcepub fn internal_edges(&self) -> InternalEdges<'_> ⓘ
pub fn internal_edges(&self) -> InternalEdges<'_> ⓘ
Get an iterator over all internal edges. Each link will appear twice, once in each direction.
Sourcepub fn external_edges(&self) -> ExternalEdges<'_> ⓘ
pub fn external_edges(&self) -> ExternalEdges<'_> ⓘ
Get an iterator over all external edges (edges that connect to a different AS). Each link will appear once, from the internal router to the external network.
Sourcepub fn edges(&self) -> Edges<'_> ⓘ
pub fn edges(&self) -> Edges<'_> ⓘ
Get an iterator over all edges in the network. The iterator will yield first all internal edges twice (once in both directions), and then yield all external edges once (from the internal router to the external network). External edges connect this AS to another one.
Trait Implementations§
Source§impl<Ospf: Clone> Clone for OspfDomain<Ospf>
impl<Ospf: Clone> Clone for OspfDomain<Ospf>
Source§fn clone(&self) -> OspfDomain<Ospf>
fn clone(&self) -> OspfDomain<Ospf>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Ospf: Debug> Debug for OspfDomain<Ospf>
impl<Ospf: Debug> Debug for OspfDomain<Ospf>
Source§impl<'de, Ospf> Deserialize<'de> for OspfDomain<Ospf>where
Ospf: Deserialize<'de>,
impl<'de, Ospf> Deserialize<'de> for OspfDomain<Ospf>where
Ospf: Deserialize<'de>,
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>,
Source§impl<Ospf> PartialEq for OspfDomain<Ospf>
impl<Ospf> PartialEq for OspfDomain<Ospf>
Auto Trait Implementations§
impl<Ospf> Freeze for OspfDomain<Ospf>where
Ospf: Freeze,
impl<Ospf> RefUnwindSafe for OspfDomain<Ospf>where
Ospf: RefUnwindSafe,
impl<Ospf> Send for OspfDomain<Ospf>where
Ospf: Send,
impl<Ospf> Sync for OspfDomain<Ospf>where
Ospf: Sync,
impl<Ospf> Unpin for OspfDomain<Ospf>where
Ospf: Unpin,
impl<Ospf> UnwindSafe for OspfDomain<Ospf>where
Ospf: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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