2 * Routines for Type 29 UCD - DOCSIS 2.0 only - Message dissection
3 * Copyright 2003, Brian Wheeler <brian.wheeler[AT]arrisi.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <epan/packet.h>
29 #include <epan/exceptions.h>
31 #define type29ucd_SYMBOL_RATE 1
32 #define type29ucd_FREQUENCY 2
33 #define type29ucd_PREAMBLE 3
34 #define type29ucd_BURST_DESCR 4
35 #define type29ucd_BURST_DESCR5 5
36 #define type29ucd_EXT_PREAMBLE 6
37 #define type29ucd_SCDMA_MODE_ENABLE 7
38 #define type29ucd_SCDMA_SPREADING_INTERVAL 8
39 #define type29ucd_SCDMA_CODES_PER_MINI_SLOT 9
40 #define type29ucd_SCDMA_ACTIVE_CODES 10
41 #define type29ucd_SCDMA_CODE_HOPPING_SEED 11
42 #define type29ucd_SCDMA_US_RATIO_NUM 12
43 #define type29ucd_SCDMA_US_RATIO_DENOM 13
44 #define type29ucd_SCDMA_TIMESTAMP_SNAPSHOT 14
45 #define type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY 15
46 #define type29ucd_RANGING_REQUIRED 16
48 #define type29ucd_MODULATION 1
49 #define type29ucd_DIFF_ENCODING 2
50 #define type29ucd_PREAMBLE_LEN 3
51 #define type29ucd_PREAMBLE_VAL_OFF 4
52 #define type29ucd_FEC 5
53 #define type29ucd_FEC_CODEWORD 6
54 #define type29ucd_SCRAMBLER_SEED 7
55 #define type29ucd_MAX_BURST 8
56 #define type29ucd_GUARD_TIME 9
57 #define type29ucd_LAST_CW_LEN 10
58 #define type29ucd_SCRAMBLER_ONOFF 11
59 #define type29ucd_RS_INT_DEPTH 12
60 #define type29ucd_RS_INT_BLOCK 13
61 #define type29ucd_PREAMBLE_TYPE 14
62 #define type29ucd_SCMDA_SCRAMBLER_ONOFF 15
63 #define type29ucd_SCDMA_CODES_PER_SUBFRAME 16
64 #define type29ucd_SCDMA_FRAMER_INT_STEP_SIZE 17
65 #define type29ucd_TCM_ENABLED 18
68 #define IUC_REQ_DATA 2
69 #define IUC_INIT_MAINT 3
70 #define IUC_STATION_MAINT 4
71 #define IUC_SHORT_DATA_GRANT 5
72 #define IUC_LONG_DATA_GRANT 6
74 #define IUC_DATA_ACK 8
75 #define IUC_ADV_PHY_SHORT_DATA_GRANT 9
76 #define IUC_ADV_PHY_LONG_DATA_GRANT 10
77 #define IUC_ADV_PHY_UGS 11
78 #define IUC_RESERVED12 12
79 #define IUC_RESERVED13 13
80 #define IUC_RESERVED14 14
81 #define IUC_EXPANSION 15
83 /* Initialize the protocol and registered fields */
84 static int proto_docsis_type29ucd
= -1;
86 static int hf_docsis_type29ucd_upstream_chid
= -1;
87 static int hf_docsis_type29ucd_config_ch_cnt
= -1;
88 static int hf_docsis_type29ucd_mini_slot_size
= -1;
89 static int hf_docsis_type29ucd_down_chid
= -1;
90 static int hf_docsis_type29ucd_symbol_rate
= -1;
91 static int hf_docsis_type29ucd_frequency
= -1;
92 static int hf_docsis_type29ucd_preamble_pat
= -1;
93 static int hf_docsis_type29ucd_iuc
= -1;
94 static int hf_docsis_type29ucd_ext_preamble
= -1;
95 static int hf_docsis_type29ucd_scdma_mode_enable
= -1;
96 static int hf_docsis_type29ucd_scdma_spreading_interval
= -1;
97 static int hf_docsis_type29ucd_scdma_codes_per_mini_slot
= -1;
98 static int hf_docsis_type29ucd_scdma_active_codes
= -1;
99 static int hf_docsis_type29ucd_scdma_code_hopping_seed
= -1;
100 static int hf_docsis_type29ucd_scdma_us_ratio_num
= -1;
101 static int hf_docsis_type29ucd_scdma_us_ratio_denom
= -1;
102 static int hf_docsis_type29ucd_scdma_timestamp_snapshot
= -1;
103 static int hf_docsis_type29ucd_maintain_power_spectral_density
= -1;
104 static int hf_docsis_type29ucd_ranging_required
= -1;
106 static int hf_docsis_burst_mod_type
= -1;
107 static int hf_docsis_burst_diff_encoding
= -1;
108 static int hf_docsis_burst_preamble_len
= -1;
109 static int hf_docsis_burst_preamble_val_off
= -1;
110 static int hf_docsis_burst_fec
= -1;
111 static int hf_docsis_burst_fec_codeword
= -1;
112 static int hf_docsis_burst_scrambler_seed
= -1;
113 static int hf_docsis_burst_max_burst
= -1;
114 static int hf_docsis_burst_guard_time
= -1;
115 static int hf_docsis_burst_last_cw_len
= -1;
116 static int hf_docsis_burst_scrambler_onoff
= -1;
117 static int hf_docsis_rs_int_depth
= -1;
118 static int hf_docsis_rs_int_block
= -1;
119 static int hf_docsis_preamble_type
= -1;
120 static int hf_docsis_scdma_scrambler_onoff
= -1;
121 static int hf_docsis_scdma_codes_per_subframe
= -1;
122 static int hf_docsis_scdma_framer_int_step_size
= -1;
123 static int hf_docsis_tcm_enabled
= -1;
126 /* Initialize the subtree pointers */
127 static gint ett_docsis_type29ucd
= -1;
128 static gint ett_burst_descr
= -1;
130 static const value_string channel_tlv_vals
[] _U_
= {
131 {type29ucd_SYMBOL_RATE
, "Symbol Rate"},
132 {type29ucd_FREQUENCY
, "Frequency"},
133 {type29ucd_PREAMBLE
, "Preamble Pattern"},
134 {type29ucd_BURST_DESCR
, "Burst Descriptor"},
135 {type29ucd_BURST_DESCR5
, "Burst Descriptor DOCSIS 2.0"},
136 {type29ucd_EXT_PREAMBLE
, "Extended Preamble Pattern"},
137 {type29ucd_SCDMA_MODE_ENABLE
, "SCDMA Mode Enabled"},
138 {type29ucd_SCDMA_SPREADING_INTERVAL
, "SCDMA Spreading Intervals per Frame"},
139 {type29ucd_SCDMA_CODES_PER_MINI_SLOT
, "SCDMA Codes per Mini-slot"},
140 {type29ucd_SCDMA_ACTIVE_CODES
, "SCDMA Number of Active Codes"},
141 {type29ucd_SCDMA_CODE_HOPPING_SEED
, "SCDMA Code Hopping Seed"},
142 {type29ucd_SCDMA_US_RATIO_NUM
, "SCDMA US ratio numerator M"},
143 {type29ucd_SCDMA_US_RATIO_DENOM
, "SCDMA US ratio denominator N"},
144 {type29ucd_SCDMA_TIMESTAMP_SNAPSHOT
, "SCDMA Timestamp Snapshot"},
145 {type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY
, "Maintain Power Spectral Density"},
146 {type29ucd_RANGING_REQUIRED
, "Ranging Required"},
150 static const value_string on_off_vals
[] = {
156 static const value_string mod_vals2
[] = {
162 {6, "QAM128 (S-CDMA)"},
166 value_string iuc_vals2
[] = {
167 {IUC_REQUEST
, "Request"},
168 {IUC_REQ_DATA
, "REQ/Data"},
169 {IUC_INIT_MAINT
, "Initial Maintenance"},
170 {IUC_STATION_MAINT
, "Station Maintenance"},
171 {IUC_SHORT_DATA_GRANT
, "Short Data Grant"},
172 {IUC_LONG_DATA_GRANT
, "Long Data Grant"},
173 {IUC_NULL_IE
, "NULL IE"},
174 {IUC_DATA_ACK
, "Data Ack"},
175 {IUC_ADV_PHY_SHORT_DATA_GRANT
, "Advanced Phy Short Data Grant"},
176 {IUC_ADV_PHY_LONG_DATA_GRANT
, "Advanced Phy Long Data Grant"},
177 {IUC_ADV_PHY_UGS
, "Advanced Phy UGS"},
178 {IUC_RESERVED12
, "Reserved 12"},
179 {IUC_RESERVED13
, "Reserved 13"},
180 {IUC_RESERVED14
, "Reserved 14"},
181 {IUC_EXPANSION
, "IUC Expansion"},
185 static const value_string last_cw_len_vals
[] = {
190 /* Code to actually dissect the packets */
192 dissect_type29ucd (tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
)
194 guint16 pos
, endtlvpos
;
196 guint8 tlvlen
, tlvtype
;
197 proto_tree
*burst_descr_tree
;
199 proto_tree
*type29ucd_tree
;
200 proto_item
*type29ucd_item
;
202 guint8 upchid
, symrate
;
204 len
= tvb_length_remaining (tvb
, 0);
205 upchid
= tvb_get_guint8 (tvb
, 0);
207 /* if the upstream Channel ID is 0 then this is for Telephony Return) */
209 col_add_fstr (pinfo
->cinfo
, COL_INFO
,
210 "type29ucd Message: Channel ID = %u (U%u)", upchid
,
213 col_add_fstr (pinfo
->cinfo
, COL_INFO
,
214 "type29ucd Message: Channel ID = %u (Telephony Return)",
220 proto_tree_add_protocol_format (tree
, proto_docsis_type29ucd
, tvb
, 0,
221 tvb_length_remaining (tvb
, 0),
222 "type29ucd Message");
223 type29ucd_tree
= proto_item_add_subtree (type29ucd_item
, ett_docsis_type29ucd
);
224 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_upstream_chid
, tvb
, 0, 1,
226 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_config_ch_cnt
, tvb
, 1, 1,
228 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_mini_slot_size
, tvb
, 2, 1,
230 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_down_chid
, tvb
, 3, 1,
236 type
= tvb_get_guint8 (tvb
, pos
++);
237 length
= tvb_get_guint8 (tvb
, pos
++);
240 case type29ucd_SYMBOL_RATE
:
243 symrate
= tvb_get_guint8 (tvb
, pos
);
244 proto_tree_add_uint (type29ucd_tree
, hf_docsis_type29ucd_symbol_rate
,
245 tvb
, pos
, length
, symrate
* 160);
249 THROW (ReportedBoundsError
);
253 case type29ucd_FREQUENCY
:
256 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_frequency
, tvb
,
257 pos
, length
, ENC_BIG_ENDIAN
);
262 THROW (ReportedBoundsError
);
265 case type29ucd_PREAMBLE
:
266 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_preamble_pat
, tvb
,
267 pos
, length
, ENC_NA
);
270 /* DOCSIS 2.0 UCD TLV definitions
271 * #define type29ucd_EXT_PREAMBLE 6
272 * #define type29ucd_SCDMA_MODE_ENABLE 7
273 * #define type29ucd_SCDMA_SPREADING_INTERVAL 8
274 * #define type29ucd_SCDMA_CODES_PER_MINI_SLOT 9
275 * #define type29ucd_SCDMA_ACTIVE_CODES 10
276 * #define type29ucd_SCDMA_CODE_HOPPING_SEED 11
277 * #define type29ucd_SCDMA_US_RATIO_NUM 12
278 * #define type29ucd_SCDMA_US_RATIO_DENOM 13
279 * #define type29ucd_SCDMA_TIMESTAMP_SNAPSHOT 14
280 * #define type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY 15
281 * #define type29ucd_RANGING_REQUIRED 16
283 case type29ucd_EXT_PREAMBLE
:
284 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_ext_preamble
, tvb
,
285 pos
, length
, ENC_NA
);
288 case type29ucd_SCDMA_MODE_ENABLE
:
291 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_scdma_mode_enable
,
292 tvb
, pos
, length
, ENC_NA
);
296 THROW (ReportedBoundsError
);
300 case type29ucd_SCDMA_SPREADING_INTERVAL
:
303 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_scdma_spreading_interval
,
304 tvb
, pos
, length
, ENC_NA
);
308 THROW (ReportedBoundsError
);
312 case type29ucd_SCDMA_CODES_PER_MINI_SLOT
:
315 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_scdma_codes_per_mini_slot
,
316 tvb
, pos
, length
, ENC_NA
);
320 THROW (ReportedBoundsError
);
324 case type29ucd_SCDMA_ACTIVE_CODES
:
327 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_scdma_active_codes
,
328 tvb
, pos
, length
, ENC_NA
);
332 THROW (ReportedBoundsError
);
336 case type29ucd_SCDMA_CODE_HOPPING_SEED
:
339 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_scdma_code_hopping_seed
,
340 tvb
, pos
, length
, ENC_NA
);
344 THROW (ReportedBoundsError
);
348 case type29ucd_SCDMA_US_RATIO_NUM
:
351 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_scdma_us_ratio_num
,
352 tvb
, pos
, length
, ENC_NA
);
356 THROW (ReportedBoundsError
);
360 case type29ucd_SCDMA_US_RATIO_DENOM
:
363 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_scdma_us_ratio_denom
,
364 tvb
, pos
, length
, ENC_NA
);
368 THROW (ReportedBoundsError
);
372 case type29ucd_SCDMA_TIMESTAMP_SNAPSHOT
:
375 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_scdma_timestamp_snapshot
,
376 tvb
, pos
, length
, ENC_NA
);
380 THROW (ReportedBoundsError
);
384 case type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY
:
387 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_maintain_power_spectral_density
,
388 tvb
, pos
, length
, ENC_NA
);
392 THROW (ReportedBoundsError
);
396 case type29ucd_RANGING_REQUIRED
:
399 proto_tree_add_item (type29ucd_tree
, hf_docsis_type29ucd_ranging_required
,
400 tvb
, pos
, length
, ENC_NA
);
404 THROW (ReportedBoundsError
);
408 /* DOCSIS 1.1 BURST DESCRIPTOR */
409 case type29ucd_BURST_DESCR
:
411 proto_tree_add_text (type29ucd_tree
, tvb
, pos
, length
,
412 "4 Burst Descriptor (Length = %u)",
414 burst_descr_tree
= proto_item_add_subtree (it
, ett_burst_descr
);
415 proto_tree_add_item (burst_descr_tree
, hf_docsis_type29ucd_iuc
, tvb
,
416 pos
++, 1, ENC_BIG_ENDIAN
);
417 endtlvpos
= pos
+ length
- 1;
418 while (pos
< endtlvpos
)
420 tlvtype
= tvb_get_guint8 (tvb
, pos
++);
421 tlvlen
= tvb_get_guint8 (tvb
, pos
++);
424 case type29ucd_MODULATION
:
427 proto_tree_add_item (burst_descr_tree
,
428 hf_docsis_burst_mod_type
, tvb
,
429 pos
, tlvlen
, ENC_BIG_ENDIAN
);
433 THROW (ReportedBoundsError
);
436 case type29ucd_DIFF_ENCODING
:
439 proto_tree_add_item (burst_descr_tree
,
440 hf_docsis_burst_diff_encoding
,
441 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
445 THROW (ReportedBoundsError
);
448 case type29ucd_PREAMBLE_LEN
:
451 proto_tree_add_item (burst_descr_tree
,
452 hf_docsis_burst_preamble_len
,
453 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
457 THROW (ReportedBoundsError
);
460 case type29ucd_PREAMBLE_VAL_OFF
:
463 proto_tree_add_item (burst_descr_tree
,
464 hf_docsis_burst_preamble_val_off
,
465 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
469 THROW (ReportedBoundsError
);
475 proto_tree_add_item (burst_descr_tree
,
476 hf_docsis_burst_fec
, tvb
, pos
,
477 tlvlen
, ENC_BIG_ENDIAN
);
481 THROW (ReportedBoundsError
);
484 case type29ucd_FEC_CODEWORD
:
487 proto_tree_add_item (burst_descr_tree
,
488 hf_docsis_burst_fec_codeword
,
489 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
493 THROW (ReportedBoundsError
);
496 case type29ucd_SCRAMBLER_SEED
:
499 proto_tree_add_item (burst_descr_tree
,
500 hf_docsis_burst_scrambler_seed
,
501 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
505 THROW (ReportedBoundsError
);
508 case type29ucd_MAX_BURST
:
511 proto_tree_add_item (burst_descr_tree
,
512 hf_docsis_burst_max_burst
, tvb
,
513 pos
, tlvlen
, ENC_BIG_ENDIAN
);
517 THROW (ReportedBoundsError
);
520 case type29ucd_GUARD_TIME
:
523 proto_tree_add_item (burst_descr_tree
,
524 hf_docsis_burst_guard_time
,
525 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
529 THROW (ReportedBoundsError
);
532 case type29ucd_LAST_CW_LEN
:
535 proto_tree_add_item (burst_descr_tree
,
536 hf_docsis_burst_last_cw_len
,
537 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
541 THROW (ReportedBoundsError
);
544 case type29ucd_SCRAMBLER_ONOFF
:
547 proto_tree_add_item (burst_descr_tree
,
548 hf_docsis_burst_scrambler_onoff
,
549 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
553 THROW (ReportedBoundsError
);
556 } /* switch(tlvtype) */
558 } /* while (pos < endtlvpos) */
560 /* DOCSIS 2.0 Upstream Channel Descriptor */
561 case type29ucd_BURST_DESCR5
:
563 proto_tree_add_text (type29ucd_tree
, tvb
, pos
, length
,
564 "5 Burst Descriptor (Length = %u)",
566 burst_descr_tree
= proto_item_add_subtree (it
, ett_burst_descr
);
567 proto_tree_add_item (burst_descr_tree
, hf_docsis_type29ucd_iuc
, tvb
,
568 pos
++, 1, ENC_BIG_ENDIAN
);
569 endtlvpos
= pos
+ length
- 1;
570 while (pos
< endtlvpos
)
572 tlvtype
= tvb_get_guint8 (tvb
, pos
++);
573 tlvlen
= tvb_get_guint8 (tvb
, pos
++);
576 case type29ucd_MODULATION
:
579 proto_tree_add_item (burst_descr_tree
,
580 hf_docsis_burst_mod_type
, tvb
,
581 pos
, tlvlen
, ENC_BIG_ENDIAN
);
585 THROW (ReportedBoundsError
);
588 case type29ucd_DIFF_ENCODING
:
591 proto_tree_add_item (burst_descr_tree
,
592 hf_docsis_burst_diff_encoding
,
593 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
597 THROW (ReportedBoundsError
);
600 case type29ucd_PREAMBLE_LEN
:
603 proto_tree_add_item (burst_descr_tree
,
604 hf_docsis_burst_preamble_len
,
605 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
609 THROW (ReportedBoundsError
);
612 case type29ucd_PREAMBLE_VAL_OFF
:
615 proto_tree_add_item (burst_descr_tree
,
616 hf_docsis_burst_preamble_val_off
,
617 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
621 THROW (ReportedBoundsError
);
627 proto_tree_add_item (burst_descr_tree
,
628 hf_docsis_burst_fec
, tvb
, pos
,
629 tlvlen
, ENC_BIG_ENDIAN
);
633 THROW (ReportedBoundsError
);
636 case type29ucd_FEC_CODEWORD
:
639 proto_tree_add_item (burst_descr_tree
,
640 hf_docsis_burst_fec_codeword
,
641 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
645 THROW (ReportedBoundsError
);
648 case type29ucd_SCRAMBLER_SEED
:
651 proto_tree_add_item (burst_descr_tree
,
652 hf_docsis_burst_scrambler_seed
,
653 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
657 THROW (ReportedBoundsError
);
660 case type29ucd_MAX_BURST
:
663 proto_tree_add_item (burst_descr_tree
,
664 hf_docsis_burst_max_burst
, tvb
,
665 pos
, tlvlen
, ENC_BIG_ENDIAN
);
669 THROW (ReportedBoundsError
);
672 case type29ucd_GUARD_TIME
:
675 proto_tree_add_item (burst_descr_tree
,
676 hf_docsis_burst_guard_time
,
677 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
681 THROW (ReportedBoundsError
);
684 case type29ucd_LAST_CW_LEN
:
687 proto_tree_add_item (burst_descr_tree
,
688 hf_docsis_burst_last_cw_len
,
689 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
693 THROW (ReportedBoundsError
);
696 case type29ucd_SCRAMBLER_ONOFF
:
699 proto_tree_add_item (burst_descr_tree
,
700 hf_docsis_burst_scrambler_onoff
,
701 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
705 THROW (ReportedBoundsError
);
708 /* New cases added for DOCSIS 2.0 US Physical Burst Descriptor TLV */
709 /* #define type29ucd_RS_INT_DEPTH 12
710 * #define type29ucd_RS_INT_BLOCK 13
711 * #define type29ucd_PREAMBLE_TYPE 14
712 * #define type29ucd_SCMDA_SCRAMBLER_ONOFF 15
713 * #define type29ucd_SCDMA_CODES_PER_SUBFRAME 16
714 * #define type29ucd_SCDMA_FRAMER_INT_STEP_SIZE 17
715 * #define type29ucd_TCM_ENABLED 18
717 case type29ucd_RS_INT_DEPTH
:
720 proto_tree_add_item (burst_descr_tree
,
721 hf_docsis_rs_int_depth
,
722 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
726 THROW (ReportedBoundsError
);
729 case type29ucd_RS_INT_BLOCK
:
732 proto_tree_add_item (burst_descr_tree
,
733 hf_docsis_rs_int_block
,
734 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
738 THROW (ReportedBoundsError
);
741 case type29ucd_PREAMBLE_TYPE
:
744 proto_tree_add_item (burst_descr_tree
,
745 hf_docsis_preamble_type
,
746 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
750 THROW (ReportedBoundsError
);
753 case type29ucd_SCMDA_SCRAMBLER_ONOFF
:
756 proto_tree_add_item (burst_descr_tree
,
757 hf_docsis_scdma_scrambler_onoff
,
758 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
762 THROW (ReportedBoundsError
);
765 case type29ucd_SCDMA_CODES_PER_SUBFRAME
:
768 proto_tree_add_item (burst_descr_tree
,
769 hf_docsis_scdma_codes_per_subframe
,
770 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
774 THROW (ReportedBoundsError
);
777 case type29ucd_SCDMA_FRAMER_INT_STEP_SIZE
:
780 proto_tree_add_item (burst_descr_tree
,
781 hf_docsis_scdma_framer_int_step_size
,
782 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
786 THROW (ReportedBoundsError
);
789 case type29ucd_TCM_ENABLED
:
792 proto_tree_add_item (burst_descr_tree
,
793 hf_docsis_tcm_enabled
,
794 tvb
, pos
, tlvlen
, ENC_BIG_ENDIAN
);
798 THROW (ReportedBoundsError
);
801 /* End of DOCSIS 2.0 US burst Descriptor Changes */
802 } /* switch(tlvtype) */
804 } /* while (pos < endtlvpos) */
807 } /* while (pos < len) */
812 /* Register the protocol with Wireshark */
814 /* this format is require because a script is used to build the C function
815 that calls all the protocol registration.
820 proto_register_docsis_type29ucd (void)
823 /* Setup list of header fields See Section 1.6.1 for details*/
824 static hf_register_info hf
[] = {
825 {&hf_docsis_type29ucd_upstream_chid
,
826 {"Upstream Channel ID", "docsis_type29ucd.upchid",
827 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
830 {&hf_docsis_type29ucd_config_ch_cnt
,
831 {"Config Change Count", "docsis_type29ucd.confcngcnt",
832 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
833 "Configuration Change Count", HFILL
}
835 {&hf_docsis_type29ucd_mini_slot_size
,
836 {"Mini Slot Size (6.25us TimeTicks)", "docsis_type29ucd.mslotsize",
837 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
840 {&hf_docsis_type29ucd_down_chid
,
841 {"Downstream Channel ID", "docsis_type29ucd.downchid",
842 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
843 "Management Message", HFILL
}
845 {&hf_docsis_type29ucd_symbol_rate
,
846 {"1 Symbol Rate (ksym/sec)", "docsis_type29ucd.symrate",
847 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
848 "Symbol Rate", HFILL
}
850 {&hf_docsis_type29ucd_frequency
,
851 {"2 Frequency (Hz)", "docsis_type29ucd.freq",
852 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
853 "Upstream Center Frequency", HFILL
}
855 {&hf_docsis_type29ucd_preamble_pat
,
856 {"3 Preamble Pattern", "docsis_type29ucd.preamble",
857 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
858 "Preamble Superstring", HFILL
}
860 {&hf_docsis_type29ucd_iuc
,
861 {"Interval Usage Code", "docsis_type29ucd.iuc",
862 FT_UINT8
, BASE_DEC
, VALS (iuc_vals2
), 0x0,
865 {&hf_docsis_burst_mod_type
,
866 {"1 Modulation Type", "docsis_type29ucd.burst.modtype",
867 FT_UINT8
, BASE_DEC
, VALS (mod_vals2
), 0x0,
868 "Modulation Type", HFILL
}
870 {&hf_docsis_burst_diff_encoding
,
871 {"2 Differential Encoding", "docsis_type29ucd.burst.diffenc",
872 FT_UINT8
, BASE_DEC
, VALS (on_off_vals
), 0x0,
873 "Differential Encoding", HFILL
}
875 {&hf_docsis_burst_preamble_len
,
876 {"3 Preamble Length (Bits)", "docsis_type29ucd.burst.preamble_len",
877 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
878 "Preamble Length (Bits)", HFILL
}
880 {&hf_docsis_burst_preamble_val_off
,
881 {"4 Preamble Offset (Bits)", "docsis_type29ucd.burst.preamble_off",
882 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
883 "Preamble Offset (Bits)", HFILL
}
885 {&hf_docsis_burst_fec
,
886 {"5 FEC (T)", "docsis_type29ucd.burst.fec",
887 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
888 "FEC (T) Codeword Parity Bits = 2^T", HFILL
}
890 {&hf_docsis_burst_fec_codeword
,
891 {"6 FEC Codeword Info bytes (k)", "docsis_type29ucd.burst.fec_codeword",
892 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
893 "FEC Codeword Info Bytes (k)", HFILL
}
895 {&hf_docsis_burst_scrambler_seed
,
896 {"7 Scrambler Seed", "docsis_type29ucd.burst.scrambler_seed",
897 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
898 "Burst Descriptor", HFILL
}
900 {&hf_docsis_burst_max_burst
,
901 {"8 Max Burst Size (Minislots)", "docsis_type29ucd.burst.maxburst",
902 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
903 "Max Burst Size (Minislots)", HFILL
}
905 {&hf_docsis_burst_guard_time
,
906 {"9 Guard Time Size (Symbol Times)", "docsis_type29ucd.burst.guardtime",
907 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
908 "Guard Time Size", HFILL
}
910 {&hf_docsis_burst_last_cw_len
,
911 {"10 Last Codeword Length", "docsis_type29ucd.burst.last_cw_len",
912 FT_UINT8
, BASE_DEC
, VALS (last_cw_len_vals
), 0x0,
913 "Last Codeword Length", HFILL
}
915 {&hf_docsis_burst_scrambler_onoff
,
916 {"11 Scrambler On/Off", "docsis_type29ucd.burst.scrambleronoff",
917 FT_UINT8
, BASE_DEC
, VALS (on_off_vals
), 0x0,
918 "Scrambler On/Off", HFILL
}
920 /* DOCSIS 2.0 UCD TLV definitions
921 * * #define type29ucd_EXT_PREAMBLE 6
922 * * #define type29ucd_SCDMA_MODE_ENABLE 7
923 * * #define type29ucd_SCDMA_SPREADING_INTERVAL 8
924 * * #define type29ucd_SCDMA_CODES_PER_MINI_SLOT 9
925 * * #define type29ucd_SCDMA_ACTIVE_CODES 10
926 * * #define type29ucd_SCDMA_CODE_HOPPING_SEED 11
927 * * #define type29ucd_SCDMA_US_RATIO_NUM 12
928 * * #define type29ucd_SCDMA_US_RATIO_DENOM 13
929 * * #define type29ucd_SCDMA_TIMESTAMP_SNAPSHOT 14
930 * * #define type29ucd_MAINTAIN_POWER_SPECTRAL_DENSITY 15
931 * * #define type29ucd_RANGING_REQUIRED 16
933 {&hf_docsis_type29ucd_ext_preamble
,
934 {"6 Extended Preamble Pattern", "docsis_type29ucd.extpreamble",
935 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
936 "Extended Preamble Pattern", HFILL
}
938 {&hf_docsis_type29ucd_scdma_mode_enable
,
939 {"7 SCDMA Mode Enable", "docsis_type29ucd.scdmaenable",
940 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
941 "SCDMA Mode Enable", HFILL
}
943 {&hf_docsis_type29ucd_scdma_spreading_interval
,
944 {"8 SCDMA Spreading Interval", "docsis_type29ucd.scdmaspreadinginterval",
945 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
946 "SCDMA Spreading Interval", HFILL
}
948 {&hf_docsis_type29ucd_scdma_codes_per_mini_slot
,
949 {"9 SCDMA Codes per mini slot", "docsis_type29ucd.scdmacodesperminislot",
950 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
951 "SCDMA Codes per mini slot", HFILL
}
953 {&hf_docsis_type29ucd_scdma_active_codes
,
954 {"10 SCDMA Active Codes", "docsis_type29ucd.scdmaactivecodes",
955 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
956 "SCDMA Active Codes", HFILL
}
958 {&hf_docsis_type29ucd_scdma_code_hopping_seed
,
959 {"11 SCDMA Code Hopping Seed", "docsis_type29ucd.scdmacodehoppingseed",
960 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
961 "SCDMA Code Hopping Seed", HFILL
}
963 {&hf_docsis_type29ucd_scdma_us_ratio_num
,
964 {"12 SCDMA US Ratio Numerator", "docsis_type29ucd.scdmausrationum",
965 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
966 "SCDMA US Ratio Numerator", HFILL
}
968 {&hf_docsis_type29ucd_scdma_us_ratio_denom
,
969 {"13 SCDMA US Ratio Denominator", "docsis_type29ucd.scdmausratiodenom",
970 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
971 "SCDMA US Ratio Denominator", HFILL
}
973 {&hf_docsis_type29ucd_scdma_timestamp_snapshot
,
974 {"14 SCDMA Timestamp Snapshot", "docsis_type29ucd.scdmatimestamp",
975 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
976 "SCDMA Timestamp Snapshot", HFILL
}
978 {&hf_docsis_type29ucd_maintain_power_spectral_density
,
979 {"15 Maintain power spectral density", "docsis_type29ucd.maintainpowerspectraldensity",
980 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
981 "Maintain power spectral density", HFILL
}
983 {&hf_docsis_type29ucd_ranging_required
,
984 {"16 Ranging Required", "docsis_type29ucd.rangingrequired",
985 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
986 "Ranging Required", HFILL
}
988 /* #define type29ucd_RS_INT_DEPTH 12
989 * #define type29ucd_RS_INT_BLOCK 13
990 * #define type29ucd_PREAMBLE_TYPE 14
991 * #define type29ucd_SCMDA_SCRAMBLER_ONOFF 15
992 * #define type29ucd_SCDMA_CODES_PER_SUBFRAME 16
993 * #define type29ucd_SCDMA_FRAMER_INT_STEP_SIZE 17
994 * #define type29ucd_TCM_ENABLED 18
996 {&hf_docsis_rs_int_depth
,
997 {"12 Scrambler On/Off", "docsis_type29ucd.burst.rsintdepth",
998 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
999 "R-S Interleaver Depth", HFILL
}
1001 {&hf_docsis_rs_int_block
,
1002 {"13 Scrambler On/Off", "docsis_type29ucd.burst.rsintblock",
1003 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1004 "R-S Interleaver Block", HFILL
}
1006 {&hf_docsis_preamble_type
,
1007 {"14 Scrambler On/Off", "docsis_type29ucd.burst.preambletype",
1008 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1009 "Preamble Type", HFILL
}
1011 {&hf_docsis_scdma_scrambler_onoff
,
1012 {"15 Scrambler On/Off", "docsis_type29ucd.burst.scdmascrambleronoff",
1013 FT_UINT8
, BASE_DEC
, VALS (on_off_vals
), 0x0,
1014 "SCDMA Scrambler On/Off", HFILL
}
1016 {&hf_docsis_scdma_codes_per_subframe
,
1017 {"16 Scrambler On/Off", "docsis_type29ucd.burst.scdmacodespersubframe",
1018 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1019 "SCDMA Codes per Subframe", HFILL
}
1021 {&hf_docsis_scdma_framer_int_step_size
,
1022 {"17 Scrambler On/Off", "docsis_type29ucd.burst.scdmaframerintstepsize",
1023 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1024 "SCDMA Framer Interleaving Step Size", HFILL
}
1026 {&hf_docsis_tcm_enabled
,
1027 {"18 Scrambler On/Off", "docsis_type29ucd.burst.tcmenabled",
1028 FT_UINT8
, BASE_DEC
, VALS (on_off_vals
), 0x0,
1029 "TCM Enabled", HFILL
}
1033 /* Setup protocol subtree array */
1034 static gint
*ett
[] = {
1035 &ett_docsis_type29ucd
,
1039 /* Register the protocol name and description */
1040 proto_docsis_type29ucd
=
1041 proto_register_protocol ("DOCSIS Upstream Channel Descriptor Type 29",
1042 "DOCSIS type29ucd", "docsis_type29ucd");
1044 /* Required function calls to register the header fields and subtrees used */
1045 proto_register_field_array (proto_docsis_type29ucd
, hf
, array_length (hf
));
1046 proto_register_subtree_array (ett
, array_length (ett
));
1048 register_dissector ("docsis_type29ucd", dissect_type29ucd
, proto_docsis_type29ucd
);
1052 /* If this dissector uses sub-dissector registration add a registration routine.
1053 This format is required because a script is used to find these routines and
1054 create the code that calls these routines.
1057 proto_reg_handoff_docsis_type29ucd (void)
1059 dissector_handle_t docsis_type29ucd_handle
;
1061 docsis_type29ucd_handle
= find_dissector ("docsis_type29ucd");
1062 dissector_add_uint ("docsis_mgmt", 0x1D, docsis_type29ucd_handle
);