2 * Routines for docsis dissection
3 * Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
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.
27 /* This code is based on the DOCSIS 1.1 specification available at:
28 * http://www.cablemodem.com/specifications/specifications11.html
30 * DOCSIS Captures can be facilitated using the Cable Monitor Feature
31 * available on Cisco Cable Modem Termination Systems :
32 * http://www.cisco.com/univercd/cc/td/doc/product/cable/cab_rout/cmtsfg/ufg_cmon.htm
34 * This dissector depends on the presence of a DOCSIS enapsulation type.
35 * There is no simple way to distinguish DOCSIS Frames from Ethernet frames,
36 * since the frames are copied from the RF interface on the CMTS to
37 * a Fast Ethernet interface; thus a preference was needed to enable
38 * the DOCSIS encapsulation type.
40 * The current CVS version of libpcap allows a link-layer header type to
41 * be specified for some interfaces on some platforms; for Ethernet
42 * interfaces, it allows DOCSIS to be specified. If an Ethernet capture
43 * is done with a link-layer type of DOCSIS, the file will have a link-
44 * layer type of DLT_DOCSIS; Wireshark will treat the frames in that capture
50 #include <epan/packet.h>
51 #include <epan/exceptions.h>
53 #define FCTYPE_PACKET 0x00
54 #define FCTYPE_ATMPDU 0x01
55 #define FCTYPE_RESRVD 0x02
56 #define FCTYPE_MACSPC 0x03
58 #define EH_NULL_CONFIG 0
63 #define EH_SFLOW_HDR_DOWN 5
64 #define EH_SFLOW_HDR_UP 6
66 #define EH_DS_SERVICE 8
67 #define EH_RESERVED_9 9
68 #define EH_RESERVED_10 10
69 #define EH_RESERVED_11 11
70 #define EH_RESERVED_12 12
71 #define EH_RESERVED_13 13
72 #define EH_RESERVED_14 14
73 #define EH_EXTENDED 15
75 /* Initialize the protocol and registered fields */
76 static int proto_docsis
= -1;
77 static int hf_docsis_fctype
= -1;
78 static int hf_docsis_machdr_fcparm
= -1;
79 static int hf_docsis_fcparm
= -1;
80 static int hf_docsis_ehdron
= -1;
81 static int hf_docsis_concat_cnt
= -1;
82 static int hf_docsis_macparm
= -1;
83 static int hf_docsis_ehdrlen
= -1;
84 static int hf_docsis_lensid
= -1;
85 static int hf_docsis_eh_type
= -1;
86 static int hf_docsis_eh_len
= -1;
87 static int hf_docsis_eh_val
= -1;
88 static int hf_docsis_frag_rsvd
= -1;
89 static int hf_docsis_frag_first
= -1;
90 static int hf_docsis_frag_last
= -1;
91 static int hf_docsis_frag_seq
= -1;
92 static int hf_docsis_sid
= -1;
93 static int hf_docsis_mini_slots
= -1;
94 static int hf_docsis_hcs
= -1;
95 static int hf_docsis_bpi_en
= -1;
96 static int hf_docsis_toggle_bit
= -1;
97 static int hf_docsis_key_seq
= -1;
98 static int hf_docsis_ehdr_ver
= -1;
99 static int hf_docsis_said
= -1;
100 static int hf_docsis_ehdr_phsi
= -1;
101 static int hf_docsis_ehdr_qind
= -1;
102 static int hf_docsis_ehdr_grants
= -1;
103 static int hf_docsis_reserved
= -1;
104 static int hf_docsis_ehdr_ds_traffic_pri
= -1;
105 static int hf_docsis_ehdr_ds_seq_chg_cnt
= -1;
106 static int hf_docsis_ehdr_ds_dsid
= -1;
107 static int hf_docsis_ehdr_ds_pkt_seq_num
= -1;
108 static int hf_docsis_ehdr_bpup2_bpi_en
= -1;
109 static int hf_docsis_ehdr_bpup2_toggle_bit
= -1;
110 static int hf_docsis_ehdr_bpup2_key_seq
= -1;
111 static int hf_docsis_ehdr_bpup2_ver
= -1;
112 static int hf_docsis_ehdr_bpup2_sid
= -1;
113 static dissector_handle_t docsis_handle
;
114 static dissector_handle_t eth_withoutfcs_handle
;
115 static dissector_handle_t data_handle
;
116 static dissector_handle_t docsis_mgmt_handle
;
118 static dissector_table_t docsis_dissector_table
;
121 /* Initialize the subtree pointers */
122 static gint ett_docsis
= -1;
123 static gint ett_ehdr
= -1;
125 static const value_string fctype_vals
[] = {
126 {FCTYPE_PACKET
, "Packet PDU"},
127 {FCTYPE_ATMPDU
, "ATM PDU"},
128 {FCTYPE_RESRVD
, "Reserved"},
129 {FCTYPE_MACSPC
, "MAC Specific"},
133 static const value_string eh_type_vals
[] = {
134 {0, "NULL Configuration Parameter"},
135 {EH_REQUEST
, "Request"},
136 {EH_ACK_REQ
, "Acknowledgement Requested"},
137 {EH_BP_UP
, "Upstream Privacy Element"},
138 {EH_BP_DOWN
, "Downstream Privacy Element"},
139 {EH_SFLOW_HDR_UP
, "Service Flow EH; PHS Header Upstream"},
140 {EH_SFLOW_HDR_DOWN
, "Service Flow EH; PHS Header Downstream"},
141 {EH_BP_UP2
, "Upstream Privacy with Multi Channel"},
142 {EH_DS_SERVICE
, "Downstream Service"},
143 {EH_RESERVED_9
, "Reserved"},
144 {EH_RESERVED_10
, "Reserved"},
145 {EH_RESERVED_10
, "Reserved"},
146 {EH_RESERVED_11
, "Reserved"},
147 {EH_RESERVED_12
, "Reserved"},
148 {EH_RESERVED_13
, "Reserved"},
149 {EH_RESERVED_14
, "Reserved"},
150 {EH_EXTENDED
, "Extended"},
154 static const value_string fcparm_vals
[] = {
155 {0x0, "Timing Header"},
156 {0x1, "Mac Management Message"},
157 {0x2, "Request Frame"},
158 {0x3, "Fragmentation Header"},
159 {0x1C, "Concatenation Header"},
163 static const true_false_string ehdron_tfs
= {
164 "Extended Header Present",
165 "Extended Header Absent"
168 static const true_false_string ena_dis_tfs
= {
173 static const true_false_string qind_tfs
= {
178 static const true_false_string odd_even_tfs
= {
183 /* Code to actually dissect the packets */
184 /* Code to Dissect the extended header */
186 dissect_ehdr (tvbuff_t
* tvb
, proto_tree
* tree
, gboolean isfrag
)
188 proto_tree
*ehdr_tree
;
189 proto_item
*it
, *item
;
198 ehdrlen
= tvb_get_guint8 (tvb
, 1);
201 it
= proto_tree_add_text (tree
, tvb
, pos
, ehdrlen
, "Extended Header");
202 ehdr_tree
= proto_item_add_subtree (it
, ett_ehdr
);
203 while (pos
< ehdrlen
+ 4)
205 type
= (tvb_get_guint8 (tvb
, pos
) & 0xF0);
206 len
= (tvb_get_guint8 (tvb
, pos
) & 0x0F);
207 if ((((type
>> 4) & 0x0F)== 6) && (len
== 2))
209 item
= proto_tree_add_item(ehdr_tree
, hf_docsis_eh_type
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
210 PROTO_ITEM_SET_HIDDEN(item
);
211 proto_tree_add_text(ehdr_tree
, tvb
, pos
, 1, "0110 .... = Unsolicited Grant Sync EHDR Sub-Element" );
214 proto_tree_add_item (ehdr_tree
, hf_docsis_eh_type
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
215 proto_tree_add_item (ehdr_tree
, hf_docsis_eh_len
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
216 switch ((type
>> 4) & 0x0F)
221 mini_slots
= tvb_get_guint8 (tvb
, pos
+ 1);
222 sid
= tvb_get_ntohs (tvb
, pos
+ 2);
223 proto_tree_add_uint (ehdr_tree
, hf_docsis_mini_slots
, tvb
,
224 pos
+ 1, 1, mini_slots
);
225 proto_tree_add_uint (ehdr_tree
, hf_docsis_sid
, tvb
, pos
+ 2, 2,
230 THROW (ReportedBoundsError
);
236 sid
= tvb_get_ntohs (tvb
, pos
+ 1);
237 proto_tree_add_uint (ehdr_tree
, hf_docsis_sid
, tvb
, pos
+ 2, 2,
242 THROW (ReportedBoundsError
);
245 proto_tree_add_item (ehdr_tree
, hf_docsis_key_seq
, tvb
, pos
+ 1, 1,
247 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_ver
, tvb
, pos
+ 1, 1,
249 proto_tree_add_item (ehdr_tree
, hf_docsis_bpi_en
, tvb
, pos
+ 2, 1,
251 proto_tree_add_item (ehdr_tree
, hf_docsis_toggle_bit
, tvb
, pos
+ 2,
253 proto_tree_add_item (ehdr_tree
, hf_docsis_sid
, tvb
, pos
+ 2, 2,
255 proto_tree_add_item (ehdr_tree
, hf_docsis_mini_slots
, tvb
, pos
+ 4,
259 proto_tree_add_item (ehdr_tree
, hf_docsis_frag_rsvd
, tvb
, pos
+5,
261 proto_tree_add_item (ehdr_tree
, hf_docsis_frag_first
, tvb
, pos
+5,
263 proto_tree_add_item (ehdr_tree
, hf_docsis_frag_last
, tvb
, pos
+5,
265 proto_tree_add_item (ehdr_tree
, hf_docsis_frag_seq
, tvb
, pos
+5,
270 proto_tree_add_item (ehdr_tree
, hf_docsis_key_seq
, tvb
, pos
+ 1, 1,
272 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_ver
, tvb
, pos
+ 1, 1,
274 proto_tree_add_item (ehdr_tree
, hf_docsis_bpi_en
, tvb
, pos
+ 2, 1,
276 proto_tree_add_item (ehdr_tree
, hf_docsis_toggle_bit
, tvb
, pos
+ 2,
278 proto_tree_add_item (ehdr_tree
, hf_docsis_said
, tvb
, pos
+ 2, 2,
280 proto_tree_add_item (ehdr_tree
, hf_docsis_reserved
, tvb
, pos
+ 4, 1,
283 case EH_SFLOW_HDR_DOWN
:
284 case EH_SFLOW_HDR_UP
:
285 val
= tvb_get_guint8 (tvb
, pos
+1);
288 item
= proto_tree_add_item(ehdr_tree
, hf_docsis_ehdr_phsi
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
289 PROTO_ITEM_SET_HIDDEN(item
);
290 proto_tree_add_text (ehdr_tree
, tvb
, pos
+1, 1, "0000 0000 = No PHS on current packet" );
293 proto_tree_add_item(ehdr_tree
, hf_docsis_ehdr_phsi
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
297 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_qind
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
);
298 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_grants
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
);
302 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_bpup2_key_seq
, tvb
, pos
+ 1, 1,
304 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_bpup2_ver
, tvb
, pos
+ 1, 1,
306 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_bpup2_bpi_en
, tvb
, pos
+ 2, 1,
308 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_bpup2_toggle_bit
, tvb
, pos
+ 2,
310 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_bpup2_sid
, tvb
, pos
+ 2, 2,
314 proto_tree_add_item(ehdr_tree
, hf_docsis_ehdr_ds_traffic_pri
, tvb
, pos
+1, 1, FALSE
);
318 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_ds_dsid
, tvb
, pos
+1, 3, FALSE
);
323 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_ds_seq_chg_cnt
, tvb
, pos
+1, 1, FALSE
);
324 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_ds_dsid
, tvb
, pos
+1, 3, FALSE
);
325 proto_tree_add_item (ehdr_tree
, hf_docsis_ehdr_ds_pkt_seq_num
, tvb
, pos
+4, 2, FALSE
);
331 proto_tree_add_item (ehdr_tree
, hf_docsis_eh_val
, tvb
, pos
+ 1,
342 dissect_docsis (tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
)
351 tvbuff_t
*next_tvb
, *mgt_tvb
;
352 gint pdulen
, captured_length
;
354 gboolean isfrag
= FALSE
;
357 /* Set up structures needed to add the protocol subtree and manage it */
359 proto_tree
*docsis_tree
;
360 /* concatlen and concatpos are declared static to allow for recursive calls to
361 * the dissect_docsis routine when dissecting Concatenated frames
363 static gint concatlen
;
364 static gint concatpos
;
366 /* Extract important fields */
367 fc
= tvb_get_guint8 (tvb
, 0); /* Frame Control Byte */
368 fctype
= (fc
>> 6) & 0x03; /* Frame Control Type: 2 MSB Bits */
369 fcparm
= (fc
>> 1) & 0x1F; /* Frame Control Parameter: Next 5 Bits */
370 ehdron
= (fc
& 0x01); /* Extended Header Bit: LSB */
372 mac_parm
= tvb_get_guint8 (tvb
, 1); /* Mac Parm */
373 len_sid
= tvb_get_ntohs (tvb
, 2); /* Length Or SID */
375 /* set Header length based on presence of Extended header */
379 hdrlen
= 6 + mac_parm
;
381 /* Captured PDU Length is based on the length of the header */
382 captured_length
= tvb_length_remaining (tvb
, hdrlen
);
384 /* If this is a Request Frame, then pdulen is 0 and framelen is 6 */
385 if ((fctype
== FCTYPE_MACSPC
) && fcparm
== 0x02)
392 framelen
= 6 + len_sid
;
393 pdulen
= len_sid
- (mac_parm
+ 2);
396 /* if this is a concatenated frame setup the length of the concatenated
397 * frame and set the position to the first byte of the first frame */
398 if ((fctype
== FCTYPE_MACSPC
) && (fcparm
== 0x1c))
404 /* Make entries in Protocol column and Info column on summary display */
405 col_set_str (pinfo
->cinfo
, COL_PROTOCOL
, "DOCSIS");
410 col_set_str (pinfo
->cinfo
, COL_INFO
, "Packet PDU");
413 col_set_str (pinfo
->cinfo
, COL_INFO
, "ATM PDU");
416 col_set_str (pinfo
->cinfo
, COL_INFO
, "Reserved PDU");
420 col_add_fstr (pinfo
->cinfo
, COL_INFO
,
421 "Request Frame SID = %u Mini Slots = %u", len_sid
,
423 else if (fcparm
== 0x03)
424 col_set_str (pinfo
->cinfo
, COL_INFO
, "Fragmented Frame");
426 col_set_str (pinfo
->cinfo
, COL_INFO
, "Mac Specific");
430 /* In the interest of speed, if "tree" is NULL, don't do any work not
431 necessary to generate protocol tree items. */
434 ti
= proto_tree_add_protocol_format (tree
, proto_docsis
, tvb
, 0,
436 docsis_tree
= proto_item_add_subtree (ti
, ett_docsis
);
438 /* add an item to the subtree, see section 1.6 for more information */
439 proto_tree_add_item (docsis_tree
, hf_docsis_fctype
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
445 proto_tree_add_item (docsis_tree
, hf_docsis_fcparm
, tvb
, 0, 1,
447 proto_tree_add_item (docsis_tree
, hf_docsis_ehdron
, tvb
, 0, 1,
451 proto_tree_add_item (docsis_tree
, hf_docsis_ehdrlen
, tvb
, 1, 1,
453 proto_tree_add_item (docsis_tree
, hf_docsis_lensid
, tvb
, 2, 2,
455 dissect_ehdr (tvb
, docsis_tree
, isfrag
);
456 proto_tree_add_item (docsis_tree
, hf_docsis_hcs
, tvb
,
457 4 + mac_parm
, 2, ENC_BIG_ENDIAN
);
461 proto_tree_add_item (docsis_tree
, hf_docsis_macparm
, tvb
, 1, 1,
463 proto_tree_add_item (docsis_tree
, hf_docsis_lensid
, tvb
, 2, 2,
465 proto_tree_add_item (docsis_tree
, hf_docsis_hcs
, tvb
, 4, 2,
470 proto_tree_add_item (docsis_tree
, hf_docsis_machdr_fcparm
, tvb
, 0,
472 proto_tree_add_item (docsis_tree
, hf_docsis_ehdron
, tvb
, 0, 1,
474 /* Decode for a Request Frame. No extended header */
477 proto_tree_add_uint (docsis_tree
, hf_docsis_mini_slots
, tvb
, 1,
479 proto_tree_add_uint (docsis_tree
, hf_docsis_sid
, tvb
, 2, 2,
481 proto_tree_add_item (docsis_tree
, hf_docsis_hcs
, tvb
, 4, 2,
485 /* Check if this is a fragmentation header */
490 /* Decode for a Concatenated Header. No Extended Header */
493 proto_item_append_text (ti
, " (Concatenated Header)");
494 proto_tree_add_item (docsis_tree
, hf_docsis_concat_cnt
, tvb
, 1,
496 proto_tree_add_item (docsis_tree
, hf_docsis_lensid
, tvb
, 2, 2,
498 proto_tree_add_item (docsis_tree
, hf_docsis_hcs
, tvb
, 4, 2,
502 /* If Extended header is present then decode it */
505 proto_tree_add_item (docsis_tree
, hf_docsis_ehdrlen
, tvb
, 1, 1,
507 proto_tree_add_item (docsis_tree
, hf_docsis_lensid
, tvb
, 2, 2,
509 dissect_ehdr (tvb
, docsis_tree
, isfrag
);
510 proto_tree_add_item (docsis_tree
, hf_docsis_hcs
, tvb
,
511 4 + mac_parm
, 2, ENC_BIG_ENDIAN
);
514 /* default case for all other Mac Frame Types */
515 proto_tree_add_item (docsis_tree
, hf_docsis_macparm
, tvb
, 1, 1,
517 proto_tree_add_item (docsis_tree
, hf_docsis_lensid
, tvb
, 2, 2,
519 proto_tree_add_item (docsis_tree
, hf_docsis_hcs
, tvb
, 4, 2, ENC_BIG_ENDIAN
);
524 /* If this protocol has a sub-dissector call it here, see section 1.8 */
533 next_tvb
= tvb_new_subset (tvb
, hdrlen
, captured_length
, pdulen
);
534 call_dissector (eth_withoutfcs_handle
, next_tvb
, pinfo
, tree
);
538 concatlen
= concatlen
- framelen
;
539 concatpos
+= framelen
;
550 mgt_tvb
= tvb_new_subset (tvb
, hdrlen
, captured_length
, pdulen
);
551 call_dissector (docsis_mgmt_handle
, mgt_tvb
, pinfo
, tree
);
555 concatlen
= concatlen
- framelen
;
556 concatpos
+= framelen
;
560 /* Don't do anything for a Request Frame */
563 /* For Fragmentation Frames simply dissect using the data
564 * dissector as we don't handle them yet
568 mgt_tvb
= tvb_new_subset (tvb
, hdrlen
, captured_length
, pdulen
);
569 call_dissector (data_handle
, mgt_tvb
, pinfo
, tree
);
573 concatlen
= concatlen
- framelen
;
574 concatpos
+= framelen
;
578 /* call the docsis dissector on the same frame
579 * to dissect DOCSIS frames within the concatenated
580 * frame. concatpos and concatlen are declared
581 * static and are decremented and incremented
582 * respectively when the inner
583 * docsis frames are dissected. */
584 while (concatlen
> 0)
586 oldconcatlen
= concatlen
;
587 next_tvb
= tvb_new_subset (tvb
, concatpos
, -1, concatlen
);
588 call_dissector (docsis_handle
, next_tvb
, pinfo
, tree
);
589 if (oldconcatlen
<= concatlen
)
590 THROW(ReportedBoundsError
);
594 col_set_str(pinfo
->cinfo
, COL_INFO
, "Concatenated Frame");
602 /* Register the protocol with Wireshark */
604 /* this format is require because a script is used to build the C function
605 that calls all the protocol registration.
610 proto_register_docsis (void)
613 /* Setup list of header fields See Section 1.6.1 for details*/
614 static hf_register_info hf
[] = {
616 {"FCType", "docsis.fctype",
617 FT_UINT8
, BASE_HEX
, VALS (fctype_vals
), 0xC0,
618 "Frame Control Type", HFILL
}
621 {"FCParm", "docsis.fcparm",
622 FT_UINT8
, BASE_DEC
, NULL
, 0x3E,
623 "Parameter Field", HFILL
}
625 {&hf_docsis_machdr_fcparm
,
626 {"FCParm", "docsis.fcparm",
627 FT_UINT8
, BASE_HEX
, VALS (fcparm_vals
), 0x3E,
628 "Parameter Field", HFILL
}
631 {"EHDRON", "docsis.ehdron",
632 FT_BOOLEAN
, 8, TFS (&ehdron_tfs
), 0x01,
633 "Extended Header Presence", HFILL
}
636 {"MacParm", "docsis.macparm",
637 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
638 "Mac Parameter Field", HFILL
}
640 {&hf_docsis_concat_cnt
,
641 {"Number of Concatenated Frames", "docsis.macparm",
642 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
646 {"Extended Header Length (bytes)", "docsis.macparm",
647 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
648 "Mac Parameter Field", HFILL
}
651 {"Length after HCS (bytes)", "docsis.lensid",
652 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
653 "Length or SID", HFILL
}
656 {"Type", "docsis.ehdr.type",
657 FT_UINT8
, BASE_DEC
, VALS (eh_type_vals
), 0xF0,
661 {"Length", "docsis.ehdr.len",
662 FT_UINT8
, BASE_DEC
, NULL
, 0x0F,
666 {"Value", "docsis.ehdr.value",
667 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
670 {&hf_docsis_frag_rsvd
,
671 {"Reserved", "docsis.frag_rsvd",
672 FT_UINT8
, BASE_DEC
, NULL
, 0xC0,
675 {&hf_docsis_frag_first
,
676 {"First Frame", "docsis.frag_first",
677 FT_BOOLEAN
, 8, NULL
, 0x20,
680 {&hf_docsis_frag_last
,
681 {"Last Frame", "docsis.frag_last",
682 FT_BOOLEAN
, 8, NULL
, 0x10,
685 {&hf_docsis_frag_seq
,
686 {"Fragmentation Sequence #", "docsis.frag_seq",
687 FT_UINT8
, BASE_DEC
, NULL
, 0x0F,
688 "Fragmentation Sequence Number", HFILL
}
691 {"SID", "docsis.ehdr.sid",
692 FT_UINT16
, BASE_DEC
, NULL
, 0x3FFF,
693 "Service Identifier", HFILL
}
696 {"SAID", "docsis.ehdr.said",
697 FT_UINT16
, BASE_DEC
, NULL
, 0x3FFF,
698 "Security Association Identifier", HFILL
}
700 {&hf_docsis_reserved
,
701 {"Reserved", "docsis.ehdr.rsvd",
702 FT_UINT8
, BASE_HEX
, NULL
, 0x3FFF,
703 "Reserved Byte", HFILL
}
705 {&hf_docsis_mini_slots
,
706 {"MiniSlots", "docsis.ehdr.minislots",
707 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
708 "Mini Slots Requested", HFILL
}
711 {"Key Sequence", "docsis.ehdr.keyseq",
712 FT_UINT8
, BASE_DEC
, NULL
, 0xF0,
715 {&hf_docsis_ehdr_ver
,
716 {"Version", "docsis.ehdr.ver",
717 FT_UINT8
, BASE_DEC
, NULL
, 0x0F,
720 {&hf_docsis_ehdr_phsi
,
721 {"Payload Header Suppression Index", "docsis.ehdr.phsi",
722 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
725 {&hf_docsis_ehdr_qind
,
726 {"Queue Indicator", "docsis.ehdr.qind",
727 FT_BOOLEAN
, 8, TFS(&qind_tfs
), 0x80,
730 {&hf_docsis_ehdr_grants
,
731 {"Active Grants", "docsis.ehdr.act_grants",
732 FT_UINT8
, BASE_DEC
, NULL
, 0x7F,
735 {&hf_docsis_ehdr_bpup2_key_seq
,
736 {"Key Sequence", "docsis.ehdr.bpup2_keyseq",
737 FT_UINT8
, BASE_DEC
, NULL
, 0xF0,
740 {&hf_docsis_ehdr_bpup2_ver
,
741 {"Version", "docsis.ehdr.bpup2_ver",
742 FT_UINT8
, BASE_DEC
, NULL
, 0x0F,
745 {&hf_docsis_ehdr_bpup2_bpi_en
,
746 {"Encryption", "docsis.ehdr.bpup2_bpi_en",
747 FT_BOOLEAN
, 8, TFS (&ena_dis_tfs
), 0x80,
748 "BPI Enable", HFILL
},
750 {&hf_docsis_ehdr_bpup2_toggle_bit
,
751 {"Toggle", "docsis.ehdr.bpup2_toggle_bit",
752 FT_BOOLEAN
, 8, TFS (&odd_even_tfs
), 0x40,
755 {&hf_docsis_ehdr_bpup2_sid
,
756 {"SID", "docsis.ehdr.bpup2_sid",
757 FT_UINT16
, BASE_DEC
, NULL
, 0x3FFF,
758 "Service Identifier", HFILL
}
760 {&hf_docsis_ehdr_ds_traffic_pri
,
761 {"DS Traffic Priority", "docsis.ehdr.ds_traffic_pri",
762 FT_UINT8
, BASE_DEC
, NULL
, 0xE0,
765 {&hf_docsis_ehdr_ds_seq_chg_cnt
,
766 {"DS Sequence Change Count", "docsis.ehdr.ds_seq_chg_cnt",
767 FT_UINT8
, BASE_DEC
, NULL
, 0x10,
770 {&hf_docsis_ehdr_ds_dsid
,
771 {"DS DSID", "docsis.ehdr.ds_dsid",
772 FT_UINT32
, BASE_DEC
, NULL
, 0x0FFFFF,
775 {&hf_docsis_ehdr_ds_pkt_seq_num
,
776 {"DS Packet Sequence Number", "docsis.ehdr.ds_pkt_seq_num",
777 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
781 {"Header check sequence", "docsis.hcs",
782 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
786 {"Encryption", "docsis.bpi_en",
787 FT_BOOLEAN
, 8, TFS (&ena_dis_tfs
), 0x80,
788 "BPI Enable", HFILL
},
790 {&hf_docsis_toggle_bit
,
791 {"Toggle", "docsis.toggle_bit",
792 FT_BOOLEAN
, 8, TFS (&odd_even_tfs
), 0x40,
798 /* Setup protocol subtree array */
799 static gint
*ett
[] = {
805 docsis_dissector_table
= register_dissector_table ("docsis",
806 "DOCSIS Encapsulation Type",
810 /* Register the protocol name and description */
811 proto_docsis
= proto_register_protocol ("DOCSIS 1.1", "DOCSIS", "docsis");
813 /* Required function calls to register the header fields and subtrees used */
814 proto_register_field_array (proto_docsis
, hf
, array_length (hf
));
815 proto_register_subtree_array (ett
, array_length (ett
));
817 register_dissector ("docsis", dissect_docsis
, proto_docsis
);
821 /* If this dissector uses sub-dissector registration add a registration routine.
822 This format is required because a script is used to find these routines and
823 create the code that calls these routines.
826 proto_reg_handoff_docsis (void)
829 docsis_handle
= find_dissector ("docsis");
830 data_handle
= find_dissector ("data");
831 dissector_add_uint ("wtap_encap", WTAP_ENCAP_DOCSIS
, docsis_handle
);
833 docsis_mgmt_handle
= find_dissector ("docsis_mgmt");
834 eth_withoutfcs_handle
= find_dissector ("eth_withoutfcs");