From e77507b0eac903e74389ef1bf2dfa51d4cf00aad Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Mon, 1 Dec 2014 00:18:41 -0500 Subject: 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 Petri-Dish: Michael Mann Reviewed-by: Anders Broman --- epan/dissectors/packet-winsrepl.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'epan/dissectors/packet-winsrepl.c') 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 */ -- cgit v1.2.3