def tcp_timestamp_test(): p = Packet(tlspkt) (bef_tsval, _, _) = p.parse_timestamp() p.offset_timestamp(4, True) (after_tsval, _, _) = p.parse_timestamp() assert (bef_tsval + 4 == after_tsval) # Verify the TCP checksum before = p.get_tcp_cksum() p.update_cksum() after = p.get_tcp_cksum() assert (abs(after - before) == 4)
def tcp_cksum_test(): p = Packet(tlspkt) before = p.get_tcp_cksum() p.update_cksum() after = p.get_tcp_cksum() assert (before == after)