Struct capsules_extra::net::ipv6::IP6Packet

source ·
pub struct IP6Packet<'a> {
    pub header: IP6Header,
    pub payload: IPPayload<'a>,
}
Expand description

This struct defines the IP6Packet format, and contains an IP6Header and an IPPayload.

Fields§

§header: IP6Header§payload: IPPayload<'a>

Implementations§

source§

impl<'a> IP6Packet<'a>

source

pub fn new(payload: IPPayload<'a>) -> IP6Packet<'a>

This function returns a new IP6Packet struct. Note that the IP6Packet.header field is set to IP6Header::default()

§Arguments

payload - The IPPayload struct for the IP6Packet

source

pub fn reset(&mut self)

source

pub fn get_total_len(&self) -> u16

source

pub fn get_payload(&self) -> &[u8]

source

pub fn get_total_hdr_size(&self) -> usize

source

pub fn set_transport_checksum(&mut self)

source

pub fn set_payload( &mut self, transport_header: TransportHeader, payload: &SubSliceMut<'static, u8>, )

This function should be the function used to set the payload for a given IP6Packet object. It first calls the IPPayload::set_payload method to set the transport header and transport payload, which then returns the ip6_nh value for the TransportHeader and the length of the serialized IPPayload region. This function then sets the IP6Header next header field correctly. Without using this function, the IP6Header.next_header field may not agree with the actual next header (IP6Header.payload.header)

§Arguments

transport_header - The TransportHeader to be set as the next header payload - The transport payload to be copied into the IPPayload transport payload

source

pub fn encode(&self, buf: &mut [u8]) -> SResult<usize>

Auto Trait Implementations§

§

impl<'a> Freeze for IP6Packet<'a>

§

impl<'a> RefUnwindSafe for IP6Packet<'a>

§

impl<'a> Send for IP6Packet<'a>

§

impl<'a> Sync for IP6Packet<'a>

§

impl<'a> Unpin for IP6Packet<'a>

§

impl<'a> !UnwindSafe for IP6Packet<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.