dcerpc-netlogon: improve NetrLogonGetCapabilities dissection
[wireshark-sm.git] / epan / crc10-tvb.c
blobffae9795d1390395f04c6f17142a051bd56082ff
1 /* crc10-tvb.c
2 * CRC-10 tvb routines
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
11 #include "config.h"
13 #include <glib.h>
14 #include <epan/tvbuff.h>
15 #include <wsutil/crc10.h>
16 #include <epan/crc10-tvb.h>
18 /* update the data block's CRC-10 remainder one byte at a time */
19 uint16_t
20 update_crc10_by_bytes_tvb(uint16_t crc10, tvbuff_t *tvb, int offset, int len)
22 const uint8_t *buf;
24 tvb_ensure_bytes_exist(tvb, offset, len); /* len == -1 not allowed */
25 buf = tvb_get_ptr(tvb, offset, len);
27 return update_crc10_by_bytes(crc10, buf, len);
31 * Editor modelines - https://www.wireshark.org/tools/modelines.html
33 * Local variables:
34 * c-basic-offset: 4
35 * tab-width: 8
36 * indent-tabs-mode: nil
37 * End:
39 * vi: set shiftwidth=4 tabstop=8 expandtab:
40 * :indentSize=4:tabSize=8:noTabs=true: