[−][src]Struct capsule::packets::ip::v6::Fragment
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]
fn next_protocol(&self) -> ProtocolNumber
[src]
fn set_next_protocol(&mut self, proto: ProtocolNumber)
[src]
fn src(&self) -> IpAddr
[src]
fn set_src(&mut self, src: IpAddr) -> Fallible<()>
[src]
fn dst(&self) -> IpAddr
[src]
fn set_dst(&mut self, dst: IpAddr) -> Fallible<()>
[src]
fn pseudo_header(
&self,
packet_len: u16,
protocol: ProtocolNumber
) -> PseudoHeader
[src]
&self,
packet_len: u16,
protocol: ProtocolNumber
) -> PseudoHeader
fn truncate(&mut self, mtu: usize) -> Fallible<()>
[src]
impl<E: Ipv6Packet> Ipv6Packet for Fragment<E>
[src]
fn next_header(&self) -> ProtocolNumber
[src]
fn set_next_header(&mut self, next_header: ProtocolNumber)
[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 envelope(&self) -> &Self::Envelope
[src]
fn envelope_mut(&mut self) -> &mut Self::Envelope
[src]
fn offset(&self) -> usize
[src]
fn header_len(&self) -> usize
[src]
unsafe fn clone(&self, internal: Internal) -> Self
[src]
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.
fn deparse(self) -> Self::Envelope
[src]
fn mbuf(&self) -> &Mbuf
[src]
fn mbuf_mut(&mut self) -> &mut Mbuf
[src]
fn payload_offset(&self) -> usize
[src]
fn len(&self) -> usize
[src]
fn payload_len(&self) -> usize
[src]
fn parse<T: Packet<Envelope = Self>>(self) -> Fallible<T> where
Self: Sized,
[src]
Self: Sized,
fn peek<T: Packet<Envelope = Self>>(&self) -> Fallible<Immutable<T>> where
Self: Sized,
[src]
Self: Sized,
fn push<T: Packet<Envelope = Self>>(self) -> Fallible<T> where
Self: Sized,
[src]
Self: Sized,
fn remove_payload(&mut self) -> Fallible<()>
[src]
fn reset(self) -> Mbuf where
Self: Sized,
[src]
Self: Sized,
fn reconcile(&mut self)
[src]
fn reconcile_all(&mut self)
[src]
Auto Trait Implementations
impl<E> RefUnwindSafe for Fragment<E> where
E: RefUnwindSafe,
E: RefUnwindSafe,
impl<E> !Send for Fragment<E>
impl<E> !Sync for Fragment<E>
impl<E> Unpin for Fragment<E> where
E: Unpin,
E: Unpin,
impl<E> UnwindSafe for Fragment<E> where
E: UnwindSafe,
E: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,