• Home
  • Raw
  • Download

Lines Matching full:checksum

22 #include "checksum.h"
30 * calculates the checksum over all the packet components starting from pos
31 * checksum - checksum of packet components before pos
32 * packet - packet to calculate the checksum of
34 * returns - the completed 16-bit checksum, ready to write into a checksum header field
36 uint16_t packet_checksum(uint32_t checksum, clat_packet packet, clat_packet_index pos) { in packet_checksum() argument
40 checksum = ip_checksum_add(checksum, packet[i].iov_base, packet[i].iov_len); in packet_checksum()
43 return ip_checksum_finish(checksum); in packet_checksum()
222 * checksum - pseudo-header checksum
228 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()
313 icmp_targ->checksum = 0; // Checksum field must be 0 when calculating checksum. in icmp6_to_icmp()
314 icmp_targ->checksum = packet_checksum(0, out, pos); in icmp6_to_icmp()
339 * old_sum - pseudo-header checksum of old header
340 * new_sum - pseudo-header checksum of new header
363 * checksum - pseudo-header checksum
395 * common between ipv4/ipv6 - setup checksum and send udp packet
398 * old_sum - pseudo-header checksum of old header
399 * new_sum - pseudo-header checksum of new header
417 // Zero checksums are special. RFC 768 says, "An all zero transmitted checksum value means that in udp_translate()
418 // the transmitter generated no checksum (for debugging or for higher level protocols that in udp_translate()
421 udp_targ->check = 0; // Checksum field must be 0 when calculating checksum. in udp_translate()
425 // RFC 768: "If the computed checksum is zero, it is transmitted as all ones (the equivalent in udp_translate()
435 * common between ipv4/ipv6 - setup checksum and send tcp packet
439 * checksum - partial checksum covering ipv4/ipv6 header