diff options
author | Gerald Combs <gerald@wireshark.org> | 2009-03-18 21:59:30 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2009-03-18 21:59:30 +0000 |
commit | dd903ca9c8434f68f01c2affbe7fef4b05ba07d4 (patch) | |
tree | 1ad1bf485828e29deedc3571b0d9b00b10e1fc08 /plugins | |
parent | cf536e062b5ac17b4f91a8fe706fd1dfb62622ea (diff) |
Create an "epan/crc" directory for CRC code. Add crc-16-plain.[ch],
generated from pycrc. The command line used to generate the file is in
epan/crc/Makefile.common. I used "plain" to distinguish it from CCITT,
USB, and other 16-bit CRCs. Integrate the new CRC code into our
infrastructure.
Add crc16_plain_tvb_offset() to epan/crc16.[ch] and use it in
plugins/profinet/packet-pn-rt.c. This _should_ work correctly, but
hasn't been tested.
svn path=/trunk/; revision=27790
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/profinet/packet-pn-rt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/profinet/packet-pn-rt.c b/plugins/profinet/packet-pn-rt.c index 4b755b1860..a981890990 100644 --- a/plugins/profinet/packet-pn-rt.c +++ b/plugins/profinet/packet-pn-rt.c @@ -49,9 +49,9 @@ #include <epan/etypes.h> #include <epan/expert.h> #include <epan/dissectors/packet-dcerpc.h> +#include <epan/crc16.h> #include "packet-pn.h" -#include "crc16.h" /* Define the pn-rt proto */ static int proto_pn_rt = -1; @@ -145,7 +145,6 @@ dissect_SubFrame_heur(tvbuff_t *tvb, proto_item *sub_item; proto_tree *sub_tree; proto_item *item; - const char *crc_buf; guint16 crc; @@ -193,8 +192,11 @@ dissect_SubFrame_heur(tvbuff_t *tvb, item = proto_tree_add_uint(sub_tree, hf_pn_rt_sf_crc16, tvb, offset, 2, u16SFCRC16); if(u8SFPosition & 0x80) { + /* crc_buf = (const char *) tvb_get_ptr(tvb, u32SubStart, offset-u32SubStart); crc = crc16(0, crc_buf, offset-u32SubStart); + */ + crc = crc16_plain_tvb_offset(tvb, u32SubStart, offset-u32SubStart); if(crc != u16SFCRC16) { proto_item_append_text(item, " [Preliminary check: incorrect, should be: %u]", crc); |