Lines Matching defs:sum
54 #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
60 register int sum = 0;
87 sum += s_util.s;
97 sum <<= 8;
108 sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
109 sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
110 sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11];
111 sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15];
116 sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
124 sum += *w++;
128 sum <<= 8;
132 sum += s_util.s;
144 sum += s_util.s;
147 return (~sum & 0xffff);
157 in_cksum_shouldbe(u_int16_t sum, u_int16_t computed_sum)
167 * field from the sum of all the data in the packet, and then
170 * "sum" is the value of the checksum field, and "computed_sum"
171 * is the negative of the sum of all the data in the packets,
172 * so that's -(-computed_sum - sum), or (sum + computed_sum).
177 * and then adding the upper 16 bits of the sum, which contain
178 * the carry, to the lower 16 bits of the sum, and then do it
179 * again in case *that* sum produced a carry.
195 shouldbe = sum;