summaryrefslogtreecommitdiff
path: root/wsutil
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-03-01 10:46:31 -0500
committerAnders Broman <a.broman58@gmail.com>2015-03-03 05:12:10 +0000
commit43fd878c4e4d726dd4604ade4c0548eed783c4f3 (patch)
tree0f891fdab1f18e128ae1cd49b400c4ff74aed82d /wsutil
parent091d2db3d71aa30b6d0c7cc664349797da3ef865 (diff)
downloadwireshark-43fd878c4e4d726dd4604ade4c0548eed783c4f3.tar.gz
Add "seed" capabilities to crc16_x25_ccitt (now crc16_x25_ccitt_seed) so we can remove CRC algorithm calculation in packet-assa_r3.c.
Change-Id: I3143800f6ff922a309f5506d9acbc2c4293363b7 Reviewed-on: https://code.wireshark.org/review/7490 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/crc16.c4
-rw-r--r--wsutil/crc16.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/wsutil/crc16.c b/wsutil/crc16.c
index 01af42af4b..8febfa1c66 100644
--- a/wsutil/crc16.c
+++ b/wsutil/crc16.c
@@ -335,9 +335,9 @@ guint16 crc16_ccitt(const guint8 *buf, guint len)
^ crc16_ccitt_xorout;
}
-guint16 crc16_x25_ccitt(const guint8 *buf, guint len)
+guint16 crc16_x25_ccitt_seed(const guint8 *buf, guint len, guint16 seed)
{
- return crc16_unreflected(buf,len,crc16_ccitt_start,crc16_ccitt_table);
+ return crc16_unreflected(buf,len,seed,crc16_ccitt_table);
}
guint16 crc16_ccitt_seed(const guint8 *buf, guint len, guint16 seed)
diff --git a/wsutil/crc16.h b/wsutil/crc16.h
index 53a8305e09..151b3f210d 100644
--- a/wsutil/crc16.h
+++ b/wsutil/crc16.h
@@ -50,7 +50,7 @@ WS_DLL_PUBLIC guint16 crc16_ccitt(const guint8 *buf, guint len);
@param buf The buffer containing the data.
@param len The number of bytes to include in the computation.
@return The CRC16 X.25 CCITT checksum. */
-WS_DLL_PUBLIC guint16 crc16_x25_ccitt(const guint8 *buf, guint len);
+WS_DLL_PUBLIC guint16 crc16_x25_ccitt_seed(const guint8 *buf, guint len, guint16 seed);
/** Compute CRC16 CCITT checksum of a buffer of data. If computing the
* checksum over multiple buffers and you want to feed the partial CRC16