Enum bgpkit_parser::models::community::ExtendedCommunity
source · pub enum ExtendedCommunity {
TransitiveTwoOctetAs(TwoOctetAsExtCommunity),
TransitiveIpv4Addr(Ipv4AddrExtCommunity),
TransitiveFourOctetAs(FourOctetAsExtCommunity),
TransitiveOpaque(OpaqueExtCommunity),
NonTransitiveTwoOctetAs(TwoOctetAsExtCommunity),
NonTransitiveIpv4Addr(Ipv4AddrExtCommunity),
NonTransitiveFourOctetAs(FourOctetAsExtCommunity),
NonTransitiveOpaque(OpaqueExtCommunity),
Raw([u8; 8]),
}
Expand description
Extended Communities.
§Overview
It is a 8-octet data that has flexible definition based on the types: https://datatracker.ietf.org/doc/html/rfc4360
For more up-to-date definitions, see IANA’ website.
Each Extended Community is encoded as an 8-octet quantity, as
follows:
- Type Field : 1 or 2 octets
- Value Field : Remaining octets
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type high | Type low(*) | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Value |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
(*) Present for Extended types only, used for the Value field
otherwise.
§Display
When output, the extended communities has the following string prefixes to indicate the sub type:
ecas2:
stands forExtended Community AS Specific 2-octet
ecas4:
stands forExtended Community AS Specific 4-octet
ecv4:
stands forExtended Community IPv4 Specific
ecv6:
stands forExtended Community IPv6 Specific
ecop:
stands forExtended Community Opaque
ecraw:
stands forExtended Community Raw
Variants§
TransitiveTwoOctetAs(TwoOctetAsExtCommunity)
TransitiveIpv4Addr(Ipv4AddrExtCommunity)
TransitiveFourOctetAs(FourOctetAsExtCommunity)
TransitiveOpaque(OpaqueExtCommunity)
NonTransitiveTwoOctetAs(TwoOctetAsExtCommunity)
NonTransitiveIpv4Addr(Ipv4AddrExtCommunity)
NonTransitiveFourOctetAs(FourOctetAsExtCommunity)
NonTransitiveOpaque(OpaqueExtCommunity)
Raw([u8; 8])
Implementations§
source§impl ExtendedCommunity
impl ExtendedCommunity
pub const fn community_type(&self) -> ExtendedCommunityType
Trait Implementations§
source§impl Clone for ExtendedCommunity
impl Clone for ExtendedCommunity
source§fn clone(&self) -> ExtendedCommunity
fn clone(&self) -> ExtendedCommunity
Returns a copy 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 Debug for ExtendedCommunity
impl Debug for ExtendedCommunity
source§impl Display for ExtendedCommunity
impl Display for ExtendedCommunity
source§impl PartialEq for ExtendedCommunity
impl PartialEq for ExtendedCommunity
source§fn eq(&self, other: &ExtendedCommunity) -> bool
fn eq(&self, other: &ExtendedCommunity) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for ExtendedCommunity
impl Eq for ExtendedCommunity
impl StructuralPartialEq for ExtendedCommunity
Auto Trait Implementations§
impl Freeze for ExtendedCommunity
impl RefUnwindSafe for ExtendedCommunity
impl Send for ExtendedCommunity
impl Sync for ExtendedCommunity
impl Unpin for ExtendedCommunity
impl UnwindSafe for ExtendedCommunity
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<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.