diff options
author | Lorand Jakab <ljakab@ac.upc.edu> | 2018-11-16 13:03:55 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2018-11-16 14:18:02 +0000 |
commit | f8100ba30a581836e86c11e5fbf50d5f4d0cca83 (patch) | |
tree | c95c40332781cf571319d3eba731291d8515f395 /epan/dissectors/packet-lisp-tcp.c | |
parent | e2e069e3fa604ca6633199cfd29df4b9f23044e4 (diff) |
LISP: Switch to proto_tree_add_subtree_format()
When the LISP dissector was initially written, it followed a different
pattern for adding subtrees with a text label, which needs to be
modified while dissecting: proto_tree_add_item() +
proto_item_append_text() + proto_item_add_subtree().
This commit updates the code to use the more elegant
proto_tree_add_subtree_format() call.
Change-Id: Icb6424be3c9cdecbfe9bb5aa2d39f3ad3d1499e0
Signed-off-by: Lorand Jakab <ljakab@ac.upc.edu>
Reviewed-on: https://code.wireshark.org/review/30655
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-lisp-tcp.c')
-rw-r--r-- | epan/dissectors/packet-lisp-tcp.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/epan/dissectors/packet-lisp-tcp.c b/epan/dissectors/packet-lisp-tcp.c index c7f8d28049..4e6a1c265f 100644 --- a/epan/dissectors/packet-lisp-tcp.c +++ b/epan/dissectors/packet-lisp-tcp.c @@ -68,7 +68,6 @@ static int hf_lisp_tcp_message_eid_prefix_afi = -1; static int hf_lisp_tcp_message_eid_ipv4 = -1; static int hf_lisp_tcp_message_eid_ipv6 = -1; static int hf_lisp_tcp_message_eid_mac = -1; -static int hf_lisp_tcp_message_eid_lcaf = -1; static int hf_lisp_tcp_message_rloc_afi = -1; static int hf_lisp_tcp_message_rloc_ipv4 = -1; static int hf_lisp_tcp_message_rloc_ipv6 = -1; @@ -141,7 +140,6 @@ static guint dissect_lisp_tcp_message_eid_prefix(tvbuff_t *tvb, packet_info *pinfo, proto_tree *message_tree, guint offset, proto_item *tim) { - proto_item *ti_lcaf_prefix; proto_tree *prefix_tree, *lcaf_tree; guint8 prefix_length; guint16 prefix_afi, addr_len = 0; @@ -181,9 +179,7 @@ dissect_lisp_tcp_message_eid_prefix(tvbuff_t *tvb, packet_info *pinfo, proto_tre offset += INET6_ADDRLEN; break; case AFNUM_LCAF: - ti_lcaf_prefix = proto_tree_add_item(prefix_tree, hf_lisp_tcp_message_eid_lcaf, tvb, offset, addr_len, ENC_ASCII|ENC_NA); - proto_item_append_text(ti_lcaf_prefix, "%s", prefix); - lcaf_tree = proto_item_add_subtree(ti_lcaf_prefix, ett_lisp_tcp_lcaf); + lcaf_tree = proto_tree_add_subtree_format(prefix_tree, tvb, offset, addr_len, ett_lisp_tcp_lcaf, NULL, "Address: %s", prefix); dissect_lcaf(tvb, pinfo, lcaf_tree, offset, NULL); offset += addr_len; break; @@ -642,9 +638,6 @@ proto_register_lisp_tcp(void) { &hf_lisp_tcp_message_eid_mac, { "Address", "lisp-tcp.message.eid.mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_lisp_tcp_message_eid_lcaf, - { "Address", "lisp-tcp.message.eid.lcaf", - FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_lisp_tcp_message_rloc_afi, { "RLOC AFI", "lisp-tcp.message.rloc.afi", FT_UINT16, BASE_DEC, VALS(afn_vals), 0x0, NULL, HFILL }}, |