Lines Matching defs:sum
151 u_int32_t sum;
170 sum = 0;
172 sum += phu.pa[i];
177 sum += *sp++;
180 sum += htons((*(const u_int8_t *)sp) << 8);
182 while (sum > 0xffff)
183 sum = (sum & 0xffff) + (sum >> 16);
184 sum = ~sum & 0xffff;
186 return (sum);
424 u_int16_t sum, tcp_sum;
426 sum = tcp_cksum(ip, tp, length);
429 if (sum != 0) {
431 (void)printf(" (incorrect (-> 0x%04x),",in_cksum_shouldbe(tcp_sum, sum));
438 u_int16_t sum,tcp_sum;
440 sum = tcp6_cksum(ip6, tp, length);
442 if (sum != 0) {
444 (void)printf(" (incorrect (-> 0x%04x),",in_cksum_shouldbe(tcp_sum, sum));