Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
crc32.h
Go to the documentation of this file.
1
11#ifndef __CRC32_H__
12#define __CRC32_H__
13
14#include <wireshark.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20#define CRC32_CCITT_SEED 0xFFFFFFFF
21#define CRC32C_PRELOAD 0xffffffff
22#define CRC32_MPEG2_SEED 0xFFFFFFFF
23
24/*
25 * Byte swap fix contributed by Dave Wysochanski <[email protected]>.
26 */
27#define CRC32C_SWAP(crc32c_value) \
28 (((crc32c_value & 0xff000000) >> 24) | \
29 ((crc32c_value & 0x00ff0000) >> 8) | \
30 ((crc32c_value & 0x0000ff00) << 8) | \
31 ((crc32c_value & 0x000000ff) << 24))
32
43WS_DLL_PUBLIC uint32_t crc32_ccitt_table_lookup (unsigned char pos);
44
47WS_DLL_PUBLIC uint32_t crc32c_table_lookup (unsigned char pos);
48
55WS_DLL_PUBLIC uint32_t crc32c_calculate(const void *buf, int len, uint32_t crc);
56
64WS_DLL_PUBLIC uint32_t crc32c_calculate_no_swap(const void *buf, int len, uint32_t crc);
65
71WS_DLL_PUBLIC uint32_t crc32_ccitt(const uint8_t *buf, unsigned len);
72
82WS_DLL_PUBLIC uint32_t crc32_ccitt_seed(const uint8_t *buf, unsigned len, uint32_t seed);
83
90WS_DLL_PUBLIC uint32_t crc32_mpeg2_seed(const uint8_t *buf, unsigned len, uint32_t seed);
91
100WS_DLL_PUBLIC uint32_t crc32_0x0AA725CF_seed(const uint8_t *buf, unsigned len, uint32_t seed);
101
110WS_DLL_PUBLIC uint32_t crc32_0x5D6DCB_seed(const uint8_t *buf, unsigned len, uint32_t seed);
111
118WS_DLL_PUBLIC uint32_t crc32_sc32_seed(const uint8_t *buf, unsigned len, uint32_t seed);
119
120#ifdef __cplusplus
121}
122#endif /* __cplusplus */
123
124#endif /* crc32.h */
WS_DLL_PUBLIC uint32_t crc32_0x0AA725CF_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Computes CRC32 checksum for the given data with the polynom 0x0AA725CF using precompiled CRC table.
Definition crc32.c:491
WS_DLL_PUBLIC uint32_t crc32_ccitt(const uint8_t *buf, unsigned len)
Compute CRC32 CCITT checksum of a buffer of data.
Definition crc32.c:455
WS_DLL_PUBLIC uint32_t crc32c_table_lookup(unsigned char pos)
Definition crc32.c:421
WS_DLL_PUBLIC uint32_t crc32c_calculate_no_swap(const void *buf, int len, uint32_t crc)
Compute CRC32C checksum of a buffer of data without swapping seed crc or completed checksum.
Definition crc32.c:444
WS_DLL_PUBLIC uint32_t crc32c_calculate(const void *buf, int len, uint32_t crc)
Compute CRC32C checksum of a buffer of data.
Definition crc32.c:433
WS_DLL_PUBLIC uint32_t crc32_ccitt_table_lookup(unsigned char pos)
Lookup a CRC-32/CCITT table value by position.
Definition crc32.c:427
WS_DLL_PUBLIC uint32_t crc32_ccitt_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Compute CRC32 CCITT checksum of a buffer of data.
Definition crc32.c:461
WS_DLL_PUBLIC uint32_t crc32_sc32_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Compute SC-32 CRC32 checksum of a buffer of data.
Definition crc32.c:519
WS_DLL_PUBLIC uint32_t crc32_0x5D6DCB_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Computes CRC32 checksum for the given data with the polynom 0x5D6DCB using precompiled CRC table.
Definition crc32.c:503
WS_DLL_PUBLIC uint32_t crc32_mpeg2_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Compute MPEG-2 CRC32 checksum of a buffer of data.
Definition crc32.c:477