|
version 1.1.1.1, 2013/01/17 10:05:35
|
version 1.1.1.1.6.1, 2013/05/26 20:03:18
|
|
Line 66 typedef struct tagCRCPoly crcPoly_t;
|
Line 66 typedef struct tagCRCPoly crcPoly_t;
|
| * @crcBits = Number width bits |
* @crcBits = Number width bits |
| * return: -1 error, !=-1 reflecting number |
* return: -1 error, !=-1 reflecting number |
| */ |
*/ |
| inline unsigned int crcReflect(unsigned int crcNum, unsigned char crcBits); | unsigned int crcReflect(unsigned int crcNum, unsigned char crcBits); |
| /* |
/* |
| * crcCalc() - Generic CRC calculation function for many sub variants of CRC algorithms |
* crcCalc() - Generic CRC calculation function for many sub variants of CRC algorithms |
| * |
* |
|
Line 78 inline unsigned int crcReflect(unsigned int crcNum, un
|
Line 78 inline unsigned int crcReflect(unsigned int crcNum, un
|
| * @xorCRC = Last xor CRC value |
* @xorCRC = Last xor CRC value |
| * return: -1 error, !=-1 CRC checksum |
* return: -1 error, !=-1 CRC checksum |
| */ |
*/ |
| inline unsigned int crcCalc(unsigned char * __restrict psBuf, unsigned int bufLen, | unsigned int crcCalc(unsigned char * __restrict psBuf, unsigned int bufLen, |
| unsigned char crcBits, unsigned char RevOpts, |
unsigned char crcBits, unsigned char RevOpts, |
| unsigned int initCRC, unsigned int xorCRC); |
unsigned int initCRC, unsigned int xorCRC); |
| |
|
|
Line 89 inline unsigned int crcCalc(unsigned char * __restrict
|
Line 89 inline unsigned int crcCalc(unsigned char * __restrict
|
| * @bufLen = Length of data |
* @bufLen = Length of data |
| * return: -1 error, !=-1 Checksum |
* return: -1 error, !=-1 Checksum |
| */ |
*/ |
| inline unsigned short crcIP(unsigned char * __restrict buf, int bufLen); | unsigned short crcIP(unsigned char * __restrict buf, int bufLen); |
| /* |
/* |
| * crcFletcher16() - Fletcher-16 Checksum computing |
* crcFletcher16() - Fletcher-16 Checksum computing |
| * |
* |
|
Line 97 inline unsigned short crcIP(unsigned char * __restrict
|
Line 97 inline unsigned short crcIP(unsigned char * __restrict
|
| * @bufLen = Length of data |
* @bufLen = Length of data |
| * return: -1 error, !=-1 Checksum |
* return: -1 error, !=-1 Checksum |
| */ |
*/ |
| inline unsigned short crcFletcher16(unsigned short * __restrict nBuf, int bufLen); | unsigned short crcFletcher16(unsigned short * __restrict nBuf, int bufLen); |
| /* |
/* |
| * crcFletcher() - Fletcher-32 Checksum computing |
* crcFletcher() - Fletcher-32 Checksum computing |
| * |
* |
|
Line 105 inline unsigned short crcFletcher16(unsigned short * _
|
Line 105 inline unsigned short crcFletcher16(unsigned short * _
|
| * @bufLen = Length of data |
* @bufLen = Length of data |
| * return: -1 error, !=-1 Checksum |
* return: -1 error, !=-1 Checksum |
| */ |
*/ |
| inline unsigned int crcFletcher(unsigned short * __restrict nBuf, int bufLen); | unsigned int crcFletcher(unsigned short * __restrict nBuf, int bufLen); |
| /* |
/* |
| * crcAdler() - crcAdler-32 Checksum computing |
* crcAdler() - crcAdler-32 Checksum computing |
| * |
* |
|
Line 113 inline unsigned int crcFletcher(unsigned short * __res
|
Line 113 inline unsigned int crcFletcher(unsigned short * __res
|
| * @bufLen = Length of data |
* @bufLen = Length of data |
| * return: -1 error, !=-1 Checksum |
* return: -1 error, !=-1 Checksum |
| */ |
*/ |
| inline unsigned int crcAdler(unsigned char * __restrict psBuf, int bufLen); | unsigned int crcAdler(unsigned char * __restrict psBuf, int bufLen); |
| |
|
| /* |
/* |
| * crcEther() - Checksum in Ethernet communication |
* crcEther() - Checksum in Ethernet communication |
|
Line 133 inline unsigned int crcAdler(unsigned char * __restric
|
Line 133 inline unsigned int crcAdler(unsigned char * __restric
|
| * return: crc for packet, if is 0 check and crc_GetErrno() == 1 |
* return: crc for packet, if is 0 check and crc_GetErrno() == 1 |
| Pelco protocol not supported |
Pelco protocol not supported |
| */ |
*/ |
| inline unsigned char crcPelco(unsigned char ver, unsigned char *pkt); | unsigned char crcPelco(unsigned char ver, unsigned char *pkt); |
| |
|
| |
|
| /* |
/* |
|
Line 144 inline unsigned char crcPelco(unsigned char ver, unsig
|
Line 144 inline unsigned char crcPelco(unsigned char ver, unsig
|
| * @nVer = Version of algorythm; 0 - original, 1 - AITNET variant |
* @nVer = Version of algorythm; 0 - original, 1 - AITNET variant |
| * return: Hash value |
* return: Hash value |
| */ |
*/ |
| inline unsigned int hash_varchar(const char *csStr, int nStrLen, int nVer); | unsigned int hash_varchar(const char *csStr, int nStrLen, int nVer); |
| /* |
/* |
| * hash_bernstein() - Compute index hash by Bernstein |
* hash_bernstein() - Compute index hash by Bernstein |
| * |
* |
|
Line 153 inline unsigned int hash_varchar(const char *csStr, in
|
Line 153 inline unsigned int hash_varchar(const char *csStr, in
|
| * @nVer = Version of algorythm; 0 - Bernstein, 1 - DJBX33A variant |
* @nVer = Version of algorythm; 0 - Bernstein, 1 - DJBX33A variant |
| * return: Hash value |
* return: Hash value |
| */ |
*/ |
| inline unsigned int hash_bernstein(const char *csStr, int nStrLen, int nVer); | unsigned int hash_bernstein(const char *csStr, int nStrLen, int nVer); |
| /* |
/* |
| * hash_jenkins() - Compute index hash by Jenkins (one-at-a-time) |
* hash_jenkins() - Compute index hash by Jenkins (one-at-a-time) |
| * |
* |
|
Line 161 inline unsigned int hash_bernstein(const char *csStr,
|
Line 161 inline unsigned int hash_bernstein(const char *csStr,
|
| * @nStrLen = Length of data buffer |
* @nStrLen = Length of data buffer |
| * return: Hash value |
* return: Hash value |
| */ |
*/ |
| inline unsigned int hash_jenkins(const char *csStr, int nStrLen); | unsigned int hash_jenkins(const char *csStr, int nStrLen); |
| /* |
/* |
| * hash_jenkins32() - Fast Jenkins hash function |
* hash_jenkins32() - Fast Jenkins hash function |
| * |
* |
|
Line 178 unsigned int hash_jenkins32(const unsigned int *buf, i
|
Line 178 unsigned int hash_jenkins32(const unsigned int *buf, i
|
| * @nStrLen = Length of data buffer |
* @nStrLen = Length of data buffer |
| * return: Hash value |
* return: Hash value |
| */ |
*/ |
| inline unsigned int hash_reddragon(const char *csStr, int nStrLen); | unsigned int hash_reddragon(const char *csStr, int nStrLen); |
| /* |
/* |
| * hash_fnv1() - Compute index hash by FNV-1 |
* hash_fnv1() - Compute index hash by FNV-1 |
| * |
* |
|
Line 187 inline unsigned int hash_reddragon(const char *csStr,
|
Line 187 inline unsigned int hash_reddragon(const char *csStr,
|
| * @nVer = Version of algorythm; 0 - FNV-1, 1 - FNV-1a (best avalanche) |
* @nVer = Version of algorythm; 0 - FNV-1, 1 - FNV-1a (best avalanche) |
| * return: Hash value |
* return: Hash value |
| */ |
*/ |
| inline unsigned int hash_fnv1(const char *csStr, int nStrLen, int nVer); | unsigned int hash_fnv1(const char *csStr, int nStrLen, int nVer); |
| |
|
| /* |
/* |
| * hash_fnv() - Compute index hash by FNV-1a |
* hash_fnv() - Compute index hash by FNV-1a |