diff options
author | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-09-10 11:16:29 +0000 |
---|---|---|
committer | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-09-10 11:16:29 +0000 |
commit | f7d7fce1baa733bdaf79c92a2939016cbf944f4c (patch) | |
tree | b33d84e0414aac42f9cfe38b0174abe715aa50ba /epan/dissectors | |
parent | 86fdf75cc11fb82e7a3abdff55a0e68022f68332 (diff) |
Update dsfield ECN according to RFC3168.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34092 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-ip.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 4946dca965..2bbee5b363 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -91,8 +91,7 @@ static int hf_ip_version = -1; static int hf_ip_hdr_len = -1; static int hf_ip_dsfield = -1; static int hf_ip_dsfield_dscp = -1; -static int hf_ip_dsfield_ect = -1; -static int hf_ip_dsfield_ce = -1; +static int hf_ip_dsfield_ecn = -1; static int hf_ip_tos = -1; static int hf_ip_tos_precedence = -1; static int hf_ip_tos_delay = -1; @@ -247,8 +246,10 @@ static dissector_handle_t tapa_handle; #define IPDSFIELD_DSCP_AF42 0x24 #define IPDSFIELD_DSCP_AF43 0x26 #define IPDSFIELD_DSCP_EF 0x2E -#define IPDSFIELD_ECT_MASK 0x02 -#define IPDSFIELD_CE_MASK 0x01 +#define IPDSFIELD_ECT_NOT 0x00 +#define IPDSFIELD_ECT_1 0x01 +#define IPDSFIELD_ECT_0 0x02 +#define IPDSFIELD_CE 0x03 /* IP TOS, superseded by the DS Field, RFC 2474. */ #define IPTOS_TOS_MASK 0x1E @@ -1271,6 +1272,13 @@ const value_string dscp_vals[] = { { IPDSFIELD_DSCP_EF, "Expedited Forwarding" }, { 0, NULL } }; +const value_string ecn_vals[] = { + { IPDSFIELD_ECT_NOT, "Not-ECT (Not ECN-Capable Transport)" }, + { IPDSFIELD_ECT_1, "ECT(1) (ECN-Capable Transport)" }, + { IPDSFIELD_ECT_0, "ECT(0) (ECN-Capable Transport)" }, + { IPDSFIELD_CE, "CE (Congestion Experienced)" }, + { 0, NULL } }; + static const value_string precedence_vals[] = { { IPTOS_PREC_ROUTINE, "routine" }, { IPTOS_PREC_PRIORITY, "priority" }, @@ -1397,14 +1405,13 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) if (tree) { if (g_ip_dscp_actif) { tf = proto_tree_add_uint_format(ip_tree, hf_ip_dsfield, tvb, offset + 1, 1, iph->ip_tos, - "Differentiated Services Field: 0x%02x (DSCP 0x%02x: %s; ECN: 0x%02x)", iph->ip_tos, - IPDSFIELD_DSCP(iph->ip_tos), val_to_str(IPDSFIELD_DSCP(iph->ip_tos), dscp_vals, - "Unknown DSCP"),IPDSFIELD_ECN(iph->ip_tos)); + "Differentiated Services Field: 0x%02x (DSCP 0x%02x: %s; ECN: 0x%02x: %s)", iph->ip_tos, + IPDSFIELD_DSCP(iph->ip_tos), val_to_str(IPDSFIELD_DSCP(iph->ip_tos), dscp_vals, "Unknown DSCP"), + IPDSFIELD_ECN(iph->ip_tos), val_to_str(IPDSFIELD_ECN(iph->ip_tos), ecn_vals, "Unknown ECN")); field_tree = proto_item_add_subtree(tf, ett_ip_dsfield); 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_ect, tvb, offset + 1, 1, ENC_NA); - proto_tree_add_item(field_tree, hf_ip_dsfield_ce, 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, iph->ip_tos, "Type of service: 0x%02x (%s)", iph->ip_tos, @@ -1756,15 +1763,10 @@ proto_register_ip(void) VALS(dscp_vals), IPDSFIELD_DSCP_MASK, NULL, HFILL }}, - { &hf_ip_dsfield_ect, - { "ECN-Capable Transport (ECT)", "ip.dsfield.ect", FT_BOOLEAN, 8, TFS(&tfs_set_notset), - IPDSFIELD_ECT_MASK, - "Explicit Congestion Notification Capable Transport", HFILL }}, - - { &hf_ip_dsfield_ce, - { "ECN-CE", "ip.dsfield.ce", FT_BOOLEAN, 8, TFS(&tfs_set_notset), - IPDSFIELD_CE_MASK, - "Explicit Congestion Notification - Congestion Experienced", HFILL }}, + { &hf_ip_dsfield_ecn, + { "Explicit Congestion Notification", "ip.dsfield.ecn", FT_UINT8, BASE_HEX, + VALS(ecn_vals), IPDSFIELD_ECN_MASK, + NULL, HFILL }}, { &hf_ip_tos, { "Type of Service", "ip.tos", FT_UINT8, BASE_DEC, NULL, 0x0, |