3 * Routines for REG-REQ-MP Message dissection
4 * Copyright 2007, Bruno Verstuyft <bruno.verstuyft@excentis.com>
6 * Based on packet-regreq.c (by Anand V. Narwani <anand[AT]narwani.org>)
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include <epan/packet.h>
34 /* Initialize the protocol and registered fields */
35 static int proto_docsis_regreqmp = -1;
36 static int hf_docsis_regreqmp = -1;
38 static int hf_docsis_regreqmp_sid = -1;
40 static int hf_docsis_regreqmp_number_of_fragments = -1;
41 static int hf_docsis_regreqmp_fragment_sequence_number = -1;
43 static dissector_handle_t docsis_tlv_handle;
47 /* Initialize the subtree pointers */
48 static gint ett_docsis_regreqmp = -1;
51 dissect_regreqmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
55 proto_tree *regreqmp_tree;
58 if (check_col (pinfo->cinfo, COL_INFO))
60 col_clear (pinfo->cinfo, COL_INFO);
61 col_add_fstr (pinfo->cinfo, COL_INFO,
62 "REG-REQ-MP Message:");
67 it = proto_tree_add_protocol_format (tree, proto_docsis_regreqmp, tvb, 0, -1,"REG-REQ-MP Message");
68 regreqmp_tree = proto_item_add_subtree (it, ett_docsis_regreqmp);
70 proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_sid, tvb, 0, 2, FALSE);
71 proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_number_of_fragments, tvb, 2, 1, FALSE);
72 proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_fragment_sequence_number, tvb, 3, 1, FALSE);
74 /* Call Dissector for Appendix C TLV's */
75 next_tvb = tvb_new_subset_remaining (tvb, 4);
76 call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreqmp_tree);
83 /* Register the protocol with Wireshark */
85 /* this format is require because a script is used to build the C function
86 that calls all the protocol registration.
91 proto_register_docsis_regreqmp (void)
93 /* Setup list of header fields See Section 1.6.1 for details*/
94 static hf_register_info hf[] = {
96 {"REG-REQ-MP Message", "docsis_regreqmp",
97 FT_BYTES, BASE_NONE, NULL, 0x0,
100 {&hf_docsis_regreqmp_sid,
101 {"Sid", "docsis_regreqmp.sid",
102 FT_UINT16, BASE_DEC, NULL, 0x0,
103 "Reg-Req-Mp Sid", HFILL}
105 {&hf_docsis_regreqmp_number_of_fragments,
106 {"Number of Fragments", "docsis_regreqmp.number_of_fragments",
107 FT_UINT8, BASE_DEC, NULL, 0x0,
108 "Reg-Req-Mp Number of Fragments", HFILL}
110 {&hf_docsis_regreqmp_fragment_sequence_number,
111 {"Fragment Sequence Number", "docsis_regreqmp.fragment_sequence_number",
112 FT_UINT8, BASE_DEC, NULL, 0x0,
113 "Reg-Req-Mp Fragment Sequence Number", HFILL}
117 /* Setup protocol subtree array */
118 static gint *ett[] = {
119 &ett_docsis_regreqmp,
122 /* Register the protocol name and description */
123 proto_docsis_regreqmp =
124 proto_register_protocol ("DOCSIS Registration Request Multipart",
125 "DOCSIS Reg-Req-Mp", "docsis_regreqmp");
127 /* Required function calls to register the header fields and subtrees used */
128 proto_register_field_array (proto_docsis_regreqmp, hf, array_length (hf));
129 proto_register_subtree_array (ett, array_length (ett));
131 register_dissector ("docsis_regreqmp", dissect_regreqmp, proto_docsis_regreqmp);
135 /* If this dissector uses sub-dissector registration add a registration routine.
136 This format is required because a script is used to find these routines and
137 create the code that calls these routines.
140 proto_reg_handoff_docsis_regreqmp (void)
142 dissector_handle_t docsis_regreqmp_handle;
144 docsis_tlv_handle = find_dissector ("docsis_tlv");
145 docsis_regreqmp_handle = find_dissector ("docsis_regreqmp");
146 dissector_add ("docsis_mgmt", 44, docsis_regreqmp_handle);