ssl,dtls: use ProtocolVersion from Server Hello
[metze/wireshark/wip.git] / epan / crc6-tvb.c
1 /* crc6-tvb.c
2  * CRC-6 tvb routines
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #include "config.h"
24
25 #include <glib.h>
26 #include <epan/tvbuff.h>
27 #include <wsutil/crc6.h>
28 #include <epan/crc6-tvb.h>
29
30 guint16
31 crc6_compute_tvb(tvbuff_t *tvb, int len)
32 {
33     const guint8 *buf;
34
35     tvb_ensure_bytes_exist(tvb, 0, len);  /* len == -1 not allowed */
36     buf = tvb_get_ptr(tvb, 0, len);
37
38     return crc6_compute(buf, len);
39 }
40
41 /*
42  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
43  *
44  * Local variables:
45  * c-basic-offset: 4
46  * tab-width: 8
47  * indent-tabs-mode: nil
48  * End:
49  *
50  * vi: set shiftwidth=4 tabstop=8 expandtab:
51  * :indentSize=4:tabSize=8:noTabs=true:
52  */