Lines Matching full:checksum

29 #include "checksum.h"
47 55, (p), (c1), (c2), /* TTL=55, protocol=p, checksum=c1,c2 */ \
70 0x00, UDP_LEN, 0, 0, /* Length 21, checksum empty for now */
75 0x08, 0x00, 0x88, 0xd0, /* Type 8, code 0, checksum 0x88d0 */ \
79 0x80, 0x00, 0xc3, 0x42, /* Type 128, code 0, checksum 0xc342 */ \
213 EXPECT_EQ(0, ip_checksum(ip, sizeof(*ip))) << msg << ": Incorrect IP checksum\n"; in check_packet()
257 // If we understand the payload, verify the checksum. in check_packet()
259 uint16_t checksum; in check_packet() local
264 checksum = ip_checksum_finish(ip_checksum_add(pseudo_checksum, payload, payload_length)); in check_packet()
267 checksum = ip_checksum(payload, payload_length); in check_packet()
270 checksum = 0; // Don't check. in check_packet()
273 EXPECT_EQ(0, checksum) << msg << ": Incorrect transport checksum\n"; in check_packet()
278 EXPECT_NE(0, udp->check) << msg << ": UDP checksum 0 should be 0xffff"; in check_packet()
355 // Fix up the reassembled headers to reflect fragmentation and length (and IPv4 checksum). in reassemble_packet()
658 // Check that the IID is checksum-neutral with the NAT64 prefix and the in TEST_F()
674 << " not checksum-neutral with " << ipv4_str << " and " << plat_str in TEST_F()
676 << "\n IPv4 checksum: " << c1 in TEST_F()
677 << "\n IPv6 checksum: " << c2 in TEST_F()
758 ASSERT_EQ(kUdpV4Checksum, udp->check) << "UDP/IPv4 packet checksum sanity check\n"; in TEST_F()
764 ASSERT_EQ(kUdpV6Checksum, udp->check) << "UDP/IPv6 packet checksum sanity check\n"; in TEST_F()
814 << "UDP partial checksum\n"; in TEST_F()
816 << "Payload partial checksum\n"; in TEST_F()
824 EXPECT_EQ(0x3ad0U, ipv4_pseudo_sum) << "IPv4 pseudo-checksum sanity check\n"; in TEST_F()
825 EXPECT_EQ(0x2644bU, ipv6_pseudo_sum) << "IPv6 pseudo-checksum sanity check\n"; in TEST_F()
829 << "Unexpected UDP/IPv4 checksum\n"; in TEST_F()
833 << "Unexpected UDP/IPv6 checksum\n"; in TEST_F()
837 << "Adjust IPv4/UDP checksum to IPv6\n"; in TEST_F()
840 << "Adjust IPv6/UDP checksum to IPv4\n"; in TEST_F()
845 uint16_t checksum; in TEST_F() member
860 uint16_t result = ip_checksum_adjust(data->checksum, data->old_hdr_sum, data->new_hdr_sum); in TEST_F()
862 << "Incorrect checksum" << std::showbase << std::hex in TEST_F()
865 << "\n checksum=" << data->checksum in TEST_F()
904 // do_translate_packet already checks packets for validity and verifies the checksum. in check_translate_checksum_neutral()
910 << "Not checksum neutral: original and translated checksums differ\n"; in check_translate_checksum_neutral()
914 // Generate a random clat IPv6 address and check that translation is checksum-neutral. in TEST_F()
922 // Check that translating UDP packets is checksum-neutral. First, IPv4. in TEST_F()
926 "UDP/IPv4 -> UDP/IPv6 checksum neutral"); in TEST_F()
935 "UDP/IPv4 -> UDP/IPv6 checksum neutral"); in TEST_F()