Enum PathAttribute

Source
pub enum PathAttribute {
Show 33 variants ORIGIN(Origin), AS_PATH(ASPath), NEXT_HOP(IpAddr), MULTI_EXIT_DISC(u32), LOCAL_PREF(u32), ATOMIC_AGGREGATOR, AGGREGATOR((u32, Ipv4Addr)), COMMUNITY(Vec<u32>), ORIGINATOR_ID(u32), CLUSTER_LIST(Vec<u32>), DPA((u16, u32)), ADVERTISER, CLUSTER_ID, MP_REACH_NLRI(MPReachNLRI), MP_UNREACH_NLRI(MPUnreachNLRI), EXTENDED_COMMUNITIES(Vec<u64>), AS4_PATH(ASPath), AS4_AGGREGATOR((u32, Ipv4Addr)), SSA, CONNECTOR(Ipv4Addr), AS_PATHLIMIT((u8, u32)), PMSI_TUNNEL((u8, u32, Vec<u8>)), TUNNEL_ENCAPSULATION((u16, Vec<u8>)), TRAFFIC_ENGINEERING, IPV6_SPECIFIC_EXTENDED_COMMUNITY((u8, u8, Ipv6Addr, u16)), AIGP((u8, Vec<u8>)), PE_DISTINGUISHER_LABELS, ENTROPY_LABEL_CAPABILITY, BGP_LS, LARGE_COMMUNITY(Vec<(u32, u32, u32)>), BGPSEC_PATH, BGP_PREFIX_SID, ATTR_SET((u32, Vec<PathAttribute>)),
}
Expand description

Represents a path attribute that described meta data of a specific route.

Variants§

§

ORIGIN(Origin)

Indicates how an UPDATE message has been generated. Defined in RFC4271.

§

AS_PATH(ASPath)

Represents the path through which an UPDATE message traveled. Defined in RFC4271.

§

NEXT_HOP(IpAddr)

Indicates IP address that is to be used as a next hop. Defined in RFC4271.

§

MULTI_EXIT_DISC(u32)

Used to discriminate between multiple exit or entry points. Defined in RFC4271.

§

LOCAL_PREF(u32)

Represents the degree of preference for internal routes. Defined in RFC4271.

§

ATOMIC_AGGREGATOR

May be used when a route has been aggregated. Defined in RFC4271.

§

AGGREGATOR((u32, Ipv4Addr))

May be used to add information on who aggregated this route. Defined in RFC4271.

§

COMMUNITY(Vec<u32>)

Enables users to add extra information. Defined in RFC1997.

§

ORIGINATOR_ID(u32)

Defined in RFC4456.

§

CLUSTER_LIST(Vec<u32>)

Defined in RFC4456. Holds a list of CLUSTER_IDs.

§

DPA((u16, u32))

Defined in RFC6938. (deprecated) Tuple represents the (ASN specifying the preference, DPA value).

§

ADVERTISER

Defined in RFC6938. (deprecated)

§

CLUSTER_ID

Defined in RFC6938. (deprecated)

§

MP_REACH_NLRI(MPReachNLRI)

Multi-protocol extensions. Defined in RFC4760.

§

MP_UNREACH_NLRI(MPUnreachNLRI)

Multi-protocol extensions. Defined in RFC4760.

§

EXTENDED_COMMUNITIES(Vec<u64>)

Defined in RFC4360.

§

AS4_PATH(ASPath)

AS_PATH using 32-bit ASN. Defined in RFC6793.

§

AS4_AGGREGATOR((u32, Ipv4Addr))

AGGREGATOR using 32-bit ASN. Defined in RFC6793.

§

SSA

SAFI Specific Attribute (deprecated).

§

CONNECTOR(Ipv4Addr)

Defined in RFC6037. (deprecated)

§

AS_PATHLIMIT((u8, u32))

Defined here. (deprecated)

§

PMSI_TUNNEL((u8, u32, Vec<u8>))

Defined in RFC6514. Specifies the (Flags, Tunnel Type + MPLS Label, Tunnel Identifier) fields.

§

TUNNEL_ENCAPSULATION((u16, Vec<u8>))

Defined in RFC5512. Specifies the (Tunnel Type, Value) fields.

§

TRAFFIC_ENGINEERING

Defined in RFC5543.

§

IPV6_SPECIFIC_EXTENDED_COMMUNITY((u8, u8, Ipv6Addr, u16))

Defined in RFC5701. Specifies the (Transitive, Sub-type, Global Administrator, Local Administrator) fields.

§

AIGP((u8, Vec<u8>))

Defined in RFC7311. Specifies the (Type, Value) fields.

§

PE_DISTINGUISHER_LABELS

Defined in RFC6514.

§

ENTROPY_LABEL_CAPABILITY

Defined in RFC6790.

§

BGP_LS

Defined in RFC7752. (deprecated)

§

LARGE_COMMUNITY(Vec<(u32, u32, u32)>)

Defined in RFC8092.

§

BGPSEC_PATH

Defined in RFC8205.

§

BGP_PREFIX_SID

Defined here.

§

ATTR_SET((u32, Vec<PathAttribute>))

Defined in RFC6368.

Implementations§

Source§

impl PathAttribute

Source

pub fn parse( stream: &mut impl Read, capabilities: &Capabilities, ) -> Result<PathAttribute, Error>

Reads a Path Attribute from an object that implements Read.

§Panics

This function does not panic.

§Errors

Any IO error will be returned while reading from the stream. Behavior is undefined when an ill-formatted stream is provided.

§Safety

This function does not make use of unsafe code.

Source

pub fn id(&self) -> Identifier

Retrieve the identifier belonging to this PathAttribute

Source

pub fn encode(&self, buf: &mut impl Write) -> Result<(), Error>

Encode path attribute to bytes

Trait Implementations§

Source§

impl Clone for PathAttribute

Source§

fn clone(&self) -> PathAttribute

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PathAttribute

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.