diff options
author | Michael Mann <mmann78@netscape.net> | 2014-11-07 07:47:43 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-11-08 16:33:50 +0000 |
commit | 421913b721d5b12c1f6c8a09daec35d8bae58bb5 (patch) | |
tree | 1c039d5db023456f106d3bd1d221401463639daf /epan/dissectors/packet-msnip.c | |
parent | bd5384c84a53a88c64fb79094444c063756ca183 (diff) |
Create real subdissectors to the IGMP protocol.
Change-Id: I79ee9413b87722bfe4782342737cff03cfc34495
Reviewed-on: https://code.wireshark.org/review/5179
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-msnip.c')
-rw-r--r-- | epan/dissectors/packet-msnip.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/epan/dissectors/packet-msnip.c b/epan/dissectors/packet-msnip.c index 3f4a92914c..dd85598f5c 100644 --- a/epan/dissectors/packet-msnip.c +++ b/epan/dissectors/packet-msnip.c @@ -40,7 +40,6 @@ #include <epan/packet.h> #include <epan/to_str.h> #include "packet-igmp.h" -#include "packet-msnip.h" void proto_register_msnip(void); @@ -60,6 +59,7 @@ static int hf_rec_type = -1; static int ett_msnip = -1; static int ett_groups = -1; +#define MC_ALL_IGMPV3_ROUTERS 0xe0000016 #define MSNIP_GM 0x23 #define MSNIP_IS 0x24 @@ -212,26 +212,23 @@ dissect_msnip_gm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int /* This function is only called from the IGMP dissector */ int -dissect_msnip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset) +dissect_msnip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_) { proto_tree *tree; proto_item *item; guint8 type; + int offset = 0; + guint32 dst = g_htonl(MC_ALL_IGMPV3_ROUTERS); - if (!proto_is_protocol_enabled(find_protocol_by_id(proto_msnip))) { - /* we are not enabled, skip entire packet to be nice - to the igmp layer. (so clicking on IGMP will display the data) - */ - return offset+tvb_length_remaining(tvb, offset); - } - - item = proto_tree_add_item(parent_tree, proto_msnip, tvb, offset, -1, ENC_NA); - tree = proto_item_add_subtree(item, ett_msnip); - + /* Shouldn't be destined for us */ + if (memcmp(pinfo->dst.data, &dst, 4)) + return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSNIP"); col_clear(pinfo->cinfo, COL_INFO); + item = proto_tree_add_item(parent_tree, proto_msnip, tvb, offset, -1, ENC_NA); + tree = proto_item_add_subtree(item, ett_msnip); type = tvb_get_guint8(tvb, offset); col_add_str(pinfo->cinfo, COL_INFO, @@ -322,6 +319,17 @@ proto_register_msnip(void) proto_register_subtree_array(ett, array_length(ett)); } +void +proto_reg_handoff_msnip(void) +{ + dissector_handle_t msnip_handle; + + msnip_handle = new_create_dissector_handle(dissect_msnip, proto_msnip); + dissector_add_uint("igmp.type", IGMP_TYPE_0x23, msnip_handle); + dissector_add_uint("igmp.type", IGMP_TYPE_0x24, msnip_handle); + dissector_add_uint("igmp.type", IGMP_TYPE_0x25, msnip_handle); +} + /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * |