diff options
author | Michael Mann <mmann78@netscape.net> | 2015-05-21 22:20:29 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-05-27 11:02:30 +0000 |
commit | 4963c772852134b75561290d152be2acbe0597d9 (patch) | |
tree | c6e6f2f683587e58aea96355cdadd2472215c4c4 /epan/dissectors/packet-zbee-nwk.c | |
parent | a25c46bc7b3d2ba2a3674cdcf9cfc1cc79bfc022 (diff) |
Convert proto_tree_add_boolean to proto_tree_add_bitmask_[value|value_with_flags|list]
Final part.
While there change deprecated tvb_length-xxx() calls
Change-Id: I8b0cf823c2d37a92c58fcb653f7fe1e8fdad5a79
Reviewed-on: https://code.wireshark.org/review/8642
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-zbee-nwk.c')
-rw-r--r-- | epan/dissectors/packet-zbee-nwk.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c index 05e17258ae..e37cdbbda2 100644 --- a/epan/dissectors/packet-zbee-nwk.c +++ b/epan/dissectors/packet-zbee-nwk.c @@ -1015,18 +1015,15 @@ dissect_zbee_nwk_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui static guint dissect_zbee_nwk_leave(tvbuff_t *tvb, proto_tree *tree, guint offset) { - guint8 leave_options; + static const int * leave_options[] = { + &hf_zbee_nwk_cmd_leave_rejoin, + &hf_zbee_nwk_cmd_leave_request, + &hf_zbee_nwk_cmd_leave_children, + NULL + }; /* Get and display the leave options. */ - leave_options = tvb_get_guint8(tvb, offset); - if (tree) { - proto_tree_add_boolean(tree, hf_zbee_nwk_cmd_leave_rejoin, tvb, offset, 1, - leave_options & ZBEE_NWK_CMD_LEAVE_OPTION_REJOIN); - proto_tree_add_boolean(tree, hf_zbee_nwk_cmd_leave_request, tvb, offset, 1, - leave_options & ZBEE_NWK_CMD_LEAVE_OPTION_REQUEST); - proto_tree_add_boolean(tree, hf_zbee_nwk_cmd_leave_children, tvb, offset, 1, - leave_options & ZBEE_NWK_CMD_LEAVE_OPTION_CHILDREN); - } + proto_tree_add_bitmask_list(tree, tvb, offset, 1, leave_options, ENC_NA); offset += 1; /* Done */ @@ -1176,17 +1173,17 @@ dissect_zbee_nwk_link_status(tvbuff_t *tvb, proto_tree *tree, guint offset) guint8 options; int i, link_count; proto_tree *subtree; + static const int * link_options[] = { + &hf_zbee_nwk_cmd_link_last, + &hf_zbee_nwk_cmd_link_first, + &hf_zbee_nwk_cmd_link_count, + NULL + }; /* Get and Display the link status options. */ options = tvb_get_guint8(tvb, offset); link_count = options & ZBEE_NWK_CMD_LINK_OPTION_COUNT_MASK; - if (tree) { - proto_tree_add_boolean(tree, hf_zbee_nwk_cmd_link_last, tvb, offset, 1, - options & ZBEE_NWK_CMD_LINK_OPTION_LAST_FRAME); - proto_tree_add_boolean(tree, hf_zbee_nwk_cmd_link_first, tvb, offset, 1, - options & ZBEE_NWK_CMD_LINK_OPTION_FIRST_FRAME); - proto_tree_add_uint(tree, hf_zbee_nwk_cmd_link_count, tvb, offset, 1, link_count); - } + proto_tree_add_bitmask_list(tree, tvb, offset, 1, link_options, ENC_NA); offset += 1; /* Get and Display the link status list. */ |