1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated 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 . -O ../../epan/dissectors ../ros/Remote-Operations-Information-Objects.asn Facility-Information-Element-Components.asn */
6 /* Input file: packet-q932-ros-template.c */
8 #line 1 "../../asn1/q932-ros/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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
36 #include <epan/packet.h>
37 #include <epan/strutil.h>
38 #include <epan/asn1.h>
39 #include <epan/expert.h>
41 #include "packet-ber.h"
43 #define PNAME "Q.932 Operations Service Element"
44 #define PSNAME "Q932.ROS"
45 #define PFNAME "q932.ros"
47 /* Initialize the protocol and registered fields */
48 static int proto_q932_ros = -1;
50 /*--- Included file: packet-q932-ros-hf.c ---*/
51 #line 1 "../../asn1/q932-ros/packet-q932-ros-hf.c"
52 static int hf_q932_ros_ROS_PDU = -1; /* ROS */
53 static int hf_q932_ros_local = -1; /* T_local */
54 static int hf_q932_ros_global = -1; /* T_global */
55 static int hf_q932_ros_invoke = -1; /* Invoke */
56 static int hf_q932_ros_returnResult = -1; /* ReturnResult */
57 static int hf_q932_ros_returnError = -1; /* ReturnError */
58 static int hf_q932_ros_reject = -1; /* Reject */
59 static int hf_q932_ros_invokeId = -1; /* InvokeId */
60 static int hf_q932_ros_linkedId = -1; /* T_linkedId */
61 static int hf_q932_ros_linkedIdPresent = -1; /* T_linkedIdPresent */
62 static int hf_q932_ros_absent = -1; /* NULL */
63 static int hf_q932_ros_opcode = -1; /* Code */
64 static int hf_q932_ros_argument = -1; /* InvokeArgument */
65 static int hf_q932_ros_result = -1; /* T_result */
66 static int hf_q932_ros_resultArgument = -1; /* ResultArgument */
67 static int hf_q932_ros_errcode = -1; /* Code */
68 static int hf_q932_ros_parameter = -1; /* T_parameter */
69 static int hf_q932_ros_problem = -1; /* T_problem */
70 static int hf_q932_ros_general = -1; /* GeneralProblem */
71 static int hf_q932_ros_invokeProblem = -1; /* InvokeProblem */
72 static int hf_q932_ros_returnResultProblem = -1; /* ReturnResultProblem */
73 static int hf_q932_ros_returnErrorProblem = -1; /* ReturnErrorProblem */
74 static int hf_q932_ros_present = -1; /* INTEGER */
75 static int hf_q932_ros_InvokeId_present = -1; /* InvokeId_present */
77 /*--- End of included file: packet-q932-ros-hf.c ---*/
78 #line 42 "../../asn1/q932-ros/packet-q932-ros-template.c"
80 /* Initialize the subtree pointers */
82 /*--- Included file: packet-q932-ros-ett.c ---*/
83 #line 1 "../../asn1/q932-ros/packet-q932-ros-ett.c"
84 static gint ett_q932_ros_Code = -1;
85 static gint ett_q932_ros_ROS = -1;
86 static gint ett_q932_ros_Invoke = -1;
87 static gint ett_q932_ros_T_linkedId = -1;
88 static gint ett_q932_ros_ReturnResult = -1;
89 static gint ett_q932_ros_T_result = -1;
90 static gint ett_q932_ros_ReturnError = -1;
91 static gint ett_q932_ros_Reject = -1;
92 static gint ett_q932_ros_T_problem = -1;
93 static gint ett_q932_ros_InvokeId = -1;
95 /*--- End of included file: packet-q932-ros-ett.c ---*/
96 #line 45 "../../asn1/q932-ros/packet-q932-ros-template.c"
101 static dissector_handle_t data_handle = NULL;
103 /* Gloabl variables */
104 static rose_ctx_t *rose_ctx_tmp;
106 static guint32 problem_val;
107 static gchar problem_str[64];
108 static tvbuff_t *arg_next_tvb, *res_next_tvb, *err_next_tvb;
112 /*--- Included file: packet-q932-ros-fn.c ---*/
113 #line 1 "../../asn1/q932-ros/packet-q932-ros-fn.c"
117 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_) {
118 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
119 &actx->rose_ctx->d.code_local);
127 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_) {
128 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->rose_ctx->d.code_global);
134 static const value_string q932_ros_Code_vals[] = {
140 static const ber_choice_t Code_choice[] = {
141 { 0, &hf_q932_ros_local , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_local },
142 { 1, &hf_q932_ros_global , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_global },
143 { 0, NULL, 0, 0, 0, NULL }
147 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_) {
148 offset = dissect_ber_choice(actx, tree, tvb, offset,
149 Code_choice, hf_index, ett_q932_ros_Code,
150 &actx->rose_ctx->d.code);
152 #line 43 "../../asn1/q932-ros/q932-ros.cnf"
153 actx->rose_ctx->d.code_item = actx->created_item;
161 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_) {
162 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
171 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_) {
172 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
178 static const value_string q932_ros_InvokeId_vals[] = {
184 static const ber_choice_t InvokeId_choice[] = {
185 { 0, &hf_q932_ros_present , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_q932_ros_INTEGER },
186 { 1, &hf_q932_ros_absent , BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_q932_ros_NULL },
187 { 0, NULL, 0, 0, 0, NULL }
191 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_) {
192 offset = dissect_ber_choice(actx, tree, tvb, offset,
193 InvokeId_choice, hf_index, ett_q932_ros_InvokeId,
202 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_) {
203 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
212 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_) {
213 offset = dissect_q932_ros_InvokeId_present(implicit_tag, tvb, offset, actx, tree, hf_index);
219 static const value_string q932_ros_T_linkedId_vals[] = {
225 static const ber_choice_t T_linkedId_choice[] = {
226 { 0, &hf_q932_ros_linkedIdPresent, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_ros_T_linkedIdPresent },
227 { 1, &hf_q932_ros_absent , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_NULL },
228 { 0, NULL, 0, 0, 0, NULL }
232 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_) {
233 offset = dissect_ber_choice(actx, tree, tvb, offset,
234 T_linkedId_choice, hf_index, ett_q932_ros_T_linkedId,
243 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_) {
244 #line 69 "../../asn1/q932-ros/q932-ros.cnf"
247 len = tvb_length_remaining(tvb, offset);
249 proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
250 arg_next_tvb = tvb_new_subset(tvb, offset, len, len);
252 offset += tvb_length_remaining(tvb, offset);
259 static const ber_sequence_t Invoke_sequence[] = {
260 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
261 { &hf_q932_ros_linkedId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_T_linkedId },
262 { &hf_q932_ros_opcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
263 { &hf_q932_ros_argument , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_InvokeArgument },
264 { NULL, 0, 0, 0, NULL }
268 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_) {
269 #line 8 "../../asn1/ros/ros-inv.cnf"
270 dissector_handle_t arg_handle = NULL;
271 const gchar *descr = "";
275 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
276 Invoke_sequence, hf_index, ett_q932_ros_Invoke);
278 #line 13 "../../asn1/ros/ros-inv.cnf"
279 actx->rose_ctx->d.pdu = 1;
281 if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->arg_local_dissector_table) {
282 arg_handle = dissector_get_uint_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
283 } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->arg_global_dissector_table) {
284 arg_handle = dissector_get_string_handle(actx->rose_ctx->arg_global_dissector_table, actx->rose_ctx->d.code_global);
290 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(arg_handle)))) {
291 if (actx->rose_ctx->d.code == 0)
292 descr = ep_strdup_printf("INV: %d", actx->rose_ctx->d.code_local);
293 else if (actx->rose_ctx->d.code == 1)
294 descr = ep_strdup_printf("INV: %s", actx->rose_ctx->d.code_global);
296 descr = ep_strdup_printf("INV:");
299 if (actx->rose_ctx->apdu_depth >= 0)
300 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
301 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
302 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
303 if (actx->rose_ctx->fillin_ptr)
304 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
306 if (!arg_next_tvb) { /* empty argument */
307 arg_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
309 actx->pinfo->private_data = actx->rose_ctx;
310 call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
312 expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr);
321 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_) {
322 #line 87 "../../asn1/q932-ros/q932-ros.cnf"
325 len = tvb_length_remaining(tvb, offset);
327 proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
328 res_next_tvb = tvb_new_subset(tvb, offset, len, len);
330 offset += tvb_length_remaining(tvb, offset);
338 static const ber_sequence_t T_result_sequence[] = {
339 { &hf_q932_ros_opcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
340 { &hf_q932_ros_resultArgument, BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_q932_ros_ResultArgument },
341 { NULL, 0, 0, 0, NULL }
345 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_) {
346 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
347 T_result_sequence, hf_index, ett_q932_ros_T_result);
353 static const ber_sequence_t ReturnResult_sequence[] = {
354 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
355 { &hf_q932_ros_result , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_result },
356 { NULL, 0, 0, 0, NULL }
360 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_) {
361 #line 7 "../../asn1/ros/ros-res.cnf"
362 dissector_handle_t res_handle = NULL;
363 const gchar *descr = "";
365 actx->rose_ctx->d.code = -1;
368 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
369 ReturnResult_sequence, hf_index, ett_q932_ros_ReturnResult);
371 #line 13 "../../asn1/ros/ros-res.cnf"
372 actx->rose_ctx->d.pdu = 2;
374 if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->res_local_dissector_table) {
375 res_handle = dissector_get_uint_handle(actx->rose_ctx->res_local_dissector_table, actx->rose_ctx->d.code_local);
376 } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->res_global_dissector_table) {
377 res_handle = dissector_get_string_handle(actx->rose_ctx->res_global_dissector_table, actx->rose_ctx->d.code_global);
383 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
384 if (actx->rose_ctx->d.code == 0)
385 descr = ep_strdup_printf("RES: %d", actx->rose_ctx->d.code_local);
386 else if (actx->rose_ctx->d.code == 1)
387 descr = ep_strdup_printf("RES: %s", actx->rose_ctx->d.code_global);
389 descr = ep_strdup_printf("RES:");
392 if (actx->rose_ctx->apdu_depth >= 0)
393 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
394 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
395 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
396 if (actx->rose_ctx->fillin_ptr)
397 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
399 if (actx->rose_ctx->d.code != -1) {
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);
416 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_) {
417 #line 106 "../../asn1/q932-ros/q932-ros.cnf"
421 len = tvb_length_remaining(tvb, offset);
423 proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
424 err_next_tvb = tvb_new_subset(tvb, offset, len, len);
426 offset += tvb_length_remaining(tvb, offset);
433 static const ber_sequence_t ReturnError_sequence[] = {
434 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
435 { &hf_q932_ros_errcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
436 { &hf_q932_ros_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_parameter },
437 { NULL, 0, 0, 0, NULL }
441 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_) {
442 #line 7 "../../asn1/ros/ros-err.cnf"
443 dissector_handle_t err_handle = NULL;
444 const gchar *descr = "";
448 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
449 ReturnError_sequence, hf_index, ett_q932_ros_ReturnError);
451 #line 12 "../../asn1/ros/ros-err.cnf"
452 actx->rose_ctx->d.pdu = 3;
454 if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->err_local_dissector_table) {
455 err_handle = dissector_get_uint_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
456 } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->err_global_dissector_table) {
457 err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
463 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
464 if (actx->rose_ctx->d.code == 0)
465 descr = ep_strdup_printf("ERR: %d", actx->rose_ctx->d.code_local);
466 else if (actx->rose_ctx->d.code == 1)
467 descr = ep_strdup_printf("ERR: %s", actx->rose_ctx->d.code_global);
469 descr = ep_strdup_printf("ERR:");
472 if (actx->rose_ctx->apdu_depth >= 0)
473 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
474 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
475 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
476 if (actx->rose_ctx->fillin_ptr)
477 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
479 if (!err_next_tvb) { /* empty error */
480 err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
482 actx->pinfo->private_data = actx->rose_ctx;
483 call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
485 expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr);
492 static const value_string q932_ros_GeneralProblem_vals[] = {
493 { 0, "unrecognizedComponent" },
494 { 1, "mistypedComponent" },
495 { 2, "badlyStructuredComponent" },
501 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_) {
502 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
505 #line 54 "../../asn1/q932-ros/q932-ros.cnf"
506 g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_GeneralProblem_vals), ""), 64);
512 static const value_string q932_ros_InvokeProblem_vals[] = {
513 { 0, "duplicateInvocation" },
514 { 1, "unrecognizedOperation" },
515 { 2, "mistypedArgument" },
516 { 3, "resourceLimitation" },
517 { 4, "releaseInProgress" },
518 { 5, "unrecognizedLinkedId" },
519 { 6, "linkedResponseUnexpected" },
520 { 7, "unexpectedLinkedOperation" },
526 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_) {
527 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
530 #line 56 "../../asn1/q932-ros/q932-ros.cnf"
531 g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_InvokeProblem_vals), ""), 64);
537 static const value_string q932_ros_ReturnResultProblem_vals[] = {
538 { 0, "unrecognizedInvocation" },
539 { 1, "resultResponseUnexpected" },
540 { 2, "mistypedResult" },
546 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_) {
547 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
550 #line 58 "../../asn1/q932-ros/q932-ros.cnf"
551 g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""), 64);
557 static const value_string q932_ros_ReturnErrorProblem_vals[] = {
558 { 0, "unrecognizedInvocation" },
559 { 1, "errorResponseUnexpected" },
560 { 2, "unrecognizedError" },
561 { 3, "unexpectedError" },
562 { 4, "mistypedParameter" },
568 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_) {
569 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
572 #line 60 "../../asn1/q932-ros/q932-ros.cnf"
573 g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""), 64);
579 static const value_string q932_ros_T_problem_vals[] = {
582 { 2, "returnResult" },
583 { 3, "returnError" },
587 static const ber_choice_t T_problem_choice[] = {
588 { 0, &hf_q932_ros_general , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_ros_GeneralProblem },
589 { 1, &hf_q932_ros_invokeProblem, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_InvokeProblem },
590 { 2, &hf_q932_ros_returnResultProblem, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnResultProblem },
591 { 3, &hf_q932_ros_returnErrorProblem, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnErrorProblem },
592 { 0, NULL, 0, 0, 0, NULL }
596 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_) {
597 offset = dissect_ber_choice(actx, tree, tvb, offset,
598 T_problem_choice, hf_index, ett_q932_ros_T_problem,
605 static const ber_sequence_t Reject_sequence[] = {
606 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
607 { &hf_q932_ros_problem , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_T_problem },
608 { NULL, 0, 0, 0, NULL }
612 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_) {
613 #line 7 "../../asn1/ros/ros-rej.cnf"
614 const gchar *descr = "";
616 problem_str[0] = '\0';
618 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
619 Reject_sequence, hf_index, ett_q932_ros_Reject);
621 #line 11 "../../asn1/ros/ros-rej.cnf"
622 descr = ep_strdup_printf("REJ: %s", problem_str);
624 if (actx->rose_ctx->apdu_depth >= 0)
625 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
626 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
627 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
628 if (actx->rose_ctx->fillin_ptr)
629 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
635 static const value_string q932_ros_ROS_vals[] = {
637 { 2, "returnResult" },
638 { 3, "returnError" },
643 static const ber_choice_t ROS_choice[] = {
644 { 1, &hf_q932_ros_invoke , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_Invoke },
645 { 2, &hf_q932_ros_returnResult, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnResult },
646 { 3, &hf_q932_ros_returnError, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnError },
647 { 4, &hf_q932_ros_reject , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_q932_ros_Reject },
648 { 0, NULL, 0, 0, 0, NULL }
652 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_) {
653 #line 31 "../../asn1/q932-ros/q932-ros.cnf"
654 /* will be moved to ROS_PDU when PDU function can be alternated from conformance file */
655 actx->rose_ctx = rose_ctx_tmp;
656 rose_ctx_clean_data(actx->rose_ctx);
658 offset = dissect_ber_choice(actx, tree, tvb, offset,
659 ROS_choice, hf_index, ett_q932_ros_ROS,
667 static int dissect_ROS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
670 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
671 offset = dissect_q932_ros_ROS(FALSE, tvb, offset, &asn1_ctx, tree, hf_q932_ros_ROS_PDU);
676 /*--- End of included file: packet-q932-ros-fn.c ---*/
677 #line 60 "../../asn1/q932-ros/packet-q932-ros-template.c"
679 /*--- dissect_q932_ros -----------------------------------------------------*/
680 static int dissect_q932_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
681 rose_ctx_tmp = get_rose_ctx(pinfo->private_data);
682 DISSECTOR_ASSERT(rose_ctx_tmp);
683 return dissect_ROS_PDU(tvb, pinfo, tree, NULL);
686 /*--- proto_register_q932_ros -----------------------------------------------*/
687 void proto_register_q932_ros(void) {
690 static hf_register_info hf[] = {
692 /*--- Included file: packet-q932-ros-hfarr.c ---*/
693 #line 1 "../../asn1/q932-ros/packet-q932-ros-hfarr.c"
694 { &hf_q932_ros_ROS_PDU,
695 { "ROS", "q932.ros.ROS",
696 FT_UINT32, BASE_DEC, VALS(q932_ros_ROS_vals), 0,
698 { &hf_q932_ros_local,
699 { "local", "q932.ros.local",
700 FT_INT32, BASE_DEC, NULL, 0,
702 { &hf_q932_ros_global,
703 { "global", "q932.ros.global",
704 FT_OID, BASE_NONE, NULL, 0,
706 { &hf_q932_ros_invoke,
707 { "invoke", "q932.ros.invoke_element",
708 FT_NONE, BASE_NONE, NULL, 0,
710 { &hf_q932_ros_returnResult,
711 { "returnResult", "q932.ros.returnResult_element",
712 FT_NONE, BASE_NONE, NULL, 0,
714 { &hf_q932_ros_returnError,
715 { "returnError", "q932.ros.returnError_element",
716 FT_NONE, BASE_NONE, NULL, 0,
718 { &hf_q932_ros_reject,
719 { "reject", "q932.ros.reject_element",
720 FT_NONE, BASE_NONE, NULL, 0,
722 { &hf_q932_ros_invokeId,
723 { "invokeId", "q932.ros.invokeId",
724 FT_UINT32, BASE_DEC, VALS(q932_ros_InvokeId_vals), 0,
726 { &hf_q932_ros_linkedId,
727 { "linkedId", "q932.ros.linkedId",
728 FT_UINT32, BASE_DEC, VALS(q932_ros_T_linkedId_vals), 0,
730 { &hf_q932_ros_linkedIdPresent,
731 { "present", "q932.ros.present",
732 FT_INT32, BASE_DEC, NULL, 0,
733 "T_linkedIdPresent", HFILL }},
734 { &hf_q932_ros_absent,
735 { "absent", "q932.ros.absent_element",
736 FT_NONE, BASE_NONE, NULL, 0,
738 { &hf_q932_ros_opcode,
739 { "opcode", "q932.ros.opcode",
740 FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
742 { &hf_q932_ros_argument,
743 { "argument", "q932.ros.argument",
744 FT_BYTES, BASE_NONE, NULL, 0,
745 "InvokeArgument", HFILL }},
746 { &hf_q932_ros_result,
747 { "result", "q932.ros.result_element",
748 FT_NONE, BASE_NONE, NULL, 0,
750 { &hf_q932_ros_resultArgument,
751 { "result", "q932.ros.result",
752 FT_BYTES, BASE_NONE, NULL, 0,
753 "ResultArgument", HFILL }},
754 { &hf_q932_ros_errcode,
755 { "errcode", "q932.ros.errcode",
756 FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
758 { &hf_q932_ros_parameter,
759 { "parameter", "q932.ros.parameter",
760 FT_BYTES, BASE_NONE, NULL, 0,
762 { &hf_q932_ros_problem,
763 { "problem", "q932.ros.problem",
764 FT_UINT32, BASE_DEC, VALS(q932_ros_T_problem_vals), 0,
766 { &hf_q932_ros_general,
767 { "general", "q932.ros.general",
768 FT_INT32, BASE_DEC, VALS(q932_ros_GeneralProblem_vals), 0,
769 "GeneralProblem", HFILL }},
770 { &hf_q932_ros_invokeProblem,
771 { "invoke", "q932.ros.invoke",
772 FT_INT32, BASE_DEC, VALS(q932_ros_InvokeProblem_vals), 0,
773 "InvokeProblem", HFILL }},
774 { &hf_q932_ros_returnResultProblem,
775 { "returnResult", "q932.ros.returnResult",
776 FT_INT32, BASE_DEC, VALS(q932_ros_ReturnResultProblem_vals), 0,
777 "ReturnResultProblem", HFILL }},
778 { &hf_q932_ros_returnErrorProblem,
779 { "returnError", "q932.ros.returnError",
780 FT_INT32, BASE_DEC, VALS(q932_ros_ReturnErrorProblem_vals), 0,
781 "ReturnErrorProblem", HFILL }},
782 { &hf_q932_ros_present,
783 { "present", "q932.ros.present",
784 FT_INT32, BASE_DEC, NULL, 0,
786 { &hf_q932_ros_InvokeId_present,
787 { "InvokeId.present", "q932.ros.InvokeId_present",
788 FT_INT32, BASE_DEC, NULL, 0,
789 "InvokeId_present", HFILL }},
791 /*--- End of included file: packet-q932-ros-hfarr.c ---*/
792 #line 74 "../../asn1/q932-ros/packet-q932-ros-template.c"
795 /* List of subtrees */
796 static gint *ett[] = {
798 /*--- Included file: packet-q932-ros-ettarr.c ---*/
799 #line 1 "../../asn1/q932-ros/packet-q932-ros-ettarr.c"
802 &ett_q932_ros_Invoke,
803 &ett_q932_ros_T_linkedId,
804 &ett_q932_ros_ReturnResult,
805 &ett_q932_ros_T_result,
806 &ett_q932_ros_ReturnError,
807 &ett_q932_ros_Reject,
808 &ett_q932_ros_T_problem,
809 &ett_q932_ros_InvokeId,
811 /*--- End of included file: packet-q932-ros-ettarr.c ---*/
812 #line 79 "../../asn1/q932-ros/packet-q932-ros-template.c"
815 /* Register protocol and dissector */
816 proto_q932_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
817 proto_set_cant_toggle(proto_q932_ros);
819 /* Register fields and subtrees */
820 proto_register_field_array(proto_q932_ros, hf, array_length(hf));
821 proto_register_subtree_array(ett, array_length(ett));
823 new_register_dissector(PFNAME, dissect_q932_ros, proto_q932_ros);
826 /*--- proto_reg_handoff_q932_ros --------------------------------------------*/
827 void proto_reg_handoff_q932_ros(void) {
828 data_handle = find_dissector("data");
831 /*---------------------------------------------------------------------------*/