diff options
author | Michael Mann <mmann78@netscape.net> | 2015-04-22 07:57:37 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-04-22 23:24:45 +0000 |
commit | 8d6324f759639c7d3c0cab839ca1d3c42c93f895 (patch) | |
tree | e2a36618d1c6892347c03bf479fc3eb15f5d9571 /epan/dissectors/packet-h261.c | |
parent | 825aa502e7a1730141a3bfbf463f23167fb0b975 (diff) |
Convert proto_tree_add_boolean to proto_tree_add_bitmask_[value|value_with_flags|list]
Part 2 of a few
Change-Id: Ic1f1aafe2ed02dce95b15c03a91cbd68807a5cf4
Reviewed-on: https://code.wireshark.org/review/8165
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-h261.c')
-rw-r--r-- | epan/dissectors/packet-h261.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/epan/dissectors/packet-h261.c b/epan/dissectors/packet-h261.c index 45717059dc..a754de75d0 100644 --- a/epan/dissectors/packet-h261.c +++ b/epan/dissectors/packet-h261.c @@ -62,6 +62,17 @@ dissect_h261( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) proto_item *ti = NULL; proto_tree *h261_tree = NULL; unsigned int offset = 0; + static const int * bits[] = { + /* SBIT 1st octet, 3 bits */ + &hf_h261_sbit, + /* EBIT 1st octet, 3 bits */ + &hf_h261_ebit, + /* I flag, 1 bit */ + &hf_h261_ibit, + /* V flag, 1 bit */ + &hf_h261_vbit, + NULL + }; col_set_str(pinfo->cinfo, COL_PROTOCOL, "H.261"); @@ -70,14 +81,8 @@ dissect_h261( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) if ( tree ) { ti = proto_tree_add_item( tree, proto_h261, tvb, offset, -1, ENC_NA ); h261_tree = proto_item_add_subtree( ti, ett_h261 ); - /* SBIT 1st octet, 3 bits */ - proto_tree_add_uint( h261_tree, hf_h261_sbit, tvb, offset, 1, tvb_get_guint8( tvb, offset ) >> 5 ); - /* EBIT 1st octet, 3 bits */ - proto_tree_add_uint( h261_tree, hf_h261_ebit, tvb, offset, 1, ( tvb_get_guint8( tvb, offset ) >> 2 ) & 7 ); - /* I flag, 1 bit */ - proto_tree_add_boolean( h261_tree, hf_h261_ibit, tvb, offset, 1, tvb_get_guint8( tvb, offset ) & 2 ); - /* V flag, 1 bit */ - proto_tree_add_boolean( h261_tree, hf_h261_vbit, tvb, offset, 1, tvb_get_guint8( tvb, offset ) & 1 ); + + proto_tree_add_bitmask_list(h261_tree, tvb, offset, 1, bits, ENC_NA); offset++; /* GOBN 2nd octet, 4 bits */ |