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 -p q932.ros -c q932-ros.cnf -o q932-ros -s packet-q932-ros-template q932-ros.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/prefs.h>
42 #include <epan/strutil.h>
43 #include <epan/emem.h>
45 #include "packet-ber.h"
46 #include "packet-q932-ros.h"
48 #define PNAME "Q.932 Operations Service Element"
49 #define PSNAME "Q932.ROS"
50 #define PFNAME "q932.ros"
52 /* Initialize the protocol and registered fields */
55 /*--- Included file: packet-q932-ros-hf.c ---*/
56 #line 1 "packet-q932-ros-hf.c"
57 static int hf_q932_ros_RoseAPDU_PDU = -1; /* RoseAPDU */
58 static int hf_q932_ros_local = -1; /* T_local */
59 static int hf_q932_ros_global = -1; /* T_global */
60 static int hf_q932_ros_invoke = -1; /* Invoke */
61 static int hf_q932_ros_returnResult = -1; /* ReturnResult */
62 static int hf_q932_ros_returnError = -1; /* ReturnError */
63 static int hf_q932_ros_reject = -1; /* Reject */
64 static int hf_q932_ros_invokeId = -1; /* InvokeId */
65 static int hf_q932_ros_linkedId = -1; /* T_linkedId */
66 static int hf_q932_ros_linkedIdPresent = -1; /* InvokeId */
67 static int hf_q932_ros_absent = -1; /* NULL */
68 static int hf_q932_ros_opcode = -1; /* Code */
69 static int hf_q932_ros_argument = -1; /* InvokeArgument */
70 static int hf_q932_ros_result = -1; /* T_result */
71 static int hf_q932_ros_resultArgument = -1; /* ResultArgument */
72 static int hf_q932_ros_errcode = -1; /* Code */
73 static int hf_q932_ros_parameter = -1; /* T_parameter */
74 static int hf_q932_ros_problem = -1; /* T_problem */
75 static int hf_q932_ros_general = -1; /* GeneralProblem */
76 static int hf_q932_ros_invokeProblem = -1; /* InvokeProblem */
77 static int hf_q932_ros_returnResultProblem = -1; /* ReturnResultProblem */
78 static int hf_q932_ros_returnErrorProblem = -1; /* ReturnErrorProblem */
79 static int hf_q932_ros_present = -1; /* INTEGER */
81 /*--- End of included file: packet-q932-ros-hf.c ---*/
82 #line 47 "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_RoseAPDU = -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 50 "packet-q932-ros-template.c"
105 static dissector_handle_t data_handle = NULL;
107 /* Gloabl variables */
108 static rose_context *rose_ctx;
110 static gint32 code_choice;
111 static guint32 code_local;
112 static const gchar *code_global;
113 static guint32 problem_val;
114 static gchar problem_str[64];
115 static tvbuff_t *arg_next_tvb, *res_next_tvb, *err_next_tvb;
119 /*--- Included file: packet-q932-ros-fn.c ---*/
120 #line 1 "packet-q932-ros-fn.c"
121 /*--- Fields for imported types ---*/
127 dissect_q932_ros_T_local(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
128 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
131 #line 31 "q932-ros.cnf"
136 static int dissect_local(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
137 return dissect_q932_ros_T_local(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_local);
143 dissect_q932_ros_T_global(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
144 offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &code_global);
146 #line 33 "q932-ros.cnf"
151 static int dissect_global(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
152 return dissect_q932_ros_T_global(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_global);
156 static const value_string q932_ros_Code_vals[] = {
162 static const ber_choice_t Code_choice[] = {
163 { 0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_local },
164 { 1, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_global },
169 dissect_q932_ros_Code(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
170 #line 24 "q932-ros.cnf"
175 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
176 Code_choice, hf_index, ett_q932_ros_Code,
181 static int dissect_opcode(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
182 return dissect_q932_ros_Code(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_opcode);
184 static int dissect_errcode(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
185 return dissect_q932_ros_Code(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_errcode);
191 dissect_q932_ros_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
192 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
197 static int dissect_present(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
198 return dissect_q932_ros_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_present);
204 dissect_q932_ros_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
205 offset = dissect_ber_null(implicit_tag, pinfo, tree, tvb, offset, hf_index);
209 static int dissect_absent(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
210 return dissect_q932_ros_NULL(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_absent);
212 static int dissect_absent_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
213 return dissect_q932_ros_NULL(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_absent);
217 static const value_string q932_ros_InvokeId_vals[] = {
223 static const ber_choice_t InvokeId_choice[] = {
224 { 0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_present },
225 { 1, BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_absent },
230 dissect_q932_ros_InvokeId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
231 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
232 InvokeId_choice, hf_index, ett_q932_ros_InvokeId,
237 static int dissect_invokeId(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
238 return dissect_q932_ros_InvokeId(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_invokeId);
240 static int dissect_linkedIdPresent_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
241 return dissect_q932_ros_InvokeId(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_linkedIdPresent);
245 static const value_string q932_ros_T_linkedId_vals[] = {
251 static const ber_choice_t T_linkedId_choice[] = {
252 { 0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_linkedIdPresent_impl },
253 { 1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_absent_impl },
258 dissect_q932_ros_T_linkedId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
259 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
260 T_linkedId_choice, hf_index, ett_q932_ros_T_linkedId,
265 static int dissect_linkedId(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
266 return dissect_q932_ros_T_linkedId(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_linkedId);
272 dissect_q932_ros_InvokeArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
273 #line 59 "q932-ros.cnf"
276 len = tvb_length_remaining(tvb, offset);
278 proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
279 arg_next_tvb = tvb_new_subset(tvb, offset, len, len);
281 offset += tvb_length_remaining(tvb, offset);
287 static int dissect_argument(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
288 return dissect_q932_ros_InvokeArgument(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_argument);
292 static const ber_sequence_t Invoke_sequence[] = {
293 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
294 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_linkedId },
295 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_opcode },
296 { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_argument },
301 dissect_q932_ros_Invoke(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
302 #line 69 "q932-ros.cnf"
303 dissector_handle_t arg_handle = NULL;
307 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
308 Invoke_sequence, hf_index, ett_q932_ros_Invoke);
310 #line 73 "q932-ros.cnf"
311 if (code_choice == 0) {
312 arg_handle = dissector_get_port_handle(rose_ctx->arg_local_dissector_table, code_local);
313 } else if (code_choice == 1) {
314 arg_handle = dissector_get_string_handle(rose_ctx->arg_global_dissector_table, code_global);
319 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " INV:");
321 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(arg_handle)))) {
322 if (code_choice == 0)
323 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " %d", code_local);
324 else if (code_choice == 1)
325 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " %s", code_global);
328 pinfo->private_data = rose_ctx;
329 call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, pinfo, tree);
334 static int dissect_invoke_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
335 return dissect_q932_ros_Invoke(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_invoke);
341 dissect_q932_ros_ResultArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
342 #line 102 "q932-ros.cnf"
345 len = tvb_length_remaining(tvb, offset);
347 proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
348 res_next_tvb = tvb_new_subset(tvb, offset, len, len);
350 offset += tvb_length_remaining(tvb, offset);
356 static int dissect_resultArgument(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
357 return dissect_q932_ros_ResultArgument(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_resultArgument);
361 static const ber_sequence_t T_result_sequence[] = {
362 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_opcode },
363 { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_resultArgument },
368 dissect_q932_ros_T_result(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
369 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
370 T_result_sequence, hf_index, ett_q932_ros_T_result);
374 static int dissect_result(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
375 return dissect_q932_ros_T_result(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_result);
379 static const ber_sequence_t ReturnResult_sequence[] = {
380 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
381 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_result },
386 dissect_q932_ros_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
387 #line 112 "q932-ros.cnf"
388 dissector_handle_t res_handle = NULL;
392 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
393 ReturnResult_sequence, hf_index, ett_q932_ros_ReturnResult);
395 #line 116 "q932-ros.cnf"
396 if (code_choice == 0) {
397 res_handle = dissector_get_port_handle(rose_ctx->res_local_dissector_table, code_local);
398 } else if (code_choice == 1) {
399 res_handle = dissector_get_string_handle(rose_ctx->res_global_dissector_table, code_global);
404 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " RES:");
406 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
407 if (code_choice == 0)
408 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " %d", code_local);
409 else if (code_choice == 1)
410 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " %s", code_global);
413 pinfo->private_data = rose_ctx;
414 call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, pinfo, tree);
419 static int dissect_returnResult_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
420 return dissect_q932_ros_ReturnResult(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_returnResult);
426 dissect_q932_ros_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
427 #line 144 "q932-ros.cnf"
431 len = tvb_length_remaining(tvb, offset);
433 proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
434 res_next_tvb = tvb_new_subset(tvb, offset, len, len);
436 offset += tvb_length_remaining(tvb, offset);
442 static int dissect_parameter(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
443 return dissect_q932_ros_T_parameter(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_parameter);
447 static const ber_sequence_t ReturnError_sequence[] = {
448 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
449 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_errcode },
450 { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_parameter },
455 dissect_q932_ros_ReturnError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
456 #line 155 "q932-ros.cnf"
457 dissector_handle_t err_handle = NULL;
461 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
462 ReturnError_sequence, hf_index, ett_q932_ros_ReturnError);
464 #line 159 "q932-ros.cnf"
465 if (code_choice == 0) {
466 /*err_handle = dissector_get_port_handle(rose_ctx->err_local_dissector_table, code_local);*/
467 } else if (code_choice == 1) {
468 /*err_handle = dissector_get_string_handle(rose_ctx->err_global_dissector_table, code_global);*/
473 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " ERR:");
475 !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
476 if (code_choice == 0)
477 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " %d", code_local);
478 else if (code_choice == 1)
479 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " %s", code_global);
482 pinfo->private_data = rose_ctx;
483 call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, pinfo, tree);
488 static int dissect_returnError_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
489 return dissect_q932_ros_ReturnError(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_returnError);
493 static const value_string q932_ros_GeneralProblem_vals[] = {
494 { 0, "unrecognizedComponent" },
495 { 1, "mistypedComponent" },
496 { 2, "badlyStructuredComponent" },
502 dissect_q932_ros_GeneralProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
503 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
506 #line 44 "q932-ros.cnf"
507 strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_GeneralProblem_vals), ""));
511 static int dissect_general_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
512 return dissect_q932_ros_GeneralProblem(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_general);
516 static const value_string q932_ros_InvokeProblem_vals[] = {
517 { 0, "duplicateInvocation" },
518 { 1, "unrecognizedOperation" },
519 { 2, "mistypedArgument" },
520 { 3, "resourceLimitation" },
521 { 4, "releaseInProgress" },
522 { 5, "unrecognizedLinkedId" },
523 { 6, "linkedResponseUnexpected" },
524 { 7, "unexpectedLinkedOperation" },
530 dissect_q932_ros_InvokeProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
531 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
534 #line 46 "q932-ros.cnf"
535 strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_InvokeProblem_vals), ""));
539 static int dissect_invokeProblem_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
540 return dissect_q932_ros_InvokeProblem(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_invokeProblem);
544 static const value_string q932_ros_ReturnResultProblem_vals[] = {
545 { 0, "unrecognizedInvocation" },
546 { 1, "resultResponseUnexpected" },
547 { 2, "mistypedResult" },
553 dissect_q932_ros_ReturnResultProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
554 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
557 #line 48 "q932-ros.cnf"
558 strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""));
562 static int dissect_returnResultProblem_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
563 return dissect_q932_ros_ReturnResultProblem(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_returnResultProblem);
567 static const value_string q932_ros_ReturnErrorProblem_vals[] = {
568 { 0, "unrecognizedInvocation" },
569 { 1, "errorResponseUnexpected" },
570 { 2, "unrecognizedError" },
571 { 3, "unexpectedError" },
572 { 4, "mistypedParameter" },
578 dissect_q932_ros_ReturnErrorProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
579 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
582 #line 50 "q932-ros.cnf"
583 strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""));
587 static int dissect_returnErrorProblem_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
588 return dissect_q932_ros_ReturnErrorProblem(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_returnErrorProblem);
592 static const value_string q932_ros_T_problem_vals[] = {
595 { 2, "returnResult" },
596 { 3, "returnError" },
600 static const ber_choice_t T_problem_choice[] = {
601 { 0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_general_impl },
602 { 1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_invokeProblem_impl },
603 { 2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_returnResultProblem_impl },
604 { 3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_returnErrorProblem_impl },
609 dissect_q932_ros_T_problem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
610 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
611 T_problem_choice, hf_index, ett_q932_ros_T_problem,
616 static int dissect_problem(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
617 return dissect_q932_ros_T_problem(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_problem);
621 static const ber_sequence_t Reject_sequence[] = {
622 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
623 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_problem },
628 dissect_q932_ros_Reject(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
629 #line 184 "q932-ros.cnf"
630 problem_str[0] = '\0';
632 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
633 Reject_sequence, hf_index, ett_q932_ros_Reject);
635 #line 186 "q932-ros.cnf"
636 proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " REJ: %s", problem_str);
640 static int dissect_reject_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
641 return dissect_q932_ros_Reject(TRUE, tvb, offset, pinfo, tree, hf_q932_ros_reject);
645 static const value_string q932_ros_RoseAPDU_vals[] = {
647 { 2, "returnResult" },
648 { 3, "returnError" },
653 static const ber_choice_t RoseAPDU_choice[] = {
654 { 1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_invoke_impl },
655 { 2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_returnResult_impl },
656 { 3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_returnError_impl },
657 { 4, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_reject_impl },
662 dissect_q932_ros_RoseAPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
663 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
664 RoseAPDU_choice, hf_index, ett_q932_ros_RoseAPDU,
671 static const value_string q932_ros_RejectProblem_vals[] = {
672 { 0, "general-unrecognizedPDU" },
673 { 1, "general-mistypedPDU" },
674 { 2, "general-badlyStructuredPDU" },
675 { 10, "invoke-duplicateInvocation" },
676 { 11, "invoke-unrecognizedOperation" },
677 { 12, "invoke-mistypedArgument" },
678 { 13, "invoke-resourceLimitation" },
679 { 14, "invoke-releaseInProgress" },
680 { 15, "invoke-unrecognizedLinkedId" },
681 { 16, "invoke-linkedResponseUnexpected" },
682 { 17, "invoke-unexpectedLinkedOperation" },
683 { 20, "returnResult-unrecognizedInvocation" },
684 { 21, "returnResult-resultResponseUnexpected" },
685 { 22, "returnResult-mistypedResult" },
686 { 30, "returnError-unrecognizedInvocation" },
687 { 31, "returnError-errorResponseUnexpected" },
688 { 32, "returnError-unrecognizedError" },
689 { 33, "returnError-unexpectedError" },
690 { 34, "returnError-mistypedParameter" },
696 dissect_q932_ros_RejectProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
697 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
705 static int dissect_RoseAPDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
707 offset = dissect_q932_ros_RoseAPDU(FALSE, tvb, offset, pinfo, tree, hf_q932_ros_RoseAPDU_PDU);
712 /*--- End of included file: packet-q932-ros-fn.c ---*/
713 #line 68 "packet-q932-ros-template.c"
715 /*--- dissect_rose_apdu -----------------------------------------------------*/
716 int dissect_rose_apdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rose_context *rctx) {
719 return dissect_RoseAPDU_PDU(tvb, pinfo, tree);
722 /*--- proto_register_rose ---------------------------------------------------*/
723 void proto_register_rose(void) {
726 static hf_register_info hf[] = {
728 /*--- Included file: packet-q932-ros-hfarr.c ---*/
729 #line 1 "packet-q932-ros-hfarr.c"
730 { &hf_q932_ros_RoseAPDU_PDU,
731 { "RoseAPDU", "q932.ros.RoseAPDU",
732 FT_UINT32, BASE_DEC, VALS(q932_ros_RoseAPDU_vals), 0,
733 "q932_ros.RoseAPDU", HFILL }},
734 { &hf_q932_ros_local,
735 { "local", "q932.ros.local",
736 FT_INT32, BASE_DEC, NULL, 0,
737 "q932_ros.T_local", HFILL }},
738 { &hf_q932_ros_global,
739 { "global", "q932.ros.global",
740 FT_OID, BASE_NONE, NULL, 0,
741 "q932_ros.T_global", HFILL }},
742 { &hf_q932_ros_invoke,
743 { "invoke", "q932.ros.invoke",
744 FT_NONE, BASE_NONE, NULL, 0,
745 "q932_ros.Invoke", HFILL }},
746 { &hf_q932_ros_returnResult,
747 { "returnResult", "q932.ros.returnResult",
748 FT_NONE, BASE_NONE, NULL, 0,
749 "q932_ros.ReturnResult", HFILL }},
750 { &hf_q932_ros_returnError,
751 { "returnError", "q932.ros.returnError",
752 FT_NONE, BASE_NONE, NULL, 0,
753 "q932_ros.ReturnError", HFILL }},
754 { &hf_q932_ros_reject,
755 { "reject", "q932.ros.reject",
756 FT_NONE, BASE_NONE, NULL, 0,
757 "q932_ros.Reject", HFILL }},
758 { &hf_q932_ros_invokeId,
759 { "invokeId", "q932.ros.invokeId",
760 FT_UINT32, BASE_DEC, VALS(q932_ros_InvokeId_vals), 0,
761 "q932_ros.InvokeId", HFILL }},
762 { &hf_q932_ros_linkedId,
763 { "linkedId", "q932.ros.linkedId",
764 FT_UINT32, BASE_DEC, VALS(q932_ros_T_linkedId_vals), 0,
765 "q932_ros.T_linkedId", HFILL }},
766 { &hf_q932_ros_linkedIdPresent,
767 { "present", "q932.ros.present",
768 FT_UINT32, BASE_DEC, VALS(q932_ros_InvokeId_vals), 0,
769 "q932_ros.InvokeId", HFILL }},
770 { &hf_q932_ros_absent,
771 { "absent", "q932.ros.absent",
772 FT_NONE, BASE_NONE, NULL, 0,
773 "q932_ros.NULL", HFILL }},
774 { &hf_q932_ros_opcode,
775 { "opcode", "q932.ros.opcode",
776 FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
777 "q932_ros.Code", HFILL }},
778 { &hf_q932_ros_argument,
779 { "argument", "q932.ros.argument",
780 FT_BYTES, BASE_HEX, NULL, 0,
781 "q932_ros.InvokeArgument", HFILL }},
782 { &hf_q932_ros_result,
783 { "result", "q932.ros.result",
784 FT_NONE, BASE_NONE, NULL, 0,
785 "q932_ros.T_result", HFILL }},
786 { &hf_q932_ros_resultArgument,
787 { "result", "q932.ros.result",
788 FT_BYTES, BASE_HEX, NULL, 0,
789 "q932_ros.ResultArgument", HFILL }},
790 { &hf_q932_ros_errcode,
791 { "errcode", "q932.ros.errcode",
792 FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
793 "q932_ros.Code", HFILL }},
794 { &hf_q932_ros_parameter,
795 { "parameter", "q932.ros.parameter",
796 FT_BYTES, BASE_HEX, NULL, 0,
797 "q932_ros.T_parameter", HFILL }},
798 { &hf_q932_ros_problem,
799 { "problem", "q932.ros.problem",
800 FT_UINT32, BASE_DEC, VALS(q932_ros_T_problem_vals), 0,
801 "q932_ros.T_problem", HFILL }},
802 { &hf_q932_ros_general,
803 { "general", "q932.ros.general",
804 FT_INT32, BASE_DEC, VALS(q932_ros_GeneralProblem_vals), 0,
805 "q932_ros.GeneralProblem", HFILL }},
806 { &hf_q932_ros_invokeProblem,
807 { "invoke", "q932.ros.invoke",
808 FT_INT32, BASE_DEC, VALS(q932_ros_InvokeProblem_vals), 0,
809 "q932_ros.InvokeProblem", HFILL }},
810 { &hf_q932_ros_returnResultProblem,
811 { "returnResult", "q932.ros.returnResult",
812 FT_INT32, BASE_DEC, VALS(q932_ros_ReturnResultProblem_vals), 0,
813 "q932_ros.ReturnResultProblem", HFILL }},
814 { &hf_q932_ros_returnErrorProblem,
815 { "returnError", "q932.ros.returnError",
816 FT_INT32, BASE_DEC, VALS(q932_ros_ReturnErrorProblem_vals), 0,
817 "q932_ros.ReturnErrorProblem", HFILL }},
818 { &hf_q932_ros_present,
819 { "present", "q932.ros.present",
820 FT_INT32, BASE_DEC, NULL, 0,
821 "q932_ros.INTEGER", HFILL }},
823 /*--- End of included file: packet-q932-ros-hfarr.c ---*/
824 #line 82 "packet-q932-ros-template.c"
827 /* List of subtrees */
828 static gint *ett[] = {
830 /*--- Included file: packet-q932-ros-ettarr.c ---*/
831 #line 1 "packet-q932-ros-ettarr.c"
833 &ett_q932_ros_RoseAPDU,
834 &ett_q932_ros_Invoke,
835 &ett_q932_ros_T_linkedId,
836 &ett_q932_ros_ReturnResult,
837 &ett_q932_ros_T_result,
838 &ett_q932_ros_ReturnError,
839 &ett_q932_ros_Reject,
840 &ett_q932_ros_T_problem,
841 &ett_q932_ros_InvokeId,
843 /*--- End of included file: packet-q932-ros-ettarr.c ---*/
844 #line 87 "packet-q932-ros-template.c"
847 /* Register protocol and dissector */
848 proto_rose = proto_register_protocol(PNAME, PSNAME, PFNAME);
849 proto_set_cant_toggle(proto_rose);
851 /* Register fields and subtrees */
852 proto_register_field_array(proto_rose, hf, array_length(hf));
853 proto_register_subtree_array(ett, array_length(ett));
857 /*--- proto_reg_handoff_rose ------------------------------------------------*/
858 void proto_reg_handoff_rose(void) {
859 data_handle = find_dissector("data");
862 /*---------------------------------------------------------------------------*/