Struct etherparse::Ipv6Header [−][src]
IPv6 header according to rfc8200.
Fields
traffic_class: u8
flow_label: u32
If non 0 serves as a hint to router and switches with multiple outbound paths that these packets should stay on the same path, so that they will not be reordered.
payload_length: u16
The length of the payload and extension headers in bytes (0 in case of jumbo payloads).
next_header: u8
Specifies what the next header or transport layer protocol is (see IpTrafficClass for a definitions of ids).
hop_limit: u8
The number of hops the packet can take before it is discarded.
source: [u8; 16]
IPv6 source address
destination: [u8; 16]
IPv6 destination address
Implementations
impl Ipv6Header
[src]
pub fn read_from_slice(slice: &[u8]) -> Result<(Ipv6Header, &[u8]), ReadError>
[src]
Read an Ipv6Header from a slice and return the header & unused parts of the slice.
pub fn read<T: Read + Seek + Sized>(
reader: &mut T
) -> Result<Ipv6Header, ReadError>
[src]
reader: &mut T
) -> Result<Ipv6Header, ReadError>
Reads an IPv6 header from the current position.
pub fn read_without_version<T: Read + Seek + Sized>(
reader: &mut T,
version_rest: u8
) -> Result<Ipv6Header, Error>
[src]
reader: &mut T,
version_rest: u8
) -> Result<Ipv6Header, Error>
Reads an IPv6 header assuming the version & flow_label field have already been read.
pub fn skip_header_extension_in_slice(
slice: &[u8],
traffic_class: u8
) -> Result<(u8, &[u8]), ReadError>
[src]
slice: &[u8],
traffic_class: u8
) -> Result<(u8, &[u8]), ReadError>
Takes a slice and skips an ipv6 header extensions and returns the next_header id & the slice past the header. NOTE: There must be a ipv6 header extension id given as a traffic_class.
pub fn skip_all_header_extensions_in_slice(
slice: &[u8],
traffic_class: u8
) -> Result<(u8, &[u8]), ReadError>
[src]
slice: &[u8],
traffic_class: u8
) -> Result<(u8, &[u8]), ReadError>
Takes a slice & traffic class (identifying the first header type) and returns next_header id & the slice past after all ipv6 header extensions.
pub fn skip_header_extension<T: Read + Seek + Sized>(
reader: &mut T,
traffic_class: u8
) -> Result<u8, Error>
[src]
reader: &mut T,
traffic_class: u8
) -> Result<u8, Error>
Skips the ipv6 header extension and returns the traffic_class
pub fn skip_all_header_extensions<T: Read + Seek + Sized>(
reader: &mut T,
traffic_class: u8
) -> Result<u8, ReadError>
[src]
reader: &mut T,
traffic_class: u8
) -> Result<u8, ReadError>
Skips all ipv6 header extensions and returns the last traffic_class
pub fn write<T: Write + Sized>(&self, writer: &mut T) -> Result<(), WriteError>
[src]
Writes a given IPv6 header to the current position.
pub fn set_payload_length(&mut self, size: usize) -> Result<(), ValueError>
[src]
Sets the field total_length based on the size of the payload and the options. Returns an error if the payload is too big to fit.
Trait Implementations
impl Clone for Ipv6Header
[src]
fn clone(&self) -> Ipv6Header
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Ipv6Header
[src]
impl Default for Ipv6Header
[src]
fn default() -> Ipv6Header
[src]
impl Eq for Ipv6Header
[src]
impl PartialEq<Ipv6Header> for Ipv6Header
[src]
fn eq(&self, other: &Ipv6Header) -> bool
[src]
fn ne(&self, other: &Ipv6Header) -> bool
[src]
impl SerializedSize for Ipv6Header
[src]
const SERIALIZED_SIZE: usize
[src]
Size of the header itself in bytes.
impl StructuralEq for Ipv6Header
[src]
impl StructuralPartialEq for Ipv6Header
[src]
Auto Trait Implementations
impl RefUnwindSafe for Ipv6Header
[src]
impl Send for Ipv6Header
[src]
impl Sync for Ipv6Header
[src]
impl Unpin for Ipv6Header
[src]
impl UnwindSafe for Ipv6Header
[src]
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,
pub 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,