summaryrefslogtreecommitdiff
path: root/wsutil/crc16.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 /wsutil/crc16.h
parent8da72cd43dcd597c9f03754831d55211a17f077c (diff)
downloadwireshark-22ad90cdc8c4487072e2152cbca8112afaeaa59f.tar.gz
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 'wsutil/crc16.h')
-rw-r--r--wsutil/crc16.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/wsutil/crc16.h b/wsutil/crc16.h
index 91dbec0ffb..53a8305e09 100644
--- a/wsutil/crc16.h
+++ b/wsutil/crc16.h
@@ -88,6 +88,15 @@ WS_DLL_PUBLIC guint16 crc16_0x755B(const guint8 *buf, guint32 len, guint16 seed)
*/
WS_DLL_PUBLIC guint16 crc16_0x9949_seed(const guint8 *buf, guint len, guint16 seed);
+/** Computes CRC16 checksum for the given data with the polynom 0x3D65 using
+ * precompiled CRC table
+ * @param buf a pointer to a buffer of the given length
+ * @param len the length of the given buffer
+ * @param seed The seed to use.
+ * @return the CRC16 checksum for the buffer
+ */
+WS_DLL_PUBLIC guint16 crc16_0x3D65_seed(const guint8 *buf, guint len, guint16 seed);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */