3 * Functions and types for CRC checks.
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
11 * Generated on Wed Jul 11 17:24:57 2012,
12 * by pycrc v0.7.10, http://www.tty1.net/pycrc/
13 * using the configuration:
20 * Algorithm = table-driven
21 ****************************************************************************
26 #include <wireshark.h>
34 * The definition of the used algorithm.
35 *****************************************************************************/
36 #define CRC_ALGO_TABLE_DRIVEN 1
39 * Calculate the initial crc value.
41 * \return The initial crc value.
42 *****************************************************************************/
43 static inline uint8_t crc7init(void)
50 * Update the crc value with new data.
52 * \param crc The current crc value.
53 * \param data Pointer to a buffer of \a data_len bytes.
54 * \param data_len Number of bytes in the \a data buffer.
55 * \return The updated crc value.
56 *****************************************************************************/
57 WS_DLL_PUBLIC
uint8_t crc7update(uint8_t crc
, const unsigned char *data
, int data_len
);
61 * Calculate the final crc value.
63 * \param crc The current crc value.
64 * \return The final crc value.
65 *****************************************************************************/
66 static inline uint8_t crc7finalize(uint8_t crc
)
68 return (crc
>> 1) ^ 0x00;
73 } /* closing brace for extern "C" */
76 #endif /* __CRC7__H__ */