aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorBruno Verstuyft <bruno.verstuyft@excentis.com>2017-11-03 13:39:09 +0100
committerMichael Mann <mmann78@netscape.net>2017-11-04 01:25:22 +0000
commit6f382fed37fec0a8ee40bd06da861ff3e94a33ae (patch)
tree27f9d28b65a1cadb50a1a6b8e4228790f3f84221 /plugins
parentb227943e66c7839dca713be60f6cdaf70ba9413e (diff)
DOCSIS: RNGRSP: formatting of equalization coefficients
Change-Id: I6745bee84b096a7008d258a39d99370b1fea29a0 Reviewed-on: https://code.wireshark.org/review/24217 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/docsis/packet-macmgmt.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/docsis/packet-macmgmt.c b/plugins/docsis/packet-macmgmt.c
index d1f156256c..fd9f659b88 100644
--- a/plugins/docsis/packet-macmgmt.c
+++ b/plugins/docsis/packet-macmgmt.c
@@ -1073,6 +1073,7 @@ static gint ett_docsis_rngreq = -1;
static gint ett_docsis_rngrsp = -1;
static gint ett_docsis_rngrsptlv = -1;
static gint ett_docsis_rngrsp_tlv_transmit_equalization_encodings = -1;
+static gint ett_docsis_rngrsp_tlv_transmit_equalization_encodings_coef = -1;
static gint ett_docsis_rngrsp_tlv_commanded_power_subtlv = -1;
static gint ett_docsis_rngrsp_tlv_commanded_power = -1;
@@ -1384,8 +1385,6 @@ two_compl_frac(
frac/16384.0);
}
-
-
static const value_string rngrsp_tlv_vals[] = {
{RNGRSP_TIMING, "Timing Adjust (6.25us/64)"},
{RNGRSP_PWR_LEVEL_ADJ, "Power Level Adjust (0.25dB units)"},
@@ -2859,16 +2858,20 @@ dissect_rngrsp_transmit_equalization_encodings(tvbuff_t * tvb, proto_tree * tree
{
guint16 i;
proto_item *it;
- proto_tree *transmit_equalization_encodings_tree;
+ proto_tree *transmit_equalization_encodings_tree, *coef_tree;
+ guint lowest_subc;
it = proto_tree_add_item(tree, hf_docsis_rngrsp_trans_eq_data, tvb, start-2, len+2, ENC_NA);
transmit_equalization_encodings_tree = proto_item_add_subtree (it, ett_docsis_rngrsp_tlv_transmit_equalization_encodings);
- proto_tree_add_item (transmit_equalization_encodings_tree, hf_docsis_rngrsp_trans_eq_enc_lowest_subc, tvb, start, 3, ENC_BIG_ENDIAN);
+ proto_tree_add_item_ret_uint (transmit_equalization_encodings_tree, hf_docsis_rngrsp_trans_eq_enc_lowest_subc, tvb, start, 3, ENC_BIG_ENDIAN, &lowest_subc);
proto_tree_add_item (transmit_equalization_encodings_tree, hf_docsis_rngrsp_trans_eq_enc_highest_subc, tvb, start, 3, ENC_BIG_ENDIAN);
for(i=3; i < len; i+=4) {
- proto_tree_add_item (transmit_equalization_encodings_tree, hf_docsis_rngrsp_trans_eq_enc_coef_real, tvb, start + i, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item (transmit_equalization_encodings_tree, hf_docsis_rngrsp_trans_eq_enc_coef_imag, tvb, start + i + 2, 2, ENC_BIG_ENDIAN);
+ gint real, imag;
+ coef_tree = proto_tree_add_subtree_format (transmit_equalization_encodings_tree, tvb, start + i, 4, ett_docsis_rngrsp_tlv_transmit_equalization_encodings_coef, NULL, "Subcarrier %d: ", lowest_subc + (i-3)/4);
+ proto_tree_add_item_ret_int (coef_tree, hf_docsis_rngrsp_trans_eq_enc_coef_real, tvb, start + i, 2, ENC_BIG_ENDIAN, &real);
+ proto_tree_add_item_ret_int (coef_tree, hf_docsis_rngrsp_trans_eq_enc_coef_imag, tvb, start + i + 2, 2, ENC_BIG_ENDIAN, &imag);
+ proto_item_append_text(coef_tree, "real: %f, imag: %f", (gint16) real/16384.0, (gint16) imag/16384.0);
}
}
@@ -8400,6 +8403,7 @@ proto_register_docsis_mgmt (void)
&ett_docsis_rngrsp,
&ett_docsis_rngrsptlv,
&ett_docsis_rngrsp_tlv_transmit_equalization_encodings,
+ &ett_docsis_rngrsp_tlv_transmit_equalization_encodings_coef,
&ett_docsis_rngrsp_tlv_commanded_power,
&ett_docsis_rngrsp_tlv_commanded_power_subtlv,
&ett_docsis_regreq,