diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2009-01-06 10:36:56 -0500 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2009-01-06 10:36:56 -0500 |
commit | 11ac0c7acfe2d75d51e56e3a4305bf3209b3d420 (patch) | |
tree | e71f4c1768ac58d0e3366aa22efd9e26c3bd14eb /src/base/inet.cc | |
parent | 9f89d43b653061fe335cdb4c8dfac9b046d6416c (diff) | |
download | gem5-11ac0c7acfe2d75d51e56e3a4305bf3209b3d420.tar.xz |
INET: Add functions to header types to get offset in packet and start of payload; add function to split packet at last known header
Diffstat (limited to 'src/base/inet.cc')
-rw-r--r-- | src/base/inet.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/base/inet.cc b/src/base/inet.cc index b8da12a99..8c3240fa6 100644 --- a/src/base/inet.cc +++ b/src/base/inet.cc @@ -206,4 +206,25 @@ TcpOpt::sack(vector<SackRange> &vec) const return false; } +int +hsplit(const EthPacketPtr &ptr) +{ + int split_point = 0; + + IpPtr ip(ptr); + if (ip) { + split_point = ip.pstart(); + + TcpPtr tcp(ip); + if (tcp) + split_point = tcp.pstart(); + + UdpPtr udp(ip); + if (udp) + split_point = udp.pstart(); + } + return split_point; +} + + /* namespace Net */ } |