Enum etherparse::ValueError [−][src]
pub enum ValueError {
Show 16 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,
},
}
Expand description
Errors in the given data
Variants
Ipv4OptionsLengthBad(usize)
Tuple Fields
0: 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)
Tuple Fields
0: usize
Error when a given payload & ipv4 header is bigger then what fits inside an ipv4 total_length field.
Ipv6PayloadLengthTooLarge(usize)
Tuple Fields
0: usize
Error when a given payload & ipv6 header block is bigger then what fits inside an ipv6 payload_length field.
Ipv6ExtensionPayloadTooSmall(usize)
Tuple Fields
0: 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)
Tuple Fields
0: usize
Error when a given payload size is bigger then what fits inside an ipv6 extended header size (Ipv6RawExtensionHeader::MAX_PAYLOAD_LEN).
Ipv6ExtensionPayloadLengthUnaligned(usize)
Tuple Fields
0: 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)
Tuple Fields
0: 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)
Tuple Fields
0: 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)
Tuple Fields
0: 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)
Tuple Fields
0: IpNumber
Error when a header in Ipv6Extensions
is referenced multiple times or is referenced and not defined.
UdpPayloadLengthTooLarge(usize)
Tuple Fields
0: 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)
Tuple Fields
0: 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
Error when a u8 field in a header has a larger value then supported.
U16TooLarge
Error when a u16 field in a header has a larger value then supported.
U32TooLarge
Error when a u32 field in a header has a larger value then supported.
Trait Implementations
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ValueError
impl Send for ValueError
impl Sync for ValueError
impl Unpin for ValueError
impl UnwindSafe for ValueError
Blanket Implementations
Mutably borrows from an owned value. Read more