Enum smoltcp::wire::IpRepr [] [src]

pub enum IpRepr {
    Unspecified {
        src_addr: Address,
        dst_addr: Address,
        protocol: Protocol,
        payload_len: usize,
    },
    Ipv4(Ipv4Repr),
    // some variants omitted
}

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

Fields of Unspecified

Methods

impl IpRepr
[src]

[src]

Return the protocol version.

[src]

Return the source address.

[src]

Return the destination address.

[src]

Return the protocol.

[src]

Return the payload length.

[src]

Set the payload length.

[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.

[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.

[src]

Emit this high-level representation into a buffer.

Panics

This function panics if invoked on an unspecified representation.

[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 Debug for IpRepr
[src]

[src]

Formats the value using the given formatter.

impl Clone for IpRepr
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for IpRepr
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for IpRepr
[src]

impl From<Ipv4Repr> for IpRepr
[src]

[src]

Performs the conversion.