diff options
author | Michael Mann <mmann78@netscape.net> | 2014-12-01 00:18:41 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-12-01 12:18:44 +0000 |
commit | e77507b0eac903e74389ef1bf2dfa51d4cf00aad (patch) | |
tree | d9a99ae5315842fd1d3cc957c8adac50a779e5ed /epan/dissectors/packet-winsrepl.c | |
parent | 542439e64aef746512a5a8d3835e49805087c706 (diff) |
Use proto_tree_add_bitmask for groups of proto_tree_add_boolean.
Part 3 of many, but this concludes the strict conversion to proto_tree_add_bitmask. Patches to follow with use proto_tree_add_bitmask_xxx (some functions still need to be written)
Change-Id: Ic2435667c6a7f1d40602124e5044954d2a296180
Reviewed-on: https://code.wireshark.org/review/5553
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-winsrepl.c')
-rw-r--r-- | epan/dissectors/packet-winsrepl.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-winsrepl.c b/epan/dissectors/packet-winsrepl.c index 48328cb778..7737a521fe 100644 --- a/epan/dissectors/packet-winsrepl.c +++ b/epan/dissectors/packet-winsrepl.c @@ -379,8 +379,6 @@ dissect_winsrepl_wins_name(tvbuff_t *winsrepl_tvb, packet_info *pinfo, { proto_item *name_item = NULL, *ti; proto_tree *name_tree = NULL; - proto_item *flags_item; - proto_tree *flags_tree; int old_offset = winsrepl_offset; tvbuff_t *name_tvb = NULL; guint32 name_len; @@ -388,6 +386,14 @@ dissect_winsrepl_wins_name(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int name_type; guint32 flags; guint32 addr; + static const int * name_flags[] = { + &hf_winsrepl_name_flags_rectype, + &hf_winsrepl_name_flags_recstate, + &hf_winsrepl_name_flags_local, + &hf_winsrepl_name_flags_hosttype, + &hf_winsrepl_name_flags_static, + NULL + }; if (sub_tree) { name_tree = proto_tree_add_subtree_format(sub_tree, winsrepl_tvb, winsrepl_offset, -1, @@ -434,13 +440,7 @@ dissect_winsrepl_wins_name(tvbuff_t *winsrepl_tvb, packet_info *pinfo, * anything in the Samba code about them. */ flags = tvb_get_ntohl(winsrepl_tvb, winsrepl_offset); - flags_item = proto_tree_add_uint(name_tree, hf_winsrepl_name_flags, winsrepl_tvb, winsrepl_offset, 4, flags); - flags_tree = proto_item_add_subtree(flags_item, ett_winsrepl_flags); - proto_tree_add_uint(flags_tree, hf_winsrepl_name_flags_rectype, winsrepl_tvb, winsrepl_offset, 4, flags); - proto_tree_add_uint(flags_tree, hf_winsrepl_name_flags_recstate, winsrepl_tvb, winsrepl_offset, 4, flags); - proto_tree_add_boolean(flags_tree, hf_winsrepl_name_flags_local, winsrepl_tvb, winsrepl_offset, 4, flags); - proto_tree_add_uint(flags_tree, hf_winsrepl_name_flags_hosttype, winsrepl_tvb, winsrepl_offset, 4, flags); - proto_tree_add_boolean(flags_tree, hf_winsrepl_name_flags_static, winsrepl_tvb, winsrepl_offset, 4, flags); + proto_tree_add_bitmask(name_tree, winsrepl_tvb, winsrepl_offset, hf_winsrepl_name_flags, ett_winsrepl_flags, name_flags, ENC_BIG_ENDIAN); winsrepl_offset += 4; /* GROUP_FLAG */ |