2 * Declaration of CRC-16 routines and table
4 * 2004 Richard van der Hoff <richardv@mxtelecom.com>
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@xxxxxxxxxxxx>
10 * Copyright 1998 Gerald Combs
12 * Copied from README.developer
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.
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.
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.
29 /* Calculate the CCITT/ITU/CRC-16 16-bit CRC
31 (parameters for this CRC are:
32 Polynomial: x^16 + x^12 + x^5 + 1 (0x1021);
34 XOR result with 0xFFFF;
37 extern guint16 crc16_ccitt(const unsigned char *buf, guint len);
38 extern guint16 crc16_ccitt_tvb(tvbuff_t *tvb, unsigned int len);