pub enum ValueError {
    Ipv4OptionsLengthBad(usize),
    Ipv4PayloadAndOptionsLengthTooLarge(usize),
    Ipv6PayloadLengthTooLarge(usize),
    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,
    },
}
Expand description

Errors in the given data

Variants§

§

Ipv4OptionsLengthBad(usize)

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

§

Ipv4PayloadAndOptionsLengthTooLarge(usize)

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

§

Ipv6PayloadLengthTooLarge(usize)

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

§

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.

Trait Implementations§

Formats the value using the given formatter. 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.

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.