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-sna.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-sna.c')
-rw-r--r-- | epan/dissectors/packet-sna.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c index df5cd1de72..8131683c4d 100644 --- a/epan/dissectors/packet-sna.c +++ b/epan/dissectors/packet-sna.c @@ -2369,33 +2369,25 @@ dissect_gds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *parent_tree) { guint16 length; - guint16 type; int cont; int offset = 0; - proto_tree *gds_tree; - proto_item *gds_item; + static const int * flags[] = { + &hf_sna_gds_len, + &hf_sna_gds_cont, + &hf_sna_gds_type, + NULL + }; do { length = tvb_get_ntohs(tvb, offset) & 0x7fff; cont = (tvb_get_ntohs(tvb, offset) & 0x8000) ? 1 : 0; - type = tvb_get_ntohs(tvb, offset+2); if (length < 2 ) /* escape sequence ? */ return; - if (tree) { - gds_item = proto_tree_add_item(tree, hf_sna_gds, tvb, - offset, length, ENC_NA); - gds_tree = proto_item_add_subtree(gds_item, - ett_sna_gds); - - proto_tree_add_uint(gds_tree, hf_sna_gds_len, tvb, - offset, 2, length); - proto_tree_add_boolean(gds_tree, hf_sna_gds_cont, tvb, - offset, 2, cont); - proto_tree_add_uint(gds_tree, hf_sna_gds_type, tvb, - offset+2, 2, type); - } + + proto_tree_add_bitmask(tree, tvb, offset, hf_sna_gds, ett_sna_gds, flags, ENC_BIG_ENDIAN); offset += length; + } while(cont); if (tvb_offset_exists(tvb, offset)) call_dissector(data_handle, |