| 211 | } |
| 212 | |
| 213 | void crcitt_string_array( char *dst, str src[], int size ) |
| 214 | { |
| 215 | register int i; |
| 216 | register unsigned short ccitt; |
| 217 | register char *c; |
| 218 | register int len; |
| 219 | int str_len; |
| 220 | |
| 221 | ccitt = 0xFFFF; |
| 222 | str_len=CRC16_LEN; |
| 223 | for (i=0; i<size; i++ ) { |
| 224 | c=src[i].s; |
| 225 | len=src[i].len; |
| 226 | while(len) { |
| 227 | ccitt = UPDCIT( *c, ccitt ); |
| 228 | c++;len--; |
| 229 | } |
| 230 | } |
| 231 | ccitt = ~ccitt; |
| 232 | if (int2reverse_hex( &dst, &str_len, ccitt )==-1) { |
| 233 | /* bug ... printed ccitt value longer than CRC32_LEN */ |
| 234 | LM_CRIT("string conversion incomplete\n"); |
| 235 | } |
| 236 | /* padding */ |
| 237 | while( str_len ) { |
| 238 | *dst='0'; |
| 239 | dst++; |
| 240 | str_len--; |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | void crc32_uint (str *source_string, unsigned int *hash_ret) { |
| 245 | unsigned int hash; |
no test coverage detected