Skip to main content

decode_path_attributes

Function decode_path_attributes 

Source
pub fn decode_path_attributes(
    buf: &[u8],
    four_octet_as: bool,
    add_path_families: &[(Afi, Safi)],
) -> Result<Vec<PathAttribute>, DecodeError>
Expand description

Decode path attributes from wire bytes (RFC 4271 §4.3).

Each attribute is: flags(1) + type(1) + length(1 or 2) + value. The Extended Length flag determines 1-byte vs 2-byte length.

four_octet_as controls whether AS numbers in AS_PATH are 2 or 4 bytes.

§Errors

Returns DecodeError on truncated data or malformed attribute values.