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.
34 #include <epan/packet.h>
37 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST 1
38 #define MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP 2
39 #define DOWNSTREAM_AMBIGUITY_RESOLUTION_FREQUENCY_LIST 3
40 #define RECEIVE_CHANNEL_PROFILE_REPORTING_CONTROL 4
41 #define IP_INITIALIZATION_PARAMETERS 5
42 #define EARLY_AUTHENTICATION_AND_ENCRYPTION 6
43 #define UPSTREAM_ACTIVE_CHANNEL_LIST 7
44 #define UPSTREAM_AMBIGUITY_RESOLUTION_CHANNEL_LIST 8
45 #define UPSTREAM_FREQUENCY_RANGE 9
46 #define SYMBOL_CLOCK_LOCKING_INDICATOR 10
47 #define CM_STATUS_EVENT_CONTROL 11
48 #define UPSTREAM_TRANSMIT_POWER_REPORTING 12
49 #define DSG_DA_TO_DSID_ASSOCIATION_ENTRY 13
50 #define CM_STATUS_EVENT_ENABLE_NON_CHANNEL_SPECIFIC_EVENTS 15
52 /*Downstream Active Channel List*/
53 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_CHANNEL_ID 1
54 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_FREQUENCY 2
55 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_MODULATION_ORDER_ANNEX 3
56 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_PRIMARY_CAPABLE 4
57 #define DOWNSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK 5
59 /*Mac Domain Downstream Service Group*/
60 #define MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP_MD_DS_SG_IDENTIFIER 1
61 #define MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP_CHANNEL_IDS 2
73 #define NOT_PRIMARY_CAPABLE 0
74 #define PRIMARY_CAPABLE 1
76 /*Receive Channel Profile Reporting Control*/
77 #define RCP_CENTER_FREQUENCY_SPACING 1
78 #define VERBOSE_RCP_REPORTING 2
81 #define ASSUME_6MHZ_CENTER_FREQUENCY_SPACING 0
82 #define ASSUME_8MHZ_CENTER_FREQUENCY_SPACING 1
84 /*Verbose RCP reporting*/
85 #define RCP_NO_VERBOSE_REPORTING 0
86 #define RCP_VERBOSE_REPORTING 1
88 /*Sub-TLVs for IP Initialization Parameters*/
89 #define IP_PROVISIONING_MODE 1
90 #define PRE_REGISTRATION_DSID 2
92 /*IP Provisioning Modes*/
95 #define IP_ALTERNATE 2
98 /*Early authentication and encryption*/
99 #define EAE_DISABLED 0
100 #define EAE_ENABLED 1
102 /*Upstream Active Channel List*/
103 #define UPSTREAM_ACTIVE_CHANNEL_LIST_UPSTREAM_CHANNEL_ID 1
104 #define UPSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK 2
106 /*Upstream Frequency Range*/
107 #define STANDARD_UPSTREAM_FREQUENCY_RANGE 0
108 #define EXTENDED_UPSTREAM_FREQUENCY_RANGE 1
110 /*Symbol Clock Locking Indicator*/
111 #define NOT_LOCKED_TO_MASTER_CLOCK 0
112 #define LOCKED_TO_MASTER_CLOCK 1
114 /*CM-STATUS Event Control */
115 #define EVENT_TYPE_CODE 1
116 #define MAXIMUM_EVENT_HOLDOFF_TIMER 2
117 #define MAXIMUM_NUMBER_OF_REPORTS_PER_EVENT 3
120 #define SECONDARY_CHANNEL_MDD_TIMEOUT 1
121 #define QAM_FEC_LOCK_FAILURE 2
122 #define SEQUENCE_OUT_OF_RANGE 3
123 #define MDD_RECOVERY 4
124 #define QAM_FEC_LOCK_RECOVERY 5
126 #define T3_RETRIES_EXCEEDED 7
127 #define SUCCESFUL_RANGING_AFTER_T3_RETRIES_EXCEEDED 8
128 #define CM_OPERATING_ON_BATTERY_BACKUP 9
129 #define CM_RETURNED_TO_AC_POWER 10
131 /*Upstream Transmit Power Reporting*/
132 #define CM_DOESNT_REPORT_TRANSMIT_POWER 0
133 #define CM_REPORTS_TRANSMIT_POWER 1
136 /*Dsg DA to DSID association entry*/
137 #define DSG_DA_TO_DSID_ASSOCIATION_DA 1
138 #define DSG_DA_TO_DSID_ASSOCIATION_DSID 2
143 static const value_string J83_annex_vals[] = {
144 {J83_ANNEX_A, "J.83 Annex A"},
145 {J83_ANNEX_B, "J.83 Annex B"},
146 {J83_ANNEX_C, "J.83 Annex C"},
151 static const value_string modulation_order_vals[] = {
157 static const value_string primary_capable_vals[] = {
158 {NOT_PRIMARY_CAPABLE, "Channel is not primary-capable"},
159 {PRIMARY_CAPABLE, "channel is primary-capable"},
164 static const value_string mdd_tlv_vals[] = {
165 {DOWNSTREAM_ACTIVE_CHANNEL_LIST, "Downstream Active Channel List"},
166 {MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP, "Mac Domain Downstream Service Group"},
167 {DOWNSTREAM_AMBIGUITY_RESOLUTION_FREQUENCY_LIST, "Downstream Ambiguity Resolution Frequency List "},
168 {RECEIVE_CHANNEL_PROFILE_REPORTING_CONTROL , "Receive Channel Profile Reporting Control"},
169 {IP_INITIALIZATION_PARAMETERS , "IP Initialization Parameters"},
170 {EARLY_AUTHENTICATION_AND_ENCRYPTION , "Early Authentication and Encryption"},
171 {UPSTREAM_ACTIVE_CHANNEL_LIST , "Upstream Active Channel List"},
172 {UPSTREAM_AMBIGUITY_RESOLUTION_CHANNEL_LIST , "Upstream Ambiguity Resolution Channel List"},
173 {UPSTREAM_FREQUENCY_RANGE , "Upstream Frequency Range"},
174 {SYMBOL_CLOCK_LOCKING_INDICATOR , "Symbol Clock Locking Indicator"},
175 {CM_STATUS_EVENT_CONTROL , "CM-STATUS Event Control"},
176 {UPSTREAM_TRANSMIT_POWER_REPORTING , "Upstream Transmit Power Reporting"},
177 {DSG_DA_TO_DSID_ASSOCIATION_ENTRY , "DSG DA-to-DSID Association Entry"},
182 static const value_string rpc_center_frequency_spacing_vals[] = {
183 {ASSUME_6MHZ_CENTER_FREQUENCY_SPACING , "CM MUST report only Receive Channel Profiles assuming 6 MHz center frequency spacing"},
184 {ASSUME_8MHZ_CENTER_FREQUENCY_SPACING , "CM MUST report only Receive Channel Profiles assuming 8 MHz center frequency spacing"},
188 static const value_string verbose_rpc_reporting_vals[] = {
189 {RCP_NO_VERBOSE_REPORTING , "CM MUST NOT provide verbose reporting of all its Receive Channel Profile(s) (both standard profiles and manufacturers profiles)."},
190 {RCP_VERBOSE_REPORTING , "CM MUST provide verbose reporting of Receive Channel Profile(s) (both standard profiles and manufacturers profiles)."},
194 static const value_string ip_provisioning_mode_vals[] = {
195 {IPv4_ONLY , "IPv4 Only"},
196 {IPv6_ONLY , "IPv6 Only"},
197 {IP_ALTERNATE, "Alternate"},
198 {DUAL_STACK , "Dual Stack"},
202 static const value_string eae_vals[] = {
203 {EAE_DISABLED , "early authentication and encryption disabled"},
204 {EAE_ENABLED , "early authentication and encryption enabled"},
208 static const value_string upstream_frequency_range_vals[] = {
209 {STANDARD_UPSTREAM_FREQUENCY_RANGE, "Standard Upstream Frequency Range"},
210 {EXTENDED_UPSTREAM_FREQUENCY_RANGE, "Extended Upstream Frequency Range"},
214 static const value_string symbol_clock_locking_indicator_vals[] = {
215 {NOT_LOCKED_TO_MASTER_CLOCK, "Symbol Clock is not locked to Master Clock"},
216 {LOCKED_TO_MASTER_CLOCK, "Symbol Clock is locked to Master Clock"},
220 static const value_string symbol_cm_status_event_vals[] = {
221 {SECONDARY_CHANNEL_MDD_TIMEOUT, "Secondary Channel MDD timeout"},
222 {QAM_FEC_LOCK_FAILURE, "Qam FEC Lock Failure"},
223 {SEQUENCE_OUT_OF_RANGE, "Sequence out of Range"},
224 {MDD_RECOVERY, "MDD Recovery"},
225 {QAM_FEC_LOCK_RECOVERY, "Qam FEC Lock Recovery"},
226 {T4_TIMEOUT, "T4 Timeout"},
227 {T3_RETRIES_EXCEEDED, "T3 Retries Exceeded"},
228 {SUCCESFUL_RANGING_AFTER_T3_RETRIES_EXCEEDED, "Successful ranging after T3 Retries Exceeded"},
229 {CM_OPERATING_ON_BATTERY_BACKUP, "CM Operating on Battery Backup"},
230 {CM_RETURNED_TO_AC_POWER, "CM Returned to AC Power"},
234 static const value_string upstream_transmit_power_reporting_vals[] = {
235 {CM_DOESNT_REPORT_TRANSMIT_POWER, "CM does not report transmit power in RNG-REQ, INIT-RNG-REQ, and B-INIT-RNG-REQ messages"},
236 {CM_REPORTS_TRANSMIT_POWER, "CM reports transmit power in RNG-REQ, INIT-RNG-REQ, and B-INIT-RNG-REQ messages"},
242 /* Initialize the protocol and registered fields */
243 static int proto_docsis_mdd = -1;
244 static int hf_docsis_mdd = -1;
245 static int hf_docsis_mdd_ccc = -1;
246 static int hf_docsis_mdd_number_of_fragments = -1;
247 static int hf_docsis_mdd_fragment_sequence_number = -1;
248 static int hf_docsis_mdd_current_channel_dcid = -1;
250 static int hf_docsis_mdd_downstream_active_channel_list_channel_id = -1;
251 static int hf_docsis_mdd_downstream_active_channel_list_frequency = -1;
252 static int hf_docsis_mdd_downstream_active_channel_list_annex = -1;
253 static int hf_docsis_mdd_downstream_active_channel_list_modulation_order = -1;
254 static int hf_docsis_mdd_downstream_active_channel_list_primary_capable = -1;
256 static int hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_timeout = -1;
257 static int hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_failure = -1;
258 static int hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_recovery = -1;
259 static int hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_recovery = -1;
260 static int hf_docsis_mdd_cm_status_event_enable_bitmask_t4_timeout = -1;
261 static int hf_docsis_mdd_cm_status_event_enable_bitmask_t3_retries_exceeded = -1;
262 static int hf_docsis_mdd_cm_status_event_enable_bitmask_successful_ranging_after_t3_retries_exceeded = -1;
265 static int hf_docsis_mdd_mac_domain_downstream_service_group_md_ds_sg_identifier = -1;
266 static int hf_docsis_mdd_mac_domain_downstream_service_group_channel_id = -1;
268 static int hf_docsis_mdd_downstream_ambiguity_resolution_frequency = -1;
270 static int hf_docsis_mdd_rpc_center_frequency_spacing = -1;
271 static int hf_docsis_mdd_verbose_rcp_reporting = -1;
273 static int hf_docsis_mdd_ip_provisioning_mode = -1;
274 static int hf_docsis_mdd_pre_registration_dsid = -1;
276 static int hf_docsis_mdd_early_authentication_and_encryption = -1;
278 static int hf_docsis_mdd_upstream_active_channel_list_upstream_channel_id = -1;
280 static int hf_docsis_mdd_upstream_ambiguity_resolution_channel_list_channel_id = -1;
282 static int hf_docsis_mdd_upstream_frequency_range = -1;
284 static int hf_docsis_mdd_symbol_clock_locking_indicator = -1;
286 static int hf_docsis_mdd_event_type = -1;
288 static int hf_docsis_mdd_maximum_event_holdoff_timer = -1;
290 static int hf_docsis_mdd_maximum_number_of_reports_per_event = -1;
291 static int hf_docsis_mdd_upstream_transmit_power_reporting = -1;
293 static int hf_docsis_mdd_dsg_da_to_dsid_association_da = -1;
294 static int hf_docsis_mdd_dsg_da_to_dsid_association_dsid = -1;
296 static int hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_sequence_out_of_range = -1;
297 static int hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_operating_on_battery_backup = -1;
298 static int hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_returned_to_ac_power = -1;
301 /* Initialize the subtree pointers */
302 static gint ett_docsis_mdd = -1;
303 static gint ett_tlv = -1;
304 static gint ett_sub_tlv = -1;
307 dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
310 proto_tree *mdd_tree;
316 guint8 subtype, sublength;
319 proto_item *tlv_item;
320 proto_tree *tlv_tree;
322 proto_item *tlv_sub_item;
323 proto_tree *tlv_sub_tree;
324 proto_item *text_item;
327 len = tvb_reported_length_remaining (tvb, 0);
329 if (check_col (pinfo->cinfo, COL_INFO))
331 col_clear (pinfo->cinfo, COL_INFO);
332 col_add_fstr (pinfo->cinfo, COL_INFO, "MDD Message:");
337 it = proto_tree_add_protocol_format (tree, proto_docsis_mdd, tvb, 0, -1,"MDD Message");
338 mdd_tree = proto_item_add_subtree (it, ett_docsis_mdd);
340 proto_tree_add_item (mdd_tree, hf_docsis_mdd_ccc, tvb, 0, 1, FALSE);
341 proto_tree_add_item (mdd_tree, hf_docsis_mdd_number_of_fragments, tvb, 1, 1, FALSE);
342 proto_tree_add_item (mdd_tree, hf_docsis_mdd_fragment_sequence_number, tvb, 2, 1, FALSE);
343 proto_tree_add_item (mdd_tree, hf_docsis_mdd_current_channel_dcid, tvb, 3, 1, FALSE);
349 type = tvb_get_guint8 (tvb, pos);
350 length = tvb_get_guint8 (tvb, pos + 1);
351 tlv_item = proto_tree_add_text (mdd_tree, tvb, pos, length + 2,"%s", val_to_str(type, mdd_tlv_vals, "Unknown TLV (%u)"));
352 tlv_tree = proto_item_add_subtree (tlv_item, ett_tlv);
356 case DOWNSTREAM_ACTIVE_CHANNEL_LIST:
358 while (subpos < pos + length + 2) {
359 subtype = tvb_get_guint8 (tvb, subpos);
360 sublength = tvb_get_guint8 (tvb, subpos + 1);
362 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_CHANNEL_ID:
363 proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_active_channel_list_channel_id, tvb, subpos + 2 , 1, FALSE);
365 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_FREQUENCY:
366 proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_active_channel_list_frequency, tvb, subpos + 2 , 4, FALSE);
368 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_MODULATION_ORDER_ANNEX:
369 tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos + 2, 1, "Modulation Order/Annex");
370 tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv);
371 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_downstream_active_channel_list_modulation_order, tvb, subpos + 2 , 1, FALSE);
372 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_downstream_active_channel_list_annex, tvb, subpos + 2 , 1, FALSE);
374 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_PRIMARY_CAPABLE:
375 proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_active_channel_list_primary_capable, tvb, subpos + 2 , 1, FALSE);
377 case DOWNSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK:
378 tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos + 2, 2, "CM-STATUS Event Enable Bitmask");
379 tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv);
380 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_timeout, tvb, subpos + 2 , 2,FALSE);
381 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_failure, tvb, subpos + 2 , 2, FALSE);
382 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_recovery, tvb, subpos + 2 , 2,FALSE);
383 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_recovery, tvb, subpos + 2 , 2, FALSE);
386 subpos += sublength + 2;
389 case MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP:
391 while (subpos < pos + length + 2) {
392 subtype = tvb_get_guint8 (tvb, subpos);
393 sublength = tvb_get_guint8 (tvb, subpos + 1);
395 case MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP_MD_DS_SG_IDENTIFIER:
396 proto_tree_add_item (tlv_tree, hf_docsis_mdd_mac_domain_downstream_service_group_md_ds_sg_identifier, tvb, subpos + 2 , 1, FALSE);
398 case MAC_DOMAIN_DOWNSTREAM_SERVICE_GROUP_CHANNEL_IDS:
399 for (i = 0; i < sublength; i++) {
400 proto_tree_add_item (tlv_tree, hf_docsis_mdd_mac_domain_downstream_service_group_channel_id, tvb, subpos + 2 + i , 1, FALSE);
404 subpos += sublength + 2;
407 case DOWNSTREAM_AMBIGUITY_RESOLUTION_FREQUENCY_LIST:
409 for (i = 0; i < length; i+=4) {
410 proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_ambiguity_resolution_frequency, tvb, subpos + i , 4, FALSE);
413 case RECEIVE_CHANNEL_PROFILE_REPORTING_CONTROL:
415 while (subpos < pos + length + 2) {
416 subtype = tvb_get_guint8 (tvb, subpos);
417 sublength = tvb_get_guint8 (tvb, subpos + 1);
419 case RCP_CENTER_FREQUENCY_SPACING:
420 proto_tree_add_item (tlv_tree, hf_docsis_mdd_rpc_center_frequency_spacing, tvb, subpos + 2 , 1, FALSE);
422 case VERBOSE_RCP_REPORTING:
423 proto_tree_add_item (tlv_tree, hf_docsis_mdd_verbose_rcp_reporting, tvb, subpos + 2 , 1, FALSE);
426 subpos += sublength + 2;
429 case IP_INITIALIZATION_PARAMETERS:
431 while (subpos < pos + length + 2) {
432 subtype = tvb_get_guint8 (tvb, subpos);
433 sublength = tvb_get_guint8 (tvb, subpos + 1);
435 case IP_PROVISIONING_MODE:
436 proto_tree_add_item (tlv_tree, hf_docsis_mdd_ip_provisioning_mode, tvb, subpos + 2 , 1, FALSE);
438 case PRE_REGISTRATION_DSID:
439 proto_tree_add_item (tlv_tree, hf_docsis_mdd_pre_registration_dsid, tvb, subpos + 2 , 3, FALSE);
442 subpos += sublength + 2;
445 case EARLY_AUTHENTICATION_AND_ENCRYPTION:
447 proto_tree_add_item (tlv_tree, hf_docsis_mdd_early_authentication_and_encryption, tvb, subpos, 1, FALSE);
449 case UPSTREAM_ACTIVE_CHANNEL_LIST:
451 while (subpos < pos + length + 2) {
452 subtype = tvb_get_guint8 (tvb, subpos);
453 sublength = tvb_get_guint8 (tvb, subpos + 1);
455 case UPSTREAM_ACTIVE_CHANNEL_LIST_UPSTREAM_CHANNEL_ID:
456 proto_tree_add_item (tlv_tree, hf_docsis_mdd_upstream_active_channel_list_upstream_channel_id, tvb, subpos + 2 , 1, FALSE);
458 case UPSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK:
459 tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos + 2, 2, "CM-STATUS Event Enable Bitmask");
460 tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv);
461 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_t4_timeout, tvb, subpos + 2 , 2, FALSE);
462 proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_t3_retries_exceeded, tvb, subpos + 2 , 2, FALSE);
463 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);
466 subpos += sublength + 2;
469 case UPSTREAM_AMBIGUITY_RESOLUTION_CHANNEL_LIST:
470 sublength = tvb_get_guint8 (tvb, subpos + 1);
471 for (i = 0; i < sublength; i++) {
472 proto_tree_add_item (tlv_tree, hf_docsis_mdd_upstream_ambiguity_resolution_channel_list_channel_id, tvb, pos + 2 + i , 1, FALSE);
475 case UPSTREAM_FREQUENCY_RANGE:
477 proto_tree_add_item (tlv_tree, hf_docsis_mdd_upstream_frequency_range, tvb, subpos, 1, FALSE);
479 case SYMBOL_CLOCK_LOCKING_INDICATOR:
481 proto_tree_add_item (tlv_tree, hf_docsis_mdd_symbol_clock_locking_indicator, tvb, subpos, 1, FALSE);
483 case CM_STATUS_EVENT_CONTROL:
485 while (subpos < pos + length + 2) {
486 subtype = tvb_get_guint8 (tvb, subpos);
487 sublength = tvb_get_guint8 (tvb, subpos + 1);
489 case EVENT_TYPE_CODE:
490 proto_tree_add_item (tlv_tree, hf_docsis_mdd_event_type, tvb, subpos+2, 1, FALSE);
492 case MAXIMUM_EVENT_HOLDOFF_TIMER:
493 text_item = proto_tree_add_item (tlv_tree, hf_docsis_mdd_maximum_event_holdoff_timer, tvb, subpos, 2, FALSE);
494 proto_item_append_text(text_item, " (%d ms)", (256*tvb_get_guint8 (tvb, subpos) + tvb_get_guint8 (tvb, subpos + 1)) * 20);
496 case MAXIMUM_NUMBER_OF_REPORTS_PER_EVENT:
497 text_item = proto_tree_add_item (tlv_tree, hf_docsis_mdd_maximum_number_of_reports_per_event, tvb, subpos, 1, FALSE);
498 if ( tvb_get_guint8 (tvb, subpos) == 0) {
499 proto_item_append_text(text_item, " (Unlimited)");
503 subpos += sublength + 2;
506 case UPSTREAM_TRANSMIT_POWER_REPORTING:
508 proto_tree_add_item (tlv_tree, hf_docsis_mdd_upstream_transmit_power_reporting, tvb, subpos, 1, FALSE);
510 case DSG_DA_TO_DSID_ASSOCIATION_ENTRY:
512 while (subpos < pos + length + 2) {
513 subtype = tvb_get_guint8 (tvb, subpos);
514 sublength = tvb_get_guint8 (tvb, subpos + 1);
516 case DSG_DA_TO_DSID_ASSOCIATION_DA:
517 proto_tree_add_item (tlv_tree, hf_docsis_mdd_dsg_da_to_dsid_association_da, tvb, subpos, 6, FALSE);
519 case DSG_DA_TO_DSID_ASSOCIATION_DSID:
520 proto_tree_add_item (tlv_tree, hf_docsis_mdd_dsg_da_to_dsid_association_dsid, tvb, subpos, 3, FALSE);
523 subpos += sublength + 2;
526 case CM_STATUS_EVENT_ENABLE_NON_CHANNEL_SPECIFIC_EVENTS:
528 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);
529 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);
530 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);
541 /* Register the protocol with Wireshark */
543 /* this format is require because a script is used to build the C function
544 that calls all the protocol registration.
548 void proto_register_docsis_mdd (void)
550 /* Setup list of header fields See Section 1.6.1 for details*/
551 static hf_register_info hf[] = {
553 {"Map Message", "docsis_mdd",
554 FT_BYTES, BASE_NONE, NULL, 0x0,
555 "MAP Message", HFILL}
558 {"Configuration Change Count", "docsis_mdd.ccc",
559 FT_UINT8, BASE_DEC, NULL, 0x0,
560 "Mdd Configuration Change Count", HFILL}
562 {&hf_docsis_mdd_number_of_fragments,
563 {"Number of Fragments", "docsis_mdd.number_of_fragments",
564 FT_UINT8, BASE_DEC, NULL, 0x0,
565 "Mdd Number of Fragments", HFILL}
567 {&hf_docsis_mdd_fragment_sequence_number,
568 {"Fragment Sequence Number", "docsis_mdd.fragment_sequence_number",
569 FT_UINT8, BASE_DEC, NULL, 0x0,
570 "Mdd Fragment Sequence Number", HFILL}
572 {&hf_docsis_mdd_current_channel_dcid,
573 {"Current Channel DCID", "docsis_mdd.current_channel_dcid",
574 FT_UINT8, BASE_DEC, NULL, 0x0,
575 "Mdd Current Channel DCID", HFILL}
577 {&hf_docsis_mdd_downstream_active_channel_list_channel_id,
578 {"Channel ID", "docsis_mdd.downstream_active_channel_list_channel_id",
579 FT_UINT8, BASE_DEC, NULL, 0x0,
580 "Mdd Downstream Active Channel List Channel ID", HFILL}
582 {&hf_docsis_mdd_downstream_active_channel_list_frequency,
583 {"Frequency", "docsis_mdd.downstream_active_channel_list_frequency",
584 FT_UINT32, BASE_DEC, NULL, 0x0,
585 "Mdd Downstream Active Channel List Frequency", HFILL}
587 {&hf_docsis_mdd_downstream_active_channel_list_annex,
588 {"Annex", "docsis_mdd.downstream_active_channel_list_annex",
589 FT_UINT8, BASE_DEC, VALS(J83_annex_vals), 0xF0,
590 "Mdd Downstream Active Channel List Annex", HFILL}
592 {&hf_docsis_mdd_downstream_active_channel_list_modulation_order,
593 {"Modulation Order", "docsis_mdd.downstream_active_channel_list_modulation_order",
594 FT_UINT8, BASE_DEC, VALS(modulation_order_vals), 0x0F,
595 "Mdd Downstream Active Channel List Modulation Order", HFILL}
597 {&hf_docsis_mdd_downstream_active_channel_list_primary_capable,
598 {"Primary Capable", "docsis_mdd.downstream_active_channel_list_primary_capable",
599 FT_UINT8, BASE_DEC, VALS(primary_capable_vals), 0x0,
600 "Mdd Downstream Active Channel List Primary Capable", HFILL}
602 {&hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_timeout,
603 {"MDD Timeout", "docsis_mdd.downstream_active_channel_list_mdd_timeout",
604 FT_UINT16, BASE_DEC, NULL, 0x0002,
605 "Mdd Downstream Active Channel List MDD Timeout", HFILL}
607 {&hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_failure,
608 {"QAM/FEC Lock Failure", "docsis_mdd.cm_status_event_enable_bitmask_qam_fec_lock_failure",
609 FT_UINT16, BASE_DEC, NULL, 0x0004,
610 "Mdd Downstream Active Channel List QAM/FEC Lock Failure", HFILL}
612 {&hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_recovery,
613 {"MDD Recovery", "docsis_mdd.cm_status_event_enable_bitmask_mdd_recovery",
614 FT_UINT16, BASE_DEC, NULL, 0x0010,
615 "CM-STATUS event MDD Recovery", HFILL}
617 {&hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_recovery,
618 {"QAM/FEC Lock Recovery", "docsis_mdd.cm_status_event_enable_bitmask_qam_fec_lock_recovery",
619 FT_UINT16, BASE_DEC, NULL, 0x0020,
620 "CM-STATUS event QAM/FEC Lock Recovery", HFILL}
622 {&hf_docsis_mdd_cm_status_event_enable_bitmask_t4_timeout,
623 {"T4 timeout", "docsis_mdd.cm_status_event_enable_bitmask_t4_timeout",
624 FT_UINT16, BASE_DEC, NULL, 0x0040,
625 "CM-STATUS event T4 timeout", HFILL}
627 {&hf_docsis_mdd_cm_status_event_enable_bitmask_t3_retries_exceeded,
628 {"T3 Retries Exceeded", "docsis_mdd.cm_status_event_enable_bitmask_t3_retries_exceeded",
629 FT_UINT16, BASE_DEC, NULL, 0x0080,
630 "CM-STATUS event T3 Retries Exceeded", HFILL}
632 {&hf_docsis_mdd_cm_status_event_enable_bitmask_successful_ranging_after_t3_retries_exceeded,
633 {"Successful Ranging after T3 Retries Exceeded", "docsis_mdd.cm_status_event_enable_bitmask_successful_ranging_after_t3_retries_exceeded",
634 FT_UINT16, BASE_DEC, NULL, 0x0100,
635 "CM-STATUS event Successful Ranging after T3 Retries Exceeded", HFILL}
637 {&hf_docsis_mdd_mac_domain_downstream_service_group_channel_id,
638 {"Channel Id", "docsis_mdd.mac_domain_downstream_service_group_channel_id",
639 FT_UINT8, BASE_DEC, NULL, 0x0,
640 "Mdd Mac Domain Downstream Service Group Channel Id", HFILL}
642 {&hf_docsis_mdd_mac_domain_downstream_service_group_md_ds_sg_identifier,
643 {"MD-DS-SG Identifier", "docsis_mdd.mac_domain_downstream_service_group_md_ds_sg_identifier",
644 FT_UINT8, BASE_DEC, NULL, 0x0,
645 "Mdd Mac Domain Downstream Service Group MD-DS-SG Identifier", HFILL}
647 {&hf_docsis_mdd_downstream_ambiguity_resolution_frequency,
648 {"Frequency", "docsis_mdd.downstream_ambiguity_resolution_frequency",
649 FT_UINT32, BASE_DEC, NULL, 0x0,
650 "Mdd Downstream Ambiguity Resolution frequency", HFILL}
652 {&hf_docsis_mdd_rpc_center_frequency_spacing,
653 {"RPC Center Frequency Spacing", "docsis_mdd.rpc_center_frequency_spacing",
654 FT_UINT8, BASE_DEC, VALS(rpc_center_frequency_spacing_vals), 0x0,
655 "Mdd RPC Center Frequency Spacing", HFILL}
657 {&hf_docsis_mdd_verbose_rcp_reporting,
658 {"Verbose RCP reporting", "docsis_mdd.verbose_rpc_reporting",
659 FT_UINT8, BASE_DEC, VALS(verbose_rpc_reporting_vals), 0x0,
660 "Mdd Verbose RPC Reporting", HFILL}
662 {&hf_docsis_mdd_ip_provisioning_mode,
663 {"IP Provisioning Mode", "docsis_mdd.ip_provisioning_mode",
664 FT_UINT8, BASE_DEC, VALS(ip_provisioning_mode_vals), 0x0,
665 "Mdd IP Provisioning Mode", HFILL}
667 {&hf_docsis_mdd_pre_registration_dsid,
668 {"Pre-registration DSID", "docsis_mdd.pre_registration_dsid",
669 FT_UINT24, BASE_DEC, NULL, 0x0FFFFF,
670 "Mdd Pre-registration DSID", HFILL}
672 {&hf_docsis_mdd_early_authentication_and_encryption,
673 {"Early Authentication and Encryption", "docsis_mdd.early_authentication_and_encryption",
674 FT_UINT8, BASE_DEC, VALS(eae_vals), 0x0,
675 "Mdd Early Authentication and Encryption", HFILL}
677 {&hf_docsis_mdd_upstream_active_channel_list_upstream_channel_id,
678 {"Upstream Channel Id", "docsis_mdd.upstream_active_channel_list_upstream_channel_id",
679 FT_UINT8, BASE_DEC, NULL, 0x0,
680 "Mdd Upstream Active Channel List Upstream Channel Id", HFILL}
682 {&hf_docsis_mdd_upstream_ambiguity_resolution_channel_list_channel_id,
683 {"Channel Id", "docsis_mdd.upstream_ambiguity_resolution_channel_list_channel_id",
684 FT_UINT8, BASE_DEC, NULL, 0x0,
685 "Mdd Mac Domain Upstream Ambiguity Resolution Channel List Channel Id", HFILL}
687 {&hf_docsis_mdd_upstream_frequency_range,
688 {"Upstream Frequency Range", "docsis_mdd.upstream_frequency_range",
689 FT_UINT8, BASE_DEC, VALS(upstream_frequency_range_vals), 0x0,
690 "Mdd Upstream Frequency Range", HFILL}
692 {&hf_docsis_mdd_symbol_clock_locking_indicator,
693 {"Symbol Clock Locking Indicator", "docsis_mdd.symbol_clock_locking_indicator",
694 FT_UINT8, BASE_DEC, VALS(symbol_clock_locking_indicator_vals), 0x0,
695 "Mdd Symbol Clock Locking Indicator", HFILL}
697 {&hf_docsis_mdd_event_type,
698 {"Event Type", "docsis_mdd.event_type",
699 FT_UINT8, BASE_DEC, VALS(symbol_cm_status_event_vals), 0x0,
700 "Mdd CM-STATUS Event Type", HFILL}
702 {&hf_docsis_mdd_maximum_event_holdoff_timer,
703 {"Maximum Event Holdoff Timer (units of 20 ms)", "docsis_mdd.maximum_event_holdoff_timer",
704 FT_UINT16, BASE_DEC, NULL, 0x0,
705 "Mdd Maximum Event Holdoff Timer", HFILL}
707 {&hf_docsis_mdd_maximum_number_of_reports_per_event,
708 {"Maximum Number of Reports per Event", "docsis_mdd.maximum_number_of_reports_per_event",
709 FT_UINT8, BASE_DEC, NULL, 0x0,
710 "Mdd Maximum Number of Reports per Event", HFILL}
712 {&hf_docsis_mdd_upstream_transmit_power_reporting,
713 {"Upstream Transmit Power Reporting", "docsis_mdd.upstream_transmit_power_reporting",
714 FT_UINT8, BASE_DEC, VALS(upstream_transmit_power_reporting_vals), 0x0,
715 "Mdd Upstream Transmit Power Reporting", HFILL}
717 {&hf_docsis_mdd_dsg_da_to_dsid_association_da,
718 {"Destination Address", "docsis_mdd.dsg_da_to_dsid_association_da",
719 FT_UINT8, BASE_HEX, NULL, 0x0,
720 "Mdd DSG DA to DSID association Destination Address", HFILL}
722 {&hf_docsis_mdd_dsg_da_to_dsid_association_dsid,
723 {"DSID", "docsis_mdd.dsg_da_to_dsid_association_dsid",
724 FT_UINT24, BASE_DEC, NULL, 0x0FFFFF,
725 "Mdd Mdd DSG DA to DSID association DSID", HFILL}
727 {&hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_sequence_out_of_range,
728 {"Sequence out of range", "docsis_mdd.cm_status_event_enable_non_channel_specific_events_sequence_out_of_range",
729 FT_UINT16, BASE_DEC, NULL, 0x0008,
730 "CM-STATUS event non-channel-event Sequence out of range", HFILL}
732 {&hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_operating_on_battery_backup,
733 {"CM operating on battery backup", "docsis_mdd.cm_status_event_enable_non_channel_specific_events_cm_operating_on_battery_backup",
734 FT_UINT16, BASE_DEC, NULL, 0x0200,
735 "CM-STATUS event non-channel-event Cm operating on battery backup", HFILL}
737 {&hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_returned_to_ac_power,
738 {"Returned to AC power", "docsis_mdd.cm_status_event_enable_non_channel_specific_events_cm_returned_to_ac_power",
739 FT_UINT16, BASE_DEC, NULL, 0x0400,
740 "CM-STATUS event non-channel-event Cm returned to AC power", HFILL}
744 /* Setup protocol subtree array */
745 static gint *ett[] = {
751 /* Register the protocol name and description */
753 proto_register_protocol ("DOCSIS Mac Domain Description",
754 "DOCSIS Mdd", "docsis_mdd");
756 /* Required function calls to register the header fields and subtrees used */
757 proto_register_field_array (proto_docsis_mdd, hf, array_length (hf));
758 proto_register_subtree_array (ett, array_length (ett));
760 register_dissector ("docsis_mdd", dissect_mdd, proto_docsis_mdd);
764 /* If this dissector uses sub-dissector registration add a registration routine.
765 This format is required because a script is used to find these routines and
766 create the code that calls these routines.
769 proto_reg_handoff_docsis_mdd (void)
771 dissector_handle_t docsis_mdd_handle;
773 docsis_mdd_handle = find_dissector ("docsis_mdd");
774 dissector_add ("docsis_mgmt", 33, docsis_mdd_handle);