Skip to main content

Dissect

Trait Dissect 

Source
pub trait Dissect<'a> {
    type Output;

    // Required methods
    fn dissect(&self) -> Result<Self::Output, Error>;
    fn data(&self) -> &'a [u8] ;
    fn header_len(&self) -> usize;
}
Expand description

Trait for dissecting packet layers

Implement this trait to add support for dissecting protocol layers. The implementation should borrow from the packet data without copying.

Required Associated Types§

Source

type Output

The output type after dissection

Required Methods§

Source

fn dissect(&self) -> Result<Self::Output, Error>

Parse the next layer from the current packet data

Source

fn data(&self) -> &'a [u8]

Get the raw packet data

Source

fn header_len(&self) -> usize

Get the length of this layer’s header

Implementors§

Source§

impl<'a> Dissect<'a> for Dns<'a>

Source§

type Output = &'a [u8]

Source§

impl<'a> Dissect<'a> for Ethernet<'a>

Source§

type Output = &'a [u8]

Source§

impl<'a> Dissect<'a> for Icmp<'a>

Source§

type Output = &'a [u8]

Source§

impl<'a> Dissect<'a> for Ipv4<'a>

Source§

type Output = &'a [u8]

Source§

impl<'a> Dissect<'a> for Ipv6<'a>

Source§

type Output = &'a [u8]

Source§

impl<'a> Dissect<'a> for Tcp<'a>

Source§

type Output = &'a [u8]

Source§

impl<'a> Dissect<'a> for Udp<'a>

Source§

type Output = &'a [u8]