diff --git a/etherparse/src/net/ipv4_header.rs b/etherparse/src/net/ipv4_header.rs index 3a332b77..cf6733fd 100644 --- a/etherparse/src/net/ipv4_header.rs +++ b/etherparse/src/net/ipv4_header.rs @@ -32,7 +32,7 @@ use arrayvec::ArrayVec; /// assert_eq!(header, decoded); /// assert_eq!(slice_rest, &[]); /// ``` -#[derive(Clone, Debug, Eq, PartialEq, Hash)] +#[derive(Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)] pub struct Ipv4Header { /// Differentiated Services Code Point pub dscp: IpDscp, diff --git a/etherparse/src/net/ipv6_header.rs b/etherparse/src/net/ipv6_header.rs index 454d99aa..afec78b9 100644 --- a/etherparse/src/net/ipv6_header.rs +++ b/etherparse/src/net/ipv6_header.rs @@ -1,7 +1,7 @@ use crate::{err::ValueTooBigError, *}; /// IPv6 header according to rfc8200. -#[derive(Clone, Debug, Eq, PartialEq, Default)] +#[derive(Clone, Debug, Eq, PartialEq, Hash, Default, PartialOrd, Ord)] pub struct Ipv6Header { pub traffic_class: u8, /// If non 0 serves as a hint to router and switches with multiple outbound paths that these packets should stay on the same path, so that they will not be reordered. diff --git a/etherparse/src/transport/tcp_header.rs b/etherparse/src/transport/tcp_header.rs index a26ce532..d442bef6 100644 --- a/etherparse/src/transport/tcp_header.rs +++ b/etherparse/src/transport/tcp_header.rs @@ -19,7 +19,7 @@ pub const TCP_MAXIMUM_DATA_OFFSET: u8 = 0xf; /// TCP header according to rfc 793. /// /// Field descriptions copied from RFC 793 page 15++ -#[derive(Clone, Debug, Eq, PartialEq, Hash)] +#[derive(Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)] pub struct TcpHeader { /// The source port number. pub source_port: u16, diff --git a/etherparse/src/transport/udp_header.rs b/etherparse/src/transport/udp_header.rs index d4a5279a..6c2372aa 100644 --- a/etherparse/src/transport/udp_header.rs +++ b/etherparse/src/transport/udp_header.rs @@ -1,7 +1,7 @@ use crate::{err::ValueTooBigError, *}; /// Udp header according to rfc768. -#[derive(Clone, Debug, Eq, PartialEq, Default)] +#[derive(Clone, Debug, Eq, PartialEq, Hash, Default, PartialOrd, Ord)] pub struct UdpHeader { /// Source port of the packet (optional). pub source_port: u16,