1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-q932-ros.c */
4 /* ../../tools/asn2wrs.py -b -p q932.ros -c ./q932-ros.cnf -s ./packet-q932-ros-template -D . ../ros/Remote-Operations-Information-Objects.asn Facility-Information-Element-Components.asn */
6 /* Input file: packet-q932-ros-template.c */
8 #line 1 "packet-q932-ros-template.c"
10 * Routines for Q.932 packet dissection
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
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.
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.
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.
38 #include <epan/packet.h>
39 #include <epan/strutil.h>
40 #include <epan/asn1.h>
41 #include <epan/expert.h>
43 #include "packet-ber.h"
45 #define PNAME "Q.932 Operations Service Element"
46 #define PSNAME "Q932.ROS"
47 #define PFNAME "q932.ros"
49 /* Initialize the protocol and registered fields */
50 static int proto_q932_ros = -1;
52 /*--- Included file: packet-q932-ros-hf.c ---*/
53 #line 1 "packet-q932-ros-hf.c"
54 static int hf_q932_ros_ROS_PDU = -1; /* ROS */
55 static int hf_q932_ros_local = -1; /* T_local */
56 static int hf_q932_ros_global = -1; /* T_global */
57 static int hf_q932_ros_invoke = -1; /* Invoke */
58 static int hf_q932_ros_returnResult = -1; /* ReturnResult */
59 static int hf_q932_ros_returnError = -1; /* ReturnError */
60 static int hf_q932_ros_reject = -1; /* Reject */
61 static int hf_q932_ros_invokeId = -1; /* InvokeId */
62 static int hf_q932_ros_linkedId = -1; /* T_linkedId */
63 static int hf_q932_ros_linkedIdPresent = -1; /* T_linkedIdPresent */
64 static int hf_q932_ros_absent = -1; /* NULL */
65 static int hf_q932_ros_opcode = -1; /* Code */
66 static int hf_q932_ros_argument = -1; /* InvokeArgument */
67 static int hf_q932_ros_result = -1; /* T_result */
68 static int hf_q932_ros_resultArgument = -1; /* ResultArgument */
69 static int hf_q932_ros_errcode = -1; /* Code */
70 static int hf_q932_ros_parameter = -1; /* T_parameter */
71 static int hf_q932_ros_problem = -1; /* T_problem */
72 static int hf_q932_ros_general = -1; /* GeneralProblem */
73 static int hf_q932_ros_invokeProblem = -1; /* InvokeProblem */
74 static int hf_q932_ros_returnResultProblem = -1; /* ReturnResultProblem */
75 static int hf_q932_ros_returnErrorProblem = -1; /* ReturnErrorProblem */
76 static int hf_q932_ros_present = -1; /* INTEGER */
77 static int hf_q932_ros_InvokeId_present = -1; /* InvokeId_present */
79 /*--- End of included file: packet-q932-ros-hf.c ---*/
80 #line 44 "packet-q932-ros-template.c"
82 /* Initialize the subtree pointers */
84 /*--- Included file: packet-q932-ros-ett.c ---*/
85 #line 1 "packet-q932-ros-ett.c"
86 static gint ett_q932_ros_Code = -1;
87 static gint ett_q932_ros_ROS = -1;
88 static gint ett_q932_ros_Invoke = -1;
89 static gint ett_q932_ros_T_linkedId = -1;
90 static gint ett_q932_ros_ReturnResult = -1;
91 static gint ett_q932_ros_T_result = -1;
92 static gint ett_q932_ros_ReturnError = -1;
93 static gint ett_q932_ros_Reject = -1;
94 static gint ett_q932_ros_T_problem = -1;
95 static gint ett_q932_ros_InvokeId = -1;
97 /*--- End of included file: packet-q932-ros-ett.c ---*/
98 #line 47 "packet-q932-ros-template.c"
103 static dissector_handle_t data_handle = NULL;
105 /* Gloabl variables */
106 static rose_ctx_t *rose_ctx_tmp;
108 static guint32 problem_val;
109 static gchar problem_str[64];
110 static tvbuff_t *arg_next_tvb, *res_next_tvb, *err_next_tvb;
114 /*--- Included file: packet-q932-ros-fn.c ---*/
115 #line 1 "packet-q932-ros-fn.c"
119 dissect_q932_ros_T_local(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
120 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
121 &actx->rose_ctx->d.code_local);
129 dissect_q932_ros_T_global(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
130 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->rose_ctx->d.code_global);
136 static const value_string q932_ros_Code_vals[] = {
142 static const ber_choice_t Code_choice[] = {
143 { 0, &hf_q932_ros_local , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_local },
144 { 1, &hf_q932_ros_global , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_global },
145 { 0, NULL, 0, 0, 0, NULL }
149 dissect_q932_ros_Code(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
150 offset = dissect_ber_choice(actx, tree, tvb, offset,
151 Code_choice, hf_index, ett_q932_ros_Code,
152 &actx->rose_ctx->d.code);
154 #line 43 "q932-ros.cnf"
155 actx->rose_ctx->d.code_item = actx->created_item;
163 dissect_q932_ros_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
164 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
173 dissect_q932_ros_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
174 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
180 static const value_string q932_ros_InvokeId_vals[] = {
186 static const ber_choice_t InvokeId_choice[] = {
187 { 0, &hf_q932_ros_present , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_q932_ros_INTEGER },
188 { 1, &hf_q932_ros_absent , BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_q932_ros_NULL },
189 { 0, NULL, 0, 0, 0, NULL }
193 dissect_q932_ros_InvokeId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
194 offset = dissect_ber_choice(actx, tree, tvb, offset,
195 InvokeId_choice, hf_index, ett_q932_ros_InvokeId,
204 dissect_q932_ros_InvokeId_present(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
205 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
214 dissect_q932_ros_T_linkedIdPresent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
215 offset = dissect_q932_ros_InvokeId_present(implicit_tag, tvb, offset, actx, tree, hf_index);
221 static const value_string q932_ros_T_linkedId_vals[] = {
227 static const ber_choice_t T_linkedId_choice[] = {
228 { 0, &hf_q932_ros_linkedIdPresent, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_ros_T_linkedIdPresent },
229 { 1, &hf_q932_ros_absent , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_NULL },
230 { 0, NULL, 0, 0, 0, NULL }
234 dissect_q932_ros_T_linkedId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
235 offset = dissect_ber_choice(actx, tree, tvb, offset,
236 T_linkedId_choice, hf_index, ett_q932_ros_T_linkedId,
245 dissect_q932_ros_InvokeArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
246 #line 69 "q932-ros.cnf"
249 len = tvb_length_remaining(tvb, offset);
251 proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
252 arg_next_tvb = tvb_new_subset(tvb, offset, len, len);
254 offset += tvb_length_remaining(tvb, offset);
261 static const ber_sequence_t Invoke_sequence[] = {
262 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
263 { &hf_q932_ros_linkedId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_T_linkedId },
264 { &hf_q932_ros_opcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
265 { &hf_q932_ros_argument , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_InvokeArgument },
266 { NULL, 0, 0, 0, NULL }
270 dissect_q932_ros_Invoke(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
271 #line 8 "ros-inv.cnf"
272 dissector_handle_t arg_handle = NULL;
273 const gchar *descr = "";
277 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
278 Invoke_sequence, hf_index, ett_q932_ros_Invoke);
280 #line 13 "ros-inv.cnf"
281 actx->rose_ctx->d.pdu = 1;
283 if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->arg_local_dissector_table) {
284 arg_handle = dissector_get_port_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
285 } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->arg_global_dissector_table) {
286 arg_handle = dissector_get_string_handle(actx->rose_ctx->arg_global_dissector_table, actx->rose_ctx->d.code_global);
292 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(arg_handle)))) {
293 if (actx->rose_ctx->d.code == 0)
294 descr = ep_strdup_printf("INV: %d", actx->rose_ctx->d.code_local);
295 else if (actx->rose_ctx->d.code == 1)
296 descr = ep_strdup_printf("INV: %s", actx->rose_ctx->d.code_global);
298 descr = ep_strdup_printf("INV:");
301 if (actx->rose_ctx->apdu_depth >= 0)
302 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
303 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
304 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
305 if (actx->rose_ctx->fillin_ptr)
306 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
308 if (!arg_next_tvb) { /* empty argument */
309 arg_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
311 actx->pinfo->private_data = actx->rose_ctx;
312 call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
314 expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr);
323 dissect_q932_ros_ResultArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
324 #line 87 "q932-ros.cnf"
327 len = tvb_length_remaining(tvb, offset);
329 proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
330 res_next_tvb = tvb_new_subset(tvb, offset, len, len);
332 offset += tvb_length_remaining(tvb, offset);
340 static const ber_sequence_t T_result_sequence[] = {
341 { &hf_q932_ros_opcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
342 { &hf_q932_ros_resultArgument, BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_q932_ros_ResultArgument },
343 { NULL, 0, 0, 0, NULL }
347 dissect_q932_ros_T_result(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
348 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
349 T_result_sequence, hf_index, ett_q932_ros_T_result);
355 static const ber_sequence_t ReturnResult_sequence[] = {
356 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
357 { &hf_q932_ros_result , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_result },
358 { NULL, 0, 0, 0, NULL }
362 dissect_q932_ros_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
363 #line 7 "ros-res.cnf"
364 dissector_handle_t res_handle = NULL;
365 const gchar *descr = "";
369 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
370 ReturnResult_sequence, hf_index, ett_q932_ros_ReturnResult);
372 #line 12 "ros-res.cnf"
373 actx->rose_ctx->d.pdu = 2;
375 if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->res_local_dissector_table) {
376 res_handle = dissector_get_port_handle(actx->rose_ctx->res_local_dissector_table, actx->rose_ctx->d.code_local);
377 } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->res_global_dissector_table) {
378 res_handle = dissector_get_string_handle(actx->rose_ctx->res_global_dissector_table, actx->rose_ctx->d.code_global);
384 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
385 if (actx->rose_ctx->d.code == 0)
386 descr = ep_strdup_printf("RES: %d", actx->rose_ctx->d.code_local);
387 else if (actx->rose_ctx->d.code == 1)
388 descr = ep_strdup_printf("RES: %s", actx->rose_ctx->d.code_global);
390 descr = ep_strdup_printf("RES:");
393 if (actx->rose_ctx->apdu_depth >= 0)
394 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
395 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
396 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
397 if (actx->rose_ctx->fillin_ptr)
398 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
400 if (!res_next_tvb) { /* empty result */
401 res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
403 actx->pinfo->private_data = actx->rose_ctx;
404 call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree);
406 expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr);
415 dissect_q932_ros_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
416 #line 106 "q932-ros.cnf"
420 len = tvb_length_remaining(tvb, offset);
422 proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
423 err_next_tvb = tvb_new_subset(tvb, offset, len, len);
425 offset += tvb_length_remaining(tvb, offset);
432 static const ber_sequence_t ReturnError_sequence[] = {
433 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
434 { &hf_q932_ros_errcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
435 { &hf_q932_ros_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_parameter },
436 { NULL, 0, 0, 0, NULL }
440 dissect_q932_ros_ReturnError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
441 #line 7 "ros-err.cnf"
442 dissector_handle_t err_handle = NULL;
443 const gchar *descr = "";
447 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
448 ReturnError_sequence, hf_index, ett_q932_ros_ReturnError);
450 #line 12 "ros-err.cnf"
451 actx->rose_ctx->d.pdu = 3;
453 if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->err_local_dissector_table) {
454 err_handle = dissector_get_port_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
455 } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->err_global_dissector_table) {
456 err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
462 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
463 if (actx->rose_ctx->d.code == 0)
464 descr = ep_strdup_printf("ERR: %d", actx->rose_ctx->d.code_local);
465 else if (actx->rose_ctx->d.code == 1)
466 descr = ep_strdup_printf("ERR: %s", actx->rose_ctx->d.code_global);
468 descr = ep_strdup_printf("ERR:");
471 if (actx->rose_ctx->apdu_depth >= 0)
472 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
473 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
474 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
475 if (actx->rose_ctx->fillin_ptr)
476 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
478 if (!err_next_tvb) { /* empty error */
479 err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
481 actx->pinfo->private_data = actx->rose_ctx;
482 call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
484 expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr);
491 static const value_string q932_ros_GeneralProblem_vals[] = {
492 { 0, "unrecognizedComponent" },
493 { 1, "mistypedComponent" },
494 { 2, "badlyStructuredComponent" },
500 dissect_q932_ros_GeneralProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
501 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
504 #line 54 "q932-ros.cnf"
505 g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_GeneralProblem_vals), ""), 64);
511 static const value_string q932_ros_InvokeProblem_vals[] = {
512 { 0, "duplicateInvocation" },
513 { 1, "unrecognizedOperation" },
514 { 2, "mistypedArgument" },
515 { 3, "resourceLimitation" },
516 { 4, "releaseInProgress" },
517 { 5, "unrecognizedLinkedId" },
518 { 6, "linkedResponseUnexpected" },
519 { 7, "unexpectedLinkedOperation" },
525 dissect_q932_ros_InvokeProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
526 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
529 #line 56 "q932-ros.cnf"
530 g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_InvokeProblem_vals), ""), 64);
536 static const value_string q932_ros_ReturnResultProblem_vals[] = {
537 { 0, "unrecognizedInvocation" },
538 { 1, "resultResponseUnexpected" },
539 { 2, "mistypedResult" },
545 dissect_q932_ros_ReturnResultProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
546 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
549 #line 58 "q932-ros.cnf"
550 g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""), 64);
556 static const value_string q932_ros_ReturnErrorProblem_vals[] = {
557 { 0, "unrecognizedInvocation" },
558 { 1, "errorResponseUnexpected" },
559 { 2, "unrecognizedError" },
560 { 3, "unexpectedError" },
561 { 4, "mistypedParameter" },
567 dissect_q932_ros_ReturnErrorProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
568 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
571 #line 60 "q932-ros.cnf"
572 g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""), 64);
578 static const value_string q932_ros_T_problem_vals[] = {
581 { 2, "returnResult" },
582 { 3, "returnError" },
586 static const ber_choice_t T_problem_choice[] = {
587 { 0, &hf_q932_ros_general , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_ros_GeneralProblem },
588 { 1, &hf_q932_ros_invokeProblem, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_InvokeProblem },
589 { 2, &hf_q932_ros_returnResultProblem, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnResultProblem },
590 { 3, &hf_q932_ros_returnErrorProblem, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnErrorProblem },
591 { 0, NULL, 0, 0, 0, NULL }
595 dissect_q932_ros_T_problem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
596 offset = dissect_ber_choice(actx, tree, tvb, offset,
597 T_problem_choice, hf_index, ett_q932_ros_T_problem,
604 static const ber_sequence_t Reject_sequence[] = {
605 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
606 { &hf_q932_ros_problem , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_T_problem },
607 { NULL, 0, 0, 0, NULL }
611 dissect_q932_ros_Reject(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
612 #line 7 "ros-rej.cnf"
613 const gchar *descr = "";
615 problem_str[0] = '\0';
617 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
618 Reject_sequence, hf_index, ett_q932_ros_Reject);
620 #line 11 "ros-rej.cnf"
621 descr = ep_strdup_printf("REJ: %s", problem_str);
623 if (actx->rose_ctx->apdu_depth >= 0)
624 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
625 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
626 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
627 if (actx->rose_ctx->fillin_ptr)
628 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
634 static const value_string q932_ros_ROS_vals[] = {
636 { 2, "returnResult" },
637 { 3, "returnError" },
642 static const ber_choice_t ROS_choice[] = {
643 { 1, &hf_q932_ros_invoke , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_Invoke },
644 { 2, &hf_q932_ros_returnResult, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnResult },
645 { 3, &hf_q932_ros_returnError, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnError },
646 { 4, &hf_q932_ros_reject , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_q932_ros_Reject },
647 { 0, NULL, 0, 0, 0, NULL }
651 dissect_q932_ros_ROS(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
652 #line 31 "q932-ros.cnf"
653 /* will be moved to ROS_PDU when PDU function can be alternated from conformance file */
654 actx->rose_ctx = rose_ctx_tmp;
655 rose_ctx_clean_data(actx->rose_ctx);
657 offset = dissect_ber_choice(actx, tree, tvb, offset,
658 ROS_choice, hf_index, ett_q932_ros_ROS,
666 static int dissect_ROS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
669 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
670 offset = dissect_q932_ros_ROS(FALSE, tvb, offset, &asn1_ctx, tree, hf_q932_ros_ROS_PDU);
675 /*--- End of included file: packet-q932-ros-fn.c ---*/
676 #line 62 "packet-q932-ros-template.c"
678 /*--- dissect_q932_ros -----------------------------------------------------*/
679 static int dissect_q932_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
680 rose_ctx_tmp = get_rose_ctx(pinfo->private_data);
681 DISSECTOR_ASSERT(rose_ctx_tmp);
682 return dissect_ROS_PDU(tvb, pinfo, tree);
685 /*--- proto_register_q932_ros -----------------------------------------------*/
686 void proto_register_q932_ros(void) {
689 static hf_register_info hf[] = {
691 /*--- Included file: packet-q932-ros-hfarr.c ---*/
692 #line 1 "packet-q932-ros-hfarr.c"
693 { &hf_q932_ros_ROS_PDU,
694 { "ROS", "q932.ros.ROS",
695 FT_UINT32, BASE_DEC, VALS(q932_ros_ROS_vals), 0,
697 { &hf_q932_ros_local,
698 { "local", "q932.ros.local",
699 FT_INT32, BASE_DEC, NULL, 0,
701 { &hf_q932_ros_global,
702 { "global", "q932.ros.global",
703 FT_OID, BASE_NONE, NULL, 0,
704 "T_global", HFILL }},
705 { &hf_q932_ros_invoke,
706 { "invoke", "q932.ros.invoke",
707 FT_NONE, BASE_NONE, NULL, 0,
709 { &hf_q932_ros_returnResult,
710 { "returnResult", "q932.ros.returnResult",
711 FT_NONE, BASE_NONE, NULL, 0,
713 { &hf_q932_ros_returnError,
714 { "returnError", "q932.ros.returnError",
715 FT_NONE, BASE_NONE, NULL, 0,
717 { &hf_q932_ros_reject,
718 { "reject", "q932.ros.reject",
719 FT_NONE, BASE_NONE, NULL, 0,
721 { &hf_q932_ros_invokeId,
722 { "invokeId", "q932.ros.invokeId",
723 FT_UINT32, BASE_DEC, VALS(q932_ros_InvokeId_vals), 0,
725 { &hf_q932_ros_linkedId,
726 { "linkedId", "q932.ros.linkedId",
727 FT_UINT32, BASE_DEC, VALS(q932_ros_T_linkedId_vals), 0,
728 "T_linkedId", HFILL }},
729 { &hf_q932_ros_linkedIdPresent,
730 { "present", "q932.ros.present",
731 FT_INT32, BASE_DEC, NULL, 0,
732 "T_linkedIdPresent", HFILL }},
733 { &hf_q932_ros_absent,
734 { "absent", "q932.ros.absent",
735 FT_NONE, BASE_NONE, NULL, 0,
737 { &hf_q932_ros_opcode,
738 { "opcode", "q932.ros.opcode",
739 FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
741 { &hf_q932_ros_argument,
742 { "argument", "q932.ros.argument",
743 FT_BYTES, BASE_NONE, NULL, 0,
744 "InvokeArgument", HFILL }},
745 { &hf_q932_ros_result,
746 { "result", "q932.ros.result",
747 FT_NONE, BASE_NONE, NULL, 0,
748 "T_result", HFILL }},
749 { &hf_q932_ros_resultArgument,
750 { "result", "q932.ros.result",
751 FT_BYTES, BASE_NONE, NULL, 0,
752 "ResultArgument", HFILL }},
753 { &hf_q932_ros_errcode,
754 { "errcode", "q932.ros.errcode",
755 FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
757 { &hf_q932_ros_parameter,
758 { "parameter", "q932.ros.parameter",
759 FT_BYTES, BASE_NONE, NULL, 0,
760 "T_parameter", HFILL }},
761 { &hf_q932_ros_problem,
762 { "problem", "q932.ros.problem",
763 FT_UINT32, BASE_DEC, VALS(q932_ros_T_problem_vals), 0,
764 "T_problem", HFILL }},
765 { &hf_q932_ros_general,
766 { "general", "q932.ros.general",
767 FT_INT32, BASE_DEC, VALS(q932_ros_GeneralProblem_vals), 0,
768 "GeneralProblem", HFILL }},
769 { &hf_q932_ros_invokeProblem,
770 { "invoke", "q932.ros.invoke",
771 FT_INT32, BASE_DEC, VALS(q932_ros_InvokeProblem_vals), 0,
772 "InvokeProblem", HFILL }},
773 { &hf_q932_ros_returnResultProblem,
774 { "returnResult", "q932.ros.returnResult",
775 FT_INT32, BASE_DEC, VALS(q932_ros_ReturnResultProblem_vals), 0,
776 "ReturnResultProblem", HFILL }},
777 { &hf_q932_ros_returnErrorProblem,
778 { "returnError", "q932.ros.returnError",
779 FT_INT32, BASE_DEC, VALS(q932_ros_ReturnErrorProblem_vals), 0,
780 "ReturnErrorProblem", HFILL }},
781 { &hf_q932_ros_present,
782 { "present", "q932.ros.present",
783 FT_INT32, BASE_DEC, NULL, 0,
785 { &hf_q932_ros_InvokeId_present,
786 { "InvokeId.present", "q932.ros.InvokeId_present",
787 FT_INT32, BASE_DEC, NULL, 0,
788 "InvokeId_present", HFILL }},
790 /*--- End of included file: packet-q932-ros-hfarr.c ---*/
791 #line 76 "packet-q932-ros-template.c"
794 /* List of subtrees */
795 static gint *ett[] = {
797 /*--- Included file: packet-q932-ros-ettarr.c ---*/
798 #line 1 "packet-q932-ros-ettarr.c"
801 &ett_q932_ros_Invoke,
802 &ett_q932_ros_T_linkedId,
803 &ett_q932_ros_ReturnResult,
804 &ett_q932_ros_T_result,
805 &ett_q932_ros_ReturnError,
806 &ett_q932_ros_Reject,
807 &ett_q932_ros_T_problem,
808 &ett_q932_ros_InvokeId,
810 /*--- End of included file: packet-q932-ros-ettarr.c ---*/
811 #line 81 "packet-q932-ros-template.c"
814 /* Register protocol and dissector */
815 proto_q932_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
816 proto_set_cant_toggle(proto_q932_ros);
818 /* Register fields and subtrees */
819 proto_register_field_array(proto_q932_ros, hf, array_length(hf));
820 proto_register_subtree_array(ett, array_length(ett));
822 new_register_dissector(PFNAME, dissect_q932_ros, proto_q932_ros);
825 /*--- proto_reg_handoff_q932_ros --------------------------------------------*/
826 void proto_reg_handoff_q932_ros(void) {
827 data_handle = find_dissector("data");
830 /*---------------------------------------------------------------------------*/