| 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
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
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
112#ifdef __cplusplus
113}
114#endif /* __cplusplus */
115
116#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:427
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:391
crc32c_table_lookup
WS_DLL_PUBLIC uint32_t crc32c_table_lookup(unsigned char pos)
Definition crc32.c:357
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:380
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:369
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:363
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:397
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:439
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:413