Fixing Bug 1145
Change-Id: I62b29ecd0bb640632146b93c97250ba00afbe2fa
Signed-off-by: Colin Dixon <colin@colindixon.com>
return (BitBufferHelper.getShort(fieldValues.get(DESTPORT)));
}
+ /**
+ * Get the stored checksum value of the TCP header
+ * @return short - the checksum
+ */
+ public short getChecksum() {
+ return (BitBufferHelper.getShort(fieldValues.get(CHECKSUM)));
+ }
+
}
Assert.assertTrue(urgentPointer[1] == 10);
}
+
+ @Test
+ public void testGetChecksum() {
+ TCP tcp = new TCP();
+ byte[] udpChecksum = { 0, -56 };
+ tcp.hdrFieldsMap.put("Checksum", udpChecksum);
+ short checksum = tcp.getChecksum();
+ Assert.assertTrue(checksum == 200);
+ }
}