Wireshark 4.5.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
35WS_DLL_PUBLIC uint16_t crc16_ccitt(const uint8_t *buf, unsigned len);
36
41WS_DLL_PUBLIC uint16_t crc16_x25_ccitt_seed(const uint8_t *buf, unsigned len, uint16_t seed);
42
50WS_DLL_PUBLIC uint16_t crc16_ccitt_seed(const uint8_t *buf, unsigned len, uint16_t seed);
51
56WS_DLL_PUBLIC uint16_t crc16_iso14443a(const uint8_t *buf, unsigned len);
57
62WS_DLL_PUBLIC uint16_t crc16_usb(const uint8_t *buf, unsigned len);
63
71WS_DLL_PUBLIC uint16_t crc16_0x5935(const uint8_t *buf, uint32_t len, uint16_t seed);
72
80WS_DLL_PUBLIC uint16_t crc16_0x755B(const uint8_t *buf, uint32_t len, uint16_t seed);
81
89WS_DLL_PUBLIC uint16_t crc16_0x9949_seed(const uint8_t *buf, unsigned len, uint16_t seed);
90
98WS_DLL_PUBLIC uint16_t crc16_0x3D65_seed(const uint8_t *buf, unsigned len, uint16_t seed);
99
107WS_DLL_PUBLIC uint16_t crc16_0x080F_seed(const uint8_t *buf, unsigned len, uint16_t seed);
108
109#ifdef __cplusplus
110}
111#endif /* __cplusplus */
112
113#endif /* crc16.h */
WS_DLL_PUBLIC uint16_t crc16_x25_ccitt_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Definition crc16.c:411
WS_DLL_PUBLIC uint16_t crc16_0x080F_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Definition crc16.c:456
WS_DLL_PUBLIC uint16_t crc16_ccitt_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Definition crc16.c:416
WS_DLL_PUBLIC uint16_t crc16_usb(const uint8_t *buf, unsigned len)
Definition crc16.c:430
WS_DLL_PUBLIC uint16_t crc16_0x9949_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Definition crc16.c:446
WS_DLL_PUBLIC uint16_t crc16_ccitt(const uint8_t *buf, unsigned len)
Definition crc16.c:405
WS_DLL_PUBLIC uint16_t crc16_0x755B(const uint8_t *buf, uint32_t len, uint16_t seed)
Definition crc16.c:441
WS_DLL_PUBLIC uint16_t crc16_iso14443a(const uint8_t *buf, unsigned len)
Definition crc16.c:425
WS_DLL_PUBLIC uint16_t crc16_0x3D65_seed(const uint8_t *buf, unsigned len, uint16_t seed)
Definition crc16.c:451
WS_DLL_PUBLIC uint16_t crc16_0x5935(const uint8_t *buf, uint32_t len, uint16_t seed)
Definition crc16.c:436