summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-02-08 11:25:07 +0200
committerIdo Barnea <ibarnea@cisco.com>2016-02-24 14:21:29 +0200
commitf0ab9eba97221e491cf7b3dd846eb8c23d920ec2 (patch)
treecaf0b2f4f9cc0874a53bb3af813d5bae8d644914 /src/common
parent252b8ab3f41a18af8561cece71cf07bc9872f39f (diff)
Rx stat per flow. Low level working for xl710, and partly for i350.
added full clone (with CP VM) to stream
Diffstat (limited to 'src/common')
-rwxr-xr-xsrc/common/Network/Packet/IPHeader.h2
-rwxr-xr-xsrc/common/Network/Packet/IPHeader.inl6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/common/Network/Packet/IPHeader.h b/src/common/Network/Packet/IPHeader.h
index 5dfd03d8..b9ef8a2e 100755
--- a/src/common/Network/Packet/IPHeader.h
+++ b/src/common/Network/Packet/IPHeader.h
@@ -134,7 +134,7 @@ public:
inline void updateIpDst(uint32_t ipsrc);
-
+ inline void updateCheckSum(uint16_t old_val, uint16_t new_val);
inline void updateCheckSum ();
inline void updateCheckSum2(uint8_t* data1, uint16_t len1, uint8_t* data2 , uint16_t len2);
diff --git a/src/common/Network/Packet/IPHeader.inl b/src/common/Network/Packet/IPHeader.inl
index e7b87f06..26ea551a 100755
--- a/src/common/Network/Packet/IPHeader.inl
+++ b/src/common/Network/Packet/IPHeader.inl
@@ -258,6 +258,12 @@ inline void IPHeader::updateTotalLength(uint16_t newlen)
myChecksum = pkt_UpdateInetChecksum(myChecksum,oldLen,myLength);
}
+// updating checksum after changing old val to new
+inline void IPHeader::updateCheckSum(uint16_t old_val, uint16_t new_val)
+{
+ myChecksum = pkt_UpdateInetChecksum(myChecksum, old_val, new_val);
+}
+
inline void IPHeader::updateCheckSum()
{
myChecksum = 0;