2 * Routines for Type 29 UCD - DOCSIS 2.0 only - Message dissection
3 * Copyright 2003, Brian Wheeler <brian.wheeler[AT]arrisi.com>
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include "plugins/plugin_api.h"
32 #include "plugins/plugin_api_defs.h"
33 #include "moduleinfo.h"
41 #include <epan/packet.h>
43 #define type29ucd_SYMBOL_RATE 1
44 #define type29ucd_FREQUENCY 2
45 #define type29ucd_PREAMBLE 3
46 #define type29ucd_BURST_DESCR 4
47 #define type29ucd_BURST_DESCR5 5
48 #define type29ucd_EXT_PREAMBLE 6
49 #define type29ucd_SCDMA_MODE_ENABLE 7
50 #define type29ucd_SCDMA_SPREADING_INTERVAL 8
51 #define type29ucd_SCDMA_CODES_PER_MINI_SLOT 9
52 #define type29ucd_SCDMA_ACTIVE_CODES 10
53 #define type29ucd_SCDMA_CODE_HOPPING_SEED 11
54 #define type29ucd_SCDMA_US_RATIO_NUM 12
55 #define type29ucd_SCDMA_US_RATIO_DENOM 13
56 #define type29ucd_SCDMA_TIMESTAMP_SNAPSHOT 14
57 #define type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY 15
58 #define type29ucd_RANGING_REQUIRED 16
60 #define type29ucd_MODULATION 1
61 #define type29ucd_DIFF_ENCODING 2
62 #define type29ucd_PREAMBLE_LEN 3
63 #define type29ucd_PREAMBLE_VAL_OFF 4
64 #define type29ucd_FEC 5
65 #define type29ucd_FEC_CODEWORD 6
66 #define type29ucd_SCRAMBLER_SEED 7
67 #define type29ucd_MAX_BURST 8
68 #define type29ucd_GUARD_TIME 9
69 #define type29ucd_LAST_CW_LEN 10
70 #define type29ucd_SCRAMBLER_ONOFF 11
71 #define type29ucd_RS_INT_DEPTH 12
72 #define type29ucd_RS_INT_BLOCK 13
73 #define type29ucd_PREAMBLE_TYPE 14
74 #define type29ucd_SCMDA_SCRAMBLER_ONOFF 15
75 #define type29ucd_SCDMA_CODES_PER_SUBFRAME 16
76 #define type29ucd_SCDMA_FRAMER_INT_STEP_SIZE 17
77 #define type29ucd_TCM_ENABLED 18
80 #define IUC_REQ_DATA 2
81 #define IUC_INIT_MAINT 3
82 #define IUC_STATION_MAINT 4
83 #define IUC_SHORT_DATA_GRANT 5
84 #define IUC_LONG_DATA_GRANT 6
86 #define IUC_DATA_ACK 8
87 #define IUC_ADV_PHY_SHORT_DATA_GRANT 9
88 #define IUC_ADV_PHY_LONG_DATA_GRANT 10
89 #define IUC_ADV_PHY_UGS 11
90 #define IUC_RESERVED12 12
91 #define IUC_RESERVED13 13
92 #define IUC_RESERVED14 14
93 #define IUC_EXPANSION 15
95 /* Initialize the protocol and registered fields */
96 static int proto_docsis_type29ucd = -1;
98 static int hf_docsis_type29ucd_upstream_chid = -1;
99 static int hf_docsis_type29ucd_config_ch_cnt = -1;
100 static int hf_docsis_type29ucd_mini_slot_size = -1;
101 static int hf_docsis_type29ucd_down_chid = -1;
102 static int hf_docsis_type29ucd_symbol_rate = -1;
103 static int hf_docsis_type29ucd_frequency = -1;
104 static int hf_docsis_type29ucd_preamble_pat = -1;
105 static int hf_docsis_type29ucd_iuc = -1;
106 static int hf_docsis_type29ucd_ext_preamble = -1;
107 static int hf_docsis_type29ucd_scdma_mode_enable = -1;
108 static int hf_docsis_type29ucd_scdma_spreading_interval = -1;
109 static int hf_docsis_type29ucd_scdma_codes_per_mini_slot = -1;
110 static int hf_docsis_type29ucd_scdma_active_codes = -1;
111 static int hf_docsis_type29ucd_scdma_code_hopping_seed = -1;
112 static int hf_docsis_type29ucd_scdma_us_ratio_num = -1;
113 static int hf_docsis_type29ucd_scdma_us_ratio_denom = -1;
114 static int hf_docsis_type29ucd_scdma_timestamp_snapshot = -1;
115 static int hf_docsis_type29ucd_maintain_power_spectral_density = -1;
116 static int hf_docsis_type29ucd_ranging_required = -1;
118 static int hf_docsis_burst_mod_type = -1;
119 static int hf_docsis_burst_diff_encoding = -1;
120 static int hf_docsis_burst_preamble_len = -1;
121 static int hf_docsis_burst_preamble_val_off = -1;
122 static int hf_docsis_burst_fec = -1;
123 static int hf_docsis_burst_fec_codeword = -1;
124 static int hf_docsis_burst_scrambler_seed = -1;
125 static int hf_docsis_burst_max_burst = -1;
126 static int hf_docsis_burst_guard_time = -1;
127 static int hf_docsis_burst_last_cw_len = -1;
128 static int hf_docsis_burst_scrambler_onoff = -1;
129 static int hf_docsis_rs_int_depth = -1;
130 static int hf_docsis_rs_int_block = -1;
131 static int hf_docsis_preamble_type = -1;
132 static int hf_docsis_scdma_scrambler_onoff = -1;
133 static int hf_docsis_scdma_codes_per_subframe = -1;
134 static int hf_docsis_scdma_framer_int_step_size = -1;
135 static int hf_docsis_tcm_enabled = -1;
138 /* Initialize the subtree pointers */
139 static gint ett_docsis_type29ucd = -1;
140 static gint ett_burst_descr = -1;
142 static const value_string channel_tlv_vals[] = {
143 {type29ucd_SYMBOL_RATE, "Symbol Rate"},
144 {type29ucd_FREQUENCY, "Frequency"},
145 {type29ucd_PREAMBLE, "Preamble Pattern"},
146 {type29ucd_BURST_DESCR, "Burst Descriptor"},
147 {type29ucd_BURST_DESCR5, "Burst Descriptor DOCSIS 2.0"},
148 {type29ucd_EXT_PREAMBLE, "Extended Preamble Pattern"},
149 {type29ucd_SCDMA_MODE_ENABLE, "SCDMA Mode Enabled"},
150 {type29ucd_SCDMA_SPREADING_INTERVAL, "SCDMA Spreading Intervals per Frame"},
151 {type29ucd_SCDMA_CODES_PER_MINI_SLOT, "SCDMA Codes per Mini-slot"},
152 {type29ucd_SCDMA_ACTIVE_CODES, "SCDMA Number of Active Codes"},
153 {type29ucd_SCDMA_CODE_HOPPING_SEED, "SCDMA Code Hopping Seed"},
154 {type29ucd_SCDMA_US_RATIO_NUM, "SCDMA US ratio numerator M"},
155 {type29ucd_SCDMA_US_RATIO_DENOM, "SCDMA US ratio denominator N"},
156 {type29ucd_SCDMA_TIMESTAMP_SNAPSHOT, "SCDMA Timestamp Snapshot"},
157 {type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY, "Maintain Power Spectral Density"},
158 {type29ucd_RANGING_REQUIRED, "Ranging Required"},
162 static const value_string on_off_vals[] = {
168 static const value_string mod_vals2[] = {
174 {6, "QAM128 (S-CDMA)"},
178 value_string iuc_vals2[] = {
179 {IUC_REQUEST, "Request"},
180 {IUC_REQ_DATA, "REQ/Data"},
181 {IUC_INIT_MAINT, "Initial Maintenance"},
182 {IUC_STATION_MAINT, "Station Maintenance"},
183 {IUC_SHORT_DATA_GRANT, "Short Data Grant"},
184 {IUC_LONG_DATA_GRANT, "Long Data Grant"},
185 {IUC_NULL_IE, "NULL IE"},
186 {IUC_DATA_ACK, "Data Ack"},
187 {IUC_ADV_PHY_SHORT_DATA_GRANT, "Advanced Phy Short Data Grant"},
188 {IUC_ADV_PHY_LONG_DATA_GRANT, "Advanced Phy Long Data Grant"},
189 {IUC_ADV_PHY_UGS, "Advanced Phy UGS"},
190 {IUC_RESERVED12, "Reserved 12"},
191 {IUC_RESERVED13, "Reserved 13"},
192 {IUC_RESERVED14, "Reserved 14"},
193 {IUC_EXPANSION, "IUC Expansion"},
197 static const value_string last_cw_len_vals[] = {
202 /* Code to actually dissect the packets */
204 dissect_type29ucd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
206 guint16 pos, endtlvpos;
208 guint8 tlvlen, tlvtype;
209 proto_tree *burst_descr_tree;
211 proto_tree *type29ucd_tree;
212 proto_item *type29ucd_item;
214 guint8 upchid, symrate;
216 len = tvb_length_remaining (tvb, 0);
217 upchid = tvb_get_guint8 (tvb, 0);
219 /* if the upstream Channel ID is 0 then this is for Telephony Return) */
220 if (check_col (pinfo->cinfo, COL_INFO))
222 col_clear (pinfo->cinfo, COL_INFO);
224 col_add_fstr (pinfo->cinfo, COL_INFO,
225 "type29ucd Message: Channel ID = %u (U%u)", upchid,
228 col_add_fstr (pinfo->cinfo, COL_INFO,
229 "type29ucd Message: Channel ID = %u (Telephony Return)",
236 proto_tree_add_protocol_format (tree, proto_docsis_type29ucd, tvb, 0,
237 tvb_length_remaining (tvb, 0),
238 "type29ucd Message");
239 type29ucd_tree = proto_item_add_subtree (type29ucd_item, ett_docsis_type29ucd);
240 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_upstream_chid, tvb, 0, 1,
242 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_config_ch_cnt, tvb, 1, 1,
244 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_mini_slot_size, tvb, 2, 1,
246 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_down_chid, tvb, 3, 1,
252 type = tvb_get_guint8 (tvb, pos++);
253 length = tvb_get_guint8 (tvb, pos++);
256 case type29ucd_SYMBOL_RATE:
259 symrate = tvb_get_guint8 (tvb, pos);
260 proto_tree_add_uint (type29ucd_tree, hf_docsis_type29ucd_symbol_rate,
261 tvb, pos, length, symrate * 160);
265 THROW (ReportedBoundsError);
269 case type29ucd_FREQUENCY:
272 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_frequency, tvb,
278 THROW (ReportedBoundsError);
281 case type29ucd_PREAMBLE:
282 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_preamble_pat, tvb,
286 /* DOCSIS 2.0 UCD TLV definitions
287 * #define type29ucd_EXT_PREAMBLE 6
288 * #define type29ucd_SCDMA_MODE_ENABLE 7
289 * #define type29ucd_SCDMA_SPREADING_INTERVAL 8
290 * #define type29ucd_SCDMA_CODES_PER_MINI_SLOT 9
291 * #define type29ucd_SCDMA_ACTIVE_CODES 10
292 * #define type29ucd_SCDMA_CODE_HOPPING_SEED 11
293 * #define type29ucd_SCDMA_US_RATIO_NUM 12
294 * #define type29ucd_SCDMA_US_RATIO_DENOM 13
295 * #define type29ucd_SCDMA_TIMESTAMP_SNAPSHOT 14
296 * #define type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY 15
297 * #define type29ucd_RANGING_REQUIRED 16
299 case type29ucd_EXT_PREAMBLE:
300 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_ext_preamble, tvb,
304 case type29ucd_SCDMA_MODE_ENABLE:
307 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_scdma_mode_enable,
308 tvb, pos, length, FALSE);
312 THROW (ReportedBoundsError);
316 case type29ucd_SCDMA_SPREADING_INTERVAL:
319 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_scdma_spreading_interval,
320 tvb, pos, length, FALSE);
324 THROW (ReportedBoundsError);
328 case type29ucd_SCDMA_CODES_PER_MINI_SLOT:
331 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_scdma_codes_per_mini_slot,
332 tvb, pos, length, FALSE);
336 THROW (ReportedBoundsError);
340 case type29ucd_SCDMA_ACTIVE_CODES:
343 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_scdma_active_codes,
344 tvb, pos, length, FALSE);
348 THROW (ReportedBoundsError);
352 case type29ucd_SCDMA_CODE_HOPPING_SEED:
355 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_scdma_code_hopping_seed,
356 tvb, pos, length, FALSE);
360 THROW (ReportedBoundsError);
364 case type29ucd_SCDMA_US_RATIO_NUM:
367 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_scdma_us_ratio_num,
368 tvb, pos, length, FALSE);
372 THROW (ReportedBoundsError);
376 case type29ucd_SCDMA_US_RATIO_DENOM:
379 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_scdma_us_ratio_denom,
380 tvb, pos, length, FALSE);
384 THROW (ReportedBoundsError);
388 case type29ucd_SCDMA_TIMESTAMP_SNAPSHOT:
391 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_scdma_timestamp_snapshot,
392 tvb, pos, length, FALSE);
396 THROW (ReportedBoundsError);
400 case type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY:
403 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_maintain_power_spectral_density,
404 tvb, pos, length, FALSE);
408 THROW (ReportedBoundsError);
412 case type29ucd_RANGING_REQUIRED:
415 proto_tree_add_item (type29ucd_tree, hf_docsis_type29ucd_ranging_required,
416 tvb, pos, length, FALSE);
420 THROW (ReportedBoundsError);
424 /* DOCSIS 1.1 BURST DESCRIPTOR */
425 case type29ucd_BURST_DESCR:
427 proto_tree_add_text (type29ucd_tree, tvb, pos, length,
428 "4 Burst Descriptor (Length = %u)",
430 burst_descr_tree = proto_item_add_subtree (it, ett_burst_descr);
431 proto_tree_add_item (burst_descr_tree, hf_docsis_type29ucd_iuc, tvb,
433 endtlvpos = pos + length - 1;
434 while (pos < endtlvpos)
436 tlvtype = tvb_get_guint8 (tvb, pos++);
437 tlvlen = tvb_get_guint8 (tvb, pos++);
440 case type29ucd_MODULATION:
443 proto_tree_add_item (burst_descr_tree,
444 hf_docsis_burst_mod_type, tvb,
449 THROW (ReportedBoundsError);
452 case type29ucd_DIFF_ENCODING:
455 proto_tree_add_item (burst_descr_tree,
456 hf_docsis_burst_diff_encoding,
457 tvb, pos, tlvlen, FALSE);
461 THROW (ReportedBoundsError);
464 case type29ucd_PREAMBLE_LEN:
467 proto_tree_add_item (burst_descr_tree,
468 hf_docsis_burst_preamble_len,
469 tvb, pos, tlvlen, FALSE);
473 THROW (ReportedBoundsError);
476 case type29ucd_PREAMBLE_VAL_OFF:
479 proto_tree_add_item (burst_descr_tree,
480 hf_docsis_burst_preamble_val_off,
481 tvb, pos, tlvlen, FALSE);
485 THROW (ReportedBoundsError);
491 proto_tree_add_item (burst_descr_tree,
492 hf_docsis_burst_fec, tvb, pos,
497 THROW (ReportedBoundsError);
500 case type29ucd_FEC_CODEWORD:
503 proto_tree_add_item (burst_descr_tree,
504 hf_docsis_burst_fec_codeword,
505 tvb, pos, tlvlen, FALSE);
509 THROW (ReportedBoundsError);
512 case type29ucd_SCRAMBLER_SEED:
515 proto_tree_add_item (burst_descr_tree,
516 hf_docsis_burst_scrambler_seed,
517 tvb, pos, tlvlen, FALSE);
521 THROW (ReportedBoundsError);
524 case type29ucd_MAX_BURST:
527 proto_tree_add_item (burst_descr_tree,
528 hf_docsis_burst_max_burst, tvb,
533 THROW (ReportedBoundsError);
536 case type29ucd_GUARD_TIME:
539 proto_tree_add_item (burst_descr_tree,
540 hf_docsis_burst_guard_time,
541 tvb, pos, tlvlen, FALSE);
545 THROW (ReportedBoundsError);
548 case type29ucd_LAST_CW_LEN:
551 proto_tree_add_item (burst_descr_tree,
552 hf_docsis_burst_last_cw_len,
553 tvb, pos, tlvlen, FALSE);
557 THROW (ReportedBoundsError);
560 case type29ucd_SCRAMBLER_ONOFF:
563 proto_tree_add_item (burst_descr_tree,
564 hf_docsis_burst_scrambler_onoff,
565 tvb, pos, tlvlen, FALSE);
569 THROW (ReportedBoundsError);
572 } /* switch(tlvtype) */
574 } /* while (pos < endtlvpos) */
576 /* DOCSIS 2.0 Upstream Channel Descriptor */
577 case type29ucd_BURST_DESCR5:
579 proto_tree_add_text (type29ucd_tree, tvb, pos, length,
580 "5 Burst Descriptor (Length = %u)",
582 burst_descr_tree = proto_item_add_subtree (it, ett_burst_descr);
583 proto_tree_add_item (burst_descr_tree, hf_docsis_type29ucd_iuc, tvb,
585 endtlvpos = pos + length - 1;
586 while (pos < endtlvpos)
588 tlvtype = tvb_get_guint8 (tvb, pos++);
589 tlvlen = tvb_get_guint8 (tvb, pos++);
592 case type29ucd_MODULATION:
595 proto_tree_add_item (burst_descr_tree,
596 hf_docsis_burst_mod_type, tvb,
601 THROW (ReportedBoundsError);
604 case type29ucd_DIFF_ENCODING:
607 proto_tree_add_item (burst_descr_tree,
608 hf_docsis_burst_diff_encoding,
609 tvb, pos, tlvlen, FALSE);
613 THROW (ReportedBoundsError);
616 case type29ucd_PREAMBLE_LEN:
619 proto_tree_add_item (burst_descr_tree,
620 hf_docsis_burst_preamble_len,
621 tvb, pos, tlvlen, FALSE);
625 THROW (ReportedBoundsError);
628 case type29ucd_PREAMBLE_VAL_OFF:
631 proto_tree_add_item (burst_descr_tree,
632 hf_docsis_burst_preamble_val_off,
633 tvb, pos, tlvlen, FALSE);
637 THROW (ReportedBoundsError);
643 proto_tree_add_item (burst_descr_tree,
644 hf_docsis_burst_fec, tvb, pos,
649 THROW (ReportedBoundsError);
652 case type29ucd_FEC_CODEWORD:
655 proto_tree_add_item (burst_descr_tree,
656 hf_docsis_burst_fec_codeword,
657 tvb, pos, tlvlen, FALSE);
661 THROW (ReportedBoundsError);
664 case type29ucd_SCRAMBLER_SEED:
667 proto_tree_add_item (burst_descr_tree,
668 hf_docsis_burst_scrambler_seed,
669 tvb, pos, tlvlen, FALSE);
673 THROW (ReportedBoundsError);
676 case type29ucd_MAX_BURST:
679 proto_tree_add_item (burst_descr_tree,
680 hf_docsis_burst_max_burst, tvb,
685 THROW (ReportedBoundsError);
688 case type29ucd_GUARD_TIME:
691 proto_tree_add_item (burst_descr_tree,
692 hf_docsis_burst_guard_time,
693 tvb, pos, tlvlen, FALSE);
697 THROW (ReportedBoundsError);
700 case type29ucd_LAST_CW_LEN:
703 proto_tree_add_item (burst_descr_tree,
704 hf_docsis_burst_last_cw_len,
705 tvb, pos, tlvlen, FALSE);
709 THROW (ReportedBoundsError);
712 case type29ucd_SCRAMBLER_ONOFF:
715 proto_tree_add_item (burst_descr_tree,
716 hf_docsis_burst_scrambler_onoff,
717 tvb, pos, tlvlen, FALSE);
721 THROW (ReportedBoundsError);
724 /* New cases added for DOCSIS 2.0 US Physical Burst Descriptor TLV */
725 /* #define type29ucd_RS_INT_DEPTH 12
726 * #define type29ucd_RS_INT_BLOCK 13
727 * #define type29ucd_PREAMBLE_TYPE 14
728 * #define type29ucd_SCMDA_SCRAMBLER_ONOFF 15
729 * #define type29ucd_SCDMA_CODES_PER_SUBFRAME 16
730 * #define type29ucd_SCDMA_FRAMER_INT_STEP_SIZE 17
731 * #define type29ucd_TCM_ENABLED 18
733 case type29ucd_RS_INT_DEPTH:
736 proto_tree_add_item (burst_descr_tree,
737 hf_docsis_rs_int_depth,
738 tvb, pos, tlvlen, FALSE);
742 THROW (ReportedBoundsError);
745 case type29ucd_RS_INT_BLOCK:
748 proto_tree_add_item (burst_descr_tree,
749 hf_docsis_rs_int_block,
750 tvb, pos, tlvlen, FALSE);
754 THROW (ReportedBoundsError);
757 case type29ucd_PREAMBLE_TYPE:
760 proto_tree_add_item (burst_descr_tree,
761 hf_docsis_preamble_type,
762 tvb, pos, tlvlen, FALSE);
766 THROW (ReportedBoundsError);
769 case type29ucd_SCMDA_SCRAMBLER_ONOFF:
772 proto_tree_add_item (burst_descr_tree,
773 hf_docsis_scdma_scrambler_onoff,
774 tvb, pos, tlvlen, FALSE);
778 THROW (ReportedBoundsError);
781 case type29ucd_SCDMA_CODES_PER_SUBFRAME:
784 proto_tree_add_item (burst_descr_tree,
785 hf_docsis_scdma_codes_per_subframe,
786 tvb, pos, tlvlen, FALSE);
790 THROW (ReportedBoundsError);
793 case type29ucd_SCDMA_FRAMER_INT_STEP_SIZE:
796 proto_tree_add_item (burst_descr_tree,
797 hf_docsis_scdma_framer_int_step_size,
798 tvb, pos, tlvlen, FALSE);
802 THROW (ReportedBoundsError);
805 case type29ucd_TCM_ENABLED:
808 proto_tree_add_item (burst_descr_tree,
809 hf_docsis_tcm_enabled,
810 tvb, pos, tlvlen, FALSE);
814 THROW (ReportedBoundsError);
817 /* End of DOCSIS 2.0 US burst Descriptor Changes */
818 } /* switch(tlvtype) */
820 } /* while (pos < endtlvpos) */
823 } /* while (pos < len) */
828 /* Register the protocol with Ethereal */
830 /* this format is require because a script is used to build the C function
831 that calls all the protocol registration.
836 proto_register_docsis_type29ucd (void)
839 /* Setup list of header fields See Section 1.6.1 for details*/
840 static hf_register_info hf[] = {
841 {&hf_docsis_type29ucd_upstream_chid,
842 {"Upstream Channel ID", "docsis.type29ucd.upchid",
843 FT_UINT8, BASE_DEC, NULL, 0x0,
844 "Upstream Channel ID", HFILL}
846 {&hf_docsis_type29ucd_config_ch_cnt,
847 {"Config Change Count", "docsis.type29ucd.confcngcnt",
848 FT_UINT8, BASE_DEC, NULL, 0x0,
849 "Configuration Change Count", HFILL}
851 {&hf_docsis_type29ucd_mini_slot_size,
852 {"Mini Slot Size (6.25us TimeTicks)", "docsis.type29ucd.mslotsize",
853 FT_UINT8, BASE_DEC, NULL, 0x0,
854 "Mini Slot Size (6.25us TimeTicks)", HFILL}
856 {&hf_docsis_type29ucd_down_chid,
857 {"Downstream Channel ID", "docsis.type29ucd.downchid",
858 FT_UINT8, BASE_DEC, NULL, 0x0,
859 "Management Message", HFILL}
861 {&hf_docsis_type29ucd_symbol_rate,
862 {"1 Symbol Rate (ksym/sec)", "docsis.type29ucd.symrate",
863 FT_UINT8, BASE_DEC, NULL, 0x0,
864 "Symbol Rate", HFILL}
866 {&hf_docsis_type29ucd_frequency,
867 {"2 Frequency (Hz)", "docsis.type29ucd.freq",
868 FT_UINT32, BASE_DEC, NULL, 0x0,
869 "Upstream Center Frequency", HFILL}
871 {&hf_docsis_type29ucd_preamble_pat,
872 {"3 Preamble Pattern", "docsis.type29ucd.preamble",
873 FT_BYTES, BASE_HEX, NULL, 0x0,
874 "Preamble Superstring", HFILL}
876 {&hf_docsis_type29ucd_iuc,
877 {"Interval Usage Code", "docsis.type29ucd.iuc",
878 FT_UINT8, BASE_DEC, VALS (iuc_vals2), 0x0,
879 "Interval Usage Code", HFILL}
881 {&hf_docsis_burst_mod_type,
882 {"1 Modulation Type", "docsis.type29ucd.burst.modtype",
883 FT_UINT8, BASE_DEC, VALS (mod_vals2), 0x0,
884 "Modulation Type", HFILL}
886 {&hf_docsis_burst_diff_encoding,
887 {"2 Differential Encoding", "docsis.type29ucd.burst.diffenc",
888 FT_UINT8, BASE_DEC, VALS (on_off_vals), 0x0,
889 "Differential Encoding", HFILL}
891 {&hf_docsis_burst_preamble_len,
892 {"3 Preamble Length (Bits)", "docsis.type29ucd.burst.preamble_len",
893 FT_UINT16, BASE_DEC, NULL, 0x0,
894 "Preamble Length (Bits)", HFILL}
896 {&hf_docsis_burst_preamble_val_off,
897 {"4 Preamble Offset (Bits)", "docsis.type29ucd.burst.preamble_off",
898 FT_UINT16, BASE_DEC, NULL, 0x0,
899 "Preamble Offset (Bits)", HFILL}
901 {&hf_docsis_burst_fec,
902 {"5 FEC (T)", "docsis.type29ucd.burst.fec",
903 FT_UINT8, BASE_DEC, NULL, 0x0,
904 "FEC (T) Codeword Parity Bits = 2^T", HFILL}
906 {&hf_docsis_burst_fec_codeword,
907 {"6 FEC Codeword Info bytes (k)", "docsis.type29ucd.burst.fec_codeword",
908 FT_UINT8, BASE_DEC, NULL, 0x0,
909 "FEC Codeword Info Bytes (k)", HFILL}
911 {&hf_docsis_burst_scrambler_seed,
912 {"7 Scrambler Seed", "docsis.type29ucd.burst.scrambler_seed",
913 FT_UINT16, BASE_HEX, NULL, 0x0,
914 "Burst Descriptor", HFILL}
916 {&hf_docsis_burst_max_burst,
917 {"8 Max Burst Size (Minislots)", "docsis.type29ucd.burst.maxburst",
918 FT_UINT8, BASE_DEC, NULL, 0x0,
919 "Max Burst Size (Minislots)", HFILL}
921 {&hf_docsis_burst_guard_time,
922 {"9 Guard Time Size (Symbol Times)", "docsis.type29ucd.burst.guardtime",
923 FT_UINT8, BASE_DEC, NULL, 0x0,
924 "Guard Time Size", HFILL}
926 {&hf_docsis_burst_last_cw_len,
927 {"10 Last Codeword Length", "docsis.type29ucd.burst.last_cw_len",
928 FT_UINT8, BASE_DEC, VALS (last_cw_len_vals), 0x0,
929 "Last Codeword Length", HFILL}
931 {&hf_docsis_burst_scrambler_onoff,
932 {"11 Scrambler On/Off", "docsis.type29ucd.burst.scrambleronoff",
933 FT_UINT8, BASE_DEC, VALS (on_off_vals), 0x0,
934 "Scrambler On/Off", HFILL}
936 /* DOCSIS 2.0 UCD TLV definitions
937 * * #define type29ucd_EXT_PREAMBLE 6
938 * * #define type29ucd_SCDMA_MODE_ENABLE 7
939 * * #define type29ucd_SCDMA_SPREADING_INTERVAL 8
940 * * #define type29ucd_SCDMA_CODES_PER_MINI_SLOT 9
941 * * #define type29ucd_SCDMA_ACTIVE_CODES 10
942 * * #define type29ucd_SCDMA_CODE_HOPPING_SEED 11
943 * * #define type29ucd_SCDMA_US_RATIO_NUM 12
944 * * #define type29ucd_SCDMA_US_RATIO_DENOM 13
945 * * #define type29ucd_SCDMA_TIMESTAMP_SNAPSHOT 14
946 * * #define type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY 15
947 * * #define type29ucd_RANGING_REQUIRED 16
949 {&hf_docsis_type29ucd_ext_preamble,
950 {"6 Extended Preamble Pattern", "docsis.type29ucd.extpreamble",
951 FT_BYTES, BASE_HEX, NULL, 0x0,
952 "Extended Preamble Pattern", HFILL}
954 {&hf_docsis_type29ucd_scdma_mode_enable,
955 {"7 SCDMA Mode Enable", "docsis.type29ucd.scdmaenable",
956 FT_BYTES, BASE_HEX, NULL, 0x0,
957 "SCDMA Mode Enable", HFILL}
959 {&hf_docsis_type29ucd_scdma_spreading_interval,
960 {"8 SCDMA Spreading Interval", "docsis.type29ucd.scdmaspreadinginterval",
961 FT_BYTES, BASE_HEX, NULL, 0x0,
962 "SCDMA Spreading Interval", HFILL}
964 {&hf_docsis_type29ucd_scdma_codes_per_mini_slot,
965 {"9 SCDMA Codes per mini slot", "docsis.type29ucd.scdmacodesperminislot",
966 FT_BYTES, BASE_HEX, NULL, 0x0,
967 "SCDMA Codes per mini slot", HFILL}
969 {&hf_docsis_type29ucd_scdma_active_codes,
970 {"10 SCDMA Active Codes", "docsis.type29ucd.scdmaactivecodes",
971 FT_BYTES, BASE_HEX, NULL, 0x0,
972 "SCDMA Active Codes", HFILL}
974 {&hf_docsis_type29ucd_scdma_code_hopping_seed,
975 {"11 SCDMA Code Hopping Seed", "docsis.type29ucd.scdmacodehoppingseed",
976 FT_BYTES, BASE_HEX, NULL, 0x0,
977 "SCDMA Code Hopping Seed", HFILL}
979 {&hf_docsis_type29ucd_scdma_us_ratio_num,
980 {"12 SCDMA US Ratio Numerator", "docsis.type29ucd.scdmausrationum",
981 FT_BYTES, BASE_HEX, NULL, 0x0,
982 "SCDMA US Ratio Numerator", HFILL}
984 {&hf_docsis_type29ucd_scdma_us_ratio_denom,
985 {"13 SCDMA US Ratio Denominator", "docsis.type29ucd.scdmausratiodenom",
986 FT_BYTES, BASE_HEX, NULL, 0x0,
987 "SCDMA US Ratio Denominator", HFILL}
989 {&hf_docsis_type29ucd_scdma_timestamp_snapshot,
990 {"14 SCDMA Timestamp Snapshot", "docsis.type29ucd.scdmatimestamp",
991 FT_BYTES, BASE_HEX, NULL, 0x0,
992 "SCDMA Timestamp Snapshot", HFILL}
994 {&hf_docsis_type29ucd_maintain_power_spectral_density,
995 {"15 Maintain power spectral density", "docsis.type29ucd.maintainpowerspectraldensity",
996 FT_BYTES, BASE_HEX, NULL, 0x0,
997 "Maintain power spectral density", HFILL}
999 {&hf_docsis_type29ucd_ranging_required,
1000 {"16 Ranging Required", "docsis.type29ucd.rangingrequired",
1001 FT_BYTES, BASE_HEX, NULL, 0x0,
1002 "Ranging Required", HFILL}
1004 /* #define type29ucd_RS_INT_DEPTH 12
1005 * #define type29ucd_RS_INT_BLOCK 13
1006 * #define type29ucd_PREAMBLE_TYPE 14
1007 * #define type29ucd_SCMDA_SCRAMBLER_ONOFF 15
1008 * #define type29ucd_SCDMA_CODES_PER_SUBFRAME 16
1009 * #define type29ucd_SCDMA_FRAMER_INT_STEP_SIZE 17
1010 * #define type29ucd_TCM_ENABLED 18
1012 {&hf_docsis_rs_int_depth,
1013 {"12 Scrambler On/Off", "docsis.type29ucd.burst.rsintdepth",
1014 FT_UINT8, BASE_DEC, NULL, 0x0,
1015 "R-S Interleaver Depth", HFILL}
1017 {&hf_docsis_rs_int_block,
1018 {"13 Scrambler On/Off", "docsis.type29ucd.burst.rsintblock",
1019 FT_UINT8, BASE_DEC, NULL, 0x0,
1020 "R-S Interleaver Block", HFILL}
1022 {&hf_docsis_preamble_type,
1023 {"14 Scrambler On/Off", "docsis.type29ucd.burst.preambletype",
1024 FT_UINT8, BASE_DEC, NULL, 0x0,
1025 "Preamble Type", HFILL}
1027 {&hf_docsis_scdma_scrambler_onoff,
1028 {"15 Scrambler On/Off", "docsis.type29ucd.burst.scdmascrambleronoff",
1029 FT_UINT8, BASE_DEC, VALS (on_off_vals), 0x0,
1030 "SCDMA Scrambler On/Off", HFILL}
1032 {&hf_docsis_scdma_codes_per_subframe,
1033 {"16 Scrambler On/Off", "docsis.type29ucd.burst.scdmacodespersubframe",
1034 FT_UINT8, BASE_DEC, NULL, 0x0,
1035 "SCDMA Codes per Subframe", HFILL}
1037 {&hf_docsis_scdma_framer_int_step_size,
1038 {"17 Scrambler On/Off", "docsis.type29ucd.burst.scdmaframerintstepsize",
1039 FT_UINT8, BASE_DEC, NULL, 0x0,
1040 "SCDMA Framer Interleaving Step Size", HFILL}
1042 {&hf_docsis_tcm_enabled,
1043 {"18 Scrambler On/Off", "docsis.type29ucd.burst.tcmenabled",
1044 FT_UINT8, BASE_DEC, VALS (on_off_vals), 0x0,
1045 "TCM Enabled", HFILL}
1049 /* Setup protocol subtree array */
1050 static gint *ett[] = {
1051 &ett_docsis_type29ucd,
1055 /* Register the protocol name and description */
1056 proto_docsis_type29ucd =
1057 proto_register_protocol ("DOCSIS Upstream Channel Descriptor Type 29",
1058 "DOCSIS type29ucd", "docsis_type29ucd");
1060 /* Required function calls to register the header fields and subtrees used */
1061 proto_register_field_array (proto_docsis_type29ucd, hf, array_length (hf));
1062 proto_register_subtree_array (ett, array_length (ett));
1064 register_dissector ("docsis_type29ucd", dissect_type29ucd, proto_docsis_type29ucd);
1068 /* If this dissector uses sub-dissector registration add a registration routine.
1069 This format is required because a script is used to find these routines and
1070 create the code that calls these routines.
1073 proto_reg_handoff_docsis_type29ucd (void)
1075 dissector_handle_t docsis_type29ucd_handle;
1077 docsis_type29ucd_handle = find_dissector ("docsis_type29ucd");
1078 dissector_add ("docsis_mgmt", 0x1D, docsis_type29ucd_handle);