pub struct RedirectPacket {
pub header: Icmpv6Header,
pub reserved: u32be,
pub target_addr: Ipv6Addr,
pub dest_addr: Ipv6Addr,
pub options: Vec<NdpOptionPacket>,
pub payload: Bytes,
}Expand description
Redirect Message Format RFC 4861 Section 4.5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Target Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Destination Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options ...
+-+-+-+-+-+-+-+-+-+-+-+-Fields§
§header: Icmpv6Header§reserved: u32be§target_addr: Ipv6Addr§dest_addr: Ipv6Addr§options: Vec<NdpOptionPacket>§payload: BytesImplementations§
Source§impl RedirectPacket
impl RedirectPacket
Sourcepub fn options_length(&self) -> usize
pub fn options_length(&self) -> usize
Redirect packet calculation for the length of the options.
Trait Implementations§
Source§impl Clone for RedirectPacket
impl Clone for RedirectPacket
Source§fn clone(&self) -> RedirectPacket
fn clone(&self) -> RedirectPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RedirectPacket
impl Debug for RedirectPacket
Source§impl Packet for RedirectPacket
impl Packet for RedirectPacket
type Header = ()
Source§fn from_bytes(bytes: Bytes) -> Option<Self>
fn from_bytes(bytes: Bytes) -> Option<Self>
Parse from raw bytes. (with ownership)
Source§fn header_len(&self) -> usize
fn header_len(&self) -> usize
Get the length of the header.
Source§fn payload_len(&self) -> usize
fn payload_len(&self) -> usize
Get the length of the payload.
fn into_parts(self) -> (Self::Header, Bytes)
Source§fn to_bytes_mut(&self) -> BytesMut
fn to_bytes_mut(&self) -> BytesMut
Convert the packet to a mutable byte buffer.
Source§fn header_mut(&self) -> BytesMut
fn header_mut(&self) -> BytesMut
Get a mutable byte buffer for the header.
Source§fn payload_mut(&self) -> BytesMut
fn payload_mut(&self) -> BytesMut
Get a mutable byte buffer for the payload.
Source§impl PartialEq for RedirectPacket
impl PartialEq for RedirectPacket
Source§impl TryFrom<Icmpv6Packet> for RedirectPacket
impl TryFrom<Icmpv6Packet> for RedirectPacket
impl Eq for RedirectPacket
impl StructuralPartialEq for RedirectPacket
Auto Trait Implementations§
impl !Freeze for RedirectPacket
impl RefUnwindSafe for RedirectPacket
impl Send for RedirectPacket
impl Sync for RedirectPacket
impl Unpin for RedirectPacket
impl UnwindSafe for RedirectPacket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more