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-igap.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-igap.c')
-rw-r--r-- | epan/dissectors/packet-igap.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/epan/dissectors/packet-igap.c b/epan/dissectors/packet-igap.c index 85b9e4bf80..779612f3b4 100644 --- a/epan/dissectors/packet-igap.c +++ b/epan/dissectors/packet-igap.c @@ -46,7 +46,6 @@ #include <epan/packet.h> #include <epan/to_str.h> #include "packet-igmp.h" -#include "packet-igap.h" void proto_register_igap(void); @@ -134,20 +133,14 @@ static const value_string igap_account_status[] = { /* This function is only called from the IGMP dissector */ int -dissect_igap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset) +dissect_igap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_) { proto_tree *tree; proto_item *item; guint8 type, tsecs, subtype, asize, msize; + int offset = 0; guchar account[ACCOUNT_SIZE+1], message[MESSAGE_SIZE+1]; - if (!proto_is_protocol_enabled(find_protocol_by_id(proto_igap))) { - /* 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_igap, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_igap); @@ -342,13 +335,22 @@ proto_register_igap(void) &ett_igap }; - proto_igap = proto_register_protocol - ("Internet Group membership Authentication Protocol", - "IGAP", "igap"); + proto_igap = proto_register_protocol("Internet Group membership Authentication Protocol", "IGAP", "igap"); proto_register_field_array(proto_igap, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } +void +proto_reg_handoff_igap(void) +{ + dissector_handle_t igap_handle; + + igap_handle = new_create_dissector_handle(dissect_igap, proto_igap); + dissector_add_uint("igmp.type", IGMP_IGAP_JOIN, igap_handle); + dissector_add_uint("igmp.type", IGMP_IGAP_QUERY, igap_handle); + dissector_add_uint("igmp.type", IGMP_IGAP_LEAVE, igap_handle); +} + /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * |