[][src]Struct packet_crafter::headers::IpHeader

pub struct IpHeader { /* fields omitted */ }

Implementations

impl IpHeader[src]

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

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

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

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

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

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

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

impl IpHeader[src]

pub fn set_tos(&mut self, v: u8)[src]

pub fn set_packet_len(&mut self, v: u16)[src]

pub fn set_identification(&mut self, v: u16)[src]

pub fn set_ttl(&mut self, v: u8)[src]

pub fn set_dst_ip(&mut self, v: IpAddr)[src]

impl IpHeader[src]

pub fn new<IA: Into<IpAddr>>(
    src_ip: IA,
    dst_ip: IA,
    next_proto: Protocol
) -> Self
[src]

Checks at runtime that we do not mix v4 and v6 addresses. Panics otherwise!

When calling this function with the concrete IP version type or a array with the appropriate length you will get compile time guarantee that the versions match.

pub fn set_next_protocol(&mut self, proto: Protocol) -> &mut Self[src]

Trait Implementations

impl Header for IpHeader[src]

fn make(self) -> PacketData[src]

needs testing on a big endian machine

Auto Trait Implementations

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.