diff options
author | Michael Mann <mmann78@netscape.net> | 2017-05-16 14:48:34 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-05-17 15:16:42 +0000 |
commit | 99b76a5bc3db9579351c0fc7251086660f4f003f (patch) | |
tree | 362629bf932645e3742cf8dd32d1355b97604dac /epan/dissectors/packet-srvloc.c | |
parent | 3b7790004a3e8df79fc313143b582a552081ed29 (diff) |
Use proto_tree_add_item instead of proto_tree_add_xxx.
It's a little more efficient to use proto_tree_add_item, than
proto_tree_add_xxx, passing it the returned tvb_get_xxx value.
Change-Id: I22ddd7ab36e1ee5aae78fc693d7dbac4b4f802f2
Reviewed-on: https://code.wireshark.org/review/21691
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-srvloc.c')
-rw-r--r-- | epan/dissectors/packet-srvloc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/epan/dissectors/packet-srvloc.c b/epan/dissectors/packet-srvloc.c index db22a2c64e..963fe976e2 100644 --- a/epan/dissectors/packet-srvloc.c +++ b/epan/dissectors/packet-srvloc.c @@ -1046,15 +1046,12 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ NULL }; - length = tvb_get_ntoh24(tvb, offset + 2); - proto_tree_add_uint(srvloc_tree, hf_srvloc_pktlen, tvb, offset + 2, 3, length); + proto_tree_add_item_ret_uint(srvloc_tree, hf_srvloc_pktlen, tvb, offset + 2, 3, ENC_BIG_ENDIAN, &length); proto_tree_add_bitmask(srvloc_tree, tvb, offset + 5, hf_srvloc_flags_v2, ett_srvloc_flags, v2_flags, ENC_BIG_ENDIAN); - next_ext_off = tvb_get_ntoh24(tvb, offset + 7); - proto_tree_add_uint(srvloc_tree, hf_srvloc_nextextoff, tvb, offset + 7, 3, - next_ext_off); - proto_tree_add_uint(srvloc_tree, hf_srvloc_xid, tvb, offset + 10, 2, - tvb_get_ntohs(tvb, offset + 10)); + proto_tree_add_item_ret_uint(srvloc_tree, hf_srvloc_nextextoff, tvb, offset + 7, 3, + ENC_BIG_ENDIAN, &next_ext_off); + proto_tree_add_item(srvloc_tree, hf_srvloc_xid, tvb, offset + 10, 2, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, ", V2 XID - %u", tvb_get_ntohs(tvb, offset + 10)); lang_tag_len = tvb_get_ntohs(tvb, offset + 12); proto_tree_add_uint(srvloc_tree, hf_srvloc_langtaglen, tvb, offset + 12, 2, lang_tag_len); |