pub enum ValueError {
Show 17 variants Ipv4OptionsLengthBad(usize), Ipv4PayloadLengthTooLarge(usize), Ipv6PayloadLengthTooLarge(usize), Ipv6ExtensionPayloadTooSmall(usize), Ipv6ExtensionPayloadTooLarge(usize), Ipv6ExtensionPayloadLengthUnaligned(usize), IpAuthenticationHeaderBadIcvLength(usize), Ipv4ExtensionNotReferenced(IpNumber), Ipv6ExtensionHopByHopNotAtStart, Ipv6ExtensionNotReferenced(IpNumber), Ipv6ExtensionNotDefinedReference(IpNumber), UdpPayloadLengthTooLarge(usize), TcpLengthTooLarge(usize), U8TooLarge { value: u8, max: u8, field: ErrorField, }, U16TooLarge { value: u16, max: u16, field: ErrorField, }, U32TooLarge { value: u32, max: u32, field: ErrorField, }, Icmpv6InIpv4,
}
Expand description

Errors in the given data

Variants§

§

Ipv4OptionsLengthBad(usize)

Error when the ipv4 options length is too big or not aligned (cannot be bigger then 40 bytes and must be a multiple of 4 bytes).

§

Ipv4PayloadLengthTooLarge(usize)

Error when a given payload & ipv4 header is bigger then what fits inside an ipv4 total_length field.

§

Ipv6PayloadLengthTooLarge(usize)

Error when a given payload & ipv6 header block is bigger then what fits inside an ipv6 payload_length field.

§

Ipv6ExtensionPayloadTooSmall(usize)

Error when a given payload size is smaller then 6 octets which is the minimum ipv6 extended header size (Ipv6RawExtensionHeader::MAX_PAYLOAD_LEN).

§

Ipv6ExtensionPayloadTooLarge(usize)

Error when a given payload size is bigger then what fits inside an ipv6 extended header size (Ipv6RawExtensionHeader::MAX_PAYLOAD_LEN).

§

Ipv6ExtensionPayloadLengthUnaligned(usize)

Error when a given payload length is not aligned to be a multiple of 8 octets when 6 is substracted and can not be represented by the header length field.

§

IpAuthenticationHeaderBadIcvLength(usize)

Error when a given authentication header icv size is not a multiple of 4 bytes or bigger then 1016 bytes and therefor can not be represented in the header length field.

§

Ipv4ExtensionNotReferenced(IpNumber)

Error when a header in Ipv4Extensions is never written as it is never referenced by any of the other next_header fields or the initial protocol.

§

Ipv6ExtensionHopByHopNotAtStart

Error when a hop-by-hop header is not referenced as the first header after the ipv6 header but as a later extension header.

§

Ipv6ExtensionNotReferenced(IpNumber)

Error when a header in Ipv6Extensions is never written as it is never referenced by any of the other next_header fields or the initial ip number.

§

Ipv6ExtensionNotDefinedReference(IpNumber)

Error when a header in Ipv6Extensions is referenced multiple times or is referenced and not defined.

§

UdpPayloadLengthTooLarge(usize)

Error when a given payload is bigger then what fits inside an udp packet Note that a the maximum payload size, as far as udp is conceirned, is max_value(u16) - 8. The 8 is for the size of the udp header itself.

§

TcpLengthTooLarge(usize)

Error when a given payload + tcp header options is bigger then what fits inside an tcp packet Note that a the maximum size, as far as tcp is conceirned, is max_value(u16) - tcp_header.data_offset()*4. The data_offset is for the size of the udp header itself.

§

U8TooLarge

Fields

§value: u8
§max: u8
§field: ErrorField

Error when a u8 field in a header has a larger value then supported.

§

U16TooLarge

Fields

§value: u16
§max: u16
§field: ErrorField

Error when a u16 field in a header has a larger value then supported.

§

U32TooLarge

Fields

§value: u32
§max: u32
§field: ErrorField

Error when a u32 field in a header has a larger value then supported.

§

Icmpv6InIpv4

Error when an Icmpv6 payload is found in an IPv4 packet.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.