diff options
author | Michael Mann <mmann78@netscape.net> | 2016-07-21 10:21:25 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-07-27 03:40:02 +0000 |
commit | 8b0e9c66728f6a39bbe3ada1029e13ad1378013a (patch) | |
tree | c0c1b4da1845069520d4e131db96e6143e4ca772 /epan/dissectors/packet-rgmp.c | |
parent | b7f1e99f7f4c75fa4bac1ccba77087fb0e50b8ac (diff) |
Follow up for proto_tree_add_checksum.
Fill in the "gaps" so that all dissectors that verify checksums have both a
status and expert info field.
Also address comments from original proto_tree_add_checksum patch that didn't make it.
Ping-Bug: 8859
Change-Id: I2e6640108fd6bb218cb959fe9e4ba98a13e43a2f
Reviewed-on: https://code.wireshark.org/review/16590
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-rgmp.c')
-rw-r--r-- | epan/dissectors/packet-rgmp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/epan/dissectors/packet-rgmp.c b/epan/dissectors/packet-rgmp.c index dc0401d22b..3ff8b0e13f 100644 --- a/epan/dissectors/packet-rgmp.c +++ b/epan/dissectors/packet-rgmp.c @@ -30,6 +30,7 @@ #include "config.h" #include <epan/packet.h> +#include <epan/expert.h> #include "packet-igmp.h" void proto_register_rgmp(void); @@ -44,6 +45,8 @@ static int hf_maddr = -1; static int ett_rgmp = -1; +static expert_field ei_checksum = EI_INIT; + static dissector_handle_t rgmp_handle; #define MC_RGMP 0xe0000019 @@ -86,7 +89,7 @@ dissect_rgmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d proto_tree_add_item(tree, hf_reserved, tvb, offset, 1, ENC_NA); offset += 1; - igmp_checksum(tree, tvb, hf_checksum, hf_checksum_status, pinfo, 0); + igmp_checksum(tree, tvb, hf_checksum, hf_checksum_status, &ei_checksum, pinfo, 0); offset += 2; proto_tree_add_item(tree, hf_maddr, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -130,9 +133,17 @@ proto_register_rgmp(void) &ett_rgmp }; + static ei_register_info ei[] = { + { &ei_checksum, { "rgmp.bad_checksum", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }}, + }; + + expert_module_t* expert_rgmp; + proto_rgmp = proto_register_protocol("Router-port Group Management Protocol", "RGMP", "rgmp"); proto_register_field_array(proto_rgmp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + expert_rgmp = expert_register_protocol(proto_rgmp); + expert_register_field_array(expert_rgmp, ei, array_length(ei)); rgmp_handle = register_dissector("rgmp", dissect_rgmp, proto_rgmp); } |