Solved UDP translation

This commit is contained in:
Nico Schottelius 2019-07-01 10:37:13 +02:00
parent e1dd4d44d4
commit 6a9daa500e

View file

@ -164,25 +164,13 @@ if __name__ == '__main__':
checksums["ipv4"], checksums["ipv4"],
checksums["ipv6"] - 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"], print("Header v6: {} v4: {} diff: {}".format(header_checksums["ipv6"],
header_checksums["ipv4"], 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: print("Translating v4 to v6, expected v6 UDP checksum: {}".format(
# sums += sum_for_udp(packet_rebuild) checksums["ipv4"] + header_diff_from_v6))
# 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