diff options
author | Michael Mann <mmann78@netscape.net> | 2012-09-27 04:36:40 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2012-09-27 04:36:40 +0000 |
commit | 65ef9e9d6b691cd54540b94fb8393c02443fd9d4 (patch) | |
tree | cfeec151dcb3ccb5ee66094cd6ac3b1cadb82580 /epan/dissectors | |
parent | 0063cc00c803c80e80ff809da781987846478354 (diff) |
replaced decode_numeric_bitfield calls with filterable item or removed it if it didn't mathematically do anything.
svn path=/trunk/; revision=45166
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-atm.c | 25 | ||||
-rw-r--r-- | epan/dissectors/packet-bgp.c | 38 | ||||
-rw-r--r-- | epan/dissectors/packet-dns.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-dvbci.c | 28 |
4 files changed, 56 insertions, 45 deletions
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 31dfde1682..937b9d1387 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -49,6 +49,9 @@ static int proto_aal1 = -1; static int proto_aal3_4 = -1; static int proto_oamaal = -1; +static int hf_atm_lan_destination_route_desc = -1; +static int hf_atm_lan_destination_lan_id = -1; +static int hf_atm_lan_destination_bridge_num = -1; static int hf_atm_le_control_flag_v2_capable = -1; static int hf_atm_le_control_flag_selective_multicast = -1; static int hf_atm_le_control_flag_v2_required = -1; @@ -213,7 +216,6 @@ dissect_lan_destination(tvbuff_t *tvb, int offset, const char *type, proto_tree proto_tree *dest_tree; guint16 tag; proto_tree *rd_tree; - guint16 route_descriptor; td = proto_tree_add_text(tree, tvb, offset, 8, "%s LAN destination", type); @@ -233,16 +235,10 @@ dissect_lan_destination(tvbuff_t *tvb, int offset, const char *type, proto_tree case TAG_ROUTE_DESCRIPTOR: offset += 4; - route_descriptor = tvb_get_ntohs(tvb, offset); - proto_tree_add_text(dest_tree, tvb, offset, 2, "Route descriptor: 0x%02X", - route_descriptor); + proto_tree_add_item(dest_tree, hf_atm_lan_destination_route_desc, tvb, offset, 2, ENC_LITTLE_ENDIAN); rd_tree = proto_item_add_subtree(td, ett_atm_lane_lc_lan_dest_rd); - proto_tree_add_text(rd_tree, tvb, offset, 2, "%s", - decode_numeric_bitfield(route_descriptor, 0xFFF0, 2*8, - "LAN ID = %u")); - proto_tree_add_text(rd_tree, tvb, offset, 2, "%s", - decode_numeric_bitfield(route_descriptor, 0x000F, 2*8, - "Bridge number = %u")); + proto_tree_add_item(rd_tree, hf_atm_lan_destination_lan_id, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(rd_tree, hf_atm_lan_destination_bridge_num, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; } } @@ -1941,6 +1937,15 @@ proto_register_atm(void) { "CID", "atm.cid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_atm_lan_destination_route_desc, + { "Route descriptor", "atm.lan_destination.route_desc", FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + { &hf_atm_lan_destination_lan_id, + { "LAN ID", "atm.lan_destination.lan_id", FT_UINT16, BASE_DEC, NULL, 0xFFF0, + NULL, HFILL }}, + { &hf_atm_lan_destination_bridge_num, + { "Bridge number", "atm.lan_destination.bridge_num", FT_UINT16, BASE_DEC, NULL, 0x000F, + NULL, HFILL }}, { &hf_atm_le_control_flag_v2_capable, { "V2 capable", "atm.le_control.flag.v2_capable", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0002, NULL, HFILL }}, diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index a90b435529..89b4007fa8 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -710,6 +710,11 @@ static int hf_bgp_ext_com_cos_flags_be = -1; static int hf_bgp_ext_com_cos_flags_ef = -1; static int hf_bgp_ext_com_cos_flags_af = -1; static int hf_bgp_ext_com_cos_flags_le = -1; +static int hf_bgp_ext_com_qos_set_number = -1; +static int hf_bgp_ext_com_qos_tech_type = -1; +static int hf_bgp_ext_com_qos_marking_o = -1; +static int hf_bgp_ext_com_qos_marking_a = -1; +static int hf_bgp_ext_com_qos_default_to_zero = -1; static gint ett_bgp = -1; static gint ett_bgp_prefix = -1; @@ -3192,19 +3197,11 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree) proto_tree_add_item(subtree5, hf_bgp_ext_com_qos_flags_ignore_remarking, tvb, q+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree5, hf_bgp_ext_com_qos_flags_agg_marking, tvb, q+1, 1, ENC_BIG_ENDIAN); - proto_tree_add_text(subtree4, tvb, q+2, 1, - "QoS Set Number: 0x%02x", tvb_get_guint8(tvb,q+2)); - proto_tree_add_text(subtree4, tvb, q+3, 1, - "Technology Type: 0x%02x (%s)", tvb_get_guint8(tvb,q+3), - val_to_str_const(tvb_get_guint8(tvb,q+3),qos_tech_type,"Unknown")); - proto_tree_add_text(subtree4, tvb, q+4, 2, - "QoS Marking O (16 bit): %s", decode_numeric_bitfield(tvb_get_ntohs(tvb,q+4), - 0xffff, 16, "0x%04x")); - proto_tree_add_text(subtree4, tvb, q+6, 1, - "QoS Marking A (8 bit): %s (decimal %d)", decode_numeric_bitfield(tvb_get_guint8(tvb,q+6), - 0xff, 8, "0x%02x"), tvb_get_guint8(tvb,q+6)); - proto_tree_add_text(subtree4, tvb, q+7, 1, - "Defaults to zero: 0x%02x", tvb_get_guint8(tvb,q+7)); + proto_tree_add_item(subtree4, hf_bgp_ext_com_qos_set_number, tvb, q+2, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree4, hf_bgp_ext_com_qos_tech_type, tvb, q+3, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree4, hf_bgp_ext_com_qos_marking_o, tvb, q+4, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree4, hf_bgp_ext_com_qos_marking_a, tvb, q+6, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree4, hf_bgp_ext_com_qos_default_to_zero, tvb, q+7, 1, ENC_BIG_ENDIAN); break; case BGP_EXT_COM_COS_CAP_T: is_regular_type = TRUE; @@ -4331,6 +4328,21 @@ proto_register_bgp(void) { &hf_bgp_ext_com_cos_flags_le, { "LE class", "bgp.ext_com_cos.flags.le", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10, NULL, HFILL}}, + { &hf_bgp_ext_com_qos_set_number, + { "QoS Set Number", "bgp.ext_com_qos.set_number", FT_UINT8, BASE_HEX, + NULL, 0, NULL, HFILL}}, + { &hf_bgp_ext_com_qos_tech_type, + { "Technology Type", "bgp.ext_com_qos.tech_type", FT_UINT8, BASE_HEX, + VALS(qos_tech_type), 0, NULL, HFILL}}, + { &hf_bgp_ext_com_qos_marking_o, + { "QoS Marking O", "bgp.ext_com_qos.marking_o", FT_UINT16, BASE_HEX, + NULL, 0, NULL, HFILL}}, + { &hf_bgp_ext_com_qos_marking_a, + { "QoS Marking A", "bgp.ext_com_qos.marking_a", FT_UINT8, BASE_HEX_DEC, + NULL, 0, NULL, HFILL}}, + { &hf_bgp_ext_com_qos_default_to_zero, + { "Defaults to zero", "bgp.ext_com_qos.default_to_zero", FT_UINT8, BASE_HEX, + NULL, 0, NULL, HFILL}}, }; static gint *ett[] = { diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index a508dc3744..3c1d0dc134 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -95,6 +95,7 @@ static int hf_dns_rr_ttl = -1; static int hf_dns_rr_len = -1; static int hf_dns_rr_addr = -1; static int hf_dns_rr_primaryname = -1; +static int hf_dns_rr_udp_payload_size = -1; static int hf_dns_soa_mname = -1; static int hf_dns_soa_rname = -1; static int hf_dns_soa_serial_number = -1; @@ -1214,9 +1215,7 @@ add_opt_rr_to_tree(proto_item *trr, int rr_type, tvbuff_t *tvb, int offset, "Type: %s", dns_type_description(type)); offset += 2; if (is_mdns) { - proto_tree_add_text(rr_tree, tvb, offset, 2, "%s", - decode_numeric_bitfield(dns_class, 0x7fff, 16, - "UDP payload size: %u")); + proto_tree_add_uint(rr_tree, hf_dns_rr_udp_payload_size, tvb, offset, 2, dns_class); proto_tree_add_boolean(rr_tree, hf_dns_rr_cache_flush, tvb, offset, 2, flush); } else { @@ -4039,6 +4038,11 @@ proto_register_dns(void) FT_STRING, BASE_NONE, NULL, 0x0, "Response Primary Name", HFILL }}, + { &hf_dns_rr_udp_payload_size, + { "UDP payload size", "dns.resp.udp_payload_size", + FT_UINT16, BASE_HEX, NULL, 0x7FFF, + NULL, HFILL }}, + { &hf_dns_soa_mname, { "Primary name server", "dns.soa.mname", FT_STRING, BASE_NONE, NULL, 0x0, diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c index b91ec34ecc..b7f4123ae1 100644 --- a/epan/dissectors/packet-dvbci.c +++ b/epan/dissectors/packet-dvbci.c @@ -2249,24 +2249,14 @@ dissect_res_id(tvbuff_t *tvb, gint offset, packet_info *pinfo, /* parameter "value" == complete resource id, RES_..._MASK will be applied by the hf definition */ - proto_tree_add_uint_format(res_tree, hf_dvbci_res_id_type, - tvb, offset, tvb_data_len, res_id, "%s", - decode_numeric_bitfield(res_id, RES_ID_TYPE_MASK, 32, - "Resource ID Type: 0x%x")); - proto_tree_add_uint_format(res_tree, hf_dvbci_res_class, - tvb, offset, tvb_data_len, res_id, "%s (%s)", - decode_numeric_bitfield(res_id, RES_CLASS_MASK, 32, - "Resource Class: 0x%x"), - val_to_str_const(RES_CLASS(res_id), dvbci_res_class, - "Invalid Resource class")); - proto_tree_add_uint_format(res_tree, hf_dvbci_res_type, - tvb, offset, tvb_data_len, res_id, "%s", - decode_numeric_bitfield(res_id, RES_TYPE_MASK, 32, - "Resource Type: 0x%x")); - proto_tree_add_uint_format(res_tree, hf_dvbci_res_ver, - tvb, offset, tvb_data_len, res_id, "%s", - decode_numeric_bitfield(res_id, RES_VER_MASK, 32, - "Resource Version: 0x%x")); + proto_tree_add_uint(res_tree, hf_dvbci_res_id_type, + tvb, offset, tvb_data_len, res_id); + proto_tree_add_uint(res_tree, hf_dvbci_res_class, + tvb, offset, tvb_data_len, res_id); + proto_tree_add_uint(res_tree, hf_dvbci_res_type, + tvb, offset, tvb_data_len, res_id); + proto_tree_add_uint(res_tree, hf_dvbci_res_ver, + tvb, offset, tvb_data_len, res_id); } return ti; @@ -4655,7 +4645,7 @@ proto_register_dvbci(void) }, { &hf_dvbci_res_class, { "Resource Class", "dvb-ci.res.class", - FT_UINT32, BASE_HEX, NULL, RES_CLASS_MASK, NULL, HFILL } + FT_UINT32, BASE_HEX, VALS(dvbci_res_class), RES_CLASS_MASK, NULL, HFILL } }, { &hf_dvbci_res_type, { "Resource Type", "dvb-ci.res.type", |