Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
crc7.h
1 /*
2  * crc7.h
3  *
4  * Functions and types for CRC checks.
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * SPDX-License-Identifier: GPL-2.0-or-later
11  *
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:
15  * Width = 7
16  * Poly = 0x45
17  * XorIn = 0x00
18  * ReflectIn = False
19  * XorOut = 0x00
20  * ReflectOut = False
21  * Algorithm = table-driven
22  ****************************************************************************
23  */
24 #ifndef __CRC7__H__
25 #define __CRC7__H__
26 
27 #include "ws_symbol_export.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 
37 #define CRC_ALGO_TABLE_DRIVEN 1
38 
44 static inline guint8 crc7init(void)
45 {
46  return 0x00 << 1;
47 }
48 
49 
58 WS_DLL_PUBLIC guint8 crc7update(guint8 crc, const unsigned char *data, int data_len);
59 
60 
67 static inline guint8 crc7finalize(guint8 crc)
68 {
69  return (crc >> 1) ^ 0x00;
70 }
71 
72 
73 #ifdef __cplusplus
74 } /* closing brace for extern "C" */
75 #endif
76 
77 #endif /* __CRC7__H__ */