Enum route_verification_ir::filter::Filter
source · pub enum Filter {
Show 14 variants
FilterSet(String),
Any,
AddrPrefixSet(Vec<AddrPfxRange>),
RouteSet(String, RangeOperator),
AsNum(u32, RangeOperator),
AsSet(String, RangeOperator),
AsPathRE(String),
PeerAS,
And {
left: Box<Filter>,
right: Box<Filter>,
},
Or {
left: Box<Filter>,
right: Box<Filter>,
},
Not(Box<Filter>),
Group(Box<Filter>),
Community(Call),
Unknown(String),
}
Expand description
The filter attribute defines the set’s policy filter. A policy filter is a logical expression which when applied to a set of routes returns a subset of these routes. We say that the policy filter matches the subset returned. The policy filter can match routes using any BGP path attribute, such as the destination address prefix (or NLRI), AS-path, or community attributes.
https://www.rfc-editor.org/rfc/rfc2622#section-5.4
Range operators can also be applied to address prefix sets. In this case, they distribute over the members of the set. For example, for a route-set (defined later) rs-foo, rs-foo^+ contains all the inclusive more specifics of all the prefixes in rs-foo.
https://www.rfc-editor.org/rfc/rfc2622#page-5
Note: although RouteSet
, AsNum
, and AsSet
here use RangeOperator
,
the RFC only allows ^-
and ^+
.
Variants§
FilterSet(String)
<filter-set-name>
: An RPSL name that starts with fltr-
.
Any
AddrPrefixSet(Vec<AddrPfxRange>)
Address-Prefix Set This is an explicit list of address prefixes enclosed in braces ‘{’ and ‘}’. The policy filter matches the set of routes whose destination address-prefix is in the set.
An address prefix can be optionally followed by a range operator
RouteSet(String, RangeOperator)
Route Set Name A route set name matches the set of routes that are members of the set. A route set name may be a name of a route-set object, an AS number, or a name of an as-set object (AS numbers and as-set names implicitly define route sets; please see Section 5.3).
A route set name can also be followed by one of the operators ‘^-’, ‘^+’…
AsNum(u32, RangeOperator)
An AS number.
AsSet(String, RangeOperator)
A name of an as-set object.
AsPathRE(String)
AS Path Regular Expressions An AS-path regular expression can be used as a policy filter by enclosing the expression in ‘<’ and ‘>’. An AS-path policy filter matches the set of routes which traverses a sequence of ASes matched by the AS-path regular expression.
PeerAS
PeerAS can be used instead of the AS number of the peer AS.
And
Or
Not(Box<Filter>)
Group(Box<Filter>)
Community(Call)
Unknown(String)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Filter
impl<'de> Deserialize<'de> for Filter
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 Ord for Filter
impl Ord for Filter
source§impl PartialEq for Filter
impl PartialEq for Filter
source§impl PartialOrd for Filter
impl PartialOrd for Filter
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Filter
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
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> 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