2 * Routines for DOCSIS 3.0 DOCSIS Path Verify Response Message dissection.
3 * Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
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_dpvreq = -1;
34 static int hf_docsis_dpvreq_tranid = -1;
35 static int hf_docsis_dpvreq_dschan = -1;
36 static int hf_docsis_dpvreq_flags = -1;
37 static int hf_docsis_dpvreq_us_sf = -1;
38 static int hf_docsis_dpvreq_n = -1;
39 static int hf_docsis_dpvreq_start = -1;
40 static int hf_docsis_dpvreq_end = -1;
41 static int hf_docsis_dpvreq_ts_start = -1;
42 static int hf_docsis_dpvreq_ts_end = -1;
44 /* Initialize the subtree pointers */
45 static gint ett_docsis_dpvreq = -1;
47 /* Code to actually dissect the packets */
49 dissect_dpvreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
52 proto_tree *dpvreq_tree = NULL;
56 transid = tvb_get_ntohs (tvb, 0);
57 dschan = tvb_get_guint8 (tvb, 2);
59 col_clear (pinfo->cinfo, COL_INFO);
60 col_add_fstr (pinfo->cinfo, COL_INFO,
61 "DOCSIS Path Verify Request: Transaction-Id = %u DS-Ch %d",
67 proto_tree_add_protocol_format (tree, proto_docsis_dpvreq, tvb, 0, -1,
69 dpvreq_tree = proto_item_add_subtree (it, ett_docsis_dpvreq);
70 proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_tranid, tvb,
72 proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_dschan, tvb,
74 proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_flags, tvb,
76 proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_us_sf, tvb,
78 proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_n, tvb,
80 proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_start, tvb,
82 proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_end, tvb,
84 proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_ts_start, tvb,
86 proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_ts_end, tvb,
94 /* Register the protocol with Wireshark */
96 /* this format is require because a script is used to build the C function
97 that calls all the protocol registration.
101 proto_register_docsis_dpvreq (void)
104 /* Setup list of header fields See Section 1.6.1 for details*/
105 static hf_register_info hf[] = {
106 {&hf_docsis_dpvreq_tranid,
107 {"Transaction Id", "docsis_dpvreq.tranid",
108 FT_UINT16, BASE_DEC, NULL, 0x0,
111 {&hf_docsis_dpvreq_dschan,
112 {"Downstream Channel ID", "docsis_dpvreq.dschan",
113 FT_UINT8, BASE_DEC, NULL, 0x0,
116 {&hf_docsis_dpvreq_flags,
117 {"Flags", "docsis_dpvreq.flags",
118 FT_UINT8, BASE_DEC, NULL, 0x0,
121 {&hf_docsis_dpvreq_us_sf,
122 {"Upstream Service Flow ID", "docsis_dpvreq.us_sf",
123 FT_UINT32, BASE_DEC, NULL, 0x0,
126 {&hf_docsis_dpvreq_n,
127 {"N (Measurement avaraging factor)", "docsis_dpvreq.n",
128 FT_UINT16, BASE_DEC, NULL, 0x0,
131 {&hf_docsis_dpvreq_start,
132 {"Start Reference Point", "docsis_dpvreq.start",
133 FT_UINT8, BASE_DEC, NULL, 0x0,
136 {&hf_docsis_dpvreq_end,
137 {"End Reference Point", "docsis_dpvreq.end",
138 FT_UINT8, BASE_DEC, NULL, 0x0,
141 {&hf_docsis_dpvreq_ts_start,
142 {"Timestamp Start", "docsis_dpvreq.ts_start",
143 FT_UINT32, BASE_DEC, NULL, 0x0,
146 {&hf_docsis_dpvreq_ts_end,
147 {"Timestamp End", "docsis_dpvreq.ts_end",
148 FT_UINT32, BASE_DEC, NULL, 0x0,
153 /* Setup protocol subtree array */
154 static gint *ett[] = {
158 /* Register the protocol name and description */
159 proto_docsis_dpvreq =
160 proto_register_protocol ("DOCSIS Path Verify Request",
161 "DOCSIS DPV-REQ", "docsis_dpvreq");
163 /* Required function calls to register the header fields and subtrees used */
164 proto_register_field_array (proto_docsis_dpvreq, hf, array_length (hf));
165 proto_register_subtree_array (ett, array_length (ett));
167 register_dissector ("docsis_dpvreq", dissect_dpvreq, proto_docsis_dpvreq);
171 /* If this dissector uses sub-dissector registration add a registration routine.
172 This format is required because a script is used to find these routines and
173 create the code that calls these routines.
176 proto_reg_handoff_docsis_dpvreq (void)
178 dissector_handle_t docsis_dpvreq_handle;
180 docsis_dpvreq_handle = find_dissector ("docsis_dpvreq");
181 dissector_add_uint ("docsis_mgmt", 0x27, docsis_dpvreq_handle);