diff options
author | Bruno Verstuyft <bruno.verstuyft@excentis.com> | 2017-10-31 13:44:12 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-10-31 19:32:37 +0000 |
commit | 7e4723a589bd266d50bff10cab34d2b6838f6412 (patch) | |
tree | 3dc47c8b77c177ec9a1cb4b7fee4fa594d7604a4 /plugins | |
parent | 50c337f40a55e5b27d3442899bda60edebe38691 (diff) |
DOCSIS: add burst descriptor types. Fixed some bugs.
Change-Id: I9f7df2f62197c574087dbcce2c7b0ba7e6c8c56b
Reviewed-on: https://code.wireshark.org/review/24197
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/docsis/packet-macmgmt.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/plugins/docsis/packet-macmgmt.c b/plugins/docsis/packet-macmgmt.c index 75754fdcfe..d1f156256c 100644 --- a/plugins/docsis/packet-macmgmt.c +++ b/plugins/docsis/packet-macmgmt.c @@ -200,8 +200,8 @@ void proto_reg_handoff_docsis_mgmt(void); #define IUC_ADV_PHY_SHORT_DATA_GRANT 9 #define IUC_ADV_PHY_LONG_DATA_GRANT 10 #define IUC_ADV_PHY_UGS 11 -#define IUC_RESERVED12 12 -#define IUC_RESERVED13 13 +#define IUC_DATA_PROFILE_IUC12 12 +#define IUC_DATA_PROFILE_IUC13 13 #define IUC_RESERVED14 14 #define IUC_EXPANSION 15 @@ -1297,6 +1297,7 @@ static const value_string mgmt_type_vals[] = { {MGT_STATUS_ACK, "Status Report Acknowledge"}, {MGT_OCD, "OFDM Channel Descriptor"}, {MGT_DPD, "Downstream Profile Descriptor"}, + {MGT_TYPE51UCD, "Upstream Channel Descriptor Type 51"}, {0, NULL} }; @@ -1335,8 +1336,8 @@ static const value_string iuc_vals[] = { {IUC_ADV_PHY_SHORT_DATA_GRANT, "Advanced Phy Short Data Grant"}, {IUC_ADV_PHY_LONG_DATA_GRANT, "Advanced Phy Long Data Grant"}, {IUC_ADV_PHY_UGS, "Advanced Phy UGS"}, - {IUC_RESERVED12, "Reserved"}, - {IUC_RESERVED13, "Reserved"}, + {IUC_DATA_PROFILE_IUC12, "Data Profile IUC12"}, + {IUC_DATA_PROFILE_IUC13, "Data Profile IUC13"}, {IUC_RESERVED14, "Reserved"}, {IUC_EXPANSION, "Expanded IUC"}, {0, NULL} @@ -2016,6 +2017,7 @@ static const value_string subc_spacing_vals[] = { }; static const value_string ofdma_prof_mod_order[] = { + {0, "no bit-loading"}, {1, "BPSK"}, {2, "QPSK"}, {3, "8-QAM"}, @@ -2083,17 +2085,19 @@ dissect_sync (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data } static void -dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, int pos, guint16 len) +dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, proto_item * item, int pos, guint16 len) { int tlvpos, endtlvpos; guint8 tlvtype; guint32 i, tlvlen; proto_tree *burst_tree; proto_item *burst_item, *burst_len_item; + guint iuc; tlvpos = pos; endtlvpos = tlvpos + len; - proto_tree_add_item (tree, hf_docsis_ucd_iuc, tvb, tlvpos++, 1, ENC_BIG_ENDIAN); + proto_tree_add_item_ret_uint (tree, hf_docsis_ucd_iuc, tvb, tlvpos++, 1, ENC_BIG_ENDIAN, &iuc); + proto_item_append_text(item, ": IUC %d (%s)", iuc, val_to_str(iuc,iuc_vals, "Unknown IUC")); while (tlvpos < endtlvpos) { tlvtype = tvb_get_guint8 (tvb, tlvpos); @@ -2249,7 +2253,7 @@ dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, i case UCD_SCMDA_SCRAMBLER_ONOFF: if (tlvlen == 1) { - proto_tree_add_item (burst_tree, hf_docsis_ucd_scdma_scrambler_onoff, tvb, pos, tlvlen, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_ucd_scdma_scrambler_onoff, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN); } else { @@ -2259,7 +2263,7 @@ dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, i case UCD_SCDMA_CODES_PER_SUBFRAME: if (tlvlen == 1) { - proto_tree_add_item (burst_tree, hf_docsis_ucd_scdma_codes_per_subframe, tvb, pos, tlvlen, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_ucd_scdma_codes_per_subframe, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN); } else { @@ -2269,7 +2273,7 @@ dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, i case UCD_SCDMA_FRAMER_INT_STEP_SIZE: if (tlvlen == 1) { - proto_tree_add_item (burst_tree, hf_docsis_ucd_scdma_framer_int_step_size, tvb, pos, tlvlen, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_ucd_scdma_framer_int_step_size, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN); } else { @@ -2279,7 +2283,7 @@ dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, i case UCD_TCM_ENABLED: if (tlvlen == 1) { - proto_tree_add_item (burst_tree, hf_docsis_ucd_tcm_enabled, tvb, pos, tlvlen, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_ucd_tcm_enabled, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN); } else { @@ -2289,7 +2293,7 @@ dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, i case UCD_SUBC_INIT_RANG: if (tlvlen == 2) { - proto_tree_add_item (burst_tree, hf_docsis_subc_init_rang, tvb, pos, tlvlen, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_subc_init_rang, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN); } else { @@ -2299,7 +2303,7 @@ dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, i case UCD_SUBC_FINE_RANG: if (tlvlen == 2) { - proto_tree_add_item (burst_tree, hf_docsis_subc_fine_rang, tvb, pos, tlvlen, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_subc_fine_rang, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN); } else { @@ -2310,9 +2314,9 @@ dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, i if ((tlvlen % 2) == 0) { for(i =0; i < tlvlen; i+=2) { - proto_tree_add_item (burst_tree, hf_docsis_ofdma_prof_mod_order, tvb, pos + i, 1, ENC_BIG_ENDIAN); - proto_tree_add_item (burst_tree, hf_docsis_ofdma_prof_pilot_pattern, tvb, pos + i, 1, ENC_BIG_ENDIAN); - proto_tree_add_item (burst_tree, hf_docsis_ofdma_prof_num_add_minislots, tvb, pos + i + 1, 1, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_ofdma_prof_mod_order, tvb, tlvpos + i, 1, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_ofdma_prof_pilot_pattern, tvb, tlvpos + i, 1, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_ofdma_prof_num_add_minislots, tvb, tlvpos + i + 1, 1, ENC_BIG_ENDIAN); } } else @@ -2323,8 +2327,8 @@ dissect_ucd_burst_descr(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, i case UCD_OFDMA_IR_POWER_CONTROL: if (tlvlen == 2) { - proto_tree_add_item (burst_tree, hf_docsis_ofdma_ir_pow_ctrl_start_pow, tvb, pos, tlvlen, ENC_BIG_ENDIAN); - proto_tree_add_item (burst_tree, hf_docsis_ofdma_ir_pow_ctrl_step_size, tvb, pos + 1, tlvlen, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_ofdma_ir_pow_ctrl_start_pow, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN); + proto_tree_add_item (burst_tree, hf_docsis_ofdma_ir_pow_ctrl_step_size, tvb, tlvpos + 1, tlvlen, ENC_BIG_ENDIAN); } else { @@ -2408,7 +2412,7 @@ dissect_any_ucd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int pro case UCD_BURST_DESCR: case UCD_BURST_DESCR5: /* DOCSIS 2.0 Upstream Channel Descriptor */ case UCD_BURST_DESCR23: - dissect_ucd_burst_descr(tvb, pinfo, tlv_tree, pos, length); + dissect_ucd_burst_descr(tvb, pinfo, tlv_tree, tlv_item, pos, length); break; case UCD_EXT_PREAMBLE: proto_tree_add_item (tlv_tree, hf_docsis_ucd_ext_preamble_pat, tvb, pos, length, ENC_NA); |