version 1.1.1.1, 2012/02/21 17:26:11
|
version 1.1.1.2, 2013/07/21 23:54:40
|
Line 32 accumulate (u_char *buffer, testsz_t len, testoff_t of
|
Line 32 accumulate (u_char *buffer, testsz_t len, testoff_t of
|
{ |
{ |
u_int8_t *p; |
u_int8_t *p; |
u_int16_t *csum; |
u_int16_t *csum; |
int i, init_len, partial_len; | int i, partial_len; |
struct acc_vals ret; |
struct acc_vals ret; |
|
|
csum = (u_int16_t *) (buffer + off); |
csum = (u_int16_t *) (buffer + off); |
Line 41 accumulate (u_char *buffer, testsz_t len, testoff_t of
|
Line 41 accumulate (u_char *buffer, testsz_t len, testoff_t of
|
p = buffer; |
p = buffer; |
ret.c0 = 0; |
ret.c0 = 0; |
ret.c1 = 0; |
ret.c1 = 0; |
init_len = len; |
|
|
|
while (len != 0) |
while (len != 0) |
{ |
{ |
Line 397 verify (u_char * buffer, testsz_t len)
|
Line 396 verify (u_char * buffer, testsz_t len)
|
u_int8_t *p; |
u_int8_t *p; |
u_int32_t c0; |
u_int32_t c0; |
u_int32_t c1; |
u_int32_t c1; |
u_int16_t checksum; |
|
int i, partial_len; |
int i, partial_len; |
|
|
p = buffer; |
p = buffer; |
checksum = 0; |
|
|
|
c0 = 0; |
c0 = 0; |
c1 = 0; |
c1 = 0; |
Line 427 verify (u_char * buffer, testsz_t len)
|
Line 424 verify (u_char * buffer, testsz_t len)
|
return 1; |
return 1; |
} |
} |
|
|
int /* return checksum in low-order 16 bits */ | static int /* return checksum in low-order 16 bits */ |
in_cksum_optimized(void *parg, int nbytes) |
in_cksum_optimized(void *parg, int nbytes) |
{ |
{ |
u_short *ptr = parg; |
u_short *ptr = parg; |
Line 459 in_cksum_optimized(void *parg, int nbytes)
|
Line 456 in_cksum_optimized(void *parg, int nbytes)
|
} |
} |
|
|
|
|
int /* return checksum in low-order 16 bits */ | static int /* return checksum in low-order 16 bits */ |
in_cksum_rfc(void *parg, int count) |
in_cksum_rfc(void *parg, int count) |
/* from RFC 1071 */ |
/* from RFC 1071 */ |
{ |
{ |