3 * Routines for MDD Message dissection
4 * Copyright 2007, Bruno Verstuyft <bruno.verstuyft@excentis.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #include <epan/packet.h>
33 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST 1
34 #define MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP 2
35 #define DOWNSTREAM_AMBIGUITY_RESOLUTION_FREQUENCY_LIST 3
36 #define RECEIVE_CHANNEL_PROFILE_REPORTING_CONTROL 4
37 #define IP_INITIALIZATION_PARAMETERS 5
38 #define EARLY_AUTHENTICATION_AND_ENCRYPTION 6
39 #define UPSTREAM_ACTIVE_CHANNEL_LIST 7
40 #define UPSTREAM_AMBIGUITY_RESOLUTION_CHANNEL_LIST 8
41 #define UPSTREAM_FREQUENCY_RANGE 9
42 #define SYMBOL_CLOCK_LOCKING_INDICATOR 10
43 #define CM_STATUS_EVENT_CONTROL 11
44 #define UPSTREAM_TRANSMIT_POWER_REPORTING 12
45 #define DSG_DA_TO_DSID_ASSOCIATION_ENTRY 13
46 #define CM_STATUS_EVENT_ENABLE_NON_CHANNEL_SPECIFIC_EVENTS 15
48 /*Downstream Active Channel List*/
49 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_CHANNEL_ID 1
50 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_FREQUENCY 2
51 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_MODULATION_ORDER_ANNEX 3
52 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_PRIMARY_CAPABLE 4
53 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK 5
55 /*Mac Domain Downstream Service Group*/
56 #define MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP_MD_DS_SG_IDENTIFIER 1
57 #define MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP_CHANNEL_IDS 2
69 #define NOT_PRIMARY_CAPABLE 0
70 #define PRIMARY_CAPABLE 1
72 /*Receive Channel Profile Reporting Control*/
73 #define RCP_CENTER_FREQUENCY_SPACING 1
74 #define VERBOSE_RCP_REPORTING 2
77 #define ASSUME_6MHZ_CENTER_FREQUENCY_SPACING 0
78 #define ASSUME_8MHZ_CENTER_FREQUENCY_SPACING 1
80 /*Verbose RCP reporting*/
81 #define RCP_NO_VERBOSE_REPORTING 0
82 #define RCP_VERBOSE_REPORTING 1
84 /*Sub-TLVs for IP Initialization Parameters*/
85 #define IP_PROVISIONING_MODE 1
86 #define PRE_REGISTRATION_DSID 2
88 /*IP Provisioning Modes*/
91 #define IP_ALTERNATE 2
94 /*Early authentication and encryption*/
95 #define EAE_DISABLED 0
98 /*Upstream Active Channel List*/
99 #define UPSTREAM_ACTIVE_CHANNEL_LIST_UPSTREAM_CHANNEL_ID 1
100 #define UPSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK 2
102 /*Upstream Frequency Range*/
103 #define STANDARD_UPSTREAM_FREQUENCY_RANGE 0
104 #define EXTENDED_UPSTREAM_FREQUENCY_RANGE 1
106 /*Symbol Clock Locking Indicator*/
107 #define NOT_LOCKED_TO_MASTER_CLOCK 0
108 #define LOCKED_TO_MASTER_CLOCK 1
110 /*CM-STATUS Event Control */
111 #define EVENT_TYPE_CODE 1
112 #define MAXIMUM_EVENT_HOLDOFF_TIMER 2
113 #define MAXIMUM_NUMBER_OF_REPORTS_PER_EVENT 3
116 #define SECONDARY_CHANNEL_MDD_TIMEOUT 1
117 #define QAM_FEC_LOCK_FAILURE 2
118 #define SEQUENCE_OUT_OF_RANGE 3
119 #define MDD_RECOVERY 4
120 #define QAM_FEC_LOCK_RECOVERY 5
122 #define T3_RETRIES_EXCEEDED 7
123 #define SUCCESFUL_RANGING_AFTER_T3_RETRIES_EXCEEDED 8
124 #define CM_OPERATING_ON_BATTERY_BACKUP 9
125 #define CM_RETURNED_TO_AC_POWER 10
127 /*Upstream Transmit Power Reporting*/
128 #define CM_DOESNT_REPORT_TRANSMIT_POWER 0
129 #define CM_REPORTS_TRANSMIT_POWER 1
132 /*Dsg DA to DSID association entry*/
133 #define DSG_DA_TO_DSID_ASSOCIATION_DA 1
134 #define DSG_DA_TO_DSID_ASSOCIATION_DSID 2
139 static const value_string J83_annex_vals[] = {
140 {J83_ANNEX_A, "J.83 Annex A"},
141 {J83_ANNEX_B, "J.83 Annex B"},
142 {J83_ANNEX_C, "J.83 Annex C"},
147 static const value_string modulation_order_vals[] = {
153 static const value_string primary_capable_vals[] = {
154 {NOT_PRIMARY_CAPABLE, "Channel is not primary-capable"},
155 {PRIMARY_CAPABLE, "channel is primary-capable"},
160 static const value_string mdd_tlv_vals[] = {
161 {DOWNSTREAM_ACTIVE_CHANNEL_LIST, "Downstream Active Channel List"},
162 {MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP, "Mac Domain Downstream Service Group"},
163 {DOWNSTREAM_AMBIGUITY_RESOLUTION_FREQUENCY_LIST, "Downstream Ambiguity Resolution Frequency List "},
164 {RECEIVE_CHANNEL_PROFILE_REPORTING_CONTROL , "Receive Channel Profile Reporting Control"},
165 {IP_INITIALIZATION_PARAMETERS , "IP Initialization Parameters"},
166 {EARLY_AUTHENTICATION_AND_ENCRYPTION , "Early Authentication and Encryption"},
167 {UPSTREAM_ACTIVE_CHANNEL_LIST , "Upstream Active Channel List"},
168 {UPSTREAM_AMBIGUITY_RESOLUTION_CHANNEL_LIST , "Upstream Ambiguity Resolution Channel List"},
169 {UPSTREAM_FREQUENCY_RANGE , "Upstream Frequency Range"},
170 {SYMBOL_CLOCK_LOCKING_INDICATOR , "Symbol Clock Locking Indicator"},
171 {CM_STATUS_EVENT_CONTROL , "CM-STATUS Event Control"},
172 {UPSTREAM_TRANSMIT_POWER_REPORTING , "Upstream Transmit Power Reporting"},
173 {DSG_DA_TO_DSID_ASSOCIATION_ENTRY , "DSG DA-to-DSID Association Entry"},
178 static const value_string rpc_center_frequency_spacing_vals[] = {
179 {ASSUME_6MHZ_CENTER_FREQUENCY_SPACING , "CM MUST report only Receive Channel Profiles assuming 6 MHz center frequency spacing"},
180 {ASSUME_8MHZ_CENTER_FREQUENCY_SPACING , "CM MUST report only Receive Channel Profiles assuming 8 MHz center frequency spacing"},
184 static const value_string verbose_rpc_reporting_vals[] = {
185 {RCP_NO_VERBOSE_REPORTING , "CM MUST NOT provide verbose reporting of all its Receive Channel Profile(s) (both standard profiles and manufacturers profiles)."},
186 {RCP_VERBOSE_REPORTING , "CM MUST provide verbose reporting of Receive Channel Profile(s) (both standard profiles and manufacturers profiles)."},
190 static const value_string ip_provisioning_mode_vals[] = {
191 {IPv4_ONLY , "IPv4 Only"},
192 {IPv6_ONLY , "IPv6 Only"},
193 {IP_ALTERNATE, "Alternate"},
194 {DUAL_STACK , "Dual Stack"},
198 static const value_string eae_vals[] = {
199 {EAE_DISABLED , "early authentication and encryption disabled"},
200 {EAE_ENABLED , "early authentication and encryption enabled"},
204 static const value_string upstream_frequency_range_vals[] = {
205 {STANDARD_UPSTREAM_FREQUENCY_RANGE, "Standard Upstream Frequency Range"},
206 {EXTENDED_UPSTREAM_FREQUENCY_RANGE, "Extended Upstream Frequency Range"},
210 static const value_string symbol_clock_locking_indicator_vals[] = {
211 {NOT_LOCKED_TO_MASTER_CLOCK, "Symbol Clock is not locked to Master Clock"},
212 {LOCKED_TO_MASTER_CLOCK, "Symbol Clock is locked to Master Clock"},
216 static const value_string symbol_cm_status_event_vals[] = {
217 {SECONDARY_CHANNEL_MDD_TIMEOUT, "Secondary Channel MDD timeout"},
218 {QAM_FEC_LOCK_FAILURE, "Qam FEC Lock Failure"},
219 {SEQUENCE_OUT_OF_RANGE, "Sequence out of Range"},
220 {MDD_RECOVERY, "MDD Recovery"},
221 {QAM_FEC_LOCK_RECOVERY, "Qam FEC Lock Recovery"},
222 {T4_TIMEOUT, "T4 Timeout"},
223 {T3_RETRIES_EXCEEDED, "T3 Retries Exceeded"},
224 {SUCCESFUL_RANGING_AFTER_T3_RETRIES_EXCEEDED, "Successful ranging after T3 Retries Exceeded"},
225 {CM_OPERATING_ON_BATTERY_BACKUP, "CM Operating on Battery Backup"},
226 {CM_RETURNED_TO_AC_POWER, "CM Returned to AC Power"},
230 static const value_string upstream_transmit_power_reporting_vals[] = {
231 {CM_DOESNT_REPORT_TRANSMIT_POWER, "CM does not report transmit power in RNG-REQ, INIT-RNG-REQ, and B-INIT-RNG-REQ messages"},
232 {CM_REPORTS_TRANSMIT_POWER, "CM reports transmit power in RNG-REQ, INIT-RNG-REQ, and B-INIT-RNG-REQ messages"},
238 /* Initialize the protocol and registered fields */
239 static int proto_docsis_mdd = -1;
240 static int hf_docsis_mdd = -1;
241 static int hf_docsis_mdd_ccc = -1;
242 static int hf_docsis_mdd_number_of_fragments = -1;
243 static int hf_docsis_mdd_fragment_sequence_number = -1;
244 static int hf_docsis_mdd_current_channel_dcid = -1;
246 static int hf_docsis_mdd_downstream_active_channel_list_channel_id = -1;
247 static int hf_docsis_mdd_downstream_active_channel_list_frequency = -1;
248 static int hf_docsis_mdd_downstream_active_channel_list_annex = -1;
249 static int hf_docsis_mdd_downstream_active_channel_list_modulation_order = -1;
250 static int hf_docsis_mdd_downstream_active_channel_list_primary_capable = -1;
252 static int hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_timeout = -1;
253 static int hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_failure = -1;
254 static int hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_recovery = -1;
255 static int hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_recovery = -1;
256 static int hf_docsis_mdd_cm_status_event_enable_bitmask_t4_timeout = -1;
257 static int hf_docsis_mdd_cm_status_event_enable_bitmask_t3_retries_exceeded = -1;
258 static int hf_docsis_mdd_cm_status_event_enable_bitmask_successful_ranging_after_t3_retries_exceeded = -1;
261 static int hf_docsis_mdd_mac_domain_downstream_service_group_md_ds_sg_identifier = -1;
262 static int hf_docsis_mdd_mac_domain_downstream_service_group_channel_id = -1;
264 static int hf_docsis_mdd_downstream_ambiguity_resolution_frequency = -1;
266 static int hf_docsis_mdd_rpc_center_frequency_spacing = -1;
267 static int hf_docsis_mdd_verbose_rcp_reporting = -1;
269 static int hf_docsis_mdd_ip_provisioning_mode = -1;
270 static int hf_docsis_mdd_pre_registration_dsid = -1;
272 static int hf_docsis_mdd_early_authentication_and_encryption = -1;
274 static int hf_docsis_mdd_upstream_active_channel_list_upstream_channel_id = -1;
276 static int hf_docsis_mdd_upstream_ambiguity_resolution_channel_list_channel_id = -1;
278 static int hf_docsis_mdd_upstream_frequency_range = -1;
280 static int hf_docsis_mdd_symbol_clock_locking_indicator = -1;
282 static int hf_docsis_mdd_event_type = -1;
284 static int hf_docsis_mdd_maximum_event_holdoff_timer = -1;
286 static int hf_docsis_mdd_maximum_number_of_reports_per_event = -1;
287 static int hf_docsis_mdd_upstream_transmit_power_reporting = -1;
289 static int hf_docsis_mdd_dsg_da_to_dsid_association_da = -1;
290 static int hf_docsis_mdd_dsg_da_to_dsid_association_dsid = -1;
292 static int hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_sequence_out_of_range = -1;
293 static int hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_operating_on_battery_backup = -1;
294 static int hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_returned_to_ac_power = -1;
297 /* Initialize the subtree pointers */
298 static gint ett_docsis_mdd = -1;
299 static gint ett_tlv = -1;
300 static gint ett_sub_tlv = -1;
303 dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
306 proto_tree *mdd_tree;
312 guint8 subtype, sublength;
315 proto_item *tlv_item;
316 proto_tree *tlv_tree;
318 proto_item *tlv_sub_item;
319 proto_tree *tlv_sub_tree;
320 proto_item *text_item;
323 len = tvb_reported_length_remaining (tvb, 0);
325 col_set_str(pinfo->cinfo, COL_INFO, "MDD Message:");
329 it = proto_tree_add_protocol_format (tree, proto_docsis_mdd, tvb, 0, -1,"MDD Message");
330 mdd_tree = proto_item_add_subtree (it, ett_docsis_mdd);
332 proto_tree_add_item (mdd_tree, hf_docsis_mdd_ccc, tvb, 0, 1, FALSE);
333 proto_tree_add_item (mdd_tree, hf_docsis_mdd_number_of_fragments, tvb, 1, 1, FALSE);
334 proto_tree_add_item (mdd_tree, hf_docsis_mdd_fragment_sequence_number, tvb, 2, 1, FALSE);
335 proto_tree_add_item (mdd_tree, hf_docsis_mdd_current_channel_dcid, tvb, 3, 1, FALSE);
341 type = tvb_get_guint8 (tvb, pos);
342 length = tvb_get_guint8 (tvb, pos + 1);
343 tlv_item = proto_tree_add_text (mdd_tree, tvb, pos, length + 2,"%s", val_to_str(type, mdd_tlv_vals, "Unknown TLV (%u)"));
344 tlv_tree = proto_item_add_subtree (tlv_item, ett_tlv);
348 case DOWNSTREAM_ACTIVE_CHANNEL_LIST:
350 while (subpos < pos + length + 2) {
351 subtype = tvb_get_guint8 (tvb, subpos);
352 sublength = tvb_get_guint8 (tvb, subpos + 1);
354 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_CHANNEL_ID:
355 proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_active_channel_list_channel_id, tvb, subpos + 2 , 1, FALSE);
357 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_FREQUENCY:
358 proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_active_channel_list_frequency, tvb, subpos + 2 , 4, FALSE);
360 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_MODULATION_ORDER_ANNEX:
361 tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos + 2, 1, "Modulation Order/Annex");
362 tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv);
363 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_downstream_active_channel_list_modulation_order, tvb, subpos + 2 , 1, FALSE);
364 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_downstream_active_channel_list_annex, tvb, subpos + 2 , 1, FALSE);
366 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_PRIMARY_CAPABLE:
367 proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_active_channel_list_primary_capable, tvb, subpos + 2 , 1, FALSE);
369 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK:
370 tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos + 2, 2, "CM-STATUS Event Enable Bitmask");
371 tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv);
372 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_timeout, tvb, subpos + 2 , 2,FALSE);
373 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_failure, tvb, subpos + 2 , 2, FALSE);
374 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_recovery, tvb, subpos + 2 , 2,FALSE);
375 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_recovery, tvb, subpos + 2 , 2, FALSE);
378 subpos += sublength + 2;
381 case MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP:
383 while (subpos < pos + length + 2) {
384 subtype = tvb_get_guint8 (tvb, subpos);
385 sublength = tvb_get_guint8 (tvb, subpos + 1);
387 case MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP_MD_DS_SG_IDENTIFIER:
388 proto_tree_add_item (tlv_tree, hf_docsis_mdd_mac_domain_downstream_service_group_md_ds_sg_identifier, tvb, subpos + 2 , 1, FALSE);
390 case MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP_CHANNEL_IDS:
391 for (i = 0; i < sublength; i++) {
392 proto_tree_add_item (tlv_tree, hf_docsis_mdd_mac_domain_downstream_service_group_channel_id, tvb, subpos + 2 + i , 1, FALSE);
396 subpos += sublength + 2;
399 case DOWNSTREAM_AMBIGUITY_RESOLUTION_FREQUENCY_LIST:
401 for (i = 0; i < length; i+=4) {
402 proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_ambiguity_resolution_frequency, tvb, subpos + i , 4, FALSE);
405 case RECEIVE_CHANNEL_PROFILE_REPORTING_CONTROL:
407 while (subpos < pos + length + 2) {
408 subtype = tvb_get_guint8 (tvb, subpos);
409 sublength = tvb_get_guint8 (tvb, subpos + 1);
411 case RCP_CENTER_FREQUENCY_SPACING:
412 proto_tree_add_item (tlv_tree, hf_docsis_mdd_rpc_center_frequency_spacing, tvb, subpos + 2 , 1, FALSE);
414 case VERBOSE_RCP_REPORTING:
415 proto_tree_add_item (tlv_tree, hf_docsis_mdd_verbose_rcp_reporting, tvb, subpos + 2 , 1, FALSE);
418 subpos += sublength + 2;
421 case IP_INITIALIZATION_PARAMETERS:
423 while (subpos < pos + length + 2) {
424 subtype = tvb_get_guint8 (tvb, subpos);
425 sublength = tvb_get_guint8 (tvb, subpos + 1);
427 case IP_PROVISIONING_MODE:
428 proto_tree_add_item (tlv_tree, hf_docsis_mdd_ip_provisioning_mode, tvb, subpos + 2 , 1, FALSE);
430 case PRE_REGISTRATION_DSID:
431 proto_tree_add_item (tlv_tree, hf_docsis_mdd_pre_registration_dsid, tvb, subpos + 2 , 3, FALSE);
434 subpos += sublength + 2;
437 case EARLY_AUTHENTICATION_AND_ENCRYPTION:
439 proto_tree_add_item (tlv_tree, hf_docsis_mdd_early_authentication_and_encryption, tvb, subpos, 1, FALSE);
441 case UPSTREAM_ACTIVE_CHANNEL_LIST:
443 while (subpos < pos + length + 2) {
444 subtype = tvb_get_guint8 (tvb, subpos);
445 sublength = tvb_get_guint8 (tvb, subpos + 1);
447 case UPSTREAM_ACTIVE_CHANNEL_LIST_UPSTREAM_CHANNEL_ID:
448 proto_tree_add_item (tlv_tree, hf_docsis_mdd_upstream_active_channel_list_upstream_channel_id, tvb, subpos + 2 , 1, FALSE);
450 case UPSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK:
451 tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos + 2, 2, "CM-STATUS Event Enable Bitmask");
452 tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv);
453 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_t4_timeout, tvb, subpos + 2 , 2, FALSE);
454 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_t3_retries_exceeded, tvb, subpos + 2 , 2, FALSE);
455 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_successful_ranging_after_t3_retries_exceeded, tvb, subpos + 2 , 2, FALSE);
458 subpos += sublength + 2;
461 case UPSTREAM_AMBIGUITY_RESOLUTION_CHANNEL_LIST:
462 sublength = tvb_get_guint8 (tvb, subpos + 1);
463 for (i = 0; i < sublength; i++) {
464 proto_tree_add_item (tlv_tree, hf_docsis_mdd_upstream_ambiguity_resolution_channel_list_channel_id, tvb, pos + 2 + i , 1, FALSE);
467 case UPSTREAM_FREQUENCY_RANGE:
469 proto_tree_add_item (tlv_tree, hf_docsis_mdd_upstream_frequency_range, tvb, subpos, 1, FALSE);
471 case SYMBOL_CLOCK_LOCKING_INDICATOR:
473 proto_tree_add_item (tlv_tree, hf_docsis_mdd_symbol_clock_locking_indicator, tvb, subpos, 1, FALSE);
475 case CM_STATUS_EVENT_CONTROL:
477 while (subpos < pos + length + 2) {
478 subtype = tvb_get_guint8 (tvb, subpos);
479 sublength = tvb_get_guint8 (tvb, subpos + 1);
481 case EVENT_TYPE_CODE:
482 proto_tree_add_item (tlv_tree, hf_docsis_mdd_event_type, tvb, subpos+2, 1, FALSE);
484 case MAXIMUM_EVENT_HOLDOFF_TIMER:
485 text_item = proto_tree_add_item (tlv_tree, hf_docsis_mdd_maximum_event_holdoff_timer, tvb, subpos, 2, FALSE);
486 proto_item_append_text(text_item, " (%d ms)", (256*tvb_get_guint8 (tvb, subpos) + tvb_get_guint8 (tvb, subpos + 1)) * 20);
488 case MAXIMUM_NUMBER_OF_REPORTS_PER_EVENT:
489 text_item = proto_tree_add_item (tlv_tree, hf_docsis_mdd_maximum_number_of_reports_per_event, tvb, subpos, 1, FALSE);
490 if ( tvb_get_guint8 (tvb, subpos) == 0) {
491 proto_item_append_text(text_item, " (Unlimited)");
495 subpos += sublength + 2;
498 case UPSTREAM_TRANSMIT_POWER_REPORTING:
500 proto_tree_add_item (tlv_tree, hf_docsis_mdd_upstream_transmit_power_reporting, tvb, subpos, 1, FALSE);
502 case DSG_DA_TO_DSID_ASSOCIATION_ENTRY:
504 while (subpos < pos + length + 2) {
505 subtype = tvb_get_guint8 (tvb, subpos);
506 sublength = tvb_get_guint8 (tvb, subpos + 1);
508 case DSG_DA_TO_DSID_ASSOCIATION_DA:
509 proto_tree_add_item (tlv_tree, hf_docsis_mdd_dsg_da_to_dsid_association_da, tvb, subpos, 6, FALSE);
511 case DSG_DA_TO_DSID_ASSOCIATION_DSID:
512 proto_tree_add_item (tlv_tree, hf_docsis_mdd_dsg_da_to_dsid_association_dsid, tvb, subpos, 3, FALSE);
515 subpos += sublength + 2;
518 case CM_STATUS_EVENT_ENABLE_NON_CHANNEL_SPECIFIC_EVENTS:
520 proto_tree_add_item (tlv_tree, hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_sequence_out_of_range, tvb, subpos + 2 , 2,FALSE);
521 proto_tree_add_item (tlv_tree, hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_operating_on_battery_backup, tvb, subpos + 2 , 2,FALSE);
522 proto_tree_add_item (tlv_tree, hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_returned_to_ac_power, tvb, subpos + 2 , 2,FALSE);
533 /* Register the protocol with Wireshark */
535 /* this format is require because a script is used to build the C function
536 that calls all the protocol registration.
540 void proto_register_docsis_mdd (void)
542 /* Setup list of header fields See Section 1.6.1 for details*/
543 static hf_register_info hf[] = {
545 {"Map Message", "docsis_mdd",
546 FT_BYTES, BASE_NONE, NULL, 0x0,
550 {"Configuration Change Count", "docsis_mdd.ccc",
551 FT_UINT8, BASE_DEC, NULL, 0x0,
552 "Mdd Configuration Change Count", HFILL}
554 {&hf_docsis_mdd_number_of_fragments,
555 {"Number of Fragments", "docsis_mdd.number_of_fragments",
556 FT_UINT8, BASE_DEC, NULL, 0x0,
557 "Mdd Number of Fragments", HFILL}
559 {&hf_docsis_mdd_fragment_sequence_number,
560 {"Fragment Sequence Number", "docsis_mdd.fragment_sequence_number",
561 FT_UINT8, BASE_DEC, NULL, 0x0,
562 "Mdd Fragment Sequence Number", HFILL}
564 {&hf_docsis_mdd_current_channel_dcid,
565 {"Current Channel DCID", "docsis_mdd.current_channel_dcid",
566 FT_UINT8, BASE_DEC, NULL, 0x0,
567 "Mdd Current Channel DCID", HFILL}
569 {&hf_docsis_mdd_downstream_active_channel_list_channel_id,
570 {"Channel ID", "docsis_mdd.downstream_active_channel_list_channel_id",
571 FT_UINT8, BASE_DEC, NULL, 0x0,
572 "Mdd Downstream Active Channel List Channel ID", HFILL}
574 {&hf_docsis_mdd_downstream_active_channel_list_frequency,
575 {"Frequency", "docsis_mdd.downstream_active_channel_list_frequency",
576 FT_UINT32, BASE_DEC, NULL, 0x0,
577 "Mdd Downstream Active Channel List Frequency", HFILL}
579 {&hf_docsis_mdd_downstream_active_channel_list_annex,
580 {"Annex", "docsis_mdd.downstream_active_channel_list_annex",
581 FT_UINT8, BASE_DEC, VALS(J83_annex_vals), 0xF0,
582 "Mdd Downstream Active Channel List Annex", HFILL}
584 {&hf_docsis_mdd_downstream_active_channel_list_modulation_order,
585 {"Modulation Order", "docsis_mdd.downstream_active_channel_list_modulation_order",
586 FT_UINT8, BASE_DEC, VALS(modulation_order_vals), 0x0F,
587 "Mdd Downstream Active Channel List Modulation Order", HFILL}
589 {&hf_docsis_mdd_downstream_active_channel_list_primary_capable,
590 {"Primary Capable", "docsis_mdd.downstream_active_channel_list_primary_capable",
591 FT_UINT8, BASE_DEC, VALS(primary_capable_vals), 0x0,
592 "Mdd Downstream Active Channel List Primary Capable", HFILL}
594 {&hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_timeout,
595 {"MDD Timeout", "docsis_mdd.downstream_active_channel_list_mdd_timeout",
596 FT_UINT16, BASE_DEC, NULL, 0x0002,
597 "Mdd Downstream Active Channel List MDD Timeout", HFILL}
599 {&hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_failure,
600 {"QAM/FEC Lock Failure", "docsis_mdd.cm_status_event_enable_bitmask_qam_fec_lock_failure",
601 FT_UINT16, BASE_DEC, NULL, 0x0004,
602 "Mdd Downstream Active Channel List QAM/FEC Lock Failure", HFILL}
604 {&hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_recovery,
605 {"MDD Recovery", "docsis_mdd.cm_status_event_enable_bitmask_mdd_recovery",
606 FT_UINT16, BASE_DEC, NULL, 0x0010,
607 "CM-STATUS event MDD Recovery", HFILL}
609 {&hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_recovery,
610 {"QAM/FEC Lock Recovery", "docsis_mdd.cm_status_event_enable_bitmask_qam_fec_lock_recovery",
611 FT_UINT16, BASE_DEC, NULL, 0x0020,
612 "CM-STATUS event QAM/FEC Lock Recovery", HFILL}
614 {&hf_docsis_mdd_cm_status_event_enable_bitmask_t4_timeout,
615 {"T4 timeout", "docsis_mdd.cm_status_event_enable_bitmask_t4_timeout",
616 FT_UINT16, BASE_DEC, NULL, 0x0040,
617 "CM-STATUS event T4 timeout", HFILL}
619 {&hf_docsis_mdd_cm_status_event_enable_bitmask_t3_retries_exceeded,
620 {"T3 Retries Exceeded", "docsis_mdd.cm_status_event_enable_bitmask_t3_retries_exceeded",
621 FT_UINT16, BASE_DEC, NULL, 0x0080,
622 "CM-STATUS event T3 Retries Exceeded", HFILL}
624 {&hf_docsis_mdd_cm_status_event_enable_bitmask_successful_ranging_after_t3_retries_exceeded,
625 {"Successful Ranging after T3 Retries Exceeded", "docsis_mdd.cm_status_event_enable_bitmask_successful_ranging_after_t3_retries_exceeded",
626 FT_UINT16, BASE_DEC, NULL, 0x0100,
627 "CM-STATUS event Successful Ranging after T3 Retries Exceeded", HFILL}
629 {&hf_docsis_mdd_mac_domain_downstream_service_group_channel_id,
630 {"Channel Id", "docsis_mdd.mac_domain_downstream_service_group_channel_id",
631 FT_UINT8, BASE_DEC, NULL, 0x0,
632 "Mdd Mac Domain Downstream Service Group Channel Id", HFILL}
634 {&hf_docsis_mdd_mac_domain_downstream_service_group_md_ds_sg_identifier,
635 {"MD-DS-SG Identifier", "docsis_mdd.mac_domain_downstream_service_group_md_ds_sg_identifier",
636 FT_UINT8, BASE_DEC, NULL, 0x0,
637 "Mdd Mac Domain Downstream Service Group MD-DS-SG Identifier", HFILL}
639 {&hf_docsis_mdd_downstream_ambiguity_resolution_frequency,
640 {"Frequency", "docsis_mdd.downstream_ambiguity_resolution_frequency",
641 FT_UINT32, BASE_DEC, NULL, 0x0,
642 "Mdd Downstream Ambiguity Resolution frequency", HFILL}
644 {&hf_docsis_mdd_rpc_center_frequency_spacing,
645 {"RPC Center Frequency Spacing", "docsis_mdd.rpc_center_frequency_spacing",
646 FT_UINT8, BASE_DEC, VALS(rpc_center_frequency_spacing_vals), 0x0,
647 "Mdd RPC Center Frequency Spacing", HFILL}
649 {&hf_docsis_mdd_verbose_rcp_reporting,
650 {"Verbose RCP reporting", "docsis_mdd.verbose_rpc_reporting",
651 FT_UINT8, BASE_DEC, VALS(verbose_rpc_reporting_vals), 0x0,
652 "Mdd Verbose RPC Reporting", HFILL}
654 {&hf_docsis_mdd_ip_provisioning_mode,
655 {"IP Provisioning Mode", "docsis_mdd.ip_provisioning_mode",
656 FT_UINT8, BASE_DEC, VALS(ip_provisioning_mode_vals), 0x0,
657 "Mdd IP Provisioning Mode", HFILL}
659 {&hf_docsis_mdd_pre_registration_dsid,
660 {"Pre-registration DSID", "docsis_mdd.pre_registration_dsid",
661 FT_UINT24, BASE_DEC, NULL, 0x0FFFFF,
662 "Mdd Pre-registration DSID", HFILL}
664 {&hf_docsis_mdd_early_authentication_and_encryption,
665 {"Early Authentication and Encryption", "docsis_mdd.early_authentication_and_encryption",
666 FT_UINT8, BASE_DEC, VALS(eae_vals), 0x0,
667 "Mdd Early Authentication and Encryption", HFILL}
669 {&hf_docsis_mdd_upstream_active_channel_list_upstream_channel_id,
670 {"Upstream Channel Id", "docsis_mdd.upstream_active_channel_list_upstream_channel_id",
671 FT_UINT8, BASE_DEC, NULL, 0x0,
672 "Mdd Upstream Active Channel List Upstream Channel Id", HFILL}
674 {&hf_docsis_mdd_upstream_ambiguity_resolution_channel_list_channel_id,
675 {"Channel Id", "docsis_mdd.upstream_ambiguity_resolution_channel_list_channel_id",
676 FT_UINT8, BASE_DEC, NULL, 0x0,
677 "Mdd Mac Domain Upstream Ambiguity Resolution Channel List Channel Id", HFILL}
679 {&hf_docsis_mdd_upstream_frequency_range,
680 {"Upstream Frequency Range", "docsis_mdd.upstream_frequency_range",
681 FT_UINT8, BASE_DEC, VALS(upstream_frequency_range_vals), 0x0,
682 "Mdd Upstream Frequency Range", HFILL}
684 {&hf_docsis_mdd_symbol_clock_locking_indicator,
685 {"Symbol Clock Locking Indicator", "docsis_mdd.symbol_clock_locking_indicator",
686 FT_UINT8, BASE_DEC, VALS(symbol_clock_locking_indicator_vals), 0x0,
687 "Mdd Symbol Clock Locking Indicator", HFILL}
689 {&hf_docsis_mdd_event_type,
690 {"Event Type", "docsis_mdd.event_type",
691 FT_UINT8, BASE_DEC, VALS(symbol_cm_status_event_vals), 0x0,
692 "Mdd CM-STATUS Event Type", HFILL}
694 {&hf_docsis_mdd_maximum_event_holdoff_timer,
695 {"Maximum Event Holdoff Timer (units of 20 ms)", "docsis_mdd.maximum_event_holdoff_timer",
696 FT_UINT16, BASE_DEC, NULL, 0x0,
697 "Mdd Maximum Event Holdoff Timer", HFILL}
699 {&hf_docsis_mdd_maximum_number_of_reports_per_event,
700 {"Maximum Number of Reports per Event", "docsis_mdd.maximum_number_of_reports_per_event",
701 FT_UINT8, BASE_DEC, NULL, 0x0,
702 "Mdd Maximum Number of Reports per Event", HFILL}
704 {&hf_docsis_mdd_upstream_transmit_power_reporting,
705 {"Upstream Transmit Power Reporting", "docsis_mdd.upstream_transmit_power_reporting",
706 FT_UINT8, BASE_DEC, VALS(upstream_transmit_power_reporting_vals), 0x0,
707 "Mdd Upstream Transmit Power Reporting", HFILL}
709 {&hf_docsis_mdd_dsg_da_to_dsid_association_da,
710 {"Destination Address", "docsis_mdd.dsg_da_to_dsid_association_da",
711 FT_UINT8, BASE_HEX, NULL, 0x0,
712 "Mdd DSG DA to DSID association Destination Address", HFILL}
714 {&hf_docsis_mdd_dsg_da_to_dsid_association_dsid,
715 {"DSID", "docsis_mdd.dsg_da_to_dsid_association_dsid",
716 FT_UINT24, BASE_DEC, NULL, 0x0FFFFF,
717 "Mdd Mdd DSG DA to DSID association DSID", HFILL}
719 {&hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_sequence_out_of_range,
720 {"Sequence out of range", "docsis_mdd.cm_status_event_enable_non_channel_specific_events_sequence_out_of_range",
721 FT_UINT16, BASE_DEC, NULL, 0x0008,
722 "CM-STATUS event non-channel-event Sequence out of range", HFILL}
724 {&hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_operating_on_battery_backup,
725 {"CM operating on battery backup", "docsis_mdd.cm_status_event_enable_non_channel_specific_events_cm_operating_on_battery_backup",
726 FT_UINT16, BASE_DEC, NULL, 0x0200,
727 "CM-STATUS event non-channel-event Cm operating on battery backup", HFILL}
729 {&hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_returned_to_ac_power,
730 {"Returned to AC power", "docsis_mdd.cm_status_event_enable_non_channel_specific_events_cm_returned_to_ac_power",
731 FT_UINT16, BASE_DEC, NULL, 0x0400,
732 "CM-STATUS event non-channel-event Cm returned to AC power", HFILL}
736 /* Setup protocol subtree array */
737 static gint *ett[] = {
743 /* Register the protocol name and description */
745 proto_register_protocol ("DOCSIS Mac Domain Description",
746 "DOCSIS Mdd", "docsis_mdd");
748 /* Required function calls to register the header fields and subtrees used */
749 proto_register_field_array (proto_docsis_mdd, hf, array_length (hf));
750 proto_register_subtree_array (ett, array_length (ett));
752 register_dissector ("docsis_mdd", dissect_mdd, proto_docsis_mdd);
756 /* If this dissector uses sub-dissector registration add a registration routine.
757 This format is required because a script is used to find these routines and
758 create the code that calls these routines.
761 proto_reg_handoff_docsis_mdd (void)
763 dissector_handle_t docsis_mdd_handle;
765 docsis_mdd_handle = find_dissector ("docsis_mdd");
766 dissector_add ("docsis_mgmt", 33, docsis_mdd_handle);