Skip to main content

encode_path_attributes

Function encode_path_attributes 

Source
pub fn encode_path_attributes(
    attrs: &[PathAttribute],
    buf: &mut Vec<u8>,
    four_octet_as: bool,
    add_path_mp: bool,
)
Expand description

Encode path attributes to wire bytes.

four_octet_as controls whether AS numbers in AS_PATH are 2 or 4 bytes. Encode a list of path attributes into wire format.

When add_path_mp is true, MP_REACH_NLRI and MP_UNREACH_NLRI NLRI entries include 4-byte path IDs per RFC 7911.