docsis: SF TLV 23 is applicable to both US and DS; added SF TLVs 24.25 and 24.26

Change-Id: Id52d6e7c08c5e8d516ca8e80543f33a1e61cf907
Reviewed-on: https://code.wireshark.org/review/31166
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Andrii Vladyka 2018-12-21 23:09:12 -08:00 committed by Anders Broman
parent 2d57a56fa6
commit c8b68f004d
2 changed files with 60 additions and 13 deletions

View File

@ -309,6 +309,8 @@ static int hf_docsis_tlv_sflow_tol_grant_jitter = -1;
static int hf_docsis_tlv_sflow_grants_per_intvl = -1;
static int hf_docsis_tlv_sflow_ip_tos_overwrite = -1;
static int hf_docsis_tlv_sflow_ugs_timeref = -1;
static int hf_docsis_tlv_sflow_cont_req_backoff_window_mult = -1;
static int hf_docsis_tlv_sflow_num_of_bytes_requested_mult = -1;
static int hf_docsis_tlv_sflow_max_down_latency = -1;
static int hf_docsis_tlv_sflow_down_reseq = -1;
@ -563,6 +565,7 @@ static gint ett_docsis_ucd_reassembled = -1;
static expert_field ei_docsis_tlv_tlvlen_bad = EI_INIT;
static expert_field ei_docsis_tlv_tlvval_bad = EI_INIT;
static const true_false_string on_off_tfs = {
"On",
@ -1403,18 +1406,6 @@ dissect_upstream_sflow (tvbuff_t * tvb, packet_info* pinfo, proto_tree * sflow_t
expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case SFW_IP_TOS_OVERWRITE:
if (length == 2)
{
proto_tree_add_item (sflow_tree,
hf_docsis_tlv_sflow_ip_tos_overwrite, tvb,
pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case SFW_UG_TIME_REF:
if (length == 4)
{
@ -1427,6 +1418,37 @@ dissect_upstream_sflow (tvbuff_t * tvb, packet_info* pinfo, proto_tree * sflow_t
expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case SFW_CONTENTION_REQ_BACKOFF_WINDOW_MULT:
if (length == 1)
{
proto_tree_add_item (sflow_tree,
hf_docsis_tlv_sflow_cont_req_backoff_window_mult, tvb, pos,
length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case SFW_NUM_OF_BYTES_REQUESTED_MULT:
if (length == 1)
{
proto_tree_add_item (sflow_tree,
hf_docsis_tlv_sflow_num_of_bytes_requested_mult, tvb, pos,
length, ENC_BIG_ENDIAN);
guint8 multiplier_val = tvb_get_guint8 (tvb, pos);
if (multiplier_val != 1 && multiplier_val != 2 && multiplier_val != 4 &&
multiplier_val != 8 && multiplier_val != 16)
{
expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvval_bad,
"Wrong TLV value: %u (should be equal to 1,2,4,8 or 16)", multiplier_val);
}
}
else
{
expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
default:
dissect_unknown_tlv (tvb, pinfo, sflow_tree, pos - 2, length + 2);
break;
@ -1593,6 +1615,18 @@ dissect_sflow (tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, int start,
expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case SFW_IP_TOS_OVERWRITE:
if (length == 2)
{
proto_tree_add_item (sflow_tree,
hf_docsis_tlv_sflow_ip_tos_overwrite, tvb,
pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case SFW_PEAK_TRAFFIC_RATE:
if (length == 4)
{
@ -6761,6 +6795,16 @@ proto_register_docsis_tlv (void)
FT_UINT32, BASE_DEC, NULL, 0x0,
"UGS Time Reference", HFILL}
},
{&hf_docsis_tlv_sflow_cont_req_backoff_window_mult,
{".25 Multiplier to Contention Request Backoff Window", "docsis_tlv.sflow.cont_req_backoff_window_mult",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Multiplier to Contention Request Backoff Window", HFILL}
},
{&hf_docsis_tlv_sflow_num_of_bytes_requested_mult,
{".26 Multiplier to Number of Bytes Requested", "docsis_tlv.sflow.num_of_bytes_requested_mult",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Multiplier to Number of Bytes Requested", HFILL}
},
{&hf_docsis_tlv_sflow_peak_traffic_rate,
{".27 Peak Traffic Rate", "docsis_tlv.sflow.peak_traffic_rate",
FT_UINT32, BASE_DEC, NULL, 0x0,
@ -7821,6 +7865,7 @@ proto_register_docsis_tlv (void)
static ei_register_info ei[] = {
{&ei_docsis_tlv_tlvlen_bad, { "docsis_tlv.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
{&ei_docsis_tlv_tlvval_bad, { "docsis_tlv.tlvvalbad", PI_PROTOCOL, PI_WARN, "Wrong TLV value", EXPFILL}},
};
expert_module_t* expert_docsis_tlv;

View File

@ -247,6 +247,7 @@
#define SFW_MIN_RSVD_PACKETSIZE 11
#define SFW_ACTIVE_QOS_TIMEOUT 12
#define SFW_ADMITT_QOS_TIMEOUT 13
#define SFW_IP_TOS_OVERWRITE 23
#define SFW_PEAK_TRAFFIC_RATE 27
#define SFW_REQUIRED_ATTRIBUTE_MASK 31
#define SFW_FORBIDDEN_ATTRIBUTE_MASK 32
@ -264,8 +265,9 @@
#define SFW_NOM_GRNT_INTV 20
#define SFW_GRNT_JTTR_TOL 21
#define SFW_GRNTS_PER_INTV 22
#define SFW_IP_TOS_OVERWRITE 23
#define SFW_UG_TIME_REF 24
#define SFW_CONTENTION_REQ_BACKOFF_WINDOW_MULT 25
#define SFW_NUM_OF_BYTES_REQUESTED_MULT 26
/* The following types only apply to
* TLV_DOWN_SERVICE_FLOW (25)