aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2018-04-11 09:48:02 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2018-04-11 07:49:51 +0000
commitb79d2bc9a32a6c23426cb2da824b766ad69bbee8 (patch)
tree6b9dbfda33c6100620bdc7b8d153d9b24e102849
parent89904b61332e01f69cb9951238eed4ba57e95399 (diff)
user_encap: Avoid a hash lookup to get dissector name
The dissector handle is already known so it's no need to fetch this again using find_dissector(). Change-Id: Id48066ab881f2b80ec9e3a6e86bc1e41f32cd1ec Reviewed-on: https://code.wireshark.org/review/26873 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r--epan/dissectors/packet-user_encap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c
index 21f65ac..3fd4bea 100644
--- a/epan/dissectors/packet-user_encap.c
+++ b/epan/dissectors/packet-user_encap.c
@@ -148,7 +148,7 @@ static int dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, voi
export_pdu(hdr_tvb, pinfo, encap->header_proto_name);
call_dissector(encap->header_proto, hdr_tvb, pinfo, tree);
if (encap->header_proto_name) {
- const char *proto_name = dissector_handle_get_long_name(find_dissector(encap->header_proto_name));
+ const char *proto_name = dissector_handle_get_long_name(encap->header_proto);
if (proto_name) {
proto_item_append_text(item, ", Header: %s (%s)", encap->header_proto_name, proto_name);
}
@@ -162,7 +162,7 @@ static int dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, voi
export_pdu(payload_tvb, pinfo, encap->payload_proto_name);
call_dissector(encap->payload_proto, payload_tvb, pinfo, tree);
if (encap->payload_proto_name) {
- const char *proto_name = dissector_handle_get_long_name(find_dissector(encap->payload_proto_name));
+ const char *proto_name = dissector_handle_get_long_name(encap->payload_proto);
if (proto_name) {
proto_item_append_text(item, ", Payload: %s (%s)", encap->payload_proto_name, proto_name);
}
@@ -173,7 +173,7 @@ static int dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, voi
export_pdu(trailer_tvb, pinfo, encap->trailer_proto_name);
call_dissector(encap->trailer_proto, trailer_tvb, pinfo, tree);
if (encap->trailer_proto_name) {
- const char *proto_name = dissector_handle_get_long_name(find_dissector(encap->trailer_proto_name));
+ const char *proto_name = dissector_handle_get_long_name(encap->trailer_proto);
if (proto_name) {
proto_item_append_text(item, ", Trailer: %s (%s)", encap->trailer_proto_name, proto_name);
}
@@ -212,8 +212,8 @@ static void user_free_cb(void* record)
UAT_VS_DEF(user_encap, encap, user_encap_t, guint, WTAP_ENCAP_USER0, ENCAP0_STR)
UAT_PROTO_DEF(user_encap, payload_proto, payload_proto, payload_proto_name, user_encap_t)
UAT_DEC_CB_DEF(user_encap, header_size, user_encap_t)
-UAT_DEC_CB_DEF(user_encap, trailer_size, user_encap_t)
UAT_PROTO_DEF(user_encap, header_proto, header_proto, header_proto_name, user_encap_t)
+UAT_DEC_CB_DEF(user_encap, trailer_size, user_encap_t)
UAT_PROTO_DEF(user_encap, trailer_proto, trailer_proto, trailer_proto_name, user_encap_t)
void proto_reg_handoff_user_encap(void)