[−][src]Struct capsule::packets::ip::v6::SegmentRouting
IPv6 Segment Routing based on IETF DRAFT.
Routing Headers are defined in IETF RFC 8200. The Segment Routing Header has a new Routing Type (suggested value 4) to be assigned by IANA.
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 | Hdr Ext Len | Routing Type | Segments Left | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Last Entry | Flags | Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Segment List[0] (128 bits IPv6 address) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ... | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Segment List[n] (128 bits IPv6 address) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Optional Type Length Value objects (variable) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
Next Header: 8-bit selector. Identifies the type of header immediately following the SRH.
-
Hdr Ext Len: 8-bit unsigned integer, is the length of the SRH header in 8-octet units, not including the first 8 octets.
-
Routing Type: TBD, to be assigned by IANA (suggested value: 4).
-
Segments Left: 8-bit unsigned integer Number of route segments remaining, i.e., number of explicitly listed intermediate nodes still to be visited before reaching the final destination.
-
Last Entry: Contains the index (zero based), in the Segment List, of the last element of the Segment List.
-
Flags: 8 bits of flags. Following flags are defined:
0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ |U U U U U U U U| +-+-+-+-+-+-+-+-+
- U: Unused and for future use. MUST be 0 on transmission and ignored on receipt.
-
Tag: Tag a packet as part of a class or group of packets, e.g., packets sharing the same set of properties.
-
Segment List[n]: 128 bit IPv6 addresses representing the nth segment in the Segment List. The Segment List is encoded starting from the last segment of the SR Policy, i.e., the first element of the segment list (Segment List [0]) contains the last segment of the SR Policy, the second element contains the penultimate segment of the SR Policy and so on.
-
Type Length Value: A TLV provides meta-data for segment processing. The TLVs defined in this spec are the HMAC and PAD TLVs.
Remarks
TLVs are not supported yet.
Implementations
impl<E: Ipv6Packet> SegmentRouting<E>
[src]
pub fn hdr_ext_len(&self) -> u8
[src]
Returns the length of the segment routing header in 8-octet units, not including the first 8 octets.
pub fn routing_type(&self) -> u8
[src]
Returns the routing type. Suggested value is 4
to be assigned by
IANA.
pub fn segments_left(&self) -> u8
[src]
Returns the number of route segments remaining.
pub fn set_segments_left(&mut self, segments_left: u8)
[src]
Sets the number of route segments remaining.
Remarks
Should also call Ipv6::set_dst
to keep the packet's destination
in sync with the segment routing header.
pub fn last_entry(&self) -> u8
[src]
Returns the index of the last element of the segment list, 0 based.
pub fn tag(&self) -> u16
[src]
Returns the tag that marks a packet as part of a class or group of packets.
pub fn set_tag(&mut self, tag: u16)
[src]
Tags a packet as part of a class or group of packets.
pub fn segments(&self) -> &[Ipv6Addr]
[src]
Returns the segment list.
pub fn set_segments(&mut self, segments: &[Ipv6Addr]) -> Fallible<()>
[src]
Sets the segment list.
Remarks
Be aware that when invoking this function, it can affect Tcp and Udp checksum calculations, as the last segment is used as part of the pseudo header.
Trait Implementations
impl<E: Ipv6Packet> Debug for SegmentRouting<E>
[src]
impl<E: Ipv6Packet> IpPacket for SegmentRouting<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
Returns the pseudo header.
Based on IETF RFC 8200, if the IPv6 packet contains a Routing header, the Destination Address used in the pseudo-header is that of the final destination. At the originating node, that address will be in the last element of the Routing header; at the recipient(s), that address will be in the Destination Address field of the IPv6 header.
fn truncate(&mut self, mtu: usize) -> Fallible<()>
[src]
impl<E: Ipv6Packet> Ipv6Packet for SegmentRouting<E>
[src]
fn next_header(&self) -> ProtocolNumber
[src]
fn set_next_header(&mut self, next_header: ProtocolNumber)
[src]
impl<E: Ipv6Packet> Packet for SegmentRouting<E>
[src]
type Envelope = E
The preceding type for an IPv6 segment routing 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 segment routing packet.
next_header
of the envelope must be set to ProtocolNumbers::Ipv6Route
.
Otherwise a parsing error is returned.
fn try_push(envelope: Self::Envelope, _internal: Internal) -> Fallible<Self>
[src]
Prepends an IPv6 segment routing packet with a segment list of one 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::Ipv6Route
.
fn remove(self) -> Fallible<Self::Envelope>
[src]
Removes IPv6 segment routing packet from the message buffer.
The envelope's next_header
field is set to the value of the
next_header
field on the segment routing 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 SegmentRouting<E> where
E: RefUnwindSafe,
E: RefUnwindSafe,
impl<E> !Send for SegmentRouting<E>
impl<E> !Sync for SegmentRouting<E>
impl<E> Unpin for SegmentRouting<E> where
E: Unpin,
E: Unpin,
impl<E> UnwindSafe for SegmentRouting<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>,