Trait rshark::Protocol [] [src]

pub trait Protocol {
    fn short_name(&self) -> &'static str;
    fn full_name(&self) -> &'static str;
    fn dissect(&self, &[u8]) -> Result;
}

A description of a protocol, including code that can parse it.

Required Methods

fn short_name(&self) -> &'static str

A short name that can fit in a user display, e.g., "IPv6".

fn full_name(&self) -> &'static str

A complete, unambigous protocol name, e.g., "Internet Protocol version 6"

fn dissect(&self, &[u8]) -> Result

A function to dissect some bytes according to the protocol.

Implementors