2 * Declaration of CRC-32 tvbuff routines
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #ifndef __CRC32_TVB_H__
26 #define __CRC32_TVB_H__
30 #endif /* __cplusplus */
32 /** Compute CRC32 CCITT checksum of a tv buffer.
33 @param tvb The tv buffer containing the data.
34 @param len The number of bytes to include in the computation.
35 @return The CRC32 CCITT checksum. */
36 extern guint32 crc32_ccitt_tvb(tvbuff_t *tvb, guint len);
38 /** Compute CRC32 CCITT checksum of a tv buffer.
39 @param tvb The tv buffer containing the data.
40 @param offset The offset into the tv buffer.
41 @param len The number of bytes to include in the computation.
42 @return The CRC32 CCITT checksum. */
43 extern guint32 crc32_ccitt_tvb_offset(tvbuff_t *tvb, guint offset, guint len);
45 /** Compute CRC32 CCITT checksum of a tv buffer. If computing the
46 * checksum over multiple tv buffers and you want to feed the partial CRC32
47 * back in, remember to take the 1's complement of the partial CRC32 first.
48 @param tvb The tv buffer containing the data.
49 @param len The number of bytes to include in the computation.
50 @param seed The seed to use.
51 @return The CRC32 CCITT checksum (using the given seed). */
52 extern guint32 crc32_ccitt_tvb_seed(tvbuff_t *tvb, guint len, guint32 seed);
54 /** Compute CRC32 CCITT checksum of a tv buffer. If computing the
55 * checksum over multiple tv buffers and you want to feed the partial CRC32
56 * back in, remember to take the 1's complement of the partial CRC32 first.
57 @param tvb The tv buffer containing the data.
58 @param offset The offset into the tv buffer.
59 @param len The number of bytes to include in the computation.
60 @param seed The seed to use.
61 @return The CRC32 CCITT checksum (using the given seed). */
62 extern guint32 crc32_ccitt_tvb_offset_seed(tvbuff_t *tvb, guint offset,
63 guint len, guint32 seed);
65 /** Compute IEEE 802.x CRC32 checksum of a tv buffer.
66 @param tvb The tv buffer containing the data.
67 @param len The number of bytes to include in the computation.
68 @return The IEEE 802.x CRC32 checksum. */
69 extern guint32 crc32_802_tvb(tvbuff_t *tvb, guint len);
73 #endif /* __cplusplus */
75 #endif /* crc32-tvb.h */