Skip to content

Commit

Permalink
DOCSIS: added Energy Management and CM Status Ack modem capabilities
Browse files Browse the repository at this point in the history
Change-Id: Ieef2cbf34e32f0730af03acc65ebe3499e1fe1f3
Reviewed-on: https://code.wireshark.org/review/24076
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
  • Loading branch information
verstuyft-excentis authored and mmann78 committed Oct 26, 2017
1 parent 52332e3 commit 3bafae2
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
68 changes: 67 additions & 1 deletion plugins/docsis/packet-tlv.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ static int hf_docsis_tlv_mcap_map_ucd = -1;
static int hf_docsis_tlv_mcap_udc = -1;
static int hf_docsis_tlv_mcap_ipv6 = -1;
static int hf_docsis_tlv_mcap_ext_us_trans_power = -1;

static int hf_docsis_tlv_mcap_em = -1;
static int hf_docsis_tlv_mcap_em_1x1 = -1;
static int hf_docsis_tlv_mcap_em_light_sleep = -1;
static int hf_docsis_tlv_mcap_cm_status_ack = -1;

static int hf_docsis_tlv_clsfr_ref = -1;
static int hf_docsis_tlv_clsfr_id = -1;
Expand Down Expand Up @@ -411,6 +414,7 @@ static int hf_docsis_tlv_unknown = -1;
static gint ett_docsis_tlv = -1;
static gint ett_docsis_tlv_cos = -1;
static gint ett_docsis_tlv_mcap = -1;
static gint ett_docsis_tlv_mcap_em = -1;
static gint ett_docsis_tlv_clsfr = -1;
static gint ett_docsis_tlv_clsfr_ip = -1;
static gint ett_docsis_tlv_clsfr_ip6 = -1;
Expand Down Expand Up @@ -470,6 +474,17 @@ static const true_false_string ena_dis_tfs = {
"Disable"
};

static const value_string sup_unsup_vals[] = {
{0, "Unsupported"},
{1, "Supported"},
{0, NULL},
};

static const true_false_string sup_unsup_tfs = {
"Supported",
"Unsupported"
};

static const value_string docs_ver_vals[] = {
{0, "v1.0"},
{1, "v1.1"},
Expand Down Expand Up @@ -2487,6 +2502,33 @@ dissect_modemcap (tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, int sta
expert_add_info_format(pinfo, mcap_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case CAP_EM:
if (length == 4)
{
static const int * cap_em[] = {
&hf_docsis_tlv_mcap_em_1x1,
&hf_docsis_tlv_mcap_em_light_sleep,
NULL
};

proto_tree_add_bitmask_with_flags(mcap_tree, tvb, pos, hf_docsis_tlv_mcap_em, ett_docsis_tlv_mcap_em, cap_em, ENC_BIG_ENDIAN, BMT_NO_FLAGS);
}
else
{
expert_add_info_format(pinfo, mcap_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case CAP_CM_STATUS_ACK:
if (length == 1)
{
proto_tree_add_item (mcap_tree, hf_docsis_tlv_mcap_cm_status_ack, tvb,
pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, mcap_item, &ei_docsis_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
default:
proto_tree_add_item (mcap_tree, hf_docsis_tlv_unknown, tvb, pos, length, ENC_NA);
break;
Expand Down Expand Up @@ -5020,6 +5062,29 @@ proto_register_docsis_tlv (void)
FT_UINT8, BASE_DEC, NULL, 0x0,
"Extended Upstream Transmit Power Capability", HFILL}
},
{&hf_docsis_tlv_mcap_em,
{".44 Energy Management Capabilities", "docsis_tlv.mcap.em",
FT_UINT32, BASE_HEX, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_tlv_mcap_em_1x1,
{"Energy Management 1x1 Feature",
"docsis_tlv.mcap.em.1x1",
FT_BOOLEAN, 32, TFS (&sup_unsup_tfs), 0x1,
NULL, HFILL}
},
{&hf_docsis_tlv_mcap_em_light_sleep,
{"DOCSIS Light Sleep Mode",
"docsis_tlv.mcap.em.light_sleep",
FT_BOOLEAN, 32, TFS (&sup_unsup_tfs), 0x2,
NULL, HFILL}
},
{&hf_docsis_tlv_mcap_cm_status_ack,
{".46 CM-STATUS_ACK",
"docsis_tlv.mcap.cm_status_ack",
FT_UINT8, BASE_DEC, VALS (&sup_unsup_vals), 0x0,
"CM_STATUS_ACK", HFILL}
},
{&hf_docsis_tlv_cm_mic,
{"6 CM MIC", "docsis_tlv.cmmic",
FT_BYTES, BASE_NONE, NULL, 0x0,
Expand Down Expand Up @@ -6378,6 +6443,7 @@ proto_register_docsis_tlv (void)
&ett_docsis_tlv,
&ett_docsis_tlv_cos,
&ett_docsis_tlv_mcap,
&ett_docsis_tlv_mcap_em,
&ett_docsis_tlv_clsfr,
&ett_docsis_tlv_clsfr_ip,
&ett_docsis_tlv_clsfr_ip6,
Expand Down
2 changes: 2 additions & 0 deletions plugins/docsis/packet-tlv.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
#define CAP_UDC 38
#define CAP_IPV6 39
#define CAP_EXT_US_TRNS_PWR 40
#define CAP_EM 44
#define CAP_CM_STATUS_ACK 46

/* Define Classifier subtypes
* These are subtypes of either:
Expand Down

0 comments on commit 3bafae2

Please sign in to comment.