X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7b2c5a11a7bc236d72b440c4db5263edb23b4880..a8abce5c5e2dce2ba6dbccd5d3829da104b80f9c:/checksum.c diff --git a/checksum.c b/checksum.c index 1d771365..e6e84a25 100644 --- a/checksum.c +++ b/checksum.c @@ -14,21 +14,21 @@ * * miscellaneous checksumming routines * - * Original code by Hannes Gredler (hannes@juniper.net) + * Original code by Hannes Gredler (hannes@gredler.at) */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif -#include +#include "netdissect-stdinc.h" #include #include #include #include -#include "interface.h" +#include "netdissect.h" /* * CRC-10 table generated using the following Python snippet: @@ -90,8 +90,8 @@ static void init_crc10_table(void) { #define CRC10_POLYNOMIAL 0x633 - register int i, j; - register uint16_t accum; + int i, j; + uint16_t accum; uint16_t verify_crc10_table[256]; for ( i = 0; i < 256; i++ ) @@ -112,7 +112,7 @@ init_crc10_table(void) uint16_t verify_crc10_cksum(uint16_t accum, const u_char *p, int length) { - register int i; + int i; for ( i = 0; i < length; i++ ) { @@ -145,17 +145,17 @@ create_osi_cksum (const uint8_t *pptr, int checksum_offset, int length) uint32_t c0; uint32_t c1; uint16_t checksum; - int index; + int idx; c0 = 0; c1 = 0; - for (index = 0; index < length; index++) { + for (idx = 0; idx < length; idx++) { /* * Ignore the contents of the checksum field. */ - if (index == checksum_offset || - index == checksum_offset+1) { + if (idx == checksum_offset || + idx == checksum_offset+1) { c1 += c0; pptr++; } else {