/src/wireshark/epan/crc6-tvb.c
Line | Count | Source |
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 | | * SPDX-License-Identifier: GPL-2.0-or-later |
9 | | */ |
10 | | |
11 | | #include "config.h" |
12 | | |
13 | | #include <glib.h> |
14 | | #include <epan/tvbuff.h> |
15 | | #include <wsutil/crc6.h> |
16 | | #include <epan/crc6-tvb.h> |
17 | | |
18 | | uint16_t |
19 | | crc6_compute_tvb(tvbuff_t *tvb, int len) |
20 | 0 | { |
21 | 0 | const uint8_t *buf; |
22 | |
|
23 | 0 | tvb_ensure_bytes_exist(tvb, 0, len); /* len == -1 not allowed */ |
24 | 0 | buf = tvb_get_ptr(tvb, 0, len); |
25 | |
|
26 | 0 | return crc6_0X6F(0, buf, len); |
27 | 0 | } |
28 | | |
29 | | /* |
30 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
31 | | * |
32 | | * Local variables: |
33 | | * c-basic-offset: 4 |
34 | | * tab-width: 8 |
35 | | * indent-tabs-mode: nil |
36 | | * End: |
37 | | * |
38 | | * vi: set shiftwidth=4 tabstop=8 expandtab: |
39 | | * :indentSize=4:tabSize=8:noTabs=true: |
40 | | */ |