From cd6ca0da41ce2af151670486e724d47870705d44 Mon Sep 17 00:00:00 2001 From: Bruno Verstuyft Date: Tue, 26 Sep 2017 15:32:03 +0200 Subject: DOCSIS: Adding Attribute masks to Service Flow Change-Id: I626b8a1d85e3062c58f9e3bd7bd6c6123c4b8272 Reviewed-on: https://code.wireshark.org/review/23749 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte --- plugins/docsis/packet-tlv.c | 55 +++++++++++++++++++++++++++++++++++++++++++++ plugins/docsis/packet-tlv.h | 3 +++ 2 files changed, 58 insertions(+) diff --git a/plugins/docsis/packet-tlv.c b/plugins/docsis/packet-tlv.c index 05f44e7785..561e8ef97b 100644 --- a/plugins/docsis/packet-tlv.c +++ b/plugins/docsis/packet-tlv.c @@ -222,6 +222,9 @@ static int hf_docsis_tlv_sflow_min_traf = -1; static int hf_docsis_tlv_sflow_ass_min_pkt_size = -1; static int hf_docsis_tlv_sflow_timeout_active = -1; static int hf_docsis_tlv_sflow_timeout_admitted = -1; +static int hf_docsis_tlv_sflow_req_attr_mask = -1; +static int hf_docsis_tlv_sflow_forb_attr_mask = -1; +static int hf_docsis_tlv_sflow_attr_aggr_rule_mask = -1; static int hf_docsis_tlv_sflow_vendor_spec = -1; static int hf_docsis_tlv_sflow_max_concat_burst = -1; static int hf_docsis_tlv_sflow_sched_type = -1; @@ -1296,6 +1299,43 @@ 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_REQUIRED_ATTRIBUTE_MASK: + if (length == 4) + { + proto_tree_add_item (sflow_tree, + hf_docsis_tlv_sflow_req_attr_mask, tvb, + pos, length, ENC_NA); + } + else + { + expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length); + + } + break; + case SFW_FORBIDDEN_ATTRIBUTE_MASK: + if (length == 4) + { + proto_tree_add_item (sflow_tree, + hf_docsis_tlv_sflow_forb_attr_mask, tvb, + pos, length, ENC_NA); + } + else + { + expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length); + } + break; + case SFW_ATTRIBUTE_AGGREGATION_RULE_MASK: + if (length == 4) + { + proto_tree_add_item (sflow_tree, + hf_docsis_tlv_sflow_attr_aggr_rule_mask, tvb, + pos, length, ENC_NA); + } + else + { + expert_add_info_format(pinfo, sflow_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length); + } + break; case SFW_VENDOR_SPEC: proto_tree_add_item (sflow_tree, hf_docsis_tlv_sflow_vendor_spec, tvb, pos, length, ENC_NA); @@ -5160,6 +5200,21 @@ proto_register_docsis_tlv (void) FT_UINT32, BASE_DEC, NULL, 0x0, "UGS Time Reference", HFILL} }, + {&hf_docsis_tlv_sflow_req_attr_mask, + {".31 Required Attribute Mask", "docsis_tlv.sflow.req_attr_mask", + FT_BYTES, BASE_NONE, NULL, 0x0, + "Required Attribute Mask", HFILL} + }, + {&hf_docsis_tlv_sflow_forb_attr_mask, + {".32 Forbidden Attribute Mask", "docsis_tlv.sflow.forb_attr_mask", + FT_BYTES, BASE_NONE, NULL, 0x0, + "Forbidden Attribute Mask", HFILL} + }, + {&hf_docsis_tlv_sflow_attr_aggr_rule_mask, + {".33 Attribute Aggregation Rule Mask", "docsis_tlv.sflow.attr_aggr_rule_mask", + FT_BYTES, BASE_NONE, NULL, 0x0, + "Attribute Aggregation Rule Mask", HFILL} + }, {&hf_docsis_tlv_sflow_vendor_spec, {".43 Vendor Specific Encodings", "docsis_tlv.sflow.vendorspec", FT_BYTES, BASE_NONE, NULL, 0x0, diff --git a/plugins/docsis/packet-tlv.h b/plugins/docsis/packet-tlv.h index dbf1a81f1f..4ce1489929 100644 --- a/plugins/docsis/packet-tlv.h +++ b/plugins/docsis/packet-tlv.h @@ -226,6 +226,9 @@ #define SFW_MIN_RSVD_PACKETSIZE 11 #define SFW_ACTIVE_QOS_TIMEOUT 12 #define SFW_ADMITT_QOS_TIMEOUT 13 +#define SFW_REQUIRED_ATTRIBUTE_MASK 31 +#define SFW_FORBIDDEN_ATTRIBUTE_MASK 32 +#define SFW_ATTRIBUTE_AGGREGATION_RULE_MASK 33 #define SFW_VENDOR_SPEC 43 /* The following types only apply to * TLV_UPSTREAM_SERVICE_FLOW (24) -- cgit v1.2.3