pub enum ConfigExpr<P: Prefix> {
IgpLinkWeight {
source: RouterId,
target: RouterId,
weight: LinkWeight,
},
OspfArea {
source: RouterId,
target: RouterId,
area: OspfArea,
},
BgpSession {
source: RouterId,
target: RouterId,
target_is_client: bool,
},
BgpRouteMap {
router: RouterId,
neighbor: RouterId,
direction: RouteMapDirection,
map: RouteMap<P>,
},
StaticRoute {
router: RouterId,
prefix: P,
target: StaticRoute,
},
LoadBalancing {
router: RouterId,
},
AdvertiseRoute {
router: RouterId,
prefix: P,
as_path: Vec<ASN>,
med: Option<u32>,
community: BTreeSet<Community>,
},
}Expand description
§Single configuration expression
The expression sets a specific thing in the network.
Variants§
IgpLinkWeight
Sets the link weight of a single link (directional) TODO make sure that the weight is strictly smaller than infinity.
Fields
§
weight: LinkWeightLink weight for IGP
OspfArea
Set the OSPF area of a single link (bidirectional)
Fields
BgpSession
Create a BGP session
Fields
BgpRouteMap
Set the BGP Route Map
Fields
§
direction: RouteMapDirectionDirection (incoming or outgoing)
StaticRoute
Set a static route
Fields
§
prefix: PFor which prefix to set the static route
§
target: StaticRouteTo which neighbor to forward packets to.
LoadBalancing
Enable or disable load balancing
AdvertiseRoute
Advertise (originate) a route for a prefix (network)
Implementations§
Source§impl<P: Prefix> ConfigExpr<P>
impl<P: Prefix> ConfigExpr<P>
Sourcepub fn key(&self) -> ConfigExprKey<P>
pub fn key(&self) -> ConfigExprKey<P>
Returns the key of the config expression. The idea behind the key is that the ConfigExpr
cannot be hashed and used as a key for a HashMap. But ConfigExprKey implements Hash,
and can therefore be used as a key.
Trait Implementations§
Source§impl<P: Clone + Prefix> Clone for ConfigExpr<P>
impl<P: Clone + Prefix> Clone for ConfigExpr<P>
Source§fn clone(&self) -> ConfigExpr<P>
fn clone(&self) -> ConfigExpr<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 ConfigExpr<P>where
P: for<'a> Deserialize<'a> + Prefix,
impl<'de, P> Deserialize<'de> for ConfigExpr<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 ConfigExpr<P>
impl<'n, P: Prefix, Q, Ospf: OspfImpl> NetworkFormatter<'n, P, Q, Ospf> for ConfigExpr<P>
Auto Trait Implementations§
impl<P> Freeze for ConfigExpr<P>where
P: Freeze,
impl<P> RefUnwindSafe for ConfigExpr<P>
impl<P> Send for ConfigExpr<P>
impl<P> Sync for ConfigExpr<P>
impl<P> Unpin for ConfigExpr<P>
impl<P> UnwindSafe for ConfigExpr<P>
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<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