Set the svn:eol-style property on all text files to "native", so that
[obnox/wireshark/wip.git] / crc16.h
1 /* crc16.h
2  * Declaration of CRC-16 routines and table
3  *
4  * 2004 Richard van der Hoff <richardv@mxtelecom.com>
5  *
6  * $Id$
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@xxxxxxxxxxxx>
10  * Copyright 1998 Gerald Combs
11  *
12  * Copied from README.developer
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */
28
29 /* Calculate the CCITT/ITU/CRC-16 16-bit CRC
30    
31    (parameters for this CRC are:
32        Polynomial: x^16 + x^12 + x^5 + 1  (0x1021);
33        Start value 0xFFFF;
34        XOR result with 0xFFFF;
35        First bit is LSB)
36 */
37 extern guint16 crc16_ccitt(const unsigned char *buf, guint len);
38 extern guint16 crc16_ccitt_tvb(tvbuff_t *tvb, unsigned int len);
39