| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
crc16.h
Go to the documentation of this file.
1
13#ifndef __CRC16_H__
14#define __CRC16_H__
15
16#include <wireshark.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21
22/* Calculate the CCITT/ITU/CRC-16 16-bit CRC
23
24 (parameters for this CRC are:
25 Polynomial: x^16 + x^12 + x^5 + 1 (0x1021);
26 Start value 0xFFFF;
27 XOR result with 0xFFFF;
28 First bit is LSB)
29*/
30
36WS_DLL_PUBLIC uint16_t crc16_ccitt(const uint8_t *buf, unsigned len);
37
44WS_DLL_PUBLIC uint16_t crc16_x25_ccitt_seed(const uint8_t *buf, unsigned len, uint16_t seed);
45
56WS_DLL_PUBLIC uint16_t crc16_ccitt_seed(const uint8_t *buf, unsigned len, uint16_t seed);
57
63WS_DLL_PUBLIC uint16_t crc16_iso14443a(const uint8_t *buf, unsigned len);
64
70WS_DLL_PUBLIC uint16_t crc16_usb(const uint8_t *buf, unsigned len);
71
80WS_DLL_PUBLIC uint16_t crc16_0x5935(const uint8_t *buf, uint32_t len, uint16_t seed);
81
90WS_DLL_PUBLIC uint16_t crc16_0x755B(const uint8_t *buf, uint32_t len, uint16_t seed);
91
100WS_DLL_PUBLIC uint16_t crc16_0x9949_seed(const uint8_t *buf, unsigned len, uint16_t seed);
101
110WS_DLL_PUBLIC uint16_t crc16_0x3D65_seed(const uint8_t *buf, unsigned len, uint16_t seed);
111
120WS_DLL_PUBLIC uint16_t crc16_0x080F_seed(const uint8_t *buf, unsigned len, uint16_t seed);
121
122#ifdef __cplusplus
123}
124#endif /* __cplusplus */
125
126#endif /* crc16.h */
crc16_x25_ccitt_seed
WS_DLL_PUBLIC uint16_t crc16_x25_ccitt_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Compute CRC16 X.25 CCITT checksum of a buffer of data.
Definition crc16.c:411
crc16_0x080F_seed
WS_DLL_PUBLIC uint16_t crc16_0x080F_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Computes CRC16 checksum for the given data with the polynom 0x080F using precompiled CRC table.
Definition crc16.c:456
crc16_ccitt_seed
WS_DLL_PUBLIC uint16_t crc16_ccitt_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Compute CRC16 CCITT checksum of a buffer of data.
Definition crc16.c:416
crc16_usb
WS_DLL_PUBLIC uint16_t crc16_usb(const uint8_t *buf, unsigned len)
Compute the 16bit CRC value of a buffer as defined in USB Specification.
Definition crc16.c:430
crc16_0x9949_seed
WS_DLL_PUBLIC uint16_t crc16_0x9949_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Computes CRC16 checksum for the given data with the polynom 0x9949 using precompiled CRC table.
Definition crc16.c:446
crc16_ccitt
WS_DLL_PUBLIC uint16_t crc16_ccitt(const uint8_t *buf, unsigned len)
Compute CRC16 CCITT checksum of a buffer of data.
Definition crc16.c:405
crc16_0x755B
WS_DLL_PUBLIC uint16_t crc16_0x755B(const uint8_t *buf, uint32_t len, uint16_t seed)
Calculates a CRC16 checksum for the given buffer with the polynom 0x755B using a precompiled CRC tabl...
Definition crc16.c:441
crc16_iso14443a
WS_DLL_PUBLIC uint16_t crc16_iso14443a(const uint8_t *buf, unsigned len)
Compute the 16bit CRC_A value of a buffer as defined in ISO14443-3.
Definition crc16.c:425
crc16_0x3D65_seed
WS_DLL_PUBLIC uint16_t crc16_0x3D65_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Computes CRC16 checksum for the given data with the polynom 0x3D65 using precompiled CRC table.
Definition crc16.c:451
crc16_0x5935
WS_DLL_PUBLIC uint16_t crc16_0x5935(const uint8_t *buf, uint32_t len, uint16_t seed)
Calculates a CRC16 checksum for the given buffer with the polynomial 0x5935 using a precompiled CRC t...
Definition crc16.c:436