Struct smoltcp::wire::EthernetFrame
[−]
[src]
pub struct EthernetFrame<T: AsRef<[u8]>> { /* fields omitted */ }
A read/write wrapper around an Ethernet II frame buffer.
Methods
impl<T: AsRef<[u8]>> Frame<T>
[src]
fn new(buffer: T) -> Result<Frame<T>, Error>
Wrap a buffer with an Ethernet frame. Returns an error if the buffer is too small or too large to contain one.
fn into_inner(self) -> T
Consumes the frame, returning the underlying buffer.
fn buffer_len(payload_len: usize) -> usize
Return the length of a buffer required to hold a packet with the payload of a given length.
fn dst_addr(&self) -> Address
Return the destination address field.
fn src_addr(&self) -> Address
Return the source address field.
fn ethertype(&self) -> EtherType
Return the EtherType field, without checking for 802.1Q.
impl<'a, T: AsRef<[u8]> + ?Sized> Frame<&'a T>
[src]
impl<T: AsRef<[u8]> + AsMut<[u8]>> Frame<T>
[src]
fn set_dst_addr(&mut self, value: Address)
Set the destination address field.
fn set_src_addr(&mut self, value: Address)
Set the source address field.
fn set_ethertype(&mut self, value: EtherType)
Set the EtherType field.
impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Frame<&'a mut T>
[src]
fn payload_mut(&mut self) -> &mut [u8]
Return a mutable pointer to the payload.
Trait Implementations
impl<T: Debug + AsRef<[u8]>> Debug for Frame<T>
[src]
impl<T: AsRef<[u8]>> Display for Frame<T>
[src]
impl<T: AsRef<[u8]>> PrettyPrint for Frame<T>
[src]
fn pretty_print(buffer: &AsRef<[u8]>,
f: &mut Formatter,
indent: &mut PrettyIndent)
-> Result
f: &mut Formatter,
indent: &mut PrettyIndent)
-> Result
Write a concise, formatted representation of a packet contained in the provided buffer, and any nested packets it may contain. Read more