aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2015-01-06 13:58:59 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2015-01-06 13:01:31 +0000
commitcbca7eeb712c7365bf46ed3de8ed5c633a662bc2 (patch)
tree87e75dd785462f9cabf988d233d63170dc9e7108 /epan
parent0910b551a9ad858cb463f9cc4eb5f2098f60ffd7 (diff)
p_mul: Indicate if fletcher algorithm is used.
The first version of ACP 142 uses the fletcher algorithm for checksum. Indicate if this (now old variant) checksum is used. Change-Id: Id6f3e7ecfcde022b339bdb956cd6f642a917076a Reviewed-on: https://code.wireshark.org/review/6342 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-p_mul.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c
index fd1672034f..026a6d72b6 100644
--- a/epan/dissectors/packet-p_mul.c
+++ b/epan/dissectors/packet-p_mul.c
@@ -274,7 +274,7 @@ static const gchar *get_type (guint8 value)
}
-/* Function checksum, found in ACP 142 annex B04 */
+/* Function checksum, found in ACP 142 annex B04 (Fletcher algorithm) */
static guint16 checksum_acp142 (guint8 *buffer, gint len, gint offset)
{
guint16 c0 = 0, c1 = 0, ret, ctmp;
@@ -800,6 +800,7 @@ static int dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
address src, dst;
wmem_strbuf_t *message_id_list = NULL;
nstime_t ts;
+ gboolean fletcher = FALSE;
col_set_str (pinfo->cinfo, COL_PROTOCOL, "P_MUL");
col_clear (pinfo->cinfo, COL_INFO);
@@ -918,9 +919,15 @@ static int dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
checksum_calc = g_ntohs (ip_checksum (value, len));
if (checksum_calc != checksum_found) {
guint16 checksum1 = checksum_acp142 (value, len, offset);
- if (checksum1 == checksum_found) checksum_calc = checksum1;
+ if (checksum1 == checksum_found) {
+ checksum_calc = checksum1;
+ fletcher = TRUE;
+ }
}
if (checksum_calc == checksum_found) {
+ if (fletcher) {
+ proto_item_append_text (en, " [Fletcher algorithm]");
+ }
proto_item_append_text (en, " (correct)");
en = proto_tree_add_boolean (checksum_tree, hf_checksum_good, tvb,
offset, 2, TRUE);