Skip to content

Commit

Permalink
Add computed_data_offset method to all supported layer 4 protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
alexforster committed May 25, 2021
1 parent 1fdfbe8 commit 0cfa2cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/icmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,8 @@ impl<'a> IcmpPdu<'a> {
pub fn message(&'a self) -> &'a [u8] {
&self.buffer[4..]
}

pub fn computed_data_offset(&'a self) -> usize {
4
}
}
4 changes: 4 additions & 0 deletions src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,8 @@ impl<'a> UdpPdu<'a> {
]),
}
}

pub fn computed_data_offset(&'a self) -> usize {
8
}
}

0 comments on commit 0cfa2cc

Please sign in to comment.