aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gvrp.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-03-19 20:33:14 -0400
committerMichael Mann <mmann78@netscape.net>2016-03-20 17:38:03 +0000
commit1e60d63c8c6882c8c0bdb00cf6df594e1bb6fccf (patch)
tree4147c4f2bee3b93c250a49fa8ec337072c80e713 /epan/dissectors/packet-gvrp.c
parent2b2fc64447e5f778d969e6c850e9196d248cbbe1 (diff)
Create call_data_dissector() to call data dissector.
This saves many dissectors the need to find the data dissector and store a handle to it. There were also some that were finding it, but not using it. For others this was the only reason for their handoff function, so it could be eliminated. Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b Reviewed-on: https://code.wireshark.org/review/14530 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-gvrp.c')
-rw-r--r--epan/dissectors/packet-gvrp.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/epan/dissectors/packet-gvrp.c b/epan/dissectors/packet-gvrp.c
index 75871d6f35..be8b75c181 100644
--- a/epan/dissectors/packet-gvrp.c
+++ b/epan/dissectors/packet-gvrp.c
@@ -27,7 +27,6 @@
#include <epan/expert.h>
void proto_register_gvrp(void);
-void proto_reg_handoff_gvrp(void);
/* Initialize the protocol and registered fields */
static int proto_gvrp = -1;
@@ -45,8 +44,6 @@ static gint ett_gvrp_attribute = -1;
static expert_field ei_gvrp_proto_id = EI_INIT;
-static dissector_handle_t data_handle;
-
/* Constant definitions */
#define GARP_DEFAULT_PROTOCOL_ID 0x0001
#define GARP_END_OF_MARK 0x00
@@ -124,8 +121,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
if (protocol_id != GARP_DEFAULT_PROTOCOL_ID)
{
expert_add_info(pinfo, id_item, &ei_gvrp_proto_id);
- call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, GARP_PROTOCOL_ID + 2),
+ call_data_dissector(tvb_new_subset_remaining(tvb, GARP_PROTOCOL_ID + 2),
pinfo, tree);
return tvb_captured_length(tvb);
}
@@ -155,8 +151,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
else
{
- call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, offset), pinfo, tree);
+ call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return tvb_captured_length(tvb);
}
}
@@ -173,7 +168,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* GVRP only supports one attribute type. */
if (octet != GVRP_ATTRIBUTE_TYPE)
{
- call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset),
+ call_data_dissector(tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
return tvb_captured_length(tvb);
}
@@ -206,8 +201,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
else
{
- call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, offset), pinfo, tree);
+ call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return tvb_captured_length(tvb);
}
}
@@ -238,8 +232,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
case GVRP_EVENT_LEAVEALL:
if (octet != GVRP_LENGTH_LEAVEALL)
{
- call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, offset), pinfo,
+ call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo,
tree);
return tvb_captured_length(tvb);
}
@@ -252,8 +245,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
case GVRP_EVENT_EMPTY:
if (octet != GVRP_LENGTH_NON_LEAVEALL)
{
- call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, offset),pinfo,
+ call_data_dissector(tvb_new_subset_remaining(tvb, offset),pinfo,
tree);
return tvb_captured_length(tvb);
}
@@ -267,8 +259,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
break;
default:
- call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, offset), pinfo, tree);
+ call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return tvb_captured_length(tvb);
}
}
@@ -347,10 +338,6 @@ proto_register_gvrp(void)
register_dissector("gvrp", dissect_gvrp, proto_gvrp);
}
-void
-proto_reg_handoff_gvrp(void){
- data_handle = find_dissector("data");
-}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html