2 * Routines for DOCSIS 3.0 Bonded Intial Ranging Request Message dissection.
3 * Copyright 2009, Geoffrey Kimball <gekimbal[AT]cisco.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>
32 /* Initialize the protocol and registered fields */
33 static int proto_docsis_bintrngreq = -1;
34 static int hf_docsis_bintrngreq = -1;
35 static int hf_docsis_bintrngreq_down_chid = -1;
36 static int hf_docsis_bintrngreq_mddsgid = -1;
37 static int hf_docsis_bintrngreq_capflags = -1;
38 static int hf_docsis_bintrngreq_up_chid = -1;
39 static int hf_docsis_bintrngreq_capflags_frag = -1;
40 static int hf_docsis_bintrngreq_capflags_encrypt = -1;
43 /* Initialize the subtree pointers */
44 static gint ett_docsis_bintrngreq = -1;
46 /* Code to actually dissect the packets */
48 dissect_bintrngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
50 proto_item *bintrngreq_item;
51 proto_tree *bintrngreq_tree;
54 md_ds_sg_id = tvb_get_ntohs (tvb, 0);
56 col_clear (pinfo->cinfo, COL_INFO);
57 col_add_fstr (pinfo->cinfo, COL_INFO, "Bonded Ranging Request: MD-DS-SG-ID = %u (0x%X)",
58 md_ds_sg_id, md_ds_sg_id );
63 bintrngreq_item = proto_tree_add_protocol_format (tree, proto_docsis_bintrngreq,
64 tvb, offset, tvb_length_remaining (tvb, 0),
65 "Bonded Initial Ranging Request");
66 bintrngreq_tree = proto_item_add_subtree (bintrngreq_item, ett_docsis_bintrngreq);
67 proto_tree_add_item (bintrngreq_tree, hf_docsis_bintrngreq_capflags,
68 tvb, offset, 1, FALSE);
69 proto_tree_add_item( bintrngreq_tree, hf_docsis_bintrngreq_capflags_frag,
70 tvb, offset, 1, FALSE );
71 proto_tree_add_item( bintrngreq_tree, hf_docsis_bintrngreq_capflags_encrypt,
72 tvb, offset, 1, FALSE );
74 proto_tree_add_item (bintrngreq_tree, hf_docsis_bintrngreq_mddsgid,
75 tvb, offset, 1, FALSE);
77 proto_tree_add_item (bintrngreq_tree, hf_docsis_bintrngreq_down_chid,
78 tvb, offset, 1, FALSE);
80 proto_tree_add_item (bintrngreq_tree, hf_docsis_bintrngreq_up_chid,
81 tvb, offset, 1, FALSE);
85 /* Register the protocol with Wireshark */
88 * this format is required because a script is used to build the C function
89 * that calls all the protocol registration.
92 proto_register_docsis_bintrngreq (void)
94 /* Setup list of header fields See Section 1.6.1 for details*/
95 static hf_register_info hf[] = {
96 {&hf_docsis_bintrngreq,
97 {"RNG-REQ Message", "docsis_bintrngreq",
98 FT_BYTES, BASE_NONE, NULL, 0x0,
99 "Ranging Request Message", HFILL}
101 {&hf_docsis_bintrngreq_capflags,
102 {"Capability Flags", "docsis_bintrngreq.capflags",
103 FT_UINT8, BASE_HEX, NULL, 0x0,
106 { &hf_docsis_bintrngreq_capflags_frag,
107 {"Pre-3.0 Fragmentation", "docsis_bintrngreq.capflags.frag",
108 FT_BOOLEAN, 8, NULL, (1<<7),
109 "Pre-3.0 DOCSIS fragmentation is supported prior to registration", HFILL }
111 { &hf_docsis_bintrngreq_capflags_encrypt,
112 {"Early Auth. & Encrypt", "docsis_bintrngreq.capflags.encrypt",
113 FT_BOOLEAN, 8, NULL, (1<<6),
114 "Early Authentication and Encryption supported", HFILL }
116 {&hf_docsis_bintrngreq_mddsgid,
117 {"MD-DS-SG-ID", "docsis_bintrngreq.mddsgid",
118 FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
119 "MAC Domain Downstream Service Group Identifier", HFILL}
121 {&hf_docsis_bintrngreq_down_chid,
122 {"DS Chan ID ", "docsis_bintrngreq.downchid",
123 FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
126 {&hf_docsis_bintrngreq_up_chid,
127 {"US Chan ID ", "docsis_bintrngreq.upchid",
128 FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
133 /* Setup protocol subtree array */
134 static gint *ett[] = {
135 &ett_docsis_bintrngreq,
138 /* Register the protocol name and description */
139 proto_docsis_bintrngreq = proto_register_protocol ("DOCSIS Bonded Initial Ranging Message",
140 "DOCSIS B-INT-RNG-REQ",
141 "docsis_bintrngreq");
143 /* Required function calls to register the header fields and subtrees used */
144 proto_register_field_array (proto_docsis_bintrngreq, hf, array_length (hf));
145 proto_register_subtree_array (ett, array_length (ett));
147 register_dissector ("docsis_bintrngreq", dissect_bintrngreq, proto_docsis_bintrngreq);
151 /* If this dissector uses sub-dissector registration add a registration routine.
152 This format is required because a script is used to find these routines and
153 create the code that calls these routines.
156 proto_reg_handoff_docsis_bintrngreq (void)
158 dissector_handle_t docsis_bintrngreq_handle;
160 docsis_bintrngreq_handle = find_dissector ("docsis_bintrngreq");
161 dissector_add ("docsis_mgmt", 0x22, docsis_bintrngreq_handle);