2 * Routines for Q.932 packet dissection
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>
29 #include <epan/strutil.h>
30 #include <epan/asn1.h>
31 #include <epan/expert.h>
32 #include <epan/wmem/wmem.h>
34 #include "packet-ber.h"
36 #define PNAME "Q.932 Operations Service Element"
37 #define PSNAME "Q932.ROS"
38 #define PFNAME "q932.ros"
40 /* Initialize the protocol and registered fields */
41 static int proto_q932_ros
= -1;
42 #include "packet-q932-ros-hf.c"
44 /* Initialize the subtree pointers */
45 #include "packet-q932-ros-ett.c"
47 static expert_field ei_ros_undecoded
= EI_INIT
;
52 static dissector_handle_t data_handle
= NULL
;
54 /* Gloabl variables */
55 static rose_ctx_t
*rose_ctx_tmp
;
57 static guint32 problem_val
;
58 static gchar problem_str
[64];
59 static tvbuff_t
*arg_next_tvb
, *res_next_tvb
, *err_next_tvb
;
62 #include "packet-q932-ros-fn.c"
64 /*--- dissect_q932_ros -----------------------------------------------------*/
65 static int dissect_q932_ros(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
) {
66 rose_ctx_tmp
= get_rose_ctx(data
);
67 DISSECTOR_ASSERT(rose_ctx_tmp
);
68 return dissect_ROS_PDU(tvb
, pinfo
, tree
, NULL
);
71 /*--- proto_register_q932_ros -----------------------------------------------*/
72 void proto_register_q932_ros(void) {
75 static hf_register_info hf
[] = {
76 #include "packet-q932-ros-hfarr.c"
79 /* List of subtrees */
80 static gint
*ett
[] = {
81 #include "packet-q932-ros-ettarr.c"
84 static ei_register_info ei
[] = {
85 { &ei_ros_undecoded
, { "q932.ros.undecoded", PI_UNDECODED
, PI_WARN
, "Undecoded", EXPFILL
}},
88 expert_module_t
* expert_q932_ros
;
90 /* Register protocol and dissector */
91 proto_q932_ros
= proto_register_protocol(PNAME
, PSNAME
, PFNAME
);
92 proto_set_cant_toggle(proto_q932_ros
);
94 /* Register fields and subtrees */
95 proto_register_field_array(proto_q932_ros
, hf
, array_length(hf
));
96 proto_register_subtree_array(ett
, array_length(ett
));
97 expert_q932_ros
= expert_register_protocol(proto_q932_ros
);
98 expert_register_field_array(expert_q932_ros
, ei
, array_length(ei
));
100 new_register_dissector(PFNAME
, dissect_q932_ros
, proto_q932_ros
);
103 /*--- proto_reg_handoff_q932_ros --------------------------------------------*/
104 void proto_reg_handoff_q932_ros(void) {
105 data_handle
= find_dissector("data");
108 /*---------------------------------------------------------------------------*/