Lines Matching full:sum
59 checksum(unsigned char *buf, unsigned nbytes, u_int32_t sum) in checksum() argument
65 sum += (u_int16_t)ntohs(*((u_int16_t *)(buf + i))); in checksum()
66 if (sum > 0xFFFF) in checksum()
67 sum -= 0xFFFF; in checksum()
76 sum += buf[i] << 8; in checksum()
77 if (sum > 0xFFFF) in checksum()
78 sum -= 0xFFFF; in checksum()
81 return (sum); in checksum()
85 wrapsum(u_int32_t sum) in wrapsum() argument
87 sum = ~sum & 0xFFFF; in wrapsum()
88 return (htons(sum)); in wrapsum()
169 u_int32_t sum, usum; in decode_udp_ip_header() local
229 sum = wrapsum(checksum((unsigned char *)udp, sizeof(*udp), in decode_udp_ip_header()
235 if (usum && usum != sum) { in decode_udp_ip_header()