update epan/dissectors/pidl/drsuapi/drsuapi.idl from samba
[wireshark-sm.git] / wsutil / crc8.h
blob8695640b6306d4baed5d8def5913c53225accbd8
1 /** @file
2 * Declaration of CRC-8 routine and tables
4 * 2011 Roland Knall <rknall@gmail.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #ifndef __CRC8_H__
14 #define __CRC8_H__
16 #include <wireshark.h>
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
22 /** Calculates a CRC8 checksum for the given buffer with the polynom
23 * 0x2F using the precompiled CRC table
24 * @param buf a pointer to a buffer of the given length
25 * @param len the length of the given buffer
26 * @param seed The seed to use.
27 * @return the CRC8 checksum for the buffer
29 WS_DLL_PUBLIC uint8_t crc8_0x2F(const uint8_t *buf, uint32_t len, uint8_t seed);
31 /** Calculates a CRC8 checksum for the given buffer with the polynom
32 * 0x37 using the precompiled CRC table
33 * @param buf a pointer to a buffer of the given length
34 * @param len the length of the given buffer
35 * @param seed The seed to use.
36 * @return the CRC8 checksum for the buffer
38 WS_DLL_PUBLIC uint8_t crc8_0x37(const uint8_t *buf, uint32_t len, uint8_t seed);
40 /** Calculates a CRC8 checksum for the given buffer with the polynom
41 * 0x3B using the precompiled CRC table
42 * @param buf a pointer to a buffer of the given length
43 * @param len the length of the given buffer
44 * @param seed The seed to use.
45 * @return the CRC8 checksum for the buffer
47 WS_DLL_PUBLIC uint8_t crc8_0x3B(const uint8_t *buf, uint32_t len, uint8_t seed);
49 #ifdef __cplusplus
51 #endif /* __cplusplus */
53 #endif /* crc8.h */