| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
crc32.h
Go to the documentation of this file.
1
10
11#ifndef __CRC32_H__
12#define __CRC32_H__
13
14#include <wireshark.h>
15
16#ifdef __cplusplus
17 extern "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 <davidw@netapp.com>.
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
50WS_DLL_PUBLIC uint32_t crc32c_table_lookup (unsigned char pos);
51
59WS_DLL_PUBLIC uint32_t crc32c_calculate(const void *buf, int len, uint32_t crc);
60
69WS_DLL_PUBLIC uint32_t crc32c_calculate_no_swap(const void *buf, int len, uint32_t crc);
70
77WS_DLL_PUBLIC uint32_t crc32_ccitt(const uint8_t *buf, unsigned len);
78
89WS_DLL_PUBLIC uint32_t crc32_ccitt_seed(const uint8_t *buf, unsigned len, uint32_t seed);
90
98WS_DLL_PUBLIC uint32_t crc32_mpeg2_seed(const uint8_t *buf, unsigned len, uint32_t seed);
99
108WS_DLL_PUBLIC uint32_t crc32_0x0AA725CF_seed(const uint8_t *buf, unsigned len, uint32_t seed);
109
118WS_DLL_PUBLIC uint32_t crc32_0x5D6DCB_seed(const uint8_t *buf, unsigned len, uint32_t seed);
119
126WS_DLL_PUBLIC uint32_t crc32_sc32_seed(const uint8_t *buf, unsigned len, uint32_t seed);
127
128#ifdef __cplusplus
129}
130#endif /* __cplusplus */
131
132#endif /* crc32.h */
crc32_0x0AA725CF_seed
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
crc32_ccitt
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
crc32c_table_lookup
WS_DLL_PUBLIC uint32_t crc32c_table_lookup(unsigned char pos)
Lookup the crc value in the crc32c_table.
Definition crc32.c:421
crc32c_calculate_no_swap
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
crc32c_calculate
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
crc32_ccitt_table_lookup
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
crc32_ccitt_seed
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
crc32_sc32_seed
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
crc32_0x5D6DCB_seed
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
crc32_mpeg2_seed
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