2 * Routines for Intial Ranging Request Message dissection
3 * Copyright 2003, Brian Wheeler <brian.wheeler[AT]arrisi.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <epan/packet.h>
31 /* Initialize the protocol and registered fields */
32 static int proto_docsis_intrngreq = -1;
33 static int hf_docsis_intrngreq_down_chid = -1;
34 static int hf_docsis_intrngreq_sid = -1;
35 static int hf_docsis_intrngreq_up_chid = -1;
38 /* Initialize the subtree pointers */
39 static gint ett_docsis_intrngreq = -1;
41 /* Code to actually dissect the packets */
43 dissect_intrngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
45 proto_item *intrngreq_item;
46 proto_tree *intrngreq_tree;
49 sid = tvb_get_ntohs (tvb, 0);
51 col_clear (pinfo->cinfo, COL_INFO);
52 col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Request: SID = %u",sid);
57 proto_tree_add_protocol_format (tree, proto_docsis_intrngreq, tvb, 0,
58 tvb_length_remaining (tvb, 0),
59 "Initial Ranging Request");
60 intrngreq_tree = proto_item_add_subtree (intrngreq_item, ett_docsis_intrngreq);
61 proto_tree_add_item (intrngreq_tree, hf_docsis_intrngreq_sid, tvb, 0, 2,
63 proto_tree_add_item (intrngreq_tree, hf_docsis_intrngreq_down_chid, tvb, 2, 1,
65 proto_tree_add_item (intrngreq_tree, hf_docsis_intrngreq_up_chid, tvb, 3,
75 /* Register the protocol with Wireshark */
77 /* this format is require because a script is used to build the C function
78 that calls all the protocol registration.
83 proto_register_docsis_intrngreq (void)
86 /* Setup list of header fields See Section 1.6.1 for details*/
87 static hf_register_info hf[] = {
88 {&hf_docsis_intrngreq_sid,
89 {"Service Identifier", "docsis_intrngreq.sid",
90 FT_UINT16, BASE_DEC, NULL, 0x0,
93 {&hf_docsis_intrngreq_down_chid,
94 {"Downstream Channel ID", "docsis_intrngreq.downchid",
95 FT_UINT8, BASE_DEC, NULL, 0x0,
98 {&hf_docsis_intrngreq_up_chid,
99 {"Upstream Channel ID", "docsis_intrngreq.upchid",
100 FT_UINT8, BASE_DEC, NULL, 0x0,
106 /* Setup protocol subtree array */
107 static gint *ett[] = {
108 &ett_docsis_intrngreq,
111 /* Register the protocol name and description */
112 proto_docsis_intrngreq = proto_register_protocol ("DOCSIS Initial Ranging Message",
113 "DOCSIS INT-RNG-REQ",
116 /* Required function calls to register the header fields and subtrees used */
117 proto_register_field_array (proto_docsis_intrngreq, hf, array_length (hf));
118 proto_register_subtree_array (ett, array_length (ett));
120 register_dissector ("docsis_intrngreq", dissect_intrngreq, proto_docsis_intrngreq);
124 /* If this dissector uses sub-dissector registration add a registration routine.
125 This format is required because a script is used to find these routines and
126 create the code that calls these routines.
129 proto_reg_handoff_docsis_intrngreq (void)
131 dissector_handle_t docsis_intrngreq_handle;
133 docsis_intrngreq_handle = find_dissector ("docsis_intrngreq");
134 dissector_add_uint ("docsis_mgmt", 0x1E, docsis_intrngreq_handle);