Lines Matching full:sum
52 #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
58 int sum = 0; in in_cksum() local
85 sum += s_util.s; in in_cksum()
95 sum <<= 8; in in_cksum()
106 sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; in in_cksum()
107 sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; in in_cksum()
108 sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11]; in in_cksum()
109 sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15]; in in_cksum()
114 sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; in in_cksum()
122 sum += *w++; in in_cksum()
126 sum <<= 8; in in_cksum()
130 sum += s_util.s; in in_cksum()
142 sum += s_util.s; in in_cksum()
145 return (~sum & 0xffff); in in_cksum()
155 in_cksum_shouldbe(uint16_t sum, uint16_t computed_sum) in in_cksum_shouldbe() argument
165 * field from the sum of all the data in the packet, and then in in_cksum_shouldbe()
168 * "sum" is the value of the checksum field, and "computed_sum" in in_cksum_shouldbe()
169 * is the negative of the sum of all the data in the packets, in in_cksum_shouldbe()
170 * so that's -(-computed_sum - sum), or (sum + computed_sum). in in_cksum_shouldbe()
175 * and then adding the upper 16 bits of the sum, which contain in in_cksum_shouldbe()
176 * the carry, to the lower 16 bits of the sum, and then do it in in_cksum_shouldbe()
177 * again in case *that* sum produced a carry. in in_cksum_shouldbe()
193 shouldbe = sum; in in_cksum_shouldbe()