Skip to content

Commit 07f41cb

Browse files
authored
Merge pull request #138 from thomaseizinger/chore/header-traits
feat: implement more traits for header types
2 parents 84ee5cf + efb66e3 commit 07f41cb

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

etherparse/src/net/ipv4_header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use arrayvec::ArrayVec;
3232
/// assert_eq!(header, decoded);
3333
/// assert_eq!(slice_rest, &[]);
3434
/// ```
35-
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
35+
#[derive(Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)]
3636
pub struct Ipv4Header {
3737
/// Differentiated Services Code Point
3838
pub dscp: IpDscp,

etherparse/src/net/ipv6_header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{err::ValueTooBigError, *};
22

33
/// IPv6 header according to rfc8200.
4-
#[derive(Clone, Debug, Eq, PartialEq, Default)]
4+
#[derive(Clone, Debug, Eq, PartialEq, Hash, Default, PartialOrd, Ord)]
55
pub struct Ipv6Header {
66
pub traffic_class: u8,
77
/// 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.

etherparse/src/transport/tcp_header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub const TCP_MAXIMUM_DATA_OFFSET: u8 = 0xf;
1919
/// TCP header according to rfc 793.
2020
///
2121
/// Field descriptions copied from RFC 793 page 15++
22-
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
22+
#[derive(Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)]
2323
pub struct TcpHeader {
2424
/// The source port number.
2525
pub source_port: u16,

etherparse/src/transport/udp_header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{err::ValueTooBigError, *};
22

33
/// Udp header according to rfc768.
4-
#[derive(Clone, Debug, Eq, PartialEq, Default)]
4+
#[derive(Clone, Debug, Eq, PartialEq, Hash, Default, PartialOrd, Ord)]
55
pub struct UdpHeader {
66
/// Source port of the packet (optional).
77
pub source_port: u16,

0 commit comments

Comments
 (0)