aboutsummaryrefslogtreecommitdiffstats
path: root/epan/crc16-tvb.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-08-08 08:57:31 -0700
committerGuy Harris <guy@alum.mit.edu>2014-08-08 15:58:06 +0000
commit22ad90cdc8c4487072e2152cbca8112afaeaa59f (patch)
tree868fb343a8dcf01d5ae625f4fa91dc3d3d58c5b1 /epan/crc16-tvb.h
parent8da72cd43dcd597c9f03754831d55211a17f077c (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'epan/crc16-tvb.h')
-rw-r--r--epan/crc16-tvb.h12
1 files changed, 12 insertions, 0 deletions
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 */