diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-17 16:11:15 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-08-18 07:53:39 +0000 |
commit | 945b371a259ef8ed4fb94b13798162e688234f64 (patch) | |
tree | bdc7bc1620287a6b95452a5f7a0db9ed83d86f5f /epan/dissectors/packet-noe.c | |
parent | 83ad0d063c47aa3cc8da53a8f3c61cdd68027145 (diff) |
Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the neighborhood.
Change-Id: I77cac916d617f56f92f686e9cd9f15fba058facf
Reviewed-on: https://code.wireshark.org/review/3675
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-noe.c')
-rw-r--r-- | epan/dissectors/packet-noe.c | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/epan/dissectors/packet-noe.c b/epan/dissectors/packet-noe.c index ad695f20e5..90f42e0f3b 100644 --- a/epan/dissectors/packet-noe.c +++ b/epan/dissectors/packet-noe.c @@ -609,6 +609,8 @@ static int hf_noe_aindx = -1; static int hf_noe_errcode = -1; static int hf_noe_value = -1; static int hf_noe_message = -1; +static int hf_noe_key_name = -1; +static int hf_noe_bonded = -1; static int hf_noe_property_item_u8 = -1; static int hf_noe_property_item_u16 = -1; static int hf_noe_property_item_u24 = -1; @@ -1122,11 +1124,11 @@ static void decode_evt(proto_tree *tree, proto_item_append_text(tree, ", %s", key_name); - proto_tree_add_text(tree, + proto_tree_add_string_format_value(tree, hf_noe_key_name, tvb, offset, - length, - "Key Name: %s (UTF-8 Value: %s, Unicode Value: 0x%" G_GINT64_MODIFIER "x)", + length, key_name, + "%s (UTF-8 Value: %s, Unicode Value: 0x%" G_GINT64_MODIFIER "x)", key_name, tvb_bytes_to_ep_str(tvb, offset, length), unicode_value); @@ -1160,21 +1162,15 @@ static void decode_evt(proto_tree *tree, offset += 2; /*length -= 2;*/ - /* XXX - should a 16-bit value be gotten if the size is only 8-bit? */ - proto_tree_add_text(tree, - tvb, - offset, - 1, - "Bonded: %d", - tvb_get_ntohs(tvb, offset)); + proto_tree_add_item(tree, hf_noe_bonded, tvb, offset, 1, ENC_NA); offset += 1; /*length -= 1;*/ - proto_tree_add_text(tree, + proto_tree_add_uint_format_value(tree, hf_noe_value, tvb, offset, - 1, - "Value: %d", + 1, tvb_get_ntohs(tvb, offset), + "%d", tvb_get_ntohs(tvb, offset)); break; } @@ -1620,6 +1616,30 @@ void proto_register_noe(void) HFILL } }, + { &hf_noe_bonded, + { + "Bonded", + "noe.bonded", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_noe_key_name, + { + "Key name", + "noe.keyname", + FT_STRING, + BASE_NONE, + NULL, + 0x0, + NULL, + HFILL + } + }, }; static gint *ett[] = |