Struct bgpkit_parser::parser::bgp::attributes::AttributeParser
source · pub struct AttributeParser { /* private fields */ }Implementations§
source§impl AttributeParser
impl AttributeParser
pub fn new(has_add_path: bool) -> AttributeParser
sourcepub fn parse_attributes(
&self,
data: &[u8],
asn_len: &AsnLength,
afi: Option<Afi>,
safi: Option<Safi>,
prefixes: Option<&[NetworkPrefix]>
) -> Result<Vec<Attribute>, ParserError>
pub fn parse_attributes( &self, data: &[u8], asn_len: &AsnLength, afi: Option<Afi>, safi: Option<Safi>, prefixes: Option<&[NetworkPrefix]> ) -> Result<Vec<Attribute>, ParserError>
Parse BGP attributes given a slice of u8 and some options.
The data: &[u8] contains the entirety of the attributes bytes, therefore the size of
the slice is the total byte length of the attributes section of the message.