2 * Routines for Dynamic Service Delete Response 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.
28 #include <epan/packet.h>
30 /* Initialize the protocol and registered fields */
31 static int proto_docsis_dsdrsp
= -1;
32 static int hf_docsis_dsdrsp_tranid
= -1;
33 static int hf_docsis_dsdrsp_confcode
= -1;
34 static int hf_docsis_dsdrsp_rsvd
= -1;
36 extern value_string docsis_conf_code
[];
38 /* Initialize the subtree pointers */
39 static gint ett_docsis_dsdrsp
= -1;
41 /* Code to actually dissect the packets */
43 dissect_dsdrsp (tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
)
47 proto_tree
*dsdrsp_tree
;
51 tranid
= tvb_get_ntohs (tvb
, 0);
52 confcode
= tvb_get_guint8 (tvb
, 2);
54 col_add_fstr (pinfo
->cinfo
, COL_INFO
,
55 "Dynamic Service Delete Response Tran id = %u (%s)",
56 tranid
, val_to_str (confcode
, docsis_conf_code
, "%d"));
61 proto_tree_add_protocol_format (tree
, proto_docsis_dsdrsp
, tvb
, 0, -1,
63 dsdrsp_tree
= proto_item_add_subtree (it
, ett_docsis_dsdrsp
);
64 proto_tree_add_item (dsdrsp_tree
, hf_docsis_dsdrsp_tranid
, tvb
, 0, 2,
66 proto_tree_add_item (dsdrsp_tree
, hf_docsis_dsdrsp_confcode
, tvb
, 2, 1,
68 proto_tree_add_item (dsdrsp_tree
, hf_docsis_dsdrsp_rsvd
, tvb
, 3, 1,
77 /* Register the protocol with Wireshark */
79 /* this format is require because a script is used to build the C function
80 that calls all the protocol registration.
85 proto_register_docsis_dsdrsp (void)
88 /* Setup list of header fields See Section 1.6.1 for details*/
89 static hf_register_info hf
[] = {
90 {&hf_docsis_dsdrsp_tranid
,
91 {"Transaction Id", "docsis_dsdrsp.tranid",
92 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
95 {&hf_docsis_dsdrsp_confcode
,
96 {"Confirmation Code", "docsis_dsdrsp.confcode",
97 FT_UINT8
, BASE_DEC
, VALS (docsis_conf_code
), 0x0,
100 {&hf_docsis_dsdrsp_rsvd
,
101 {"Reserved", "docsis_dsdrsp.rsvd",
102 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
107 /* Setup protocol subtree array */
108 static gint
*ett
[] = {
112 /* Register the protocol name and description */
113 proto_docsis_dsdrsp
=
114 proto_register_protocol ("DOCSIS Dynamic Service Delete Response",
115 "DOCSIS DSD-RSP", "docsis_dsdrsp");
117 /* Required function calls to register the header fields and subtrees used */
118 proto_register_field_array (proto_docsis_dsdrsp
, hf
, array_length (hf
));
119 proto_register_subtree_array (ett
, array_length (ett
));
121 register_dissector ("docsis_dsdrsp", dissect_dsdrsp
, proto_docsis_dsdrsp
);
125 /* If this dissector uses sub-dissector registration add a registration routine.
126 This format is required because a script is used to find these routines and
127 create the code that calls these routines.
130 proto_reg_handoff_docsis_dsdrsp (void)
132 dissector_handle_t docsis_dsdrsp_handle
;
134 docsis_dsdrsp_handle
= find_dissector ("docsis_dsdrsp");
135 dissector_add_uint ("docsis_mgmt", 0x16, docsis_dsdrsp_handle
);