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 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * Generated on Wed Jul 11 17:24:57 2012,
25 * by pycrc v0.7.10, http://www.tty1.net/pycrc/
26 * using the configuration:
33 * Algorithm = table-driven
34 ****************************************************************************
39 #include "ws_symbol_export.h"
47 * The definition of the used algorithm.
48 *****************************************************************************/
49 #define CRC_ALGO_TABLE_DRIVEN 1
52 * Calculate the initial crc value.
54 * \return The initial crc value.
55 *****************************************************************************/
56 static inline guint8 crc7init(void)
63 * Update the crc value with new data.
65 * \param crc The current crc value.
66 * \param data Pointer to a buffer of \a data_len bytes.
67 * \param data_len Number of bytes in the \a data buffer.
68 * \return The updated crc value.
69 *****************************************************************************/
70 WS_DLL_PUBLIC guint8 crc7update(guint8 crc, const unsigned char *data, int data_len);
74 * Calculate the final crc value.
76 * \param crc The current crc value.
77 * \return The final crc value.
78 *****************************************************************************/
79 static inline guint8 crc7finalize(guint8 crc)
81 return (crc >> 1) ^ 0x00;
86 } /* closing brace for extern "C" */
89 #endif /* __CRC7__H__ */