aboutsummaryrefslogtreecommitdiffstats
path: root/epan/crc16-tvb.c
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 /epan/crc16-tvb.c
parent091d2db3d71aa30b6d0c7cc664349797da3ef865 (diff)
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 'epan/crc16-tvb.c')
-rw-r--r--epan/crc16-tvb.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/epan/crc16-tvb.c b/epan/crc16-tvb.c
index 3a2bb48c71..b20d759c50 100644
--- a/epan/crc16-tvb.c
+++ b/epan/crc16-tvb.c
@@ -55,7 +55,17 @@ guint16 crc16_x25_ccitt_tvb(tvbuff_t *tvb, guint len)
tvb_ensure_bytes_exist(tvb, 0, len); /* len == -1 not allowed */
buf = tvb_get_ptr(tvb, 0, len);
- return crc16_x25_ccitt(buf, len);
+ return crc16_x25_ccitt_seed(buf, len, 0xFFFF);
+}
+
+guint16 crc16_r3_ccitt_tvb(tvbuff_t *tvb, int offset, guint len)
+{
+ const guint8 *buf;
+
+ tvb_ensure_bytes_exist(tvb, offset, len); /* len == -1 not allowed */
+ buf = tvb_get_ptr(tvb, offset, len);
+
+ return crc16_x25_ccitt_seed(buf, len, 0);
}
guint16 crc16_ccitt_tvb_offset(tvbuff_t *tvb, guint offset, guint len)