From 22ad90cdc8c4487072e2152cbca8112afaeaa59f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 8 Aug 2014 08:57:31 -0700 Subject: Add routines for CRC-16 with a polynomial of 0x3D65. There are routines that take a buffer and a length and that take a tvbuff, offset, and length; use those routines in the DNP dissector (which no longer needs its own table and loop), and use the tvbuff routine instead of calling tvb_get_ptr(). Change-Id: Ic67b0f3b65b94ea47c0fdc2f3d3b6f88df77f9c6 Reviewed-on: https://code.wireshark.org/review/3505 Reviewed-by: Guy Harris --- epan/crc16-tvb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'epan/crc16-tvb.h') diff --git a/epan/crc16-tvb.h b/epan/crc16-tvb.h index f85ae8fc8c..eee19f7597 100644 --- a/epan/crc16-tvb.h +++ b/epan/crc16-tvb.h @@ -115,6 +115,18 @@ WS_DLL_PUBLIC guint16 crc16_plain_tvb_offset_seed(tvbuff_t *tvb, guint offset, g @return The CRC16 checksum. */ WS_DLL_PUBLIC guint16 crc16_0x9949_tvb_offset_seed(tvbuff_t *tvb, guint offset, guint len, guint16 seed); +/** Compute CRC16 checksum of a tv buffer using the parameters + * Width = 16 bits + * Poly = 0x3D65 + * Reflection = true + * Algorithm = table-driven + @param tvb The tv buffer containing the data. + @param offset The offset into the tv buffer. + @param len The number of bytes to include in the computation. + @param seed The seed to use. + @return The CRC16 checksum. */ +WS_DLL_PUBLIC guint16 crc16_0x3D65_tvb_offset_seed(tvbuff_t *tvb, guint offset, guint len, guint16 seed); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.3