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 -T -X -p q932.ros -c q932-ros.cnf -s packet-q932-ros-template ../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.
40 #include <epan/packet.h>
41 #include <epan/strutil.h>
42 #include <epan/emem.h>
43 #include <epan/asn1.h>
45 #include "packet-ber.h"
47 #define PNAME "Q.932 Operations Service Element"
48 #define PSNAME "Q932.ROS"
49 #define PFNAME "q932.ros"
51 /* Initialize the protocol and registered fields */
52 int proto_q932_ros = -1;
54 /*--- Included file: packet-q932-ros-hf.c ---*/
55 #line 1 "packet-q932-ros-hf.c"
56 static int hf_q932_ros_ROS_PDU = -1; /* ROS */
57 static int hf_q932_ros_local = -1; /* T_local */
58 static int hf_q932_ros_global = -1; /* T_global */
59 static int hf_q932_ros_invoke = -1; /* Invoke */
60 static int hf_q932_ros_returnResult = -1; /* ReturnResult */
61 static int hf_q932_ros_returnError = -1; /* ReturnError */
62 static int hf_q932_ros_reject = -1; /* Reject */
63 static int hf_q932_ros_invokeId = -1; /* InvokeId */
64 static int hf_q932_ros_linkedId = -1; /* T_linkedId */
65 static int hf_q932_ros_linkedIdPresent = -1; /* T_linkedIdPresent */
66 static int hf_q932_ros_absent = -1; /* NULL */
67 static int hf_q932_ros_opcode = -1; /* Code */
68 static int hf_q932_ros_argument = -1; /* InvokeArgument */
69 static int hf_q932_ros_result = -1; /* T_result */
70 static int hf_q932_ros_resultArgument = -1; /* ResultArgument */
71 static int hf_q932_ros_errcode = -1; /* Code */
72 static int hf_q932_ros_parameter = -1; /* T_parameter */
73 static int hf_q932_ros_problem = -1; /* T_problem */
74 static int hf_q932_ros_general = -1; /* GeneralProblem */
75 static int hf_q932_ros_invokeProblem = -1; /* InvokeProblem */
76 static int hf_q932_ros_returnResultProblem = -1; /* ReturnResultProblem */
77 static int hf_q932_ros_returnErrorProblem = -1; /* ReturnErrorProblem */
78 static int hf_q932_ros_present = -1; /* INTEGER */
79 static int hf_q932_ros_InvokeId_present = -1; /* InvokeId_present */
81 /*--- End of included file: packet-q932-ros-hf.c ---*/
82 #line 46 "packet-q932-ros-template.c"
84 /* Initialize the subtree pointers */
86 /*--- Included file: packet-q932-ros-ett.c ---*/
87 #line 1 "packet-q932-ros-ett.c"
88 static gint ett_q932_ros_Code = -1;
89 static gint ett_q932_ros_ROS = -1;
90 static gint ett_q932_ros_Invoke = -1;
91 static gint ett_q932_ros_T_linkedId = -1;
92 static gint ett_q932_ros_ReturnResult = -1;
93 static gint ett_q932_ros_T_result = -1;
94 static gint ett_q932_ros_ReturnError = -1;
95 static gint ett_q932_ros_Reject = -1;
96 static gint ett_q932_ros_T_problem = -1;
97 static gint ett_q932_ros_InvokeId = -1;
99 /*--- End of included file: packet-q932-ros-ett.c ---*/
100 #line 49 "packet-q932-ros-template.c"
105 static dissector_handle_t data_handle = NULL;
107 /* Gloabl variables */
108 static rose_ctx_t *rose_ctx_tmp;
110 static guint32 problem_val;
111 static gchar problem_str[64];
112 static tvbuff_t *arg_next_tvb, *res_next_tvb, *err_next_tvb;
116 /*--- Included file: packet-q932-ros-fn.c ---*/
117 #line 1 "packet-q932-ros-fn.c"
121 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_) {
122 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
123 &actx->rose_ctx->d.code_local);
131 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_) {
132 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->rose_ctx->d.code_global);
138 static const value_string q932_ros_Code_vals[] = {
144 static const ber_choice_t Code_choice[] = {
145 { 0, &hf_q932_ros_local , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_local },
146 { 1, &hf_q932_ros_global , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_global },
147 { 0, NULL, 0, 0, 0, NULL }
151 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_) {
152 offset = dissect_ber_choice(actx, tree, tvb, offset,
153 Code_choice, hf_index, ett_q932_ros_Code,
154 &actx->rose_ctx->d.code);
156 #line 43 "q932-ros.cnf"
157 actx->rose_ctx->d.code_item = actx->created_item;
165 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_) {
166 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
175 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_) {
176 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
182 static const value_string q932_ros_InvokeId_vals[] = {
188 static const ber_choice_t InvokeId_choice[] = {
189 { 0, &hf_q932_ros_present , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_q932_ros_INTEGER },
190 { 1, &hf_q932_ros_absent , BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_q932_ros_NULL },
191 { 0, NULL, 0, 0, 0, NULL }
195 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_) {
196 offset = dissect_ber_choice(actx, tree, tvb, offset,
197 InvokeId_choice, hf_index, ett_q932_ros_InvokeId,
206 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_) {
207 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
216 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_) {
217 offset = dissect_q932_ros_InvokeId_present(implicit_tag, tvb, offset, actx, tree, hf_index);
223 static const value_string q932_ros_T_linkedId_vals[] = {
229 static const ber_choice_t T_linkedId_choice[] = {
230 { 0, &hf_q932_ros_linkedIdPresent, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_ros_T_linkedIdPresent },
231 { 1, &hf_q932_ros_absent , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_NULL },
232 { 0, NULL, 0, 0, 0, NULL }
236 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_) {
237 offset = dissect_ber_choice(actx, tree, tvb, offset,
238 T_linkedId_choice, hf_index, ett_q932_ros_T_linkedId,
247 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_) {
248 #line 69 "q932-ros.cnf"
251 len = tvb_length_remaining(tvb, offset);
253 proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
254 arg_next_tvb = tvb_new_subset(tvb, offset, len, len);
256 offset += tvb_length_remaining(tvb, offset);
263 static const ber_sequence_t Invoke_sequence[] = {
264 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
265 { &hf_q932_ros_linkedId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_T_linkedId },
266 { &hf_q932_ros_opcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
267 { &hf_q932_ros_argument , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_InvokeArgument },
268 { NULL, 0, 0, 0, NULL }
272 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_) {
273 #line 8 "ros-inv.cnf"
274 dissector_handle_t arg_handle = NULL;
275 const gchar *descr = "";
279 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
280 Invoke_sequence, hf_index, ett_q932_ros_Invoke);
282 #line 13 "ros-inv.cnf"
283 actx->rose_ctx->d.pdu = 1;
285 if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->arg_local_dissector_table) {
286 arg_handle = dissector_get_port_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
287 } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->arg_global_dissector_table) {
288 arg_handle = dissector_get_string_handle(actx->rose_ctx->arg_global_dissector_table, actx->rose_ctx->d.code_global);
294 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(arg_handle)))) {
295 if (actx->rose_ctx->d.code == 0)
296 descr = ep_strdup_printf("INV: %d", actx->rose_ctx->d.code_local);
297 else if (actx->rose_ctx->d.code == 1)
298 descr = ep_strdup_printf("INV: %s", actx->rose_ctx->d.code_global);
300 descr = ep_strdup_printf("INV:");
303 if (actx->rose_ctx->apdu_depth >= 0)
304 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
305 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
306 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
307 if (actx->rose_ctx->fillin_ptr)
308 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
310 if (!arg_next_tvb) { /* empty argument */
311 arg_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
313 actx->pinfo->private_data = actx->rose_ctx;
314 call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
322 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_) {
323 #line 87 "q932-ros.cnf"
326 len = tvb_length_remaining(tvb, offset);
328 proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
329 res_next_tvb = tvb_new_subset(tvb, offset, len, len);
331 offset += tvb_length_remaining(tvb, offset);
339 static const ber_sequence_t T_result_sequence[] = {
340 { &hf_q932_ros_opcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
341 { &hf_q932_ros_resultArgument, BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_q932_ros_ResultArgument },
342 { NULL, 0, 0, 0, NULL }
346 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_) {
347 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
348 T_result_sequence, hf_index, ett_q932_ros_T_result);
354 static const ber_sequence_t ReturnResult_sequence[] = {
355 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
356 { &hf_q932_ros_result , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_result },
357 { NULL, 0, 0, 0, NULL }
361 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_) {
362 #line 7 "ros-res.cnf"
363 dissector_handle_t res_handle = NULL;
364 const gchar *descr = "";
368 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
369 ReturnResult_sequence, hf_index, ett_q932_ros_ReturnResult);
371 #line 12 "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_port_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 (!res_next_tvb) { /* empty result */
400 res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
402 actx->pinfo->private_data = actx->rose_ctx;
403 call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree);
411 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_) {
412 #line 106 "q932-ros.cnf"
416 len = tvb_length_remaining(tvb, offset);
418 proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
419 err_next_tvb = tvb_new_subset(tvb, offset, len, len);
421 offset += tvb_length_remaining(tvb, offset);
428 static const ber_sequence_t ReturnError_sequence[] = {
429 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
430 { &hf_q932_ros_errcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
431 { &hf_q932_ros_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_parameter },
432 { NULL, 0, 0, 0, NULL }
436 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_) {
437 #line 7 "ros-err.cnf"
438 dissector_handle_t err_handle = NULL;
439 const gchar *descr = "";
443 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
444 ReturnError_sequence, hf_index, ett_q932_ros_ReturnError);
446 #line 12 "ros-err.cnf"
447 actx->rose_ctx->d.pdu = 3;
449 if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->err_local_dissector_table) {
450 err_handle = dissector_get_port_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
451 } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->err_global_dissector_table) {
452 err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
458 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
459 if (actx->rose_ctx->d.code == 0)
460 descr = ep_strdup_printf("ERR: %d", actx->rose_ctx->d.code_local);
461 else if (actx->rose_ctx->d.code == 1)
462 descr = ep_strdup_printf("ERR: %s", actx->rose_ctx->d.code_global);
464 descr = ep_strdup_printf("ERR:");
467 if (actx->rose_ctx->apdu_depth >= 0)
468 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
469 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
470 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
471 if (actx->rose_ctx->fillin_ptr)
472 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
474 if (!err_next_tvb) { /* empty error */
475 err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
477 actx->pinfo->private_data = actx->rose_ctx;
478 call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
484 static const value_string q932_ros_GeneralProblem_vals[] = {
485 { 0, "unrecognizedComponent" },
486 { 1, "mistypedComponent" },
487 { 2, "badlyStructuredComponent" },
493 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_) {
494 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
497 #line 54 "q932-ros.cnf"
498 strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_GeneralProblem_vals), ""));
504 static const value_string q932_ros_InvokeProblem_vals[] = {
505 { 0, "duplicateInvocation" },
506 { 1, "unrecognizedOperation" },
507 { 2, "mistypedArgument" },
508 { 3, "resourceLimitation" },
509 { 4, "releaseInProgress" },
510 { 5, "unrecognizedLinkedId" },
511 { 6, "linkedResponseUnexpected" },
512 { 7, "unexpectedLinkedOperation" },
518 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_) {
519 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
522 #line 56 "q932-ros.cnf"
523 strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_InvokeProblem_vals), ""));
529 static const value_string q932_ros_ReturnResultProblem_vals[] = {
530 { 0, "unrecognizedInvocation" },
531 { 1, "resultResponseUnexpected" },
532 { 2, "mistypedResult" },
538 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_) {
539 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
542 #line 58 "q932-ros.cnf"
543 strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""));
549 static const value_string q932_ros_ReturnErrorProblem_vals[] = {
550 { 0, "unrecognizedInvocation" },
551 { 1, "errorResponseUnexpected" },
552 { 2, "unrecognizedError" },
553 { 3, "unexpectedError" },
554 { 4, "mistypedParameter" },
560 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_) {
561 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
564 #line 60 "q932-ros.cnf"
565 strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""));
571 static const value_string q932_ros_T_problem_vals[] = {
574 { 2, "returnResult" },
575 { 3, "returnError" },
579 static const ber_choice_t T_problem_choice[] = {
580 { 0, &hf_q932_ros_general , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_ros_GeneralProblem },
581 { 1, &hf_q932_ros_invokeProblem, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_InvokeProblem },
582 { 2, &hf_q932_ros_returnResultProblem, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnResultProblem },
583 { 3, &hf_q932_ros_returnErrorProblem, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnErrorProblem },
584 { 0, NULL, 0, 0, 0, NULL }
588 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_) {
589 offset = dissect_ber_choice(actx, tree, tvb, offset,
590 T_problem_choice, hf_index, ett_q932_ros_T_problem,
597 static const ber_sequence_t Reject_sequence[] = {
598 { &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
599 { &hf_q932_ros_problem , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_T_problem },
600 { NULL, 0, 0, 0, NULL }
604 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_) {
605 #line 7 "ros-rej.cnf"
606 const gchar *descr = "";
608 problem_str[0] = '\0';
610 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
611 Reject_sequence, hf_index, ett_q932_ros_Reject);
613 #line 11 "ros-rej.cnf"
614 descr = ep_strdup_printf("REJ: %s", problem_str);
616 if (actx->rose_ctx->apdu_depth >= 0)
617 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
618 if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
619 col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
620 if (actx->rose_ctx->fillin_ptr)
621 g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
627 static const value_string q932_ros_ROS_vals[] = {
629 { 2, "returnResult" },
630 { 3, "returnError" },
635 static const ber_choice_t ROS_choice[] = {
636 { 1, &hf_q932_ros_invoke , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_Invoke },
637 { 2, &hf_q932_ros_returnResult, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnResult },
638 { 3, &hf_q932_ros_returnError, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnError },
639 { 4, &hf_q932_ros_reject , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_q932_ros_Reject },
640 { 0, NULL, 0, 0, 0, NULL }
644 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_) {
645 #line 31 "q932-ros.cnf"
646 /* will be moved to ROS_PDU when PDU function can be alternated from conformance file */
647 actx->rose_ctx = rose_ctx_tmp;
648 rose_ctx_clean_data(actx->rose_ctx);
650 offset = dissect_ber_choice(actx, tree, tvb, offset,
651 ROS_choice, hf_index, ett_q932_ros_ROS,
659 static int dissect_ROS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
662 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
663 offset = dissect_q932_ros_ROS(FALSE, tvb, offset, &asn1_ctx, tree, hf_q932_ros_ROS_PDU);
668 /*--- End of included file: packet-q932-ros-fn.c ---*/
669 #line 64 "packet-q932-ros-template.c"
671 /*--- dissect_q932_ros -----------------------------------------------------*/
672 static int dissect_q932_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
673 rose_ctx_tmp = get_rose_ctx(pinfo->private_data);
674 DISSECTOR_ASSERT(rose_ctx_tmp);
675 return dissect_ROS_PDU(tvb, pinfo, tree);
678 /*--- proto_register_q932_ros -----------------------------------------------*/
679 void proto_register_q932_ros(void) {
682 static hf_register_info hf[] = {
684 /*--- Included file: packet-q932-ros-hfarr.c ---*/
685 #line 1 "packet-q932-ros-hfarr.c"
686 { &hf_q932_ros_ROS_PDU,
687 { "ROS", "q932.ros.ROS",
688 FT_UINT32, BASE_DEC, VALS(q932_ros_ROS_vals), 0,
689 "q932_ros.ROS", HFILL }},
690 { &hf_q932_ros_local,
691 { "local", "q932.ros.local",
692 FT_INT32, BASE_DEC, NULL, 0,
693 "q932_ros.T_local", HFILL }},
694 { &hf_q932_ros_global,
695 { "global", "q932.ros.global",
696 FT_OID, BASE_NONE, NULL, 0,
697 "q932_ros.T_global", HFILL }},
698 { &hf_q932_ros_invoke,
699 { "invoke", "q932.ros.invoke",
700 FT_NONE, BASE_NONE, NULL, 0,
701 "q932_ros.Invoke", HFILL }},
702 { &hf_q932_ros_returnResult,
703 { "returnResult", "q932.ros.returnResult",
704 FT_NONE, BASE_NONE, NULL, 0,
705 "q932_ros.ReturnResult", HFILL }},
706 { &hf_q932_ros_returnError,
707 { "returnError", "q932.ros.returnError",
708 FT_NONE, BASE_NONE, NULL, 0,
709 "q932_ros.ReturnError", HFILL }},
710 { &hf_q932_ros_reject,
711 { "reject", "q932.ros.reject",
712 FT_NONE, BASE_NONE, NULL, 0,
713 "q932_ros.Reject", HFILL }},
714 { &hf_q932_ros_invokeId,
715 { "invokeId", "q932.ros.invokeId",
716 FT_UINT32, BASE_DEC, VALS(q932_ros_InvokeId_vals), 0,
717 "q932_ros.InvokeId", HFILL }},
718 { &hf_q932_ros_linkedId,
719 { "linkedId", "q932.ros.linkedId",
720 FT_UINT32, BASE_DEC, VALS(q932_ros_T_linkedId_vals), 0,
721 "q932_ros.T_linkedId", HFILL }},
722 { &hf_q932_ros_linkedIdPresent,
723 { "present", "q932.ros.present",
724 FT_INT32, BASE_DEC, NULL, 0,
725 "q932_ros.T_linkedIdPresent", HFILL }},
726 { &hf_q932_ros_absent,
727 { "absent", "q932.ros.absent",
728 FT_NONE, BASE_NONE, NULL, 0,
729 "q932_ros.NULL", HFILL }},
730 { &hf_q932_ros_opcode,
731 { "opcode", "q932.ros.opcode",
732 FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
733 "q932_ros.Code", HFILL }},
734 { &hf_q932_ros_argument,
735 { "argument", "q932.ros.argument",
736 FT_BYTES, BASE_HEX, NULL, 0,
737 "q932_ros.InvokeArgument", HFILL }},
738 { &hf_q932_ros_result,
739 { "result", "q932.ros.result",
740 FT_NONE, BASE_NONE, NULL, 0,
741 "q932_ros.T_result", HFILL }},
742 { &hf_q932_ros_resultArgument,
743 { "result", "q932.ros.result",
744 FT_BYTES, BASE_HEX, NULL, 0,
745 "q932_ros.ResultArgument", HFILL }},
746 { &hf_q932_ros_errcode,
747 { "errcode", "q932.ros.errcode",
748 FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
749 "q932_ros.Code", HFILL }},
750 { &hf_q932_ros_parameter,
751 { "parameter", "q932.ros.parameter",
752 FT_BYTES, BASE_HEX, NULL, 0,
753 "q932_ros.T_parameter", HFILL }},
754 { &hf_q932_ros_problem,
755 { "problem", "q932.ros.problem",
756 FT_UINT32, BASE_DEC, VALS(q932_ros_T_problem_vals), 0,
757 "q932_ros.T_problem", HFILL }},
758 { &hf_q932_ros_general,
759 { "general", "q932.ros.general",
760 FT_INT32, BASE_DEC, VALS(q932_ros_GeneralProblem_vals), 0,
761 "q932_ros.GeneralProblem", HFILL }},
762 { &hf_q932_ros_invokeProblem,
763 { "invoke", "q932.ros.invoke",
764 FT_INT32, BASE_DEC, VALS(q932_ros_InvokeProblem_vals), 0,
765 "q932_ros.InvokeProblem", HFILL }},
766 { &hf_q932_ros_returnResultProblem,
767 { "returnResult", "q932.ros.returnResult",
768 FT_INT32, BASE_DEC, VALS(q932_ros_ReturnResultProblem_vals), 0,
769 "q932_ros.ReturnResultProblem", HFILL }},
770 { &hf_q932_ros_returnErrorProblem,
771 { "returnError", "q932.ros.returnError",
772 FT_INT32, BASE_DEC, VALS(q932_ros_ReturnErrorProblem_vals), 0,
773 "q932_ros.ReturnErrorProblem", HFILL }},
774 { &hf_q932_ros_present,
775 { "present", "q932.ros.present",
776 FT_INT32, BASE_DEC, NULL, 0,
777 "q932_ros.INTEGER", HFILL }},
778 { &hf_q932_ros_InvokeId_present,
779 { "InvokeId.present", "q932.ros.InvokeId_present",
780 FT_INT32, BASE_DEC, NULL, 0,
781 "q932_ros.InvokeId_present", HFILL }},
783 /*--- End of included file: packet-q932-ros-hfarr.c ---*/
784 #line 78 "packet-q932-ros-template.c"
787 /* List of subtrees */
788 static gint *ett[] = {
790 /*--- Included file: packet-q932-ros-ettarr.c ---*/
791 #line 1 "packet-q932-ros-ettarr.c"
794 &ett_q932_ros_Invoke,
795 &ett_q932_ros_T_linkedId,
796 &ett_q932_ros_ReturnResult,
797 &ett_q932_ros_T_result,
798 &ett_q932_ros_ReturnError,
799 &ett_q932_ros_Reject,
800 &ett_q932_ros_T_problem,
801 &ett_q932_ros_InvokeId,
803 /*--- End of included file: packet-q932-ros-ettarr.c ---*/
804 #line 83 "packet-q932-ros-template.c"
807 /* Register protocol and dissector */
808 proto_q932_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
809 proto_set_cant_toggle(proto_q932_ros);
811 /* Register fields and subtrees */
812 proto_register_field_array(proto_q932_ros, hf, array_length(hf));
813 proto_register_subtree_array(ett, array_length(ett));
815 new_register_dissector(PFNAME, dissect_q932_ros, proto_q932_ros);
818 /*--- proto_reg_handoff_q932_ros --------------------------------------------*/
819 void proto_reg_handoff_q932_ros(void) {
820 data_handle = find_dissector("data");
823 /*---------------------------------------------------------------------------*/