diff --git a/bin/checksum_delta_diff_test.py b/bin/checksum_delta_diff_test.py index 3e16262..b685599 100644 --- a/bin/checksum_delta_diff_test.py +++ b/bin/checksum_delta_diff_test.py @@ -164,25 +164,13 @@ if __name__ == '__main__': checksums["ipv4"], checksums["ipv6"] - checksums["ipv4"])) + header_diff_from_v6 = header_checksums["ipv6"] - header_checksums["ipv4"] print("Header v6: {} v4: {} diff: {}".format(header_checksums["ipv6"], header_checksums["ipv4"], - header_checksums["ipv6"] - header_checksums["ipv4"])) + header_diff_from_v6)) - p + print("Translating v6 to v4, expected v4 UDP checksum: {}".format( + checksums["ipv6"] - header_diff_from_v6)) - # if UDP in packet: - # sums += sum_for_udp(packet_rebuild) - # if TCP in packet: - # sums += sum_for_udp(packet_rebuild) - - - -# diff_total += packet_rebuild[IP].chksum -# diff_total -= packet_rebuild[IPv6].chksum# Checksums: -# - tcp -# - udp -# - icmp6 -# - icmp -# - ipv4 (no payload) -# -# t.chksum = None + print("Translating v4 to v6, expected v6 UDP checksum: {}".format( + checksums["ipv4"] + header_diff_from_v6))