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-zebra.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-zebra.c')
-rw-r--r-- | epan/dissectors/packet-zebra.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/epan/dissectors/packet-zebra.c b/epan/dissectors/packet-zebra.c index 0cb7c6e493..9af6819f85 100644 --- a/epan/dissectors/packet-zebra.c +++ b/epan/dissectors/packet-zebra.c @@ -256,23 +256,17 @@ zebra_route_ifindex(proto_tree *tree, tvbuff_t *tvb, int offset, guint16 len) } static guint8 -zebra_route_message(proto_tree *tree, tvbuff_t *tvb, int offset, guint8 message) +zebra_route_message(proto_tree *tree, tvbuff_t *tvb, int offset) { - proto_item *ti; - proto_tree *msg_tree; - - ti = proto_tree_add_uint(tree, hf_zebra_message, tvb, - offset, 1, message); - msg_tree = proto_item_add_subtree(ti, ett_message); - - proto_tree_add_boolean(msg_tree, hf_zebra_msg_nexthop, - tvb, offset, 1, message); - proto_tree_add_boolean(msg_tree, hf_zebra_msg_index, - tvb, offset, 1, message); - proto_tree_add_boolean(msg_tree, hf_zebra_msg_distance, - tvb, offset, 1, message); - proto_tree_add_boolean(msg_tree, hf_zebra_msg_metric, - tvb, offset, 1, message); + static const int * flags[] = { + &hf_zebra_msg_nexthop, + &hf_zebra_msg_index, + &hf_zebra_msg_distance, + &hf_zebra_msg_metric, + NULL + }; + + proto_tree_add_bitmask(tree, tvb, offset, hf_zebra_message, ett_message, flags, ENC_NA); offset += 1; return offset; @@ -294,7 +288,7 @@ zebra_route(proto_tree *tree, tvbuff_t *tvb, int offset, guint16 len, offset += 1; message = tvb_get_guint8(tvb, offset); - offset = zebra_route_message(tree, tvb, offset, message); + offset = zebra_route_message(tree, tvb, offset); prefixlen = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_zebra_prefixlen, tvb, |