Lines Matching full:checksum
20 #include "netutils/checksum.h"
32 * calculates the checksum over all the packet components starting from pos
33 * checksum - checksum of packet components before pos
34 * packet - packet to calculate the checksum of
36 * returns - the completed 16-bit checksum, ready to write into a checksum header field
38 uint16_t packet_checksum(uint32_t checksum, clat_packet packet, clat_packet_index pos) { in packet_checksum() argument
42 checksum = ip_checksum_add(checksum, packet[i].iov_base, packet[i].iov_len); in packet_checksum()
45 return ip_checksum_finish(checksum); in packet_checksum()
224 * checksum - pseudo-header checksum
230 uint32_t checksum, const uint8_t *payload, size_t payload_size) { in icmp_to_icmp6() argument
248 // The pseudo-header checksum was calculated on the transport length of the original IPv4 in icmp_to_icmp6()
253 // pseudo-header when calculating its checksum (as the IPv4 header has its own checksum). in icmp_to_icmp6()
254 checksum = checksum + htons(20); in icmp_to_icmp6()
267 icmp6_targ->icmp6_cksum = 0; // Checksum field must be 0 when calculating checksum. in icmp_to_icmp6()
268 icmp6_targ->icmp6_cksum = packet_checksum(checksum, out, pos); in icmp_to_icmp6()
312 icmp_targ->checksum = 0; // Checksum field must be 0 when calculating checksum. in icmp6_to_icmp()
313 icmp_targ->checksum = packet_checksum(0, out, pos); in icmp6_to_icmp()
338 * old_sum - pseudo-header checksum of old header
339 * new_sum - pseudo-header checksum of new header
362 * checksum - pseudo-header checksum
394 * common between ipv4/ipv6 - setup checksum and send udp packet
397 * old_sum - pseudo-header checksum of old header
398 * new_sum - pseudo-header checksum of new header
416 // Zero checksums are special. RFC 768 says, "An all zero transmitted checksum value means that in udp_translate()
417 // the transmitter generated no checksum (for debugging or for higher level protocols that in udp_translate()
420 udp_targ->check = 0; // Checksum field must be 0 when calculating checksum. in udp_translate()
424 // RFC 768: "If the computed checksum is zero, it is transmitted as all ones (the equivalent in udp_translate()
434 * common between ipv4/ipv6 - setup checksum and send tcp packet
438 * checksum - partial checksum covering ipv4/ipv6 header