capsules_extra::net::ipv6

Struct 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>,

Source§

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>,

Source§

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.