add forgotten files
[gd/wireshark/.git] / epan / dissectors / packet-h450-ros.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
3 /* .\packet-h450-ros.c                                                        */
4 /* ../../tools/asn2wrs.py -e -p h450.ros -c h450-ros.cnf -o h450-ros -s packet-h450-ros-template ../ros/Remote-Operations-Information-Objects.asn Remote-Operations-Apdus.asn */
5
6 /* Input file: packet-h450-ros-template.c */
7
8 #line 1 "packet-h450-ros-template.c"
9 /* packet-h450-ros.c
10  * Routines for H.450 packet dissection
11  * 2007  Tomas Kukosa
12  *
13  * $Id$
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License
21  * as published by the Free Software Foundation; either version 2
22  * of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
32  */
33
34 #ifdef HAVE_CONFIG_H
35 # include "config.h"
36 #endif
37
38 #include <string.h>
39
40 #include <epan/packet.h>
41 #include <epan/prefs.h>
42 #include <epan/strutil.h>
43 #include <epan/emem.h>
44 #include <epan/asn1.h>
45
46 #include "packet-per.h"
47
48 #define PNAME  "H.450 Remote Operations Apdus"
49 #define PSNAME "H450.ROS"
50 #define PFNAME "h450.ros"
51
52 /* Initialize the protocol and registered fields */
53 int proto_h450_ros = -1;
54
55 /*--- Included file: packet-h450-ros-hf.c ---*/
56 #line 1 "packet-h450-ros-hf.c"
57 static int hf_h450_ros_local = -1;                /* T_local */
58 static int hf_h450_ros_global = -1;               /* T_global */
59 static int hf_h450_ros_invoke = -1;               /* Invoke */
60 static int hf_h450_ros_returnResult = -1;         /* ReturnResult */
61 static int hf_h450_ros_returnError = -1;          /* ReturnError */
62 static int hf_h450_ros_reject = -1;               /* Reject */
63 static int hf_h450_ros_invokeIdConstrained = -1;  /* T_invokeIdConstrained */
64 static int hf_h450_ros_linkedId = -1;             /* InvokeId */
65 static int hf_h450_ros_opcode = -1;               /* Code */
66 static int hf_h450_ros_argument = -1;             /* InvokeArgument */
67 static int hf_h450_ros_invokeId = -1;             /* InvokeId */
68 static int hf_h450_ros_result = -1;               /* T_result */
69 static int hf_h450_ros_resultArgument = -1;       /* ResultArgument */
70 static int hf_h450_ros_errcode = -1;              /* Code */
71 static int hf_h450_ros_parameter = -1;            /* T_parameter */
72 static int hf_h450_ros_problem = -1;              /* T_problem */
73 static int hf_h450_ros_general = -1;              /* GeneralProblem */
74 static int hf_h450_ros_invokeProblem = -1;        /* InvokeProblem */
75 static int hf_h450_ros_returnResultProblem = -1;  /* ReturnResultProblem */
76 static int hf_h450_ros_returnErrorProblem = -1;   /* ReturnErrorProblem */
77
78 /*--- End of included file: packet-h450-ros-hf.c ---*/
79 #line 47 "packet-h450-ros-template.c"
80
81 /* Initialize the subtree pointers */
82
83 /*--- Included file: packet-h450-ros-ett.c ---*/
84 #line 1 "packet-h450-ros-ett.c"
85 static gint ett_h450_ros_Code = -1;
86 static gint ett_h450_ros_ROS = -1;
87 static gint ett_h450_ros_Invoke = -1;
88 static gint ett_h450_ros_ReturnResult = -1;
89 static gint ett_h450_ros_T_result = -1;
90 static gint ett_h450_ros_ReturnError = -1;
91 static gint ett_h450_ros_Reject = -1;
92 static gint ett_h450_ros_T_problem = -1;
93
94 /*--- End of included file: packet-h450-ros-ett.c ---*/
95 #line 50 "packet-h450-ros-template.c"
96
97 /* Preferences */
98
99 /* Subdissectors */
100 static dissector_handle_t data_handle = NULL; 
101
102 /* Gloabl variables */
103 static rose_ctx_t *rose_ctx_tmp;
104
105 static guint32 problem_val;
106 static gchar problem_str[64];
107 static tvbuff_t *arg_next_tvb, *res_next_tvb, *err_next_tvb;
108
109 static void
110 argument_cb(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_) {
111   arg_next_tvb = tvb;
112 }
113
114 static void
115 result_cb(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_) {
116   res_next_tvb = tvb;
117 }
118
119 static void
120 error_cb(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_) {
121   err_next_tvb = tvb;
122 }
123
124
125 /*--- Included file: packet-h450-ros-fn.c ---*/
126 #line 1 "packet-h450-ros-fn.c"
127
128
129 static int
130 dissect_h450_ros_T_local(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
131   offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, &actx->rose_ctx->d.code_local);
132
133   return offset;
134 }
135
136
137
138 static int
139 dissect_h450_ros_T_global(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
140   offset = dissect_per_object_identifier_str(tvb, offset, actx, tree, hf_index, &actx->rose_ctx->d.code_global);
141
142   return offset;
143 }
144
145
146 static const value_string h450_ros_Code_vals[] = {
147   {   0, "local" },
148   {   1, "global" },
149   { 0, NULL }
150 };
151
152 static const per_choice_t Code_choice[] = {
153   {   0, &hf_h450_ros_local      , ASN1_NO_EXTENSIONS     , dissect_h450_ros_T_local },
154   {   1, &hf_h450_ros_global     , ASN1_NO_EXTENSIONS     , dissect_h450_ros_T_global },
155   { 0, NULL, 0, NULL }
156 };
157
158 static int
159 dissect_h450_ros_Code(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
160   offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
161                                  ett_h450_ros_Code, Code_choice,
162                                  &actx->rose_ctx->d.code);
163
164 #line 40 "h450-ros.cnf"
165   actx->rose_ctx->d.code_item = actx->created_item;
166
167   return offset;
168 }
169
170
171
172 static int
173 dissect_h450_ros_InvokeId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
174   offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, NULL);
175
176   return offset;
177 }
178
179
180
181 static int
182 dissect_h450_ros_T_invokeIdConstrained(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
183 #line 64 "h450-ros.cnf"
184   offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
185                                            0U, 65535U, NULL, TRUE);
186
187
188   return offset;
189 }
190
191
192
193 static int
194 dissect_h450_ros_InvokeArgument(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
195   offset = dissect_per_open_type_pdu(tvb, offset, actx, tree, hf_index, argument_cb);
196
197   return offset;
198 }
199
200
201 static const per_sequence_t Invoke_sequence[] = {
202   { &hf_h450_ros_invokeIdConstrained, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_h450_ros_T_invokeIdConstrained },
203   { &hf_h450_ros_linkedId   , ASN1_NO_EXTENSIONS     , ASN1_OPTIONAL    , dissect_h450_ros_InvokeId },
204   { &hf_h450_ros_opcode     , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_h450_ros_Code },
205   { &hf_h450_ros_argument   , ASN1_NO_EXTENSIONS     , ASN1_OPTIONAL    , dissect_h450_ros_InvokeArgument },
206   { NULL, 0, 0, NULL }
207 };
208
209 static int
210 dissect_h450_ros_Invoke(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
211 #line 76 "h450-ros.cnf"
212   dissector_handle_t arg_handle = NULL;
213
214   arg_next_tvb = NULL;
215
216   offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
217                                    ett_h450_ros_Invoke, Invoke_sequence);
218
219 #line 80 "h450-ros.cnf"
220   actx->rose_ctx->d.pdu = 1;
221
222   if (actx->rose_ctx->d.code == 0) {
223     arg_handle = dissector_get_port_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
224   } else if (actx->rose_ctx->d.code == 1) {
225     arg_handle = dissector_get_string_handle(actx->rose_ctx->arg_global_dissector_table, actx->rose_ctx->d.code_global);
226   } else {
227     arg_handle = NULL;
228   }
229
230   proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), "  INV:");
231   if (!arg_handle || 
232       !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(arg_handle)))) {
233     if (actx->rose_ctx->d.code == 0)
234       proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
235     else if (actx->rose_ctx->d.code == 1)
236       proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
237   }
238   if (!arg_next_tvb) {  /* empty argument */
239     arg_next_tvb = tvb_new_subset(tvb, offset>>3, 0, 0);
240   }
241   actx->pinfo->private_data = actx->rose_ctx;
242   call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
243
244   return offset;
245 }
246
247
248
249 static int
250 dissect_h450_ros_ResultArgument(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
251   offset = dissect_per_open_type_pdu(tvb, offset, actx, tree, hf_index, result_cb);
252
253   return offset;
254 }
255
256
257 static const per_sequence_t T_result_sequence[] = {
258   { &hf_h450_ros_opcode     , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_h450_ros_Code },
259   { &hf_h450_ros_resultArgument, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_h450_ros_ResultArgument },
260   { NULL, 0, 0, NULL }
261 };
262
263 static int
264 dissect_h450_ros_T_result(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
265   offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
266                                    ett_h450_ros_T_result, T_result_sequence);
267
268   return offset;
269 }
270
271
272 static const per_sequence_t ReturnResult_sequence[] = {
273   { &hf_h450_ros_invokeId   , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_h450_ros_InvokeId },
274   { &hf_h450_ros_result     , ASN1_NO_EXTENSIONS     , ASN1_OPTIONAL    , dissect_h450_ros_T_result },
275   { NULL, 0, 0, NULL }
276 };
277
278 static int
279 dissect_h450_ros_ReturnResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
280 #line 116 "h450-ros.cnf"
281   dissector_handle_t res_handle = NULL;
282
283   res_next_tvb = NULL;
284
285   offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
286                                    ett_h450_ros_ReturnResult, ReturnResult_sequence);
287
288 #line 120 "h450-ros.cnf"
289   actx->rose_ctx->d.pdu = 2;
290
291   if (actx->rose_ctx->d.code == 0) {
292     res_handle = dissector_get_port_handle(actx->rose_ctx->res_local_dissector_table, actx->rose_ctx->d.code_local);
293   } else if (actx->rose_ctx->d.code == 1) {
294     res_handle = dissector_get_string_handle(actx->rose_ctx->res_global_dissector_table, actx->rose_ctx->d.code_global);
295   } else {
296     res_handle = NULL;
297   }
298
299   proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), "  RES:");
300   if (!res_handle || 
301       !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
302     if (actx->rose_ctx->d.code == 0)
303       proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
304     else if (actx->rose_ctx->d.code == 1)
305       proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
306     else if (actx->rose_ctx->d.code == -1)  /* Code not available */
307       proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " -");
308   }
309   if (!res_next_tvb) {  /* empty result */
310     res_next_tvb = tvb_new_subset(tvb, offset>>3, 0, 0);
311   }
312   actx->pinfo->private_data = actx->rose_ctx;
313   call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree); 
314
315   return offset;
316 }
317
318
319
320 static int
321 dissect_h450_ros_T_parameter(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
322   offset = dissect_per_open_type_pdu(tvb, offset, actx, tree, hf_index, error_cb);
323
324   return offset;
325 }
326
327
328 static const per_sequence_t ReturnError_sequence[] = {
329   { &hf_h450_ros_invokeId   , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_h450_ros_InvokeId },
330   { &hf_h450_ros_errcode    , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_h450_ros_Code },
331   { &hf_h450_ros_parameter  , ASN1_NO_EXTENSIONS     , ASN1_OPTIONAL    , dissect_h450_ros_T_parameter },
332   { NULL, 0, 0, NULL }
333 };
334
335 static int
336 dissect_h450_ros_ReturnError(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
337 #line 157 "h450-ros.cnf"
338   dissector_handle_t err_handle = NULL;
339
340   err_next_tvb = NULL;
341
342   offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
343                                    ett_h450_ros_ReturnError, ReturnError_sequence);
344
345 #line 161 "h450-ros.cnf"
346   actx->rose_ctx->d.pdu = 3;
347
348   if (actx->rose_ctx->d.code == 0) {
349     err_handle = dissector_get_port_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
350   } else if (actx->rose_ctx->d.code == 1) {
351     err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
352   } else {
353     err_handle = NULL;
354   }
355
356   proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), "  ERR:");
357   if (!err_handle || 
358       !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
359     if (actx->rose_ctx->d.code == 0)
360       proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
361     else if (actx->rose_ctx->d.code == 1)
362       proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
363   }
364   if (!err_next_tvb) {  /* empty error */
365     err_next_tvb = tvb_new_subset(tvb, offset>>3, 0, 0);
366   }
367   actx->pinfo->private_data = actx->rose_ctx;
368   call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree); 
369
370   return offset;
371 }
372
373
374 static const value_string h450_ros_GeneralProblem_vals[] = {
375   {   0, "unrecognizedComponent" },
376   {   1, "mistypedComponent" },
377   {   2, "badlyStructuredComponent" },
378   { 0, NULL }
379 };
380
381
382 static int
383 dissect_h450_ros_GeneralProblem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
384   offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, &problem_val);
385
386 #line 51 "h450-ros.cnf"
387   strcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_GeneralProblem_vals), ""));
388
389   return offset;
390 }
391
392
393 static const value_string h450_ros_InvokeProblem_vals[] = {
394   {   0, "duplicateInvocation" },
395   {   1, "unrecognizedOperation" },
396   {   2, "mistypedArgument" },
397   {   3, "resourceLimitation" },
398   {   4, "releaseInProgress" },
399   {   5, "unrecognizedLinkedId" },
400   {   6, "linkedResponseUnexpected" },
401   {   7, "unexpectedLinkedOperation" },
402   { 0, NULL }
403 };
404
405
406 static int
407 dissect_h450_ros_InvokeProblem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
408   offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, &problem_val);
409
410 #line 53 "h450-ros.cnf"
411   strcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_InvokeProblem_vals), ""));
412
413   return offset;
414 }
415
416
417 static const value_string h450_ros_ReturnResultProblem_vals[] = {
418   {   0, "unrecognizedInvocation" },
419   {   1, "resultResponseUnexpected" },
420   {   2, "mistypedResult" },
421   { 0, NULL }
422 };
423
424
425 static int
426 dissect_h450_ros_ReturnResultProblem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
427   offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, &problem_val);
428
429 #line 55 "h450-ros.cnf"
430   strcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_ReturnResultProblem_vals), ""));
431
432   return offset;
433 }
434
435
436 static const value_string h450_ros_ReturnErrorProblem_vals[] = {
437   {   0, "unrecognizedInvocation" },
438   {   1, "errorResponseUnexpected" },
439   {   2, "unrecognizedError" },
440   {   3, "unexpectedError" },
441   {   4, "mistypedParameter" },
442   { 0, NULL }
443 };
444
445
446 static int
447 dissect_h450_ros_ReturnErrorProblem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
448   offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, &problem_val);
449
450 #line 57 "h450-ros.cnf"
451   strcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_ReturnErrorProblem_vals), ""));
452
453   return offset;
454 }
455
456
457 static const value_string h450_ros_T_problem_vals[] = {
458   {   0, "general" },
459   {   1, "invoke" },
460   {   2, "returnResult" },
461   {   3, "returnError" },
462   { 0, NULL }
463 };
464
465 static const per_choice_t T_problem_choice[] = {
466   {   0, &hf_h450_ros_general    , ASN1_NO_EXTENSIONS     , dissect_h450_ros_GeneralProblem },
467   {   1, &hf_h450_ros_invokeProblem, ASN1_NO_EXTENSIONS     , dissect_h450_ros_InvokeProblem },
468   {   2, &hf_h450_ros_returnResultProblem, ASN1_NO_EXTENSIONS     , dissect_h450_ros_ReturnResultProblem },
469   {   3, &hf_h450_ros_returnErrorProblem, ASN1_NO_EXTENSIONS     , dissect_h450_ros_ReturnErrorProblem },
470   { 0, NULL, 0, NULL }
471 };
472
473 static int
474 dissect_h450_ros_T_problem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
475   offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
476                                  ett_h450_ros_T_problem, T_problem_choice,
477                                  NULL);
478
479   return offset;
480 }
481
482
483 static const per_sequence_t Reject_sequence[] = {
484   { &hf_h450_ros_invokeId   , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_h450_ros_InvokeId },
485   { &hf_h450_ros_problem    , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_h450_ros_T_problem },
486   { NULL, 0, 0, NULL }
487 };
488
489 static int
490 dissect_h450_ros_Reject(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
491 #line 189 "h450-ros.cnf"
492   problem_str[0] = '\0';
493
494   offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
495                                    ett_h450_ros_Reject, Reject_sequence);
496
497 #line 191 "h450-ros.cnf"
498   proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), "  REJ: %s", problem_str);
499
500   return offset;
501 }
502
503
504 const value_string h450_ros_ROS_vals[] = {
505   {   1, "invoke" },
506   {   2, "returnResult" },
507   {   3, "returnError" },
508   {   4, "reject" },
509   { 0, NULL }
510 };
511
512 static const per_choice_t ROS_choice[] = {
513   {   1, &hf_h450_ros_invoke     , ASN1_NO_EXTENSIONS     , dissect_h450_ros_Invoke },
514   {   2, &hf_h450_ros_returnResult, ASN1_NO_EXTENSIONS     , dissect_h450_ros_ReturnResult },
515   {   3, &hf_h450_ros_returnError, ASN1_NO_EXTENSIONS     , dissect_h450_ros_ReturnError },
516   {   4, &hf_h450_ros_reject     , ASN1_NO_EXTENSIONS     , dissect_h450_ros_Reject },
517   { 0, NULL, 0, NULL }
518 };
519
520 int
521 dissect_h450_ros_ROS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
522 #line 29 "h450-ros.cnf"
523   DISSECTOR_ASSERT(actx->rose_ctx);
524   rose_ctx_clean_data(actx->rose_ctx);
525
526   offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
527                                  ett_h450_ros_ROS, ROS_choice,
528                                  NULL);
529
530   return offset;
531 }
532
533
534 /*--- End of included file: packet-h450-ros-fn.c ---*/
535 #line 79 "packet-h450-ros-template.c"
536
537 /*--- proto_register_h450_ros -----------------------------------------------*/
538 void proto_register_h450_ros(void) {
539
540   /* List of fields */
541   static hf_register_info hf[] = {
542
543 /*--- Included file: packet-h450-ros-hfarr.c ---*/
544 #line 1 "packet-h450-ros-hfarr.c"
545     { &hf_h450_ros_local,
546       { "local", "h450.ros.local",
547         FT_INT32, BASE_DEC, NULL, 0,
548         "h450_ros.T_local", HFILL }},
549     { &hf_h450_ros_global,
550       { "global", "h450.ros.global",
551         FT_OID, BASE_NONE, NULL, 0,
552         "h450_ros.T_global", HFILL }},
553     { &hf_h450_ros_invoke,
554       { "invoke", "h450.ros.invoke",
555         FT_NONE, BASE_NONE, NULL, 0,
556         "h450_ros.Invoke", HFILL }},
557     { &hf_h450_ros_returnResult,
558       { "returnResult", "h450.ros.returnResult",
559         FT_NONE, BASE_NONE, NULL, 0,
560         "h450_ros.ReturnResult", HFILL }},
561     { &hf_h450_ros_returnError,
562       { "returnError", "h450.ros.returnError",
563         FT_NONE, BASE_NONE, NULL, 0,
564         "h450_ros.ReturnError", HFILL }},
565     { &hf_h450_ros_reject,
566       { "reject", "h450.ros.reject",
567         FT_NONE, BASE_NONE, NULL, 0,
568         "h450_ros.Reject", HFILL }},
569     { &hf_h450_ros_invokeIdConstrained,
570       { "invokeId", "h450.ros.invokeId",
571         FT_INT32, BASE_DEC, NULL, 0,
572         "h450_ros.T_invokeIdConstrained", HFILL }},
573     { &hf_h450_ros_linkedId,
574       { "linkedId", "h450.ros.linkedId",
575         FT_INT32, BASE_DEC, NULL, 0,
576         "h450_ros.InvokeId", HFILL }},
577     { &hf_h450_ros_opcode,
578       { "opcode", "h450.ros.opcode",
579         FT_UINT32, BASE_DEC, VALS(h450_ros_Code_vals), 0,
580         "h450_ros.Code", HFILL }},
581     { &hf_h450_ros_argument,
582       { "argument", "h450.ros.argument",
583         FT_BYTES, BASE_HEX, NULL, 0,
584         "h450_ros.InvokeArgument", HFILL }},
585     { &hf_h450_ros_invokeId,
586       { "invokeId", "h450.ros.invokeId",
587         FT_INT32, BASE_DEC, NULL, 0,
588         "h450_ros.InvokeId", HFILL }},
589     { &hf_h450_ros_result,
590       { "result", "h450.ros.result",
591         FT_NONE, BASE_NONE, NULL, 0,
592         "h450_ros.T_result", HFILL }},
593     { &hf_h450_ros_resultArgument,
594       { "result", "h450.ros.result",
595         FT_BYTES, BASE_HEX, NULL, 0,
596         "h450_ros.ResultArgument", HFILL }},
597     { &hf_h450_ros_errcode,
598       { "errcode", "h450.ros.errcode",
599         FT_UINT32, BASE_DEC, VALS(h450_ros_Code_vals), 0,
600         "h450_ros.Code", HFILL }},
601     { &hf_h450_ros_parameter,
602       { "parameter", "h450.ros.parameter",
603         FT_BYTES, BASE_HEX, NULL, 0,
604         "h450_ros.T_parameter", HFILL }},
605     { &hf_h450_ros_problem,
606       { "problem", "h450.ros.problem",
607         FT_UINT32, BASE_DEC, VALS(h450_ros_T_problem_vals), 0,
608         "h450_ros.T_problem", HFILL }},
609     { &hf_h450_ros_general,
610       { "general", "h450.ros.general",
611         FT_INT32, BASE_DEC, VALS(h450_ros_GeneralProblem_vals), 0,
612         "h450_ros.GeneralProblem", HFILL }},
613     { &hf_h450_ros_invokeProblem,
614       { "invoke", "h450.ros.invoke",
615         FT_INT32, BASE_DEC, VALS(h450_ros_InvokeProblem_vals), 0,
616         "h450_ros.InvokeProblem", HFILL }},
617     { &hf_h450_ros_returnResultProblem,
618       { "returnResult", "h450.ros.returnResult",
619         FT_INT32, BASE_DEC, VALS(h450_ros_ReturnResultProblem_vals), 0,
620         "h450_ros.ReturnResultProblem", HFILL }},
621     { &hf_h450_ros_returnErrorProblem,
622       { "returnError", "h450.ros.returnError",
623         FT_INT32, BASE_DEC, VALS(h450_ros_ReturnErrorProblem_vals), 0,
624         "h450_ros.ReturnErrorProblem", HFILL }},
625
626 /*--- End of included file: packet-h450-ros-hfarr.c ---*/
627 #line 86 "packet-h450-ros-template.c"
628   };
629
630   /* List of subtrees */
631   static gint *ett[] = {
632
633 /*--- Included file: packet-h450-ros-ettarr.c ---*/
634 #line 1 "packet-h450-ros-ettarr.c"
635     &ett_h450_ros_Code,
636     &ett_h450_ros_ROS,
637     &ett_h450_ros_Invoke,
638     &ett_h450_ros_ReturnResult,
639     &ett_h450_ros_T_result,
640     &ett_h450_ros_ReturnError,
641     &ett_h450_ros_Reject,
642     &ett_h450_ros_T_problem,
643
644 /*--- End of included file: packet-h450-ros-ettarr.c ---*/
645 #line 91 "packet-h450-ros-template.c"
646   };
647
648   /* Register protocol and dissector */
649   proto_h450_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
650   proto_set_cant_toggle(proto_h450_ros);
651
652   /* Register fields and subtrees */
653   proto_register_field_array(proto_h450_ros, hf, array_length(hf));
654   proto_register_subtree_array(ett, array_length(ett));
655 }
656
657 /*--- proto_reg_handoff_h450_ros --------------------------------------------*/
658 void proto_reg_handoff_h450_ros(void) {
659   data_handle = find_dissector("data");
660 }
661
662 /*---------------------------------------------------------------------------*/