Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

crc.c File Reference

#include <stdio.h>
#include "str.h"
#include "ut.h"
#include "crc.h"

Go to the source code of this file.

Defines

#define OK   0
#define ERROR   (-1)
#define UPDC32(ch, crc)   (crc_32_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8))
#define UPDCIT(ch, crc)   (ccitt_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8))
#define UPDC16(ch, crc)   (crc_16_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8))

Functions

unsigned short crcitt_string_ex (char *s, int len, register unsigned short ccitt)
unsigned short crcitt_string (char *s, int len)
void crcitt_string_array (char *dst, str src[], int size)
int crc32file (char *name)

Variables

unsigned long int crc_32_tab []
unsigned short int ccitt_tab []
unsigned short int crc_16_tab []


Define Documentation

#define ERROR   (-1)
 

Definition at line 37 of file crc.c.

#define OK   0
 

Definition at line 36 of file crc.c.

#define UPDC16 ch,
crc   )     (crc_16_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8))
 

Definition at line 40 of file crc.c.

Referenced by crc32file().

#define UPDC32 ch,
crc   )     (crc_32_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8))
 

Definition at line 38 of file crc.c.

Referenced by crc32file().

#define UPDCIT ch,
crc   )     (ccitt_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8))
 

Definition at line 39 of file crc.c.

Referenced by crc32file(), crcitt_string_array(), and crcitt_string_ex().


Function Documentation

int crc32file char *  name  ) 
 

Definition at line 255 of file crc.c.

References UPDC16, UPDC32, and UPDCIT.

unsigned short crcitt_string char *  s,
int  len
 

Definition at line 217 of file crc.c.

References crcitt_string_ex(), len, and s.

Referenced by mod_init().

void crcitt_string_array char *  dst,
str  src[],
int  size
 

Definition at line 222 of file crc.c.

References int2reverse_hex(), L_CRIT, len, _str::len, LOG, _str::s, str, str_len, and UPDCIT.

Referenced by calc_crc_suffix(), and generate_fromtag().

unsigned short crcitt_string_ex char *  s,
int  len,
register unsigned short  ccitt
 

Definition at line 208 of file crc.c.

References len, s, and UPDCIT.

Referenced by crcitt_string(), rr_get_avp_cookies(), and rr_set_avp_cookies().


Variable Documentation

unsigned short int ccitt_tab[]
 

Definition at line 138 of file crc.c.

Referenced by new_hash().

unsigned short int crc_16_tab[]
 

Definition at line 173 of file crc.c.

Referenced by new_hash().

unsigned long int crc_32_tab[]
 

Definition at line 92 of file crc.c.


Generated on Thu Jul 29 04:15:53 2010 for SIPExpressRouter by  doxygen 1.3.9.1