2007-04-27 08:10:18 +00:00
|
|
|
/* Do not modify this file. */
|
|
|
|
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
|
2007-10-17 09:55:08 +00:00
|
|
|
/* packet-q932-ros.c */
|
2009-05-16 22:07:03 +00:00
|
|
|
/* ../../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 */
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
/* Input file: packet-q932-ros-template.c */
|
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/q932-ros/packet-q932-ros-template.c"
|
2007-04-27 08:10:18 +00:00
|
|
|
/* packet-q932-ros.c
|
|
|
|
* Routines for Q.932 packet dissection
|
|
|
|
* 2007 Tomas Kukosa
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/strutil.h>
|
2007-05-13 20:58:29 +00:00
|
|
|
#include <epan/asn1.h>
|
2009-08-24 09:05:15 +00:00
|
|
|
#include <epan/expert.h>
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
#include "packet-ber.h"
|
|
|
|
|
|
|
|
#define PNAME "Q.932 Operations Service Element"
|
2007-04-30 08:55:59 +00:00
|
|
|
#define PSNAME "Q932.ROS"
|
|
|
|
#define PFNAME "q932.ros"
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
/* Initialize the protocol and registered fields */
|
2009-10-11 16:24:29 +00:00
|
|
|
static int proto_q932_ros = -1;
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
/*--- Included file: packet-q932-ros-hf.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/q932-ros/packet-q932-ros-hf.c"
|
2007-06-06 09:43:45 +00:00
|
|
|
static int hf_q932_ros_ROS_PDU = -1; /* ROS */
|
2007-04-27 08:10:18 +00:00
|
|
|
static int hf_q932_ros_local = -1; /* T_local */
|
|
|
|
static int hf_q932_ros_global = -1; /* T_global */
|
|
|
|
static int hf_q932_ros_invoke = -1; /* Invoke */
|
|
|
|
static int hf_q932_ros_returnResult = -1; /* ReturnResult */
|
|
|
|
static int hf_q932_ros_returnError = -1; /* ReturnError */
|
|
|
|
static int hf_q932_ros_reject = -1; /* Reject */
|
|
|
|
static int hf_q932_ros_invokeId = -1; /* InvokeId */
|
|
|
|
static int hf_q932_ros_linkedId = -1; /* T_linkedId */
|
2007-06-06 09:43:45 +00:00
|
|
|
static int hf_q932_ros_linkedIdPresent = -1; /* T_linkedIdPresent */
|
2007-04-27 08:10:18 +00:00
|
|
|
static int hf_q932_ros_absent = -1; /* NULL */
|
|
|
|
static int hf_q932_ros_opcode = -1; /* Code */
|
|
|
|
static int hf_q932_ros_argument = -1; /* InvokeArgument */
|
|
|
|
static int hf_q932_ros_result = -1; /* T_result */
|
|
|
|
static int hf_q932_ros_resultArgument = -1; /* ResultArgument */
|
|
|
|
static int hf_q932_ros_errcode = -1; /* Code */
|
|
|
|
static int hf_q932_ros_parameter = -1; /* T_parameter */
|
|
|
|
static int hf_q932_ros_problem = -1; /* T_problem */
|
|
|
|
static int hf_q932_ros_general = -1; /* GeneralProblem */
|
|
|
|
static int hf_q932_ros_invokeProblem = -1; /* InvokeProblem */
|
|
|
|
static int hf_q932_ros_returnResultProblem = -1; /* ReturnResultProblem */
|
|
|
|
static int hf_q932_ros_returnErrorProblem = -1; /* ReturnErrorProblem */
|
|
|
|
static int hf_q932_ros_present = -1; /* INTEGER */
|
2007-06-06 09:43:45 +00:00
|
|
|
static int hf_q932_ros_InvokeId_present = -1; /* InvokeId_present */
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-q932-ros-hf.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 44 "../../asn1/q932-ros/packet-q932-ros-template.c"
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
|
|
|
|
/*--- Included file: packet-q932-ros-ett.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/q932-ros/packet-q932-ros-ett.c"
|
2007-04-27 08:10:18 +00:00
|
|
|
static gint ett_q932_ros_Code = -1;
|
2007-06-06 09:43:45 +00:00
|
|
|
static gint ett_q932_ros_ROS = -1;
|
2007-04-27 08:10:18 +00:00
|
|
|
static gint ett_q932_ros_Invoke = -1;
|
|
|
|
static gint ett_q932_ros_T_linkedId = -1;
|
|
|
|
static gint ett_q932_ros_ReturnResult = -1;
|
|
|
|
static gint ett_q932_ros_T_result = -1;
|
|
|
|
static gint ett_q932_ros_ReturnError = -1;
|
|
|
|
static gint ett_q932_ros_Reject = -1;
|
|
|
|
static gint ett_q932_ros_T_problem = -1;
|
|
|
|
static gint ett_q932_ros_InvokeId = -1;
|
|
|
|
|
|
|
|
/*--- End of included file: packet-q932-ros-ett.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 47 "../../asn1/q932-ros/packet-q932-ros-template.c"
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
/* Preferences */
|
|
|
|
|
|
|
|
/* Subdissectors */
|
|
|
|
static dissector_handle_t data_handle = NULL;
|
|
|
|
|
|
|
|
/* Gloabl variables */
|
2007-07-18 13:15:36 +00:00
|
|
|
static rose_ctx_t *rose_ctx_tmp;
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
static guint32 problem_val;
|
|
|
|
static gchar problem_str[64];
|
|
|
|
static tvbuff_t *arg_next_tvb, *res_next_tvb, *err_next_tvb;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*--- Included file: packet-q932-ros-fn.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/q932-ros/packet-q932-ros-fn.c"
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-02-02 17:25:40 +00:00
|
|
|
&actx->rose_ctx->d.code_local);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-07-18 13:15:36 +00:00
|
|
|
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->rose_ctx->d.code_global);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string q932_ros_Code_vals[] = {
|
|
|
|
{ 0, "local" },
|
|
|
|
{ 1, "global" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
static const ber_choice_t Code_choice[] = {
|
|
|
|
{ 0, &hf_q932_ros_local , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_local },
|
|
|
|
{ 1, &hf_q932_ros_global , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_global },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
|
|
|
Code_choice, hf_index, ett_q932_ros_Code,
|
2007-07-18 13:15:36 +00:00
|
|
|
&actx->rose_ctx->d.code);
|
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 43 "../../asn1/q932-ros/q932-ros.cnf"
|
2007-07-18 13:15:36 +00:00
|
|
|
actx->rose_ctx->d.code_item = actx->created_item;
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-02-02 17:25:40 +00:00
|
|
|
NULL);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string q932_ros_InvokeId_vals[] = {
|
|
|
|
{ 0, "present" },
|
|
|
|
{ 1, "absent" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
static const ber_choice_t InvokeId_choice[] = {
|
|
|
|
{ 0, &hf_q932_ros_present , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_q932_ros_INTEGER },
|
|
|
|
{ 1, &hf_q932_ros_absent , BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_q932_ros_NULL },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
|
|
|
InvokeId_choice, hf_index, ett_q932_ros_InvokeId,
|
|
|
|
NULL);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-06 09:43:45 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
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_) {
|
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-02-02 17:25:40 +00:00
|
|
|
NULL);
|
2007-06-06 09:43:45 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
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_) {
|
|
|
|
offset = dissect_q932_ros_InvokeId_present(implicit_tag, tvb, offset, actx, tree, hf_index);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-04-27 08:10:18 +00:00
|
|
|
static const value_string q932_ros_T_linkedId_vals[] = {
|
|
|
|
{ 0, "present" },
|
|
|
|
{ 1, "absent" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
static const ber_choice_t T_linkedId_choice[] = {
|
2007-06-06 09:43:45 +00:00
|
|
|
{ 0, &hf_q932_ros_linkedIdPresent, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_ros_T_linkedIdPresent },
|
2007-06-05 12:15:52 +00:00
|
|
|
{ 1, &hf_q932_ros_absent , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_NULL },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
|
|
|
T_linkedId_choice, hf_index, ett_q932_ros_T_linkedId,
|
|
|
|
NULL);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 69 "../../asn1/q932-ros/q932-ros.cnf"
|
2007-04-27 08:10:18 +00:00
|
|
|
gint len;
|
|
|
|
|
|
|
|
len = tvb_length_remaining(tvb, offset);
|
|
|
|
if (len)
|
|
|
|
proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
|
|
|
|
arg_next_tvb = tvb_new_subset(tvb, offset, len, len);
|
|
|
|
|
|
|
|
offset += tvb_length_remaining(tvb, offset);
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
static const ber_sequence_t Invoke_sequence[] = {
|
|
|
|
{ &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
|
|
|
|
{ &hf_q932_ros_linkedId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_T_linkedId },
|
|
|
|
{ &hf_q932_ros_opcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
|
|
|
|
{ &hf_q932_ros_argument , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_InvokeArgument },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 8 "../../asn1/ros/ros-inv.cnf"
|
2007-04-27 08:10:18 +00:00
|
|
|
dissector_handle_t arg_handle = NULL;
|
2007-09-24 11:01:53 +00:00
|
|
|
const gchar *descr = "";
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
arg_next_tvb = NULL;
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
Invoke_sequence, hf_index, ett_q932_ros_Invoke);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 13 "../../asn1/ros/ros-inv.cnf"
|
2007-07-19 11:41:10 +00:00
|
|
|
actx->rose_ctx->d.pdu = 1;
|
|
|
|
|
2007-09-24 11:01:53 +00:00
|
|
|
if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->arg_local_dissector_table) {
|
2010-12-20 05:35:29 +00:00
|
|
|
arg_handle = dissector_get_uint_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
|
2007-09-24 11:01:53 +00:00
|
|
|
} else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->arg_global_dissector_table) {
|
2007-07-18 13:15:36 +00:00
|
|
|
arg_handle = dissector_get_string_handle(actx->rose_ctx->arg_global_dissector_table, actx->rose_ctx->d.code_global);
|
2007-04-27 08:10:18 +00:00
|
|
|
} else {
|
|
|
|
arg_handle = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!arg_handle ||
|
|
|
|
!proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(arg_handle)))) {
|
2007-07-18 13:15:36 +00:00
|
|
|
if (actx->rose_ctx->d.code == 0)
|
2007-09-24 11:01:53 +00:00
|
|
|
descr = ep_strdup_printf("INV: %d", actx->rose_ctx->d.code_local);
|
2007-07-18 13:15:36 +00:00
|
|
|
else if (actx->rose_ctx->d.code == 1)
|
2007-09-24 11:01:53 +00:00
|
|
|
descr = ep_strdup_printf("INV: %s", actx->rose_ctx->d.code_global);
|
|
|
|
} else {
|
|
|
|
descr = ep_strdup_printf("INV:");
|
2007-04-27 08:10:18 +00:00
|
|
|
}
|
2007-09-24 11:01:53 +00:00
|
|
|
|
|
|
|
if (actx->rose_ctx->apdu_depth >= 0)
|
|
|
|
proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
|
|
|
|
if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
|
|
|
|
if (actx->rose_ctx->fillin_ptr)
|
|
|
|
g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
|
|
|
|
|
2007-07-20 09:54:47 +00:00
|
|
|
if (!arg_next_tvb) { /* empty argument */
|
2007-09-24 11:01:53 +00:00
|
|
|
arg_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
|
2007-04-27 08:10:18 +00:00
|
|
|
}
|
2007-07-20 09:54:47 +00:00
|
|
|
actx->pinfo->private_data = actx->rose_ctx;
|
|
|
|
call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
|
2009-08-24 09:05:15 +00:00
|
|
|
if (!arg_handle) {
|
|
|
|
expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr);
|
|
|
|
}
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 87 "../../asn1/q932-ros/q932-ros.cnf"
|
2007-04-27 08:10:18 +00:00
|
|
|
gint len;
|
|
|
|
|
|
|
|
len = tvb_length_remaining(tvb, offset);
|
|
|
|
if (len)
|
|
|
|
proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
|
|
|
|
res_next_tvb = tvb_new_subset(tvb, offset, len, len);
|
|
|
|
|
|
|
|
offset += tvb_length_remaining(tvb, offset);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
static const ber_sequence_t T_result_sequence[] = {
|
|
|
|
{ &hf_q932_ros_opcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
|
2007-06-06 09:43:45 +00:00
|
|
|
{ &hf_q932_ros_resultArgument, BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_q932_ros_ResultArgument },
|
2007-06-05 12:15:52 +00:00
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
T_result_sequence, hf_index, ett_q932_ros_T_result);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
static const ber_sequence_t ReturnResult_sequence[] = {
|
|
|
|
{ &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
|
2007-06-06 09:43:45 +00:00
|
|
|
{ &hf_q932_ros_result , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_result },
|
2007-06-05 12:15:52 +00:00
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 7 "../../asn1/ros/ros-res.cnf"
|
2007-04-27 08:10:18 +00:00
|
|
|
dissector_handle_t res_handle = NULL;
|
2007-09-24 11:01:53 +00:00
|
|
|
const gchar *descr = "";
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2010-09-08 09:02:16 +00:00
|
|
|
actx->rose_ctx->d.code = -1;
|
2007-04-27 08:10:18 +00:00
|
|
|
res_next_tvb = NULL;
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
ReturnResult_sequence, hf_index, ett_q932_ros_ReturnResult);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 13 "../../asn1/ros/ros-res.cnf"
|
2007-07-19 11:41:10 +00:00
|
|
|
actx->rose_ctx->d.pdu = 2;
|
|
|
|
|
2007-09-24 11:01:53 +00:00
|
|
|
if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->res_local_dissector_table) {
|
2010-12-20 05:35:29 +00:00
|
|
|
res_handle = dissector_get_uint_handle(actx->rose_ctx->res_local_dissector_table, actx->rose_ctx->d.code_local);
|
2007-09-24 11:01:53 +00:00
|
|
|
} else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->res_global_dissector_table) {
|
2007-07-18 13:15:36 +00:00
|
|
|
res_handle = dissector_get_string_handle(actx->rose_ctx->res_global_dissector_table, actx->rose_ctx->d.code_global);
|
2007-04-27 08:10:18 +00:00
|
|
|
} else {
|
|
|
|
res_handle = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!res_handle ||
|
|
|
|
!proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
|
2007-07-18 13:15:36 +00:00
|
|
|
if (actx->rose_ctx->d.code == 0)
|
2007-09-24 11:01:53 +00:00
|
|
|
descr = ep_strdup_printf("RES: %d", actx->rose_ctx->d.code_local);
|
2007-07-18 13:15:36 +00:00
|
|
|
else if (actx->rose_ctx->d.code == 1)
|
2007-09-24 11:01:53 +00:00
|
|
|
descr = ep_strdup_printf("RES: %s", actx->rose_ctx->d.code_global);
|
|
|
|
} else {
|
|
|
|
descr = ep_strdup_printf("RES:");
|
2007-04-27 08:10:18 +00:00
|
|
|
}
|
2007-09-24 11:01:53 +00:00
|
|
|
|
|
|
|
if (actx->rose_ctx->apdu_depth >= 0)
|
|
|
|
proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
|
|
|
|
if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
|
|
|
|
if (actx->rose_ctx->fillin_ptr)
|
|
|
|
g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
|
|
|
|
|
2010-09-08 09:02:16 +00:00
|
|
|
if (actx->rose_ctx->d.code != -1) {
|
|
|
|
if (!res_next_tvb) { /* empty result */
|
|
|
|
res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
|
|
|
|
}
|
|
|
|
actx->pinfo->private_data = actx->rose_ctx;
|
|
|
|
call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree);
|
|
|
|
if (!res_handle) {
|
|
|
|
expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr);
|
|
|
|
}
|
2009-08-24 09:05:15 +00:00
|
|
|
}
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 106 "../../asn1/q932-ros/q932-ros.cnf"
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
gint len;
|
|
|
|
|
|
|
|
len = tvb_length_remaining(tvb, offset);
|
|
|
|
if (len)
|
|
|
|
proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
|
2007-07-20 09:54:47 +00:00
|
|
|
err_next_tvb = tvb_new_subset(tvb, offset, len, len);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
offset += tvb_length_remaining(tvb, offset);
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
static const ber_sequence_t ReturnError_sequence[] = {
|
|
|
|
{ &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
|
|
|
|
{ &hf_q932_ros_errcode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_Code },
|
|
|
|
{ &hf_q932_ros_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_q932_ros_T_parameter },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 7 "../../asn1/ros/ros-err.cnf"
|
2007-04-27 08:10:18 +00:00
|
|
|
dissector_handle_t err_handle = NULL;
|
2007-09-24 11:01:53 +00:00
|
|
|
const gchar *descr = "";
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
err_next_tvb = NULL;
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
ReturnError_sequence, hf_index, ett_q932_ros_ReturnError);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 12 "../../asn1/ros/ros-err.cnf"
|
2007-07-19 11:41:10 +00:00
|
|
|
actx->rose_ctx->d.pdu = 3;
|
|
|
|
|
2007-09-24 11:01:53 +00:00
|
|
|
if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->err_local_dissector_table) {
|
2010-12-20 05:35:29 +00:00
|
|
|
err_handle = dissector_get_uint_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
|
2007-09-24 11:01:53 +00:00
|
|
|
} else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->err_global_dissector_table) {
|
2007-07-20 09:54:47 +00:00
|
|
|
err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
|
2007-04-27 08:10:18 +00:00
|
|
|
} else {
|
|
|
|
err_handle = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!err_handle ||
|
|
|
|
!proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
|
2007-07-18 13:15:36 +00:00
|
|
|
if (actx->rose_ctx->d.code == 0)
|
2007-09-24 11:01:53 +00:00
|
|
|
descr = ep_strdup_printf("ERR: %d", actx->rose_ctx->d.code_local);
|
2007-07-18 13:15:36 +00:00
|
|
|
else if (actx->rose_ctx->d.code == 1)
|
2007-09-24 11:01:53 +00:00
|
|
|
descr = ep_strdup_printf("ERR: %s", actx->rose_ctx->d.code_global);
|
|
|
|
} else {
|
|
|
|
descr = ep_strdup_printf("ERR:");
|
2007-04-27 08:10:18 +00:00
|
|
|
}
|
2007-09-24 11:01:53 +00:00
|
|
|
|
|
|
|
if (actx->rose_ctx->apdu_depth >= 0)
|
|
|
|
proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
|
|
|
|
if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
|
|
|
|
if (actx->rose_ctx->fillin_ptr)
|
|
|
|
g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
|
|
|
|
|
2007-07-20 09:54:47 +00:00
|
|
|
if (!err_next_tvb) { /* empty error */
|
2007-09-24 11:01:53 +00:00
|
|
|
err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
|
2007-04-27 08:10:18 +00:00
|
|
|
}
|
2007-07-20 09:54:47 +00:00
|
|
|
actx->pinfo->private_data = actx->rose_ctx;
|
|
|
|
call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
|
2009-08-24 09:05:15 +00:00
|
|
|
if (!err_handle) {
|
|
|
|
expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr);
|
|
|
|
}
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string q932_ros_GeneralProblem_vals[] = {
|
|
|
|
{ 0, "unrecognizedComponent" },
|
|
|
|
{ 1, "mistypedComponent" },
|
|
|
|
{ 2, "badlyStructuredComponent" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-02-02 17:25:40 +00:00
|
|
|
&problem_val);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 54 "../../asn1/q932-ros/q932-ros.cnf"
|
2008-03-01 17:23:39 +00:00
|
|
|
g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_GeneralProblem_vals), ""), 64);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string q932_ros_InvokeProblem_vals[] = {
|
|
|
|
{ 0, "duplicateInvocation" },
|
|
|
|
{ 1, "unrecognizedOperation" },
|
|
|
|
{ 2, "mistypedArgument" },
|
|
|
|
{ 3, "resourceLimitation" },
|
|
|
|
{ 4, "releaseInProgress" },
|
|
|
|
{ 5, "unrecognizedLinkedId" },
|
|
|
|
{ 6, "linkedResponseUnexpected" },
|
|
|
|
{ 7, "unexpectedLinkedOperation" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-02-02 17:25:40 +00:00
|
|
|
&problem_val);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 56 "../../asn1/q932-ros/q932-ros.cnf"
|
2008-03-01 17:23:39 +00:00
|
|
|
g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_InvokeProblem_vals), ""), 64);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string q932_ros_ReturnResultProblem_vals[] = {
|
|
|
|
{ 0, "unrecognizedInvocation" },
|
|
|
|
{ 1, "resultResponseUnexpected" },
|
|
|
|
{ 2, "mistypedResult" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-02-02 17:25:40 +00:00
|
|
|
&problem_val);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 58 "../../asn1/q932-ros/q932-ros.cnf"
|
2008-03-01 17:23:39 +00:00
|
|
|
g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""), 64);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string q932_ros_ReturnErrorProblem_vals[] = {
|
|
|
|
{ 0, "unrecognizedInvocation" },
|
|
|
|
{ 1, "errorResponseUnexpected" },
|
|
|
|
{ 2, "unrecognizedError" },
|
|
|
|
{ 3, "unexpectedError" },
|
|
|
|
{ 4, "mistypedParameter" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-02-02 17:25:40 +00:00
|
|
|
&problem_val);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 60 "../../asn1/q932-ros/q932-ros.cnf"
|
2008-03-01 17:23:39 +00:00
|
|
|
g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""), 64);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string q932_ros_T_problem_vals[] = {
|
|
|
|
{ 0, "general" },
|
|
|
|
{ 1, "invoke" },
|
|
|
|
{ 2, "returnResult" },
|
|
|
|
{ 3, "returnError" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
static const ber_choice_t T_problem_choice[] = {
|
|
|
|
{ 0, &hf_q932_ros_general , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_q932_ros_GeneralProblem },
|
|
|
|
{ 1, &hf_q932_ros_invokeProblem, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_InvokeProblem },
|
|
|
|
{ 2, &hf_q932_ros_returnResultProblem, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnResultProblem },
|
|
|
|
{ 3, &hf_q932_ros_returnErrorProblem, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnErrorProblem },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
|
|
|
T_problem_choice, hf_index, ett_q932_ros_T_problem,
|
|
|
|
NULL);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
static const ber_sequence_t Reject_sequence[] = {
|
|
|
|
{ &hf_q932_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_InvokeId },
|
|
|
|
{ &hf_q932_ros_problem , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_q932_ros_T_problem },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
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_) {
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 7 "../../asn1/ros/ros-rej.cnf"
|
2007-09-24 11:01:53 +00:00
|
|
|
const gchar *descr = "";
|
|
|
|
|
2007-04-27 08:10:18 +00:00
|
|
|
problem_str[0] = '\0';
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
Reject_sequence, hf_index, ett_q932_ros_Reject);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 11 "../../asn1/ros/ros-rej.cnf"
|
2007-09-24 11:01:53 +00:00
|
|
|
descr = ep_strdup_printf("REJ: %s", problem_str);
|
|
|
|
|
|
|
|
if (actx->rose_ctx->apdu_depth >= 0)
|
|
|
|
proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
|
|
|
|
if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
|
|
|
|
if (actx->rose_ctx->fillin_ptr)
|
|
|
|
g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-06 09:43:45 +00:00
|
|
|
static const value_string q932_ros_ROS_vals[] = {
|
2007-04-27 08:10:18 +00:00
|
|
|
{ 1, "invoke" },
|
|
|
|
{ 2, "returnResult" },
|
|
|
|
{ 3, "returnError" },
|
|
|
|
{ 4, "reject" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-06-06 09:43:45 +00:00
|
|
|
static const ber_choice_t ROS_choice[] = {
|
2007-06-05 12:15:52 +00:00
|
|
|
{ 1, &hf_q932_ros_invoke , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_q932_ros_Invoke },
|
|
|
|
{ 2, &hf_q932_ros_returnResult, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnResult },
|
|
|
|
{ 3, &hf_q932_ros_returnError, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_q932_ros_ReturnError },
|
|
|
|
{ 4, &hf_q932_ros_reject , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_q932_ros_Reject },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-06-06 09:43:45 +00:00
|
|
|
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_) {
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 31 "../../asn1/q932-ros/q932-ros.cnf"
|
2007-07-18 13:15:36 +00:00
|
|
|
/* will be moved to ROS_PDU when PDU function can be alternated from conformance file */
|
|
|
|
actx->rose_ctx = rose_ctx_tmp;
|
|
|
|
rose_ctx_clean_data(actx->rose_ctx);
|
|
|
|
|
2007-06-05 12:15:52 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
2007-06-06 09:43:45 +00:00
|
|
|
ROS_choice, hf_index, ett_q932_ros_ROS,
|
2007-07-19 11:41:10 +00:00
|
|
|
NULL);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--- PDUs ---*/
|
|
|
|
|
2007-06-06 09:43:45 +00:00
|
|
|
static int dissect_ROS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
|
2007-05-04 07:51:19 +00:00
|
|
|
int offset = 0;
|
2007-05-13 20:58:29 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2007-06-06 09:43:45 +00:00
|
|
|
offset = dissect_q932_ros_ROS(FALSE, tvb, offset, &asn1_ctx, tree, hf_q932_ros_ROS_PDU);
|
2007-05-04 07:51:19 +00:00
|
|
|
return offset;
|
2007-04-27 08:10:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--- End of included file: packet-q932-ros-fn.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 62 "../../asn1/q932-ros/packet-q932-ros-template.c"
|
2007-04-27 08:10:18 +00:00
|
|
|
|
2007-07-18 13:15:36 +00:00
|
|
|
/*--- dissect_q932_ros -----------------------------------------------------*/
|
|
|
|
static int dissect_q932_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|
|
|
rose_ctx_tmp = get_rose_ctx(pinfo->private_data);
|
|
|
|
DISSECTOR_ASSERT(rose_ctx_tmp);
|
2007-06-06 09:43:45 +00:00
|
|
|
return dissect_ROS_PDU(tvb, pinfo, tree);
|
2007-04-27 08:10:18 +00:00
|
|
|
}
|
|
|
|
|
2007-07-18 13:15:36 +00:00
|
|
|
/*--- proto_register_q932_ros -----------------------------------------------*/
|
|
|
|
void proto_register_q932_ros(void) {
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
/* List of fields */
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
|
|
|
|
/*--- Included file: packet-q932-ros-hfarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/q932-ros/packet-q932-ros-hfarr.c"
|
2007-06-06 09:43:45 +00:00
|
|
|
{ &hf_q932_ros_ROS_PDU,
|
|
|
|
{ "ROS", "q932.ros.ROS",
|
|
|
|
FT_UINT32, BASE_DEC, VALS(q932_ros_ROS_vals), 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_local,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "local", "q932.ros.local",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_global,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "global", "q932.ros.global",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_invoke,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "invoke", "q932.ros.invoke",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_returnResult,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "returnResult", "q932.ros.returnResult",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_returnError,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "returnError", "q932.ros.returnError",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_reject,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "reject", "q932.ros.reject",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_invokeId,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "invokeId", "q932.ros.invokeId",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_UINT32, BASE_DEC, VALS(q932_ros_InvokeId_vals), 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_linkedId,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "linkedId", "q932.ros.linkedId",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_UINT32, BASE_DEC, VALS(q932_ros_T_linkedId_vals), 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_linkedIdPresent,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "present", "q932.ros.present",
|
2007-06-25 08:58:27 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"T_linkedIdPresent", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_absent,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "absent", "q932.ros.absent",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_opcode,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "opcode", "q932.ros.opcode",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"Code", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_argument,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "argument", "q932.ros.argument",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"InvokeArgument", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_result,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "result", "q932.ros.result",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_resultArgument,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "result", "q932.ros.result",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"ResultArgument", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_errcode,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "errcode", "q932.ros.errcode",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_UINT32, BASE_DEC, VALS(q932_ros_Code_vals), 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"Code", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_parameter,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "parameter", "q932.ros.parameter",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_problem,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "problem", "q932.ros.problem",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_UINT32, BASE_DEC, VALS(q932_ros_T_problem_vals), 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_general,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "general", "q932.ros.general",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_INT32, BASE_DEC, VALS(q932_ros_GeneralProblem_vals), 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"GeneralProblem", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_invokeProblem,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "invoke", "q932.ros.invoke",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_INT32, BASE_DEC, VALS(q932_ros_InvokeProblem_vals), 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"InvokeProblem", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_returnResultProblem,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "returnResult", "q932.ros.returnResult",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_INT32, BASE_DEC, VALS(q932_ros_ReturnResultProblem_vals), 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"ReturnResultProblem", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_returnErrorProblem,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "returnError", "q932.ros.returnError",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_INT32, BASE_DEC, VALS(q932_ros_ReturnErrorProblem_vals), 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"ReturnErrorProblem", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
{ &hf_q932_ros_present,
|
2007-04-30 08:55:59 +00:00
|
|
|
{ "present", "q932.ros.present",
|
2007-04-27 08:10:18 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"INTEGER", HFILL }},
|
2007-06-06 09:43:45 +00:00
|
|
|
{ &hf_q932_ros_InvokeId_present,
|
|
|
|
{ "InvokeId.present", "q932.ros.InvokeId_present",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:51:39 +00:00
|
|
|
"InvokeId_present", HFILL }},
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-q932-ros-hfarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 76 "../../asn1/q932-ros/packet-q932-ros-template.c"
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* List of subtrees */
|
|
|
|
static gint *ett[] = {
|
|
|
|
|
|
|
|
/*--- Included file: packet-q932-ros-ettarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/q932-ros/packet-q932-ros-ettarr.c"
|
2007-04-27 08:10:18 +00:00
|
|
|
&ett_q932_ros_Code,
|
2007-06-06 09:43:45 +00:00
|
|
|
&ett_q932_ros_ROS,
|
2007-04-27 08:10:18 +00:00
|
|
|
&ett_q932_ros_Invoke,
|
|
|
|
&ett_q932_ros_T_linkedId,
|
|
|
|
&ett_q932_ros_ReturnResult,
|
|
|
|
&ett_q932_ros_T_result,
|
|
|
|
&ett_q932_ros_ReturnError,
|
|
|
|
&ett_q932_ros_Reject,
|
|
|
|
&ett_q932_ros_T_problem,
|
|
|
|
&ett_q932_ros_InvokeId,
|
|
|
|
|
|
|
|
/*--- End of included file: packet-q932-ros-ettarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 81 "../../asn1/q932-ros/packet-q932-ros-template.c"
|
2007-04-27 08:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Register protocol and dissector */
|
2007-07-18 13:15:36 +00:00
|
|
|
proto_q932_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
|
|
|
|
proto_set_cant_toggle(proto_q932_ros);
|
2007-04-27 08:10:18 +00:00
|
|
|
|
|
|
|
/* Register fields and subtrees */
|
2007-07-18 13:15:36 +00:00
|
|
|
proto_register_field_array(proto_q932_ros, hf, array_length(hf));
|
2007-04-27 08:10:18 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
2007-07-19 12:31:01 +00:00
|
|
|
new_register_dissector(PFNAME, dissect_q932_ros, proto_q932_ros);
|
2007-04-27 08:10:18 +00:00
|
|
|
}
|
|
|
|
|
2007-07-18 13:15:36 +00:00
|
|
|
/*--- proto_reg_handoff_q932_ros --------------------------------------------*/
|
|
|
|
void proto_reg_handoff_q932_ros(void) {
|
2007-04-27 08:10:18 +00:00
|
|
|
data_handle = find_dissector("data");
|
|
|
|
}
|
|
|
|
|
2007-04-30 06:41:53 +00:00
|
|
|
/*---------------------------------------------------------------------------*/
|