4 * Functions and types for CRC checks.
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
12 * Generated on Wed Jul 11 17:24:57 2012,
13 * by pycrc v0.7.10, http://www.tty1.net/pycrc/
14 * using the configuration:
21 * Algorithm = table-driven
22 ****************************************************************************
27 #include "ws_symbol_export.h"
35 * The definition of the used algorithm.
36 *****************************************************************************/
37 #define CRC_ALGO_TABLE_DRIVEN 1
40 * Calculate the initial crc value.
42 * \return The initial crc value.
43 *****************************************************************************/
44 static inline guint8 crc7init(void)
51 * Update the crc value with new data.
53 * \param crc The current crc value.
54 * \param data Pointer to a buffer of \a data_len bytes.
55 * \param data_len Number of bytes in the \a data buffer.
56 * \return The updated crc value.
57 *****************************************************************************/
58 WS_DLL_PUBLIC guint8 crc7update(guint8 crc, const unsigned char *data, int data_len);
62 * Calculate the final crc value.
64 * \param crc The current crc value.
65 * \return The final crc value.
66 *****************************************************************************/
67 static inline guint8 crc7finalize(guint8 crc)
69 return (crc >> 1) ^ 0x00;
74 } /* closing brace for extern "C" */
77 #endif /* __CRC7__H__ */