Enum smoltcp::wire::IpRepr [−][src]
An IP packet representation.
This enum abstracts the various versions of IP packets. It either contains a concrete
high-level representation for some IP protocol version, or an unspecified representation,
which permits the IpAddress::Unspecified
addresses.
Variants (Non-exhaustive)
Fields of Unspecified
Ipv4(Ipv4Repr)
Ipv6(Ipv6Repr)
Implementations
impl Repr
[src]
pub fn version(&self) -> Version
[src]
Return the protocol version.
pub fn src_addr(&self) -> Address
[src]
Return the source address.
pub fn dst_addr(&self) -> Address
[src]
Return the destination address.
pub fn protocol(&self) -> Protocol
[src]
Return the protocol.
pub fn payload_len(&self) -> usize
[src]
Return the payload length.
pub fn set_payload_len(&mut self, length: usize)
[src]
Set the payload length.
pub fn hop_limit(&self) -> u8
[src]
Return the TTL value.
pub fn lower(&self, fallback_src_addrs: &[Cidr]) -> Result<Repr>
[src]
Convert an unspecified representation into a concrete one, or return
Err(Error::Unaddressable)
if not possible.
Panics
This function panics if source and destination addresses belong to different families, or the destination address is unspecified, since this indicates a logic error.
pub fn buffer_len(&self) -> usize
[src]
Return the length of a header that will be emitted from this high-level representation.
Panics
This function panics if invoked on an unspecified representation.
pub fn emit<T: AsRef<[u8]> + AsMut<[u8]>>(
&self,
buffer: T,
_checksum_caps: &ChecksumCapabilities
)
[src]
&self,
buffer: T,
_checksum_caps: &ChecksumCapabilities
)
Emit this high-level representation into a buffer.
Panics
This function panics if invoked on an unspecified representation.
pub fn total_len(&self) -> usize
[src]
Return the total length of a packet that will be emitted from this high-level representation.
This is the same as repr.buffer_len() + repr.payload_len()
.
Panics
This function panics if invoked on an unspecified representation.
Trait Implementations
impl Clone for Repr
[src]
impl Debug for Repr
[src]
impl Eq for Repr
[src]
impl From<Repr> for Repr
[src]
impl From<Repr> for Repr
[src]
impl PartialEq<Repr> for Repr
[src]
impl StructuralEq for Repr
[src]
impl StructuralPartialEq for Repr
[src]
Auto Trait Implementations
impl RefUnwindSafe for Repr
impl Send for Repr
impl Sync for Repr
impl Unpin for Repr
impl UnwindSafe for Repr
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>,