Skip to main content

Capability

Enum Capability 

Source
#[repr(u8)]
pub enum Capability {
Show 14 variants MultiProtocol { afi: AddressFamilyId, safi: SubsequentAfi, }, RouteRefresh = 2, OutboundRouteFilter { afi: AddressFamilyId, safi: SubsequentAfi, orfs: Vec<OutboundRouteFilterEntry>, }, ExtendedNextHop { entries: Vec<ExtendedNextHop>, }, ExtendedMessage = 6, BgpSec { header: BgpSecHeader, afi: AddressFamilyId, }, MultiLabelCompat {}, BgpRole { role: BgpRole, }, GracefulRestart { restart_state: bool, restart_time: u16, entries: Vec<GracefulRestartEntry>, }, FourByteAsn { asn: u32, }, AddPath { afi: AddressFamilyId, safi: SubsequentAfi, send_recv: AddPathSendRecv, }, EnhancedRouteRefresh = 70, LongLivedGracefulRestart(Vec<LongLivedGracefulRestart>), UnknownCapability { type_code: u8, length: u8, value: Vec<u8>, },
}

Variants§

§

MultiProtocol

MultiProtocol Extension (RFC 2858).

§

RouteRefresh = 2

Route Refresh capability (RFC 2918).

§

OutboundRouteFilter

Outbound Route Filtering (RFC 5291). https://datatracker.ietf.org/doc/html/rfc5291

§

ExtendedNextHop

Extended Next Hop encoding (RFC 8950).

Fields

§

ExtendedMessage = 6

Extended Message (RFC 8654).

§

BgpSec

BGPSec (RFC 8205).

§

MultiLabelCompat

Multiple labels compatibility (RFC 8277).

§

BgpRole

Fields

§role: BgpRole
§

GracefulRestart

Graceful restart capability (RFC 4724).

Fields

§restart_state: bool

When set to true it means that the BGP speaker has just restarted and the peer must not wait for the End of RIB marker from the speaker before advertising routing information to the speaker.

§restart_time: u16

This is the estimated time (in seconds) it will take for the BGP session to be re-established after a restart. This can be used to speed up routing convergence by its peer in case that the BGP speaker does not come back after a restart.

§entries: Vec<GracefulRestartEntry>

The AFI and SAFI, taken in combination, indicate that Graceful Restart is supported for routes that are advertised with the same AFI and SAFI. Routes may be explicitly associated with a particular AFI and SAFI using the encoding of [BGP-MP] or implicitly associated with <AFI=IPv4, SAFI=Unicast> if using the encoding of [BGP-4].

§

FourByteAsn

Four Byte ASN (RFC 4274).

Fields

§asn: u32
§

AddPath

Additional Path (RFC 7911).

§

EnhancedRouteRefresh = 70

Enhanced Route Refresh (RFC 7313).

§

LongLivedGracefulRestart(Vec<LongLivedGracefulRestart>)

Long Lived Graceful Restart (RFC 9494).

§

UnknownCapability

Unknown Capability encapsulates any capabilities that we don’t know about.

Fields

§type_code: u8
§length: u8
§value: Vec<u8>

Implementations§

Source§

impl Capability

Source

pub fn from_wire<'a>( _ctx: &ParserContext, buf: &'a [u8], ) -> IResult<&'a [u8], Self, BgpParserError<&'a [u8]>>

from_wire parses a Capability message.

Source

pub fn to_wire(&self, _ctx: &ParserContext, out: &mut BytesMut) -> Result<()>

Source

pub fn wire_len(&self, _ctx: &ParserContext) -> Result<u16>

Trait Implementations§

Source§

impl Debug for Capability

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Capability

Source§

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 Eq for Capability

Source§

impl<'_enum> From<&'_enum Capability> for CapabilityDiscriminants

Source§

fn from(val: &'_enum Capability) -> CapabilityDiscriminants

Converts to this type from the input type.
Source§

impl From<Capability> for CapabilityDiscriminants

Source§

fn from(val: Capability) -> CapabilityDiscriminants

Converts to this type from the input type.
Source§

impl IntoDiscriminant for Capability

Source§

type Discriminant = CapabilityDiscriminants

Enum listing the same variants as this enum but without any data fields
Source§

fn discriminant(&self) -> Self::Discriminant

Source§

impl PartialEq for Capability

Source§

fn eq(&self, other: &Capability) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Capability

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Capability

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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, 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.