[][src]Struct libtun::Packet

pub struct Packet { /* fields omitted */ }

Implementations

impl Packet[src]

pub fn new(buf: &[u8]) -> Packet[src]

pub fn out(&self) -> Vec<u8>[src]

pub fn source_addr(&self) -> IpAddr[src]

pub fn write_source_addr(&mut self, addr: IpAddr)[src]

pub fn dest_addr(&self) -> IpAddr[src]

pub fn write_dest_addr(&mut self, addr: IpAddr)[src]

pub fn total_length(&self) -> usize[src]

pub fn version(&self) -> u8[src]

pub fn ihl(&self) -> u8[src]

pub fn type_of_service(&self) -> u8[src]

pub fn identification(&self) -> u16[src]

pub fn flags(&self) -> u8[src]

pub fn ttl(&self) -> u8[src]

pub fn protocol(&self) -> u8[src]

This field indicates the next level protocol used in the data portion of the internet datagram. The values for various protocols are specified in "Assigned Numbers" [9]. 0 ICMP 6 TCP 17 UDP

pub fn checksum(&self) -> u16[src]

pub fn write_checksum(&mut self, checksum: u16)[src]

pub fn cal_checksum(&self) -> u16[src]

pub fn payload(&self) -> &[u8][src]

pub fn payload_mut(&mut self) -> &mut [u8][src]

Trait Implementations

impl AsRef<[u8]> for Packet[src]

impl Debug for Packet[src]

Auto Trait Implementations

impl RefUnwindSafe for Packet

impl Send for Packet

impl Sync for Packet

impl Unpin for Packet

impl UnwindSafe for Packet

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,