pub struct OpenMessage {
pub version: u8,
pub asn: u16,
pub hold_time: u16,
pub identifier: Ipv4Addr,
pub options: Vec<OpenOption>,
}Expand description
Contains messages related to the BGP Open message, i.e. the Open message itself and options / capabilities.
Fields§
§version: u8Version of the BGP protocol in use.
asn: u16AS Number of the BGP speaker, or AS_TRANS if using 4 byte ASN.
hold_time: u16Hold time parameter in seconds.
identifier: Ipv4AddrGlobal identifier of the BGP speaker.
options: Vec<OpenOption>Options.
Implementations§
Source§impl OpenMessage
impl OpenMessage
Sourcepub fn from_wire<'a>(
ctx: &ParserContext,
buf: &'a [u8],
) -> IResult<&'a [u8], Self, BgpParserError<&'a [u8]>>
pub fn from_wire<'a>( ctx: &ParserContext, buf: &'a [u8], ) -> IResult<&'a [u8], Self, BgpParserError<&'a [u8]>>
The from_wire implementation parses a BGP Open message from a buffer containing the payload of the open message (i.e. without the BGP header / type / length) and the buf passed in must contain only the open message.
pub fn to_wire(&self, ctx: &ParserContext, out: &mut BytesMut) -> Result<()>
pub fn wire_len(&self, ctx: &ParserContext) -> Result<u16>
Trait Implementations§
Source§impl Debug for OpenMessage
impl Debug for OpenMessage
Source§impl<'de> Deserialize<'de> for OpenMessage
impl<'de> Deserialize<'de> for OpenMessage
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
impl Eq for OpenMessage
Source§impl PartialEq for OpenMessage
impl PartialEq for OpenMessage
Source§fn eq(&self, other: &OpenMessage) -> bool
fn eq(&self, other: &OpenMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for OpenMessage
impl Serialize for OpenMessage
impl StructuralPartialEq for OpenMessage
Auto Trait Implementations§
impl Freeze for OpenMessage
impl RefUnwindSafe for OpenMessage
impl Send for OpenMessage
impl Sync for OpenMessage
impl Unpin for OpenMessage
impl UnsafeUnpin for OpenMessage
impl UnwindSafe for OpenMessage
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