[][src]Struct capsule::packets::ip::v6::Fragment

pub struct Fragment<E: Ipv6Packet> { /* fields omitted */ }

IPv6 Fragment Extension packet based on IETF RFC 8200.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Next Header  |   Reserved    |      Fragment Offset    |Res|M|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Identification                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  • Next Header: 8-bit selector. Identifies the initial header type of the Fragmentable Part of the original packet. Uses the same values as the IPv4 Protocol field [IANA-PN].

  • Reserved: 8-bit reserved field. Initialized to zero for transmission; ignored on reception.

  • Fragment Offset: 13-bit unsigned integer. The offset, in 8-octet units, of the data following this header, relative to the start of the Fragmentable Part of the original packet.

  • Res: 2-bit reserved field. Initialized to zero for transmission; ignored on reception.

  • M flag: 1 = more fragments; 0 = last fragment.

  • Identification: 32 bits.

Remarks

Because the payload following the fragment header is incomplete data, push and remove should be used with care. The result is likely not a valid packet without additional fixes.

Implementations

impl<E: Ipv6Packet> Fragment<E>[src]

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

Returns the offset of the data following this header relative to the start of the fragmentable part of the original packet. It is measured in units of 8 octets or 64 bits.

pub fn set_fragment_offset(&mut self, offset: u16)[src]

Sets the fragment offset.

pub fn more_fragments(&self) -> bool[src]

Returns a flag indicating whether there are more fragments.

pub fn set_more_fragments(&mut self)[src]

Sets the more fragment flag indicating there are more fragments.

pub fn unset_more_fragments(&mut self)[src]

Unsets the more fragment flag indicating this is the last fragment.

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

Returns the identifying value assigned by the sender to aid in assembling the fragments of a packet.

pub fn set_identification(&mut self, identification: u32)[src]

Sets the identifying value.

Trait Implementations

impl<E: Ipv6Packet> Debug for Fragment<E>[src]

impl<E: Ipv6Packet> IpPacket for Fragment<E>[src]

impl<E: Ipv6Packet> Ipv6Packet for Fragment<E>[src]

impl<E: Ipv6Packet> Packet for Fragment<E>[src]

type Envelope = E

The preceding type for an IPv6 fragment packet can be either an IPv6 packet or any possible IPv6 extension packets.

fn try_parse(envelope: Self::Envelope, _internal: Internal) -> Fallible<Self>[src]

Parses the envelope's payload as an IPv6 fragment packet.

next_header of the envelope must be set to ProtocolNumbers::Ipv6Frag. Otherwise a parsing error is returned.

fn try_push(envelope: Self::Envelope, _internal: Internal) -> Fallible<Self>[src]

Prepends an IPv6 fragment packet to the beginning of the envelope's payload.

next_header is set to the value of the next_header field of the envelope, and the envelope is set to ProtocolNumbers::Ipv6Frag.

fn remove(self) -> Fallible<Self::Envelope>[src]

Removes IPv6 fragment packet from the message buffer.

The envelope's next_header field is set to the value of the next_header field on the fragment packet.

Auto Trait Implementations

impl<E> RefUnwindSafe for Fragment<E> where
    E: RefUnwindSafe

impl<E> !Send for Fragment<E>

impl<E> !Sync for Fragment<E>

impl<E> Unpin for Fragment<E> where
    E: Unpin

impl<E> UnwindSafe for Fragment<E> where
    E: UnwindSafe

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> Same<T> for T

type Output = T

Should always be Self

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