[Automatic update for 2016-03-13]
[metze/wireshark/wip.git] / asn1 / h450-ros / packet-h450-ros-template.c
1 /* packet-h450-ros.c
2  * Routines for H.450 packet dissection
3  * 2007  Tomas Kukosa
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 #include "config.h"
25
26 #include <epan/packet.h>
27 #include <epan/strutil.h>
28 #include <epan/asn1.h>
29 #include <epan/expert.h>
30
31 #include "packet-per.h"
32 #include "packet-h450-ros.h"
33
34 #define PNAME  "H.450 Remote Operations Apdus"
35 #define PSNAME "H450.ROS"
36 #define PFNAME "h450.ros"
37
38 void proto_register_h450_ros(void);
39 void proto_reg_handoff_h450_ros(void);
40
41 /* Initialize the protocol and registered fields */
42 static int proto_h450_ros = -1;
43 #include "packet-h450-ros-hf.c"
44
45 /* Initialize the subtree pointers */
46 #include "packet-h450-ros-ett.c"
47
48 static expert_field ei_ros_undecoded = EI_INIT;
49
50 /* Preferences */
51
52 /* Subdissectors */
53 static dissector_handle_t data_handle = NULL;
54
55 /* Global variables */
56 static gint32 problem_val;
57 static gchar problem_str[64];
58 static tvbuff_t *arg_next_tvb, *res_next_tvb, *err_next_tvb;
59
60 static int
61 argument_cb(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_) {
62   arg_next_tvb = tvb;
63   return tvb_captured_length(tvb);
64 }
65
66 static int
67 result_cb(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_) {
68   res_next_tvb = tvb;
69   return tvb_captured_length(tvb);
70 }
71
72 static int
73 error_cb(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_) {
74   err_next_tvb = tvb;
75   return tvb_captured_length(tvb);
76 }
77
78 #include "packet-h450-ros-fn.c"
79
80 /*--- proto_register_h450_ros -----------------------------------------------*/
81 void proto_register_h450_ros(void) {
82
83   /* List of fields */
84   static hf_register_info hf[] = {
85 #include "packet-h450-ros-hfarr.c"
86   };
87
88   /* List of subtrees */
89   static gint *ett[] = {
90 #include "packet-h450-ros-ettarr.c"
91   };
92
93   static ei_register_info ei[] = {
94      { &ei_ros_undecoded, { "h450.ros.undecoded", PI_UNDECODED, PI_WARN, "Undecoded", EXPFILL }},
95   };
96
97   expert_module_t* expert_h450_ros;
98
99   /* Register protocol and dissector */
100   proto_h450_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
101   proto_set_cant_toggle(proto_h450_ros);
102
103   /* Register fields and subtrees */
104   proto_register_field_array(proto_h450_ros, hf, array_length(hf));
105   proto_register_subtree_array(ett, array_length(ett));
106   expert_h450_ros = expert_register_protocol(proto_h450_ros);
107   expert_register_field_array(expert_h450_ros, ei, array_length(ei));
108 }
109
110 /*--- proto_reg_handoff_h450_ros --------------------------------------------*/
111 void proto_reg_handoff_h450_ros(void) {
112   data_handle = find_dissector("data");
113 }
114
115 /*---------------------------------------------------------------------------*/