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-radius_packetcable.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-radius_packetcable.c')
-rw-r--r-- | epan/dissectors/packet-radius_packetcable.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/epan/dissectors/packet-radius_packetcable.c b/epan/dissectors/packet-radius_packetcable.c index 8b4e74983d..71defe4433 100644 --- a/epan/dissectors/packet-radius_packetcable.c +++ b/epan/dissectors/packet-radius_packetcable.c @@ -389,7 +389,7 @@ static const gchar* dissect_packetcable_redirected_from_info(proto_tree* tree, t static const gchar* dissect_packetcable_time_electr_surv_ind(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo _U_) { - if (tvb_length(tvb) == 0) + if (tvb_reported_length(tvb) == 0) return "None"; proto_tree_add_item(tree, hf_packetcable_electronic_surveillance_indication_df_cdc_address, @@ -418,18 +418,18 @@ static const gchar* dissect_packetcable_term_dsply_info(proto_tree* tree, tvbuff /* XXX - this logic seems buggy because the offsets don't line up */ guint8 bitmask = tvb_get_guint8(tvb, 2); guint intval = 1; - proto_item* ti = proto_tree_add_item(tree, hf_packetcable_terminal_display_info_terminal_display_status_bitmask, - tvb, 0, 1, ENC_BIG_ENDIAN); - proto_tree* obj_tree = proto_item_add_subtree(ti, ett_packetcable_term_dsply); + static const int * flags[] = { + &hf_packetcable_terminal_display_info_sbm_general_display, + &hf_packetcable_terminal_display_info_sbm_calling_number, + &hf_packetcable_terminal_display_info_sbm_calling_name, + &hf_packetcable_terminal_display_info_sbm_message_waiting, + NULL + }; - proto_tree_add_boolean(obj_tree, hf_packetcable_terminal_display_info_sbm_general_display, - tvb, 0, 1, bitmask); - proto_tree_add_boolean(obj_tree, hf_packetcable_terminal_display_info_sbm_calling_number, - tvb, 0, 1, bitmask); - proto_tree_add_boolean(obj_tree, hf_packetcable_terminal_display_info_sbm_calling_name, - tvb, 0, 1, bitmask); - proto_tree_add_boolean(obj_tree, hf_packetcable_terminal_display_info_sbm_message_waiting, - tvb, 0, 1, bitmask); + proto_item* ti = proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_packetcable_terminal_display_info_terminal_display_status_bitmask, + ett_packetcable_term_dsply, flags, ENC_NA, BMT_NO_APPEND|BMT_NO_FALSE); + + proto_tree* obj_tree = proto_item_add_subtree(ti, ett_packetcable_term_dsply); if (bitmask & PACKETCABLE_GENERAL_DISPLAY) { proto_tree_add_item(obj_tree, hf_packetcable_terminal_display_info_general_display, |