Manually revert r41953

BACKPORT to 1.8

svn path=/trunk/; revision=43221
This commit is contained in:
Jörg Mayer 2012-06-12 10:38:22 +00:00
parent 4f47eefa79
commit 9228ece476
3 changed files with 10 additions and 16 deletions

View File

@ -1916,15 +1916,6 @@ add_ip_version_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset)
return proto_tree_add_item(tree, hf_ip_version, tvb, offset, 1, ENC_BIG_ENDIAN);
}
/*
* Note boffset is offset in BITS to ba able to use the function in both IPv4 and IPv6
*/
proto_item *
add_ip_dscp_to_tree(proto_tree *tree, tvbuff_t *tvb, int boffset)
{
return proto_tree_add_bits_item(tree, hf_ip_dsfield_dscp, tvb, boffset, 6, ENC_BIG_ENDIAN);
}
static void
dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
@ -2013,8 +2004,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
ecn_vals, "Unknown ECN"));
field_tree = proto_item_add_subtree(tf, ett_ip_dsfield);
/* Add DSCP using bit offset to be able to use the same hf field in IPv6 */
add_ip_dscp_to_tree(field_tree, tvb, (offset+1)<<3);
proto_tree_add_item(field_tree, hf_ip_dsfield_dscp, tvb, offset + 1, 1, ENC_NA);
proto_tree_add_item(field_tree, hf_ip_dsfield_ecn, tvb, offset + 1, 1, ENC_NA);
} else {
tf = proto_tree_add_uint_format(ip_tree, hf_ip_tos, tvb, offset + 1, 1,
@ -2443,7 +2433,7 @@ proto_register_ip(void)
{ &hf_ip_dsfield_dscp,
{ "Differentiated Services Codepoint", "ip.dsfield.dscp", FT_UINT8, BASE_HEX | BASE_EXT_STRING,
&dscp_vals_ext, 0, NULL, HFILL }},
&dscp_vals_ext, IPDSFIELD_DSCP_MASK, NULL, HFILL }},
{ &hf_ip_dsfield_ecn,
{ "Explicit Congestion Notification", "ip.dsfield.ecn", FT_UINT8, BASE_HEX,

View File

@ -45,8 +45,8 @@ guint16 ip_checksum(const guint8 *ptr, int len);
/* Export the DSCP extended value-string table for other protocols */
WS_VAR_IMPORT value_string_ext dscp_vals_ext;
WS_VAR_IMPORT const value_string dscp_vals[];
proto_item *add_ip_version_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset);
proto_item *add_ip_dscp_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset);
#endif

View File

@ -223,6 +223,7 @@ static int hf_ipv6_shim6_loc_weight = -1;
static int hf_ipv6_shim6_opt_locnum = -1;
static int hf_ipv6_shim6_opt_elemlen = -1;
static int hf_ipv6_shim6_opt_fii = -1;
static int hf_ipv6_traffic_class_dscp = -1;
static int hf_ipv6_traffic_class_ect = -1;
static int hf_ipv6_traffic_class_ce = -1;
@ -1707,9 +1708,8 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ipv6_tc_tree = proto_item_add_subtree(ipv6_tc, ett_ipv6_traffic_class);
/* Add DSCP using bit offset to be able to use the same hf field in IPv6 */
add_ip_dscp_to_tree(ipv6_tc_tree, tvb, ((offset + offsetof(struct ip6_hdr, ip6_flow))<<3)+4);
proto_tree_add_item(ipv6_tc_tree, hf_ipv6_traffic_class_dscp, tvb,
offset + offsetof(struct ip6_hdr, ip6_flow), 4, ENC_BIG_ENDIAN);
proto_tree_add_item(ipv6_tc_tree, hf_ipv6_traffic_class_ect, tvb,
offset + offsetof(struct ip6_hdr, ip6_flow), 4, ENC_BIG_ENDIAN);
@ -2735,6 +2735,10 @@ proto_register_ipv6(void)
FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
NULL, HFILL }},
{ &hf_ipv6_traffic_class_dscp,
{ "Differentiated Services Field", "ipv6.traffic_class.dscp",
FT_UINT32, BASE_HEX, VALS(dscp_vals), 0x0FC00000, NULL, HFILL }},
{ &hf_ipv6_traffic_class_ect,
{ "ECN-Capable Transport (ECT)", "ipv6.traffic_class.ect",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x0200000, NULL, HFILL }},