pub struct MPLSPacket<'p> { /* private fields */ }
Expand description
A structure enabling manipulation of on the wire packets
Implementations§
Source§impl<'a> MPLSPacket<'a>
impl<'a> MPLSPacket<'a>
Sourcepub fn new(packet: &[u8]) -> Option<MPLSPacket<'_>>
pub fn new(packet: &[u8]) -> Option<MPLSPacket<'_>>
Constructs a new PPP packet. If the provided buffer is less than the minimum required packet size, this will return None.
Sourcepub fn minimum_packet_size() -> usize
pub fn minimum_packet_size() -> usize
The minimum size (in bytes) a packet of this type can be. It’s based on the total size of the fixed-size fields.
Sourcepub fn get_stack_size(&self) -> usize
pub fn get_stack_size(&self) -> usize
The size (in bytes) of the label stack.
Sourcepub fn get_num_labels(&self) -> usize
pub fn get_num_labels(&self) -> usize
The number of labels in the label stack.
Sourcepub fn get_top_label(&self) -> MPLSLabel
pub fn get_top_label(&self) -> MPLSLabel
The size (in bytes) of the label stack.
Sourcepub fn get_label_stack(&self) -> Vec<MPLSLabel>
pub fn get_label_stack(&self) -> Vec<MPLSLabel>
The label stack (top element is first).
Trait Implementations§
Source§impl<'a> Packet for MPLSPacket<'a>
impl<'a> Packet for MPLSPacket<'a>
Source§impl<'p> PartialEq for MPLSPacket<'p>
impl<'p> PartialEq for MPLSPacket<'p>
impl<'p> StructuralPartialEq for MPLSPacket<'p>
Auto Trait Implementations§
impl<'p> Freeze for MPLSPacket<'p>
impl<'p> RefUnwindSafe for MPLSPacket<'p>
impl<'p> Send for MPLSPacket<'p>
impl<'p> Sync for MPLSPacket<'p>
impl<'p> Unpin for MPLSPacket<'p>
impl<'p> UnwindSafe for MPLSPacket<'p>
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