2 * Routines for Q.932 packet dissection
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include <epan/packet.h>
15 #include <epan/strutil.h>
16 #include <epan/asn1.h>
17 #include <epan/expert.h>
18 #include <wsutil/array.h>
20 #include "packet-ber.h"
22 #define PNAME "Q.932 Operations Service Element"
23 #define PSNAME "Q932.ROS"
24 #define PFNAME "q932.ros"
26 void proto_register_q932_ros(void);
27 void proto_reg_handoff_q932_ros(void);
29 /* Initialize the protocol and registered fields */
30 static int proto_q932_ros
;
31 #include "packet-q932-ros-hf.c"
33 /* Initialize the subtree pointers */
34 #include "packet-q932-ros-ett.c"
36 static expert_field ei_ros_undecoded
;
41 static dissector_handle_t data_handle
;
43 /* Global variables */
44 static rose_ctx_t
*rose_ctx_tmp
;
46 static uint32_t problem_val
;
47 static char problem_str
[64];
48 static tvbuff_t
*arg_next_tvb
, *res_next_tvb
, *err_next_tvb
;
51 #include "packet-q932-ros-fn.c"
53 /*--- dissect_q932_ros -----------------------------------------------------*/
54 static int dissect_q932_ros(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
) {
55 /* Reject the packet if data is NULL */
58 rose_ctx_tmp
= get_rose_ctx(data
);
59 DISSECTOR_ASSERT(rose_ctx_tmp
);
60 return dissect_ROS_PDU(tvb
, pinfo
, tree
, NULL
);
63 /*--- proto_register_q932_ros -----------------------------------------------*/
64 void proto_register_q932_ros(void) {
67 static hf_register_info hf
[] = {
68 #include "packet-q932-ros-hfarr.c"
71 /* List of subtrees */
73 #include "packet-q932-ros-ettarr.c"
76 static ei_register_info ei
[] = {
77 { &ei_ros_undecoded
, { "q932.ros.undecoded", PI_UNDECODED
, PI_WARN
, "Undecoded", EXPFILL
}},
80 expert_module_t
* expert_q932_ros
;
82 /* Register protocol and dissector */
83 proto_q932_ros
= proto_register_protocol(PNAME
, PSNAME
, PFNAME
);
84 proto_set_cant_toggle(proto_q932_ros
);
86 /* Register fields and subtrees */
87 proto_register_field_array(proto_q932_ros
, hf
, array_length(hf
));
88 proto_register_subtree_array(ett
, array_length(ett
));
89 expert_q932_ros
= expert_register_protocol(proto_q932_ros
);
90 expert_register_field_array(expert_q932_ros
, ei
, array_length(ei
));
92 register_dissector(PFNAME
, dissect_q932_ros
, proto_q932_ros
);
95 /*--- proto_reg_handoff_q932_ros --------------------------------------------*/
96 void proto_reg_handoff_q932_ros(void) {
97 data_handle
= find_dissector("data");
100 /*---------------------------------------------------------------------------*/