Revert "In get_unicode_or_ascii_string(), check if the length is odd/even, not the...
[wireshark-wip.git] / plugins / docsis / packet-dcd.c
blobddab9b95cd67e141b65a9cb6c09ee0ba417c35cc
1 /* packet-dcd.c
2 * Routines for DCD Message dissection
3 * Copyright 2004, Darryl Hymel <darryl.hymel[AT]arrisi.com>
5 * $Id$
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.
26 #include "config.h"
28 #include <epan/packet.h>
29 #include <epan/exceptions.h>
31 #define DCD_DOWN_CLASSIFIER 23
32 #define DCD_DSG_RULE 50
33 #define DCD_DSG_CONFIG 51
35 /* Define Downstrean Classifier subtypes
36 * These are subtype of DCD_DOWN_CLASSIFIER (23)
39 #define DCD_CFR_ID 2
40 #define DCD_CFR_RULE_PRI 5
41 #define DCD_CFR_IP_CLASSIFIER 9
43 /* Define IP Classifier sub-subtypes
44 * These are subtypes of DCD_CFR_IP_CLASSIFIER (23.9)
46 #define DCD_CFR_IP_SOURCE_ADDR 3
47 #define DCD_CFR_IP_SOURCE_MASK 4
48 #define DCD_CFR_IP_DEST_ADDR 5
49 #define DCD_CFR_IP_DEST_MASK 6
50 #define DCD_CFR_TCPUDP_SRCPORT_START 7
51 #define DCD_CFR_TCPUDP_SRCPORT_END 8
52 #define DCD_CFR_TCPUDP_DSTPORT_START 9
53 #define DCD_CFR_TCPUDP_DSTPORT_END 10
55 /* Define DSG Rule subtypes
56 * These are subtype of DCD_DSG_RULE (50)
59 #define DCD_RULE_ID 1
60 #define DCD_RULE_PRI 2
61 #define DCD_RULE_UCID_RNG 3
62 #define DCD_RULE_CLIENT_ID 4
63 #define DCD_RULE_TUNL_ADDR 5
64 #define DCD_RULE_CFR_ID 6
65 #define DCD_RULE_VENDOR_SPEC 43
66 /* Define DSG Rule Client ID sub-subtypes
67 * These are subtypes of DCD_RULE_CLIENT_ID (50.4)
69 #define DCD_CLID_BCAST_ID 1
70 #define DCD_CLID_KNOWN_MAC_ADDR 2
71 #define DCD_CLID_CA_SYS_ID 3
72 #define DCD_CLID_APP_ID 4
74 /* Define DSG Configuration subtypes
75 * These are subtype of DCD_DSG_CONFIG (51)
78 #define DCD_CFG_CHAN_LST 1
79 #define DCD_CFG_TDSG1 2
80 #define DCD_CFG_TDSG2 3
81 #define DCD_CFG_TDSG3 4
82 #define DCD_CFG_TDSG4 5
83 #define DCD_CFG_VENDOR_SPEC 43
85 /* Initialize the protocol and registered fields */
86 static int proto_docsis_dcd = -1;
88 static int hf_docsis_dcd_config_ch_cnt = -1;
89 static int hf_docsis_dcd_num_of_frag = -1;
90 static int hf_docsis_dcd_frag_sequence_num = -1;
91 static int hf_docsis_dcd_cfr_id = -1;
92 static int hf_docsis_dcd_cfr_rule_pri = -1;
93 static int hf_docsis_dcd_cfr_ip_source_addr = -1;
94 static int hf_docsis_dcd_cfr_ip_source_mask = -1;
95 static int hf_docsis_dcd_cfr_ip_dest_addr = -1;
96 static int hf_docsis_dcd_cfr_ip_dest_mask = -1;
97 static int hf_docsis_dcd_cfr_tcpudp_srcport_start = -1;
98 static int hf_docsis_dcd_cfr_tcpudp_srcport_end = -1;
99 static int hf_docsis_dcd_cfr_tcpudp_dstport_start = -1;
100 static int hf_docsis_dcd_cfr_tcpudp_dstport_end = -1;
101 static int hf_docsis_dcd_rule_id = -1;
102 static int hf_docsis_dcd_rule_pri = -1;
103 static int hf_docsis_dcd_rule_ucid_list = -1;
104 static int hf_docsis_dcd_clid_bcast_id = -1;
105 static int hf_docsis_dcd_clid_known_mac_addr = -1;
106 static int hf_docsis_dcd_clid_ca_sys_id = -1;
107 static int hf_docsis_dcd_clid_app_id = -1;
108 static int hf_docsis_dcd_rule_tunl_addr = -1;
109 static int hf_docsis_dcd_rule_cfr_id = -1;
110 static int hf_docsis_dcd_rule_vendor_spec = -1;
111 static int hf_docsis_dcd_cfg_chan = -1;
112 static int hf_docsis_dcd_cfg_tdsg1 = -1;
113 static int hf_docsis_dcd_cfg_tdsg2 = -1;
114 static int hf_docsis_dcd_cfg_tdsg3 = -1;
115 static int hf_docsis_dcd_cfg_tdsg4 = -1;
116 static int hf_docsis_dcd_cfg_vendor_spec = -1;
118 /* Initialize the subtree pointers */
119 static gint ett_docsis_dcd = -1;
120 static gint ett_docsis_dcd_cfr = -1;
121 static gint ett_docsis_dcd_cfr_ip = -1;
122 static gint ett_docsis_dcd_rule = -1;
123 static gint ett_docsis_dcd_clid = -1;
124 static gint ett_docsis_dcd_cfg = -1;
126 /* Code to actually dissect the packets */
127 static void
128 dissect_dcd_dsg_cfg (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len)
130 guint8 type, length;
131 proto_item *dcd_item;
132 proto_tree *dcd_tree;
133 int pos;
135 pos = start;
136 dcd_item = proto_tree_add_text ( tree, tvb, start, len, "51 DCD DSG Config Encodings (Length = %u)", len);
137 dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_cfg);
139 while ( pos < ( start + len) )
141 type = tvb_get_guint8 (tvb, pos++);
142 length = tvb_get_guint8 (tvb, pos++);
144 switch (type)
146 case DCD_CFG_CHAN_LST:
147 if (length == 4)
149 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfg_chan, tvb,
150 pos, length, ENC_BIG_ENDIAN);
152 else
154 THROW (ReportedBoundsError);
156 break;
157 case DCD_CFG_TDSG1:
158 if (length == 2)
160 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfg_tdsg1, tvb,
161 pos, length, ENC_BIG_ENDIAN);
163 else
165 THROW (ReportedBoundsError);
167 break;
168 case DCD_CFG_TDSG2:
169 if (length == 2)
171 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfg_tdsg2, tvb,
172 pos, length, ENC_BIG_ENDIAN);
174 else
176 THROW (ReportedBoundsError);
178 break;
179 case DCD_CFG_TDSG3:
180 if (length == 2)
182 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfg_tdsg3, tvb,
183 pos, length, ENC_BIG_ENDIAN);
185 else
187 THROW (ReportedBoundsError);
189 break;
190 case DCD_CFG_TDSG4:
191 if (length == 2)
193 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfg_tdsg4, tvb,
194 pos, length, ENC_BIG_ENDIAN);
196 else
198 THROW (ReportedBoundsError);
200 break;
201 case DCD_CFG_VENDOR_SPEC:
202 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfg_vendor_spec, tvb,
203 pos, length, ENC_NA);
204 break;
207 pos = pos + length;
210 static void
211 dissect_dcd_down_classifier_ip (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len)
213 guint8 type, length;
214 proto_item *dcd_item;
215 proto_tree *dcd_tree;
216 int pos;
218 pos = start;
219 dcd_item = proto_tree_add_text ( tree, tvb, start, len, "23.9 DCD_CFR_IP Encodings (Length = %u)", len);
220 dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_cfr_ip);
222 while ( pos < ( start + len) )
224 type = tvb_get_guint8 (tvb, pos++);
225 length = tvb_get_guint8 (tvb, pos++);
227 switch (type)
229 case DCD_CFR_IP_SOURCE_ADDR:
230 if (length == 4)
232 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_ip_source_addr, tvb,
233 pos, length, ENC_BIG_ENDIAN);
235 else
237 THROW (ReportedBoundsError);
239 break;
240 case DCD_CFR_IP_SOURCE_MASK:
241 if (length == 4)
243 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_ip_source_mask, tvb,
244 pos, length, ENC_BIG_ENDIAN);
246 else
248 THROW (ReportedBoundsError);
250 break;
251 case DCD_CFR_IP_DEST_ADDR:
252 if (length == 4)
254 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_ip_dest_addr, tvb,
255 pos, length, ENC_BIG_ENDIAN);
257 else
259 THROW (ReportedBoundsError);
261 break;
262 case DCD_CFR_IP_DEST_MASK:
263 if (length == 4)
265 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_ip_dest_mask, tvb,
266 pos, length, ENC_BIG_ENDIAN);
268 else
270 THROW (ReportedBoundsError);
272 break;
273 case DCD_CFR_TCPUDP_SRCPORT_START:
274 if (length == 2)
276 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_tcpudp_srcport_start, tvb,
277 pos, length, ENC_BIG_ENDIAN);
279 else
281 THROW (ReportedBoundsError);
283 break;
284 case DCD_CFR_TCPUDP_SRCPORT_END:
285 if (length == 2)
287 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_tcpudp_srcport_end, tvb,
288 pos, length, ENC_BIG_ENDIAN);
290 else
292 THROW (ReportedBoundsError);
294 break;
295 case DCD_CFR_TCPUDP_DSTPORT_START:
296 if (length == 2)
298 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_tcpudp_dstport_start, tvb,
299 pos, length, ENC_BIG_ENDIAN);
301 else
303 THROW (ReportedBoundsError);
305 break;
306 case DCD_CFR_TCPUDP_DSTPORT_END:
307 if (length == 2)
309 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_tcpudp_dstport_end, tvb,
310 pos, length, ENC_BIG_ENDIAN);
312 else
314 THROW (ReportedBoundsError);
316 break;
318 pos = pos + length;
321 static void
322 dissect_dcd_clid (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len)
324 guint8 type, length;
325 proto_item *dcd_item;
326 proto_tree *dcd_tree;
327 int pos;
329 pos = start;
330 dcd_item = proto_tree_add_text ( tree, tvb, start, len, "50.4 DCD Rule ClientID Encodings (Length = %u)", len);
331 dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_clid);
333 while ( pos < ( start + len) )
335 type = tvb_get_guint8 (tvb, pos++);
336 length = tvb_get_guint8 (tvb, pos++);
338 switch (type)
340 case DCD_CLID_BCAST_ID:
341 if (length == 2)
343 proto_tree_add_item(dcd_tree, hf_docsis_dcd_clid_bcast_id, tvb, pos, length, ENC_BIG_ENDIAN);
345 else
347 THROW (ReportedBoundsError);
349 break;
350 case DCD_CLID_KNOWN_MAC_ADDR:
351 if (length == 6)
353 proto_tree_add_item (dcd_tree, hf_docsis_dcd_clid_known_mac_addr, tvb,
354 pos, length, ENC_NA);
356 else
358 THROW (ReportedBoundsError);
360 break;
361 case DCD_CLID_CA_SYS_ID:
362 if (length == 2)
364 proto_tree_add_item (dcd_tree, hf_docsis_dcd_clid_ca_sys_id, tvb,
365 pos, length, ENC_BIG_ENDIAN);
367 else
369 THROW (ReportedBoundsError);
371 break;
372 case DCD_CLID_APP_ID:
373 if (length == 2)
375 proto_tree_add_item (dcd_tree, hf_docsis_dcd_clid_app_id, tvb,
376 pos, length, ENC_BIG_ENDIAN);
378 else
380 THROW (ReportedBoundsError);
382 break;
384 pos = pos + length;
387 static void
388 dissect_dcd_dsg_rule (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len)
390 guint8 type, length;
391 proto_item *dcd_item;
392 proto_tree *dcd_tree;
393 int pos;
395 pos = start;
396 dcd_item = proto_tree_add_text ( tree, tvb, start, len, "50 DCD DSG Rule Encodings (Length = %u)", len);
397 dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_rule);
399 while ( pos < ( start + len) )
401 type = tvb_get_guint8 (tvb, pos++);
402 length = tvb_get_guint8 (tvb, pos++);
404 switch (type)
406 case DCD_RULE_ID:
407 if (length == 1)
409 proto_tree_add_item (dcd_tree, hf_docsis_dcd_rule_id, tvb,
410 pos, length, ENC_BIG_ENDIAN);
412 else
414 THROW (ReportedBoundsError);
416 break;
417 case DCD_RULE_PRI:
418 if (length == 1)
420 proto_tree_add_item (dcd_tree, hf_docsis_dcd_rule_pri, tvb,
421 pos, length, ENC_BIG_ENDIAN);
423 else
425 THROW (ReportedBoundsError);
427 break;
428 case DCD_RULE_UCID_RNG:
429 proto_tree_add_item (dcd_tree, hf_docsis_dcd_rule_ucid_list, tvb,
430 pos, length, ENC_NA);
431 break;
432 case DCD_RULE_CLIENT_ID:
433 dissect_dcd_clid (tvb , dcd_tree , pos , length );
434 break;
435 case DCD_RULE_TUNL_ADDR:
436 if (length == 6)
438 proto_tree_add_item (dcd_tree, hf_docsis_dcd_rule_tunl_addr, tvb,
439 pos, length, ENC_NA);
441 else
443 THROW (ReportedBoundsError);
445 break;
446 case DCD_RULE_CFR_ID:
447 if (length == 2)
449 proto_tree_add_item (dcd_tree, hf_docsis_dcd_rule_cfr_id, tvb,
450 pos, length, ENC_BIG_ENDIAN);
452 else
454 THROW (ReportedBoundsError);
456 break;
457 case DCD_RULE_VENDOR_SPEC:
458 proto_tree_add_item (dcd_tree, hf_docsis_dcd_rule_vendor_spec, tvb,
459 pos, length, ENC_NA);
460 break;
463 pos = pos + length;
466 static void
467 dissect_dcd_down_classifier (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len)
469 guint8 type, length;
470 proto_item *dcd_item;
471 proto_tree *dcd_tree;
472 int pos;
474 pos = start;
475 dcd_item = proto_tree_add_text ( tree, tvb, start, len, "23 DCD_CFR Encodings (Length = %u)", len);
476 dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_cfr);
478 while ( pos < ( start + len) )
480 type = tvb_get_guint8 (tvb, pos++);
481 length = tvb_get_guint8 (tvb, pos++);
483 switch (type)
485 case DCD_CFR_ID:
486 if (length == 2)
488 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_id, tvb,
489 pos, length, ENC_BIG_ENDIAN);
491 else
493 THROW (ReportedBoundsError);
495 break;
496 case DCD_CFR_RULE_PRI:
497 if (length == 1)
499 proto_tree_add_item (dcd_tree, hf_docsis_dcd_cfr_rule_pri, tvb,
500 pos, length, ENC_BIG_ENDIAN);
502 else
504 THROW (ReportedBoundsError);
506 break;
507 case DCD_CFR_IP_CLASSIFIER:
508 dissect_dcd_down_classifier_ip (tvb , dcd_tree , pos , length );
509 break;
512 pos = pos + length;
515 static void
516 dissect_dcd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
518 guint16 pos;
519 guint8 type, length;
520 proto_tree *dcd_tree;
521 proto_item *dcd_item;
522 guint16 len;
524 len = tvb_length_remaining (tvb, 0);
526 col_set_str(pinfo->cinfo, COL_INFO, "DCD Message: ");
528 if (tree)
530 dcd_item =
531 proto_tree_add_protocol_format (tree, proto_docsis_dcd, tvb, 0,
532 tvb_length_remaining (tvb, 0),
533 "DCD Message");
534 dcd_tree = proto_item_add_subtree (dcd_item, ett_docsis_dcd);
535 proto_tree_add_item (dcd_tree, hf_docsis_dcd_config_ch_cnt, tvb, 0, 1, ENC_BIG_ENDIAN);
536 proto_tree_add_item (dcd_tree, hf_docsis_dcd_num_of_frag, tvb, 1, 1, ENC_BIG_ENDIAN);
537 proto_tree_add_item (dcd_tree, hf_docsis_dcd_frag_sequence_num, tvb, 2, 1, ENC_BIG_ENDIAN);
539 pos = 3;
540 while (pos < len)
542 type = tvb_get_guint8 (tvb, pos++);
543 length = tvb_get_guint8 (tvb, pos++);
544 switch (type)
546 case DCD_DOWN_CLASSIFIER:
547 dissect_dcd_down_classifier (tvb , dcd_tree , pos , length );
548 break;
549 case DCD_DSG_RULE:
550 dissect_dcd_dsg_rule (tvb , dcd_tree , pos , length );
551 break;
552 case DCD_DSG_CONFIG:
553 dissect_dcd_dsg_cfg (tvb , dcd_tree , pos , length );
554 break;
555 } /* switch(type) */
556 pos = pos + length;
557 } /* while (pos < len) */
558 } /* if (tree) */
561 /* Register the protocol with Wireshark */
563 /* this format is require because a script is used to build the C function
564 that calls all the protocol registration.
568 void
569 proto_register_docsis_dcd (void)
571 /* Setup list of header fields See Section 1.6.1 for details*/
572 static hf_register_info hf[] = {
573 {&hf_docsis_dcd_config_ch_cnt,
575 "Configuration Change Count",
576 "docsis_dcd.config_ch_cnt",
577 FT_UINT8, BASE_DEC, NULL, 0x0,
578 NULL,
579 HFILL
582 {&hf_docsis_dcd_num_of_frag,
584 "Number of Fragments",
585 "docsis_dcd.num_of_frag",
586 FT_UINT8, BASE_DEC, NULL, 0x0,
587 NULL,
588 HFILL
591 {&hf_docsis_dcd_frag_sequence_num,
593 "Fragment Sequence Number",
594 "docsis_dcd.frag_sequence_num",
595 FT_UINT8, BASE_DEC, NULL, 0x0,
596 NULL,
597 HFILL
600 {&hf_docsis_dcd_cfr_id,
602 "Downstream Classifier Id",
603 "docsis_dcd.cfr_id",
604 FT_UINT16, BASE_DEC, NULL, 0x0,
605 NULL,
606 HFILL
609 {&hf_docsis_dcd_cfr_rule_pri,
611 "Downstream Classifier Rule Priority",
612 "docsis_dcd.cfr_rule_pri",
613 FT_UINT8, BASE_DEC, NULL, 0x0,
614 NULL,
615 HFILL
618 {&hf_docsis_dcd_cfr_ip_source_addr,
620 "Downstream Classifier IP Source Address",
621 "docsis_dcd.cfr_ip_source_addr",
622 FT_IPv4, BASE_NONE, NULL, 0x0,
623 NULL,
624 HFILL
627 {&hf_docsis_dcd_cfr_ip_source_mask,
629 "Downstream Classifier IP Source Mask",
630 "docsis_dcd.cfr_ip_source_mask",
631 FT_IPv4, BASE_NONE, NULL, 0x0,
632 NULL,
633 HFILL
636 {&hf_docsis_dcd_cfr_ip_dest_addr,
638 "Downstream Classifier IP Destination Address",
639 "docsis_dcd.cfr_ip_dest_addr",
640 FT_IPv4, BASE_NONE, NULL, 0x0,
641 NULL,
642 HFILL
645 {&hf_docsis_dcd_cfr_ip_dest_mask,
647 "Downstream Classifier IP Destination Mask",
648 "docsis_dcd.cfr_ip_dest_mask",
649 FT_IPv4, BASE_NONE, NULL, 0x0,
650 "Downstream Classifier IP Destination Address",
651 HFILL
654 {&hf_docsis_dcd_cfr_tcpudp_srcport_start,
656 "Downstream Classifier IP TCP/UDP Source Port Start",
657 "docsis_dcd.cfr_ip_tcpudp_srcport_start",
658 FT_UINT16, BASE_DEC, NULL, 0x0,
659 NULL,
660 HFILL
663 {&hf_docsis_dcd_cfr_tcpudp_srcport_end,
665 "Downstream Classifier IP TCP/UDP Source Port End",
666 "docsis_dcd.cfr_ip_tcpudp_srcport_end",
667 FT_UINT16, BASE_DEC, NULL, 0x0,
668 NULL,
669 HFILL
672 {&hf_docsis_dcd_cfr_tcpudp_dstport_start,
674 "Downstream Classifier IP TCP/UDP Destination Port Start",
675 "docsis_dcd.cfr_ip_tcpudp_dstport_start",
676 FT_UINT16, BASE_DEC, NULL, 0x0,
677 NULL,
678 HFILL
681 {&hf_docsis_dcd_cfr_tcpudp_dstport_end,
683 "Downstream Classifier IP TCP/UDP Destination Port End",
684 "docsis_dcd.cfr_ip_tcpudp_dstport_end",
685 FT_UINT16, BASE_DEC, NULL, 0x0,
686 NULL,
687 HFILL
690 {&hf_docsis_dcd_rule_id,
692 "DSG Rule Id",
693 "docsis_dcd.rule_id",
694 FT_UINT8, BASE_DEC, NULL, 0x0,
695 NULL,
696 HFILL
699 {&hf_docsis_dcd_rule_pri,
701 "DSG Rule Priority",
702 "docsis_dcd.rule_pri",
703 FT_UINT8, BASE_DEC, NULL, 0x0,
704 NULL,
705 HFILL
708 {&hf_docsis_dcd_rule_ucid_list,
710 "DSG Rule UCID Range",
711 "docsis_dcd.rule_ucid_list",
712 FT_BYTES, BASE_NONE, NULL, 0x0,
713 NULL,
714 HFILL
717 {&hf_docsis_dcd_clid_bcast_id,
719 "DSG Rule Client ID Broadcast ID",
720 "docsis_dcd.clid_bcast_id",
721 FT_UINT16, BASE_DEC, NULL, 0x0,
722 NULL,
723 HFILL
726 {&hf_docsis_dcd_clid_known_mac_addr,
728 "DSG Rule Client ID Known MAC Address",
729 "docsis_dcd.clid_known_mac_addr",
730 FT_ETHER, BASE_NONE, NULL, 0x0,
731 NULL,
732 HFILL
735 {&hf_docsis_dcd_clid_ca_sys_id,
737 "DSG Rule Client ID CA System ID",
738 "docsis_dcd.clid_ca_sys_id",
739 FT_UINT16, BASE_DEC, NULL, 0x0,
740 NULL,
741 HFILL
744 {&hf_docsis_dcd_clid_app_id,
746 "DSG Rule Client ID Application ID",
747 "docsis_dcd.clid_app_id",
748 FT_UINT16, BASE_DEC, NULL, 0x0,
749 NULL,
750 HFILL
753 {&hf_docsis_dcd_rule_tunl_addr,
755 "DSG Rule Tunnel MAC Address",
756 "docsis_dcd.rule_tunl_addr",
757 FT_ETHER, BASE_NONE, NULL, 0x0,
758 NULL,
759 HFILL
762 {&hf_docsis_dcd_rule_cfr_id,
764 "DSG Rule Classifier ID",
765 "docsis_dcd.rule_cfr_id",
766 FT_UINT16, BASE_DEC, NULL, 0x0,
767 NULL,
768 HFILL
771 {&hf_docsis_dcd_rule_vendor_spec,
773 "DSG Rule Vendor Specific Parameters",
774 "docsis_dcd.rule_vendor_spec",
775 FT_BYTES, BASE_NONE, NULL, 0x0,
776 NULL,
777 HFILL
780 {&hf_docsis_dcd_cfg_chan,
782 "DSG Configuration Channel",
783 "docsis_dcd.cfg_chan",
784 FT_UINT32, BASE_DEC, NULL, 0x0,
785 NULL,
786 HFILL
789 {&hf_docsis_dcd_cfg_tdsg1,
791 "DSG Initialization Timeout (Tdsg1)",
792 "docsis_dcd.cfg_tdsg1",
793 FT_UINT16, BASE_DEC, NULL, 0x0,
794 NULL,
795 HFILL
798 {&hf_docsis_dcd_cfg_tdsg2,
800 "DSG Operational Timeout (Tdsg2)",
801 "docsis_dcd.cfg_tdsg2",
802 FT_UINT16, BASE_DEC, NULL, 0x0,
803 NULL,
804 HFILL
807 {&hf_docsis_dcd_cfg_tdsg3,
809 "DSG Two-Way Retry Timer (Tdsg3)",
810 "docsis_dcd.cfg_tdsg3",
811 FT_UINT16, BASE_DEC, NULL, 0x0,
812 NULL,
813 HFILL
816 {&hf_docsis_dcd_cfg_tdsg4,
818 "DSG One-Way Retry Timer (Tdsg4)",
819 "docsis_dcd.cfg_tdsg4",
820 FT_UINT16, BASE_DEC, NULL, 0x0,
821 NULL,
822 HFILL
825 {&hf_docsis_dcd_cfg_vendor_spec,
827 "DSG Configuration Vendor Specific Parameters",
828 "docsis_dcd.cfg_vendor_spec",
829 FT_BYTES, BASE_NONE, NULL, 0x0,
830 NULL,
831 HFILL
837 /* Setup protocol subtree array */
838 static gint *ett[] = {
839 &ett_docsis_dcd,
840 &ett_docsis_dcd_cfr,
841 &ett_docsis_dcd_cfr_ip,
842 &ett_docsis_dcd_rule,
843 &ett_docsis_dcd_clid,
844 &ett_docsis_dcd_cfg,
847 /* Register the protocol name and description */
848 proto_docsis_dcd =
849 proto_register_protocol ("DOCSIS Downstream Channel Descriptor",
850 "DOCSIS DCD", "docsis_dcd");
852 /* Required function calls to register the header fields and subtrees used */
853 proto_register_field_array (proto_docsis_dcd, hf, array_length (hf));
854 proto_register_subtree_array (ett, array_length (ett));
856 register_dissector ("docsis_dcd", dissect_dcd, proto_docsis_dcd);
860 /* If this dissector uses sub-dissector registration add a registration routine.
861 This format is required because a script is used to find these routines and
862 create the code that calls these routines.
864 void
865 proto_reg_handoff_docsis_dcd (void)
867 dissector_handle_t docsis_dcd_handle;
869 docsis_dcd_handle = find_dissector ("docsis_dcd");
870 dissector_add_uint ("docsis_mgmt", 0x20, docsis_dcd_handle);