96 #define P_32 0xEDB88320L
97 #define P_CCITT 0x1021
99 #define P_KERMIT 0x8408
100 #define P_SICK 0x8005
164 unsigned short tmp, short_c;
166 short_c = 0x00ff & (
unsigned short) c;
170 tmp = (crc >> 8) ^ short_c;
192 unsigned short short_c, short_p;
194 short_c = 0x00ff & (
unsigned short) c;
195 short_p = ( 0x00ff & (
unsigned short) prev_byte ) << 8;
197 if ( crc & 0x8000 ) crc = ( crc << 1 ) ^
P_SICK;
201 crc ^= ( short_c | short_p );
221 unsigned short tmp, short_c;
223 short_c = 0x00ff & (
unsigned short) c;
228 crc = (crc >> 8) ^
crc_tab16[ tmp & 0xff ];
248 unsigned short tmp, short_c;
250 short_c = 0x00ff & (
unsigned short) c;
275 unsigned short tmp, short_c;
277 short_c = 0x00ff & (
unsigned short) c;
302 unsigned long tmp, long_c;
304 long_c = 0x000000ffL & (
unsigned long) c;
309 crc = (crc >> 8) ^
crc_tab32[ tmp & 0xff ];
329 unsigned short crc, c;
331 for (i=0; i<256; i++) {
334 c = (
unsigned short) i;
336 for (j=0; j<8; j++) {
338 if ( (crc ^ c) & 0x0001 ) crc = ( crc >> 1 ) ^
P_16;
365 unsigned short crc, c;
367 for (i=0; i<256; i++) {
370 c = (
unsigned short) i;
372 for (j=0; j<8; j++) {
374 if ( (crc ^ c) & 0x0001 ) crc = ( crc >> 1 ) ^
P_KERMIT;
401 unsigned short crc, c;
403 for (i=0; i<256; i++) {
406 c = (
unsigned short) i;
408 for (j=0; j<8; j++) {
410 if ( (crc ^ c) & 0x0001 ) crc = ( crc >> 1 ) ^
P_DNP;
439 for (i=0; i<256; i++) {
441 crc = (
unsigned long) i;
443 for (j=0; j<8; j++) {
445 if ( crc & 0x00000001L ) crc = ( crc >> 1 ) ^
P_32;
470 unsigned short crc, c;
472 for (i=0; i<256; i++) {
475 c = ((
unsigned short) i) << 8;
477 for (j=0; j<8; j++) {
479 if ( (crc ^ c) & 0x8000 ) crc = ( crc << 1 ) ^
P_CCITT;
static int crc_tab32_init
static unsigned short crc_tab16[256]
static unsigned short crc_tabkermit[256]
unsigned short update_crc_sick(unsigned short crc, char c, char prev_byte)
static int crc_tab16_init
header for this library. Defines public funtions prototypes this library makes available to other mod...
unsigned short update_crc_dnp(unsigned short crc, char c)
unsigned short update_crc_kermit(unsigned short crc, char c)
static void init_crckermit_tab(void)
static int crc_tabdnp_init
unsigned long update_crc_32(unsigned long crc, char c)
unsigned short update_crc_ccitt(unsigned short crc, unsigned char c)
static void init_crcdnp_tab(void)
static void init_crcccitt_tab(void)
static int crc_tabccitt_init
static unsigned long crc_tab32[256]
static void init_crc16_tab(void)
static unsigned short crc_tabdnp[256]
static void init_crc32_tab(void)
static unsigned short crc_tabccitt[256]
unsigned short update_crc_16(unsigned short crc, char c)
static int crc_tabkermit_init