wireshark/epan/dissectors/packet-ansi_tcap.c

1372 lines
52 KiB
C
Raw Normal View History

/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-ansi_tcap.c */
/* ../../tools/asn2wrs.py -b -X -T -e -p ansi_tcap -c ansi_tcap.cnf -s packet-ansi_tcap-template TCAP-Remote-Operations-Information-Objects.asn TCAPPackage.asn */
/* Input file: packet-ansi_tcap-template.c */
#line 1 "packet-ansi_tcap-template.c"
/* packet-ansi_tcap-template.c
* Routines for ANSI TCAP
* Copyright 2007 Anders Broman <anders.broman@ericsson.com>
* Built from the gsm-map dissector Copyright 2004 - 2005, Anders Broman <anders.broman@ericsson.com>
*
* $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.
* References: T1.114
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/conversation.h>
#include <epan/oid_resolv.h>
#include <epan/emem.h>
#include <epan/asn1.h>
#include <stdio.h>
#include <string.h>
#include "packet-ber.h"
#include "packet-tcap.h"
#include "packet-ansi_tcap.h"
#include "epan/tcap-persistentdata.h"
#define PNAME "ANSI Transaction Capabilities Application Part"
#define PSNAME "ANSI_TCAP"
#define PFNAME "ansi_tcap"
/* Initialize the protocol and registered fields */
int proto_ansi_tcap = -1;
static int hf_ansi_tcap_tag = -1;
static int hf_ansi_tcap_length = -1;
static int hf_ansi_tcap_data = -1;
static int hf_ansi_tcap_tid = -1;
int hf_ansi_tcapsrt_SessionId=-1;
int hf_ansi_tcapsrt_Duplicate=-1;
int hf_ansi_tcapsrt_BeginSession=-1;
int hf_ansi_tcapsrt_EndSession=-1;
int hf_ansi_tcapsrt_SessionTime=-1;
/*--- Included file: packet-ansi_tcap-hf.c ---*/
#line 1 "packet-ansi_tcap-hf.c"
static int hf_ansi_tcap_national = -1; /* INTEGER_M32768_32767 */
static int hf_ansi_tcap_private = -1; /* INTEGER */
static int hf_ansi_tcap_national_01 = -1; /* INTEGER_M128_127 */
static int hf_ansi_tcap_unidirectional = -1; /* UniTransactionPDU */
static int hf_ansi_tcap_queryWithPerm = -1; /* TransactionPDU */
static int hf_ansi_tcap_queryWithoutPerm = -1; /* TransactionPDU */
static int hf_ansi_tcap_response = -1; /* TransactionPDU */
static int hf_ansi_tcap_conversationWithPerm = -1; /* TransactionPDU */
static int hf_ansi_tcap_conversationWithoutPerm = -1; /* TransactionPDU */
static int hf_ansi_tcap_abort = -1; /* Abort */
static int hf_ansi_tcap_identifier = -1; /* TransactionID */
static int hf_ansi_tcap_dialoguePortion = -1; /* DialoguePortion */
static int hf_ansi_tcap_componentPortion = -1; /* ComponentSequence */
static int hf_ansi_tcap_dialogPortion = -1; /* DialoguePortion */
static int hf_ansi_tcap_causeInformation = -1; /* T_causeInformation */
static int hf_ansi_tcap_abortCause = -1; /* P_Abort_cause */
static int hf_ansi_tcap_userInformation = -1; /* UserAbortInformation */
static int hf_ansi_tcap_version = -1; /* ProtocolVersion */
static int hf_ansi_tcap_applicationContext = -1; /* T_applicationContext */
static int hf_ansi_tcap_integerApplicationId = -1; /* IntegerApplicationContext */
static int hf_ansi_tcap_objectApplicationId = -1; /* ObjectIDApplicationContext */
static int hf_ansi_tcap_userInformation_01 = -1; /* UserInformation */
static int hf_ansi_tcap_securityContext = -1; /* T_securityContext */
static int hf_ansi_tcap_integerSecurityId = -1; /* INTEGER */
static int hf_ansi_tcap_objectSecurityId = -1; /* OBJECT_IDENTIFIER */
static int hf_ansi_tcap_confidentiality = -1; /* Confidentiality */
static int hf_ansi_tcap__untag_item = -1; /* EXTERNAL */
static int hf_ansi_tcap_confidentialityId = -1; /* T_confidentialityId */
static int hf_ansi_tcap_integerConfidentialityId = -1; /* INTEGER */
static int hf_ansi_tcap_objectConfidentialityId = -1; /* OBJECT_IDENTIFIER */
static int hf_ansi_tcap__untag_item_01 = -1; /* ComponentPDU */
static int hf_ansi_tcap_invokeLast = -1; /* Invoke */
static int hf_ansi_tcap_returnResultLast = -1; /* ReturnResult */
static int hf_ansi_tcap_returnError = -1; /* ReturnError */
static int hf_ansi_tcap_reject = -1; /* Reject */
static int hf_ansi_tcap_invokeNotLast = -1; /* Invoke */
static int hf_ansi_tcap_returnResultNotLast = -1; /* ReturnResult */
static int hf_ansi_tcap_componentIDs = -1; /* T_componentIDs */
static int hf_ansi_tcap_operationCode = -1; /* OperationCode */
static int hf_ansi_tcap_parameter = -1; /* T_parameter */
static int hf_ansi_tcap_componentID = -1; /* T_componentID */
static int hf_ansi_tcap_parameter_01 = -1; /* T_parameter_01 */
static int hf_ansi_tcap_componentID_01 = -1; /* T_componentID_01 */
static int hf_ansi_tcap_errorCode = -1; /* ErrorCode */
static int hf_ansi_tcap_parameter_02 = -1; /* T_parameter_02 */
static int hf_ansi_tcap_componentID_02 = -1; /* OCTET_STRING_SIZE_0_1 */
static int hf_ansi_tcap_rejectProblem = -1; /* Problem */
static int hf_ansi_tcap_parameter_03 = -1; /* T_parameter_03 */
static int hf_ansi_tcap_paramSequence = -1; /* T_paramSequence */
static int hf_ansi_tcap_paramSet = -1; /* T_paramSet */
/*--- End of included file: packet-ansi_tcap-hf.c ---*/
#line 64 "packet-ansi_tcap-template.c"
/* Initialize the subtree pointers */
static gint ett_tcap = -1;
static gint ett_param = -1;
static gint ett_otid = -1;
static gint ett_dtid = -1;
gint ett_ansi_tcap_stat = -1;
static struct tcapsrt_info_t * gp_tcapsrt_info;
static gboolean tcap_subdissector_used=FALSE;
static dissector_handle_t requested_subdissector_handle = NULL;
static struct tcaphash_context_t * gp_tcap_context=NULL;
/*--- Included file: packet-ansi_tcap-ett.c ---*/
#line 1 "packet-ansi_tcap-ett.c"
static gint ett_ansi_tcap_OperationCode = -1;
static gint ett_ansi_tcap_ErrorCode = -1;
static gint ett_ansi_tcap_PackageType = -1;
static gint ett_ansi_tcap_UniTransactionPDU = -1;
static gint ett_ansi_tcap_TransactionPDU = -1;
static gint ett_ansi_tcap_Abort = -1;
static gint ett_ansi_tcap_T_causeInformation = -1;
static gint ett_ansi_tcap_DialoguePortion_U = -1;
static gint ett_ansi_tcap_T_applicationContext = -1;
static gint ett_ansi_tcap_T_securityContext = -1;
static gint ett_ansi_tcap_UserInformation_U = -1;
static gint ett_ansi_tcap_Confidentiality = -1;
static gint ett_ansi_tcap_T_confidentialityId = -1;
static gint ett_ansi_tcap_SEQUENCE_OF_ComponentPDU = -1;
static gint ett_ansi_tcap_ComponentPDU = -1;
static gint ett_ansi_tcap_Invoke = -1;
static gint ett_ansi_tcap_ReturnResult = -1;
static gint ett_ansi_tcap_ReturnError = -1;
static gint ett_ansi_tcap_Reject = -1;
static gint ett_ansi_tcap_T_parameter_03 = -1;
static gint ett_ansi_tcap_T_paramSequence = -1;
static gint ett_ansi_tcap_T_paramSet = -1;
/*--- End of included file: packet-ansi_tcap-ett.c ---*/
#line 80 "packet-ansi_tcap-template.c"
#define MAX_SSN 254
static range_t *global_ssn_range;
static range_t *ssn_range;
struct tcap_private_t ansi_tcap_private;
gboolean g_ansi_tcap_HandleSRT=FALSE;
extern gboolean gtcap_PersistentSRT;
extern gboolean gtcap_DisplaySRT;
extern guint gtcap_RepetitionTimeout;
extern guint gtcap_LostTimeout;
static dissector_handle_t tcap_handle = NULL;
static dissector_table_t ber_oid_dissector_table=NULL;
static const char * cur_oid;
static const char * tcapext_oid;
static proto_tree * tcap_top_tree=NULL;
static proto_tree * tcap_stat_tree=NULL;
static proto_item * tcap_stat_item=NULL;
static dissector_handle_t data_handle;
static dissector_table_t sccp_ssn_table;
static void raz_ansi_tcap_private(struct tcap_private_t * p_ansi_tcap_private);
static GHashTable* ansi_sub_dissectors = NULL;
static GHashTable* itu_sub_dissectors = NULL;
static void dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
/*
extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
dissector_add("sccp.ssn",ssn,tcap_handle);
}
extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) {
g_hash_table_remove(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
dissector_delete("sccp.ssn",ssn,tcap_handle);
}
dissector_handle_t get_ansi_tcap_subdissector(guint32 ssn) {
return g_hash_table_lookup(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
}
*/
/*--- Included file: packet-ansi_tcap-fn.c ---*/
#line 1 "packet-ansi_tcap-fn.c"
static int
dissect_ansi_tcap_INTEGER_M32768_32767(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,
NULL);
return offset;
}
static int
dissect_ansi_tcap_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_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string ansi_tcap_OperationCode_vals[] = {
{ 16, "national" },
{ 17, "private" },
{ 0, NULL }
};
static const ber_choice_t OperationCode_choice[] = {
{ 16, &hf_ansi_tcap_national , BER_CLASS_PRI, 16, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER_M32768_32767 },
{ 17, &hf_ansi_tcap_private , BER_CLASS_PRI, 17, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_OperationCode(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_choice(actx, tree, tvb, offset,
OperationCode_choice, hf_index, ett_ansi_tcap_OperationCode,
NULL);
return offset;
}
static int
dissect_ansi_tcap_INTEGER_M128_127(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,
NULL);
return offset;
}
static const value_string ansi_tcap_ErrorCode_vals[] = {
{ 19, "national" },
{ 20, "private" },
{ 0, NULL }
};
static const ber_choice_t ErrorCode_choice[] = {
{ 19, &hf_ansi_tcap_national_01, BER_CLASS_PRI, 19, 0, dissect_ansi_tcap_INTEGER_M128_127 },
{ 20, &hf_ansi_tcap_private , BER_CLASS_PRI, 20, 0, dissect_ansi_tcap_INTEGER },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_ErrorCode(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_choice(actx, tree, tvb, offset,
ErrorCode_choice, hf_index, ett_ansi_tcap_ErrorCode,
NULL);
return offset;
}
static int
dissect_ansi_tcap_Priority(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,
NULL);
return offset;
}
static int
dissect_ansi_tcap_OCTET_STRING(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_ansi_tcap_TransactionID(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_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_PRI, 7, TRUE, dissect_ansi_tcap_OCTET_STRING);
return offset;
}
static int
dissect_ansi_tcap_OCTET_STRING_SIZE_1(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_ansi_tcap_ProtocolVersion(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_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_PRI, 26, TRUE, dissect_ansi_tcap_OCTET_STRING_SIZE_1);
return offset;
}
static int
dissect_ansi_tcap_IntegerApplicationContext(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_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_PRI, 27, TRUE, dissect_ansi_tcap_INTEGER);
return offset;
}
static int
dissect_ansi_tcap_OBJECT_IDENTIFIER(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_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
return offset;
}
static int
dissect_ansi_tcap_ObjectIDApplicationContext(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_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_PRI, 28, TRUE, dissect_ansi_tcap_OBJECT_IDENTIFIER);
return offset;
}
static const value_string ansi_tcap_T_applicationContext_vals[] = {
{ 27, "integerApplicationId" },
{ 28, "objectApplicationId" },
{ 0, NULL }
};
static const ber_choice_t T_applicationContext_choice[] = {
{ 27, &hf_ansi_tcap_integerApplicationId, BER_CLASS_PRI, 27, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_IntegerApplicationContext },
{ 28, &hf_ansi_tcap_objectApplicationId, BER_CLASS_PRI, 28, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ObjectIDApplicationContext },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_T_applicationContext(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_choice(actx, tree, tvb, offset,
T_applicationContext_choice, hf_index, ett_ansi_tcap_T_applicationContext,
NULL);
return offset;
}
static int
dissect_ansi_tcap_EXTERNAL(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_external_type(implicit_tag, tree, tvb, offset, actx, hf_index, NULL);
return offset;
}
static const ber_sequence_t UserInformation_U_sequence_of[1] = {
{ &hf_ansi_tcap__untag_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_EXTERNAL },
};
static int
dissect_ansi_tcap_UserInformation_U(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_sequence_of(implicit_tag, actx, tree, tvb, offset,
UserInformation_U_sequence_of, hf_index, ett_ansi_tcap_UserInformation_U);
return offset;
}
static int
dissect_ansi_tcap_UserInformation(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_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_PRI, 29, TRUE, dissect_ansi_tcap_UserInformation_U);
return offset;
}
static const value_string ansi_tcap_T_securityContext_vals[] = {
{ 0, "integerSecurityId" },
{ 1, "objectSecurityId" },
{ 0, NULL }
};
static const ber_choice_t T_securityContext_choice[] = {
{ 0, &hf_ansi_tcap_integerSecurityId, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER },
{ 1, &hf_ansi_tcap_objectSecurityId, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OBJECT_IDENTIFIER },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_T_securityContext(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_choice(actx, tree, tvb, offset,
T_securityContext_choice, hf_index, ett_ansi_tcap_T_securityContext,
NULL);
return offset;
}
static const value_string ansi_tcap_T_confidentialityId_vals[] = {
{ 0, "integerConfidentialityId" },
{ 1, "objectConfidentialityId" },
{ 0, NULL }
};
static const ber_choice_t T_confidentialityId_choice[] = {
{ 0, &hf_ansi_tcap_integerConfidentialityId, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER },
{ 1, &hf_ansi_tcap_objectConfidentialityId, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OBJECT_IDENTIFIER },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_T_confidentialityId(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_choice(actx, tree, tvb, offset,
T_confidentialityId_choice, hf_index, ett_ansi_tcap_T_confidentialityId,
NULL);
return offset;
}
static const ber_sequence_t Confidentiality_sequence[] = {
{ &hf_ansi_tcap_confidentialityId, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_confidentialityId },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_Confidentiality(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_sequence(implicit_tag, actx, tree, tvb, offset,
Confidentiality_sequence, hf_index, ett_ansi_tcap_Confidentiality);
return offset;
}
static const ber_sequence_t DialoguePortion_U_sequence[] = {
{ &hf_ansi_tcap_version , BER_CLASS_PRI, 26, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ProtocolVersion },
{ &hf_ansi_tcap_applicationContext, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_applicationContext },
{ &hf_ansi_tcap_userInformation_01, BER_CLASS_PRI, 29, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_UserInformation },
{ &hf_ansi_tcap_securityContext, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_securityContext },
{ &hf_ansi_tcap_confidentiality, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Confidentiality },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_DialoguePortion_U(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_sequence(implicit_tag, actx, tree, tvb, offset,
DialoguePortion_U_sequence, hf_index, ett_ansi_tcap_DialoguePortion_U);
return offset;
}
static int
dissect_ansi_tcap_DialoguePortion(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_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_PRI, 25, TRUE, dissect_ansi_tcap_DialoguePortion_U);
return offset;
}
static int
dissect_ansi_tcap_T_componentIDs(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_ansi_tcap_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_) {
#line 11 "ansi_tcap.cnf"
tvbuff_t *parameter_tvb;
offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index,
&parameter_tvb);
if(!parameter_tvb)
return offset;
return offset;
}
static const ber_sequence_t Invoke_sequence[] = {
{ &hf_ansi_tcap_componentIDs, BER_CLASS_PRI, 15, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentIDs },
{ &hf_ansi_tcap_operationCode, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_OperationCode },
{ &hf_ansi_tcap_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_parameter },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_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_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Invoke_sequence, hf_index, ett_ansi_tcap_Invoke);
return offset;
}
static int
dissect_ansi_tcap_T_componentID(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_ansi_tcap_T_parameter_01(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 23 "ansi_tcap.cnf"
tvbuff_t *parameter_tvb;
proto_tree_add_text(tree, tvb, offset, -1, "ReturnResult/result/result");
offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index,
&parameter_tvb);
return offset;
}
static const ber_sequence_t ReturnResult_sequence[] = {
{ &hf_ansi_tcap_componentID, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentID },
{ &hf_ansi_tcap_parameter_01, BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_parameter_01 },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_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_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ReturnResult_sequence, hf_index, ett_ansi_tcap_ReturnResult);
return offset;
}
static int
dissect_ansi_tcap_T_componentID_01(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_ansi_tcap_T_parameter_02(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 37 "ansi_tcap.cnf"
tvbuff_t *parameter_tvb;
proto_tree_add_text(tree, tvb, offset, -1, "ReturnError/parameter");
offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index,
&parameter_tvb);
return offset;
}
static const ber_sequence_t ReturnError_sequence[] = {
{ &hf_ansi_tcap_componentID_01, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentID_01 },
{ &hf_ansi_tcap_errorCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_ErrorCode },
{ &hf_ansi_tcap_parameter_02, BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_parameter_02 },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_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_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ReturnError_sequence, hf_index, ett_ansi_tcap_ReturnError);
return offset;
}
static int
dissect_ansi_tcap_OCTET_STRING_SIZE_0_1(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string ansi_tcap_Problem_vals[] = {
{ 257, "general-unrecognisedComponentType" },
{ 258, "general-incorrectComponentPortion" },
{ 259, "general-badlyStructuredCompPortion" },
{ 260, "general-incorrectComponentCoding" },
{ 513, "invoke-duplicateInvocation" },
{ 514, "invoke-unrecognisedOperation" },
{ 515, "invoke-incorrectParameter" },
{ 516, "invoke-unrecognisedCorrelationID" },
{ 769, "returnResult-unrecognisedCorrelationID" },
{ 770, "returnResult-unexpectedReturnResult" },
{ 771, "returnResult-incorrectParameter" },
{ 1025, "returnError-unrecognisedCorrelationID" },
{ 1026, "returnError-unexpectedReturnError" },
{ 1027, "returnError-unrecognisedError" },
{ 1028, "returnError-unexpectedError" },
{ 1029, "returnError-incorrectParameter" },
{ 1281, "transaction-unrecognizedPackageType" },
{ 1282, "transaction-incorrectTransPortion" },
{ 1283, "transaction-badlyStructuredTransPortion" },
{ 1284, "transaction-unassignedRespondingTransID" },
{ 1285, "transaction-permissionToReleaseProblem" },
{ 1286, "transaction-resourceUnavailable" },
{ 0, NULL }
};
static int
dissect_ansi_tcap_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_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const ber_sequence_t T_paramSequence_sequence[] = {
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_T_paramSequence(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_sequence(implicit_tag, actx, tree, tvb, offset,
T_paramSequence_sequence, hf_index, ett_ansi_tcap_T_paramSequence);
return offset;
}
static const ber_sequence_t T_paramSet_set[] = {
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_T_paramSet(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_set(implicit_tag, actx, tree, tvb, offset,
T_paramSet_set, hf_index, ett_ansi_tcap_T_paramSet);
return offset;
}
static const value_string ansi_tcap_T_parameter_03_vals[] = {
{ 16, "paramSequence" },
{ 18, "paramSet" },
{ 0, NULL }
};
static const ber_choice_t T_parameter_03_choice[] = {
{ 16, &hf_ansi_tcap_paramSequence, BER_CLASS_PRI, 16, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_paramSequence },
{ 18, &hf_ansi_tcap_paramSet , BER_CLASS_PRI, 18, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_paramSet },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_T_parameter_03(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_choice(actx, tree, tvb, offset,
T_parameter_03_choice, hf_index, ett_ansi_tcap_T_parameter_03,
NULL);
return offset;
}
static const ber_sequence_t Reject_sequence[] = {
{ &hf_ansi_tcap_componentID_02, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OCTET_STRING_SIZE_0_1 },
{ &hf_ansi_tcap_rejectProblem, BER_CLASS_PRI, 21, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Problem },
{ &hf_ansi_tcap_parameter_03, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_parameter_03 },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_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_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Reject_sequence, hf_index, ett_ansi_tcap_Reject);
return offset;
}
static const value_string ansi_tcap_ComponentPDU_vals[] = {
{ 9, "invokeLast" },
{ 10, "returnResultLast" },
{ 11, "returnError" },
{ 12, "reject" },
{ 13, "invokeNotLast" },
{ 14, "returnResultNotLast" },
{ 0, NULL }
};
static const ber_choice_t ComponentPDU_choice[] = {
{ 9, &hf_ansi_tcap_invokeLast, BER_CLASS_PRI, 9, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Invoke },
{ 10, &hf_ansi_tcap_returnResultLast, BER_CLASS_PRI, 10, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnResult },
{ 11, &hf_ansi_tcap_returnError, BER_CLASS_PRI, 11, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnError },
{ 12, &hf_ansi_tcap_reject , BER_CLASS_PRI, 12, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Reject },
{ 13, &hf_ansi_tcap_invokeNotLast, BER_CLASS_PRI, 13, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Invoke },
{ 14, &hf_ansi_tcap_returnResultNotLast, BER_CLASS_PRI, 14, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnResult },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_ComponentPDU(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_choice(actx, tree, tvb, offset,
ComponentPDU_choice, hf_index, ett_ansi_tcap_ComponentPDU,
NULL);
return offset;
}
static const ber_sequence_t SEQUENCE_OF_ComponentPDU_sequence_of[1] = {
{ &hf_ansi_tcap__untag_item_01, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_ComponentPDU },
};
static int
dissect_ansi_tcap_SEQUENCE_OF_ComponentPDU(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_sequence_of(implicit_tag, actx, tree, tvb, offset,
SEQUENCE_OF_ComponentPDU_sequence_of, hf_index, ett_ansi_tcap_SEQUENCE_OF_ComponentPDU);
return offset;
}
static int
dissect_ansi_tcap_ComponentSequence(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_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_PRI, 8, TRUE, dissect_ansi_tcap_SEQUENCE_OF_ComponentPDU);
return offset;
}
static const ber_sequence_t UniTransactionPDU_sequence[] = {
{ &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
{ &hf_ansi_tcap_dialoguePortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
{ &hf_ansi_tcap_componentPortion, BER_CLASS_PRI, 8, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ComponentSequence },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_UniTransactionPDU(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_sequence(implicit_tag, actx, tree, tvb, offset,
UniTransactionPDU_sequence, hf_index, ett_ansi_tcap_UniTransactionPDU);
return offset;
}
static const ber_sequence_t TransactionPDU_sequence[] = {
{ &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
{ &hf_ansi_tcap_dialoguePortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
{ &hf_ansi_tcap_componentPortion, BER_CLASS_PRI, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ComponentSequence },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_TransactionPDU(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_sequence(implicit_tag, actx, tree, tvb, offset,
TransactionPDU_sequence, hf_index, ett_ansi_tcap_TransactionPDU);
return offset;
}
static const value_string ansi_tcap_P_Abort_cause_U_vals[] = {
{ 1, "unrecognizedPackageType" },
{ 2, "incorrectTransactionPortion" },
{ 3, "badlyStructuredTransactionPortion" },
{ 4, "unassignedRespondingTransactionID" },
{ 5, "permissionToReleaseProblem" },
{ 6, "resourceUnavailable" },
{ 7, "unrecognizedDialoguePortionID" },
{ 8, "badlyStructuredDialoguePortion" },
{ 9, "missingDialoguePortion" },
{ 10, "inconsistentDialoguePortion" },
{ 0, NULL }
};
static int
dissect_ansi_tcap_P_Abort_cause_U(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,
NULL);
return offset;
}
static int
dissect_ansi_tcap_P_Abort_cause(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_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_PRI, 23, TRUE, dissect_ansi_tcap_P_Abort_cause_U);
return offset;
}
static int
dissect_ansi_tcap_UserAbortInformation(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_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_PRI, 24, FALSE, dissect_ansi_tcap_EXTERNAL);
return offset;
}
static const value_string ansi_tcap_T_causeInformation_vals[] = {
{ 23, "abortCause" },
{ 24, "userInformation" },
{ 0, NULL }
};
static const ber_choice_t T_causeInformation_choice[] = {
{ 23, &hf_ansi_tcap_abortCause, BER_CLASS_PRI, 23, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_P_Abort_cause },
{ 24, &hf_ansi_tcap_userInformation, BER_CLASS_PRI, 24, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_UserAbortInformation },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_T_causeInformation(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_choice(actx, tree, tvb, offset,
T_causeInformation_choice, hf_index, ett_ansi_tcap_T_causeInformation,
NULL);
return offset;
}
static const ber_sequence_t Abort_sequence[] = {
{ &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
{ &hf_ansi_tcap_dialogPortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
{ &hf_ansi_tcap_causeInformation, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_causeInformation },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_Abort(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_sequence(implicit_tag, actx, tree, tvb, offset,
Abort_sequence, hf_index, ett_ansi_tcap_Abort);
return offset;
}
static const value_string ansi_tcap_PackageType_vals[] = {
{ 1, "unidirectional" },
{ 2, "queryWithPerm" },
{ 3, "queryWithoutPerm" },
{ 4, "response" },
{ 5, "conversationWithPerm" },
{ 6, "conversationWithoutPerm" },
{ 22, "abort" },
{ 0, NULL }
};
static const ber_choice_t PackageType_choice[] = {
{ 1, &hf_ansi_tcap_unidirectional, BER_CLASS_PRI, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_UniTransactionPDU },
{ 2, &hf_ansi_tcap_queryWithPerm, BER_CLASS_PRI, 2, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_TransactionPDU },
{ 3, &hf_ansi_tcap_queryWithoutPerm, BER_CLASS_PRI, 3, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_TransactionPDU },
{ 4, &hf_ansi_tcap_response , BER_CLASS_PRI, 4, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_TransactionPDU },
{ 5, &hf_ansi_tcap_conversationWithPerm, BER_CLASS_PRI, 5, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_TransactionPDU },
{ 6, &hf_ansi_tcap_conversationWithoutPerm, BER_CLASS_PRI, 6, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_TransactionPDU },
{ 22, &hf_ansi_tcap_abort , BER_CLASS_PRI, 22, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Abort },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_ansi_tcap_PackageType(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_choice(actx, tree, tvb, offset,
PackageType_choice, hf_index, ett_ansi_tcap_PackageType,
NULL);
return offset;
}
/*--- End of included file: packet-ansi_tcap-fn.c ---*/
#line 129 "packet-ansi_tcap-template.c"
static void
dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
proto_item *stat_item=NULL;
proto_tree *stat_tree=NULL;
gint offset = 0;
struct tcaphash_context_t * p_tcap_context;
dissector_handle_t subdissector_handle;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
tcap_top_tree = parent_tree;
if (check_col(pinfo->cinfo, COL_PROTOCOL))
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI TCAP");
}
/* create display subtree for the protocol */
if(parent_tree){
item = proto_tree_add_item(parent_tree, proto_ansi_tcap, tvb, 0, -1, FALSE);
tree = proto_item_add_subtree(item, ett_tcap);
tcap_stat_item=item;
tcap_stat_tree=tree;
}
cur_oid = NULL;
tcapext_oid = NULL;
raz_ansi_tcap_private(&ansi_tcap_private);
pinfo->private_data = &ansi_tcap_private;
gp_tcapsrt_info=tcapsrt_razinfo();
tcap_subdissector_used=FALSE;
gp_tcap_context=NULL;
dissect_ansi_tcap_PackageType(FALSE, tvb, 0, &asn1_ctx, tree, -1);
if (g_ansi_tcap_HandleSRT && !tcap_subdissector_used ) {
if (gtcap_DisplaySRT && tree) {
stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat");
PROTO_ITEM_SET_GENERATED(stat_item);
stat_tree = proto_item_add_subtree(stat_item, ett_ansi_tcap_stat);
}
p_tcap_context=tcapsrt_call_matching(tvb, pinfo, stat_tree, gp_tcapsrt_info);
ansi_tcap_private.context=p_tcap_context;
/* If the current message is TCAP only,
* save the Application contexte name for the next messages
*/
if ( p_tcap_context && cur_oid && !p_tcap_context->oid_present ) {
/* Save the application context and the sub dissector */
ber_oid_dissector_table = find_dissector_table("ber.oid");
strncpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
p_tcap_context->subdissector_handle=subdissector_handle;
p_tcap_context->oid_present=TRUE;
}
}
if (g_ansi_tcap_HandleSRT && p_tcap_context && p_tcap_context->callback) {
/* Callback fonction for the upper layer */
(p_tcap_context->callback)(tvb, pinfo, stat_tree, p_tcap_context);
}
}
}
static void raz_ansi_tcap_private(struct tcap_private_t * p_ansi_tcap_private)
{
memset(p_ansi_tcap_private,0,sizeof(struct tcap_private_t) );
}
void
proto_reg_handoff_ansi_tcap(void)
{
data_handle = find_dissector("data");
}
void
proto_register_ansi_tcap(void)
{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{ &hf_ansi_tcap_tag,
{ "Tag", "tcap.msgtype",
FT_UINT8, BASE_HEX, NULL, 0,
"", HFILL }
},
{ &hf_ansi_tcap_length,
{ "Length", "tcap.len",
FT_UINT8, BASE_HEX, NULL, 0,
"", HFILL }
},
{ &hf_ansi_tcap_data,
{ "Data", "tcap.data",
FT_BYTES, BASE_HEX, NULL, 0,
"", HFILL }
},
{ &hf_ansi_tcap_tid,
{ "Transaction Id", "tcap.tid",
FT_BYTES, BASE_HEX, NULL, 0,
"", HFILL }
},
/* Tcap Service Response Time */
{ &hf_ansi_tcapsrt_SessionId,
{ "Session Id",
"tcap.srt.session_id",
FT_UINT32, BASE_DEC, NULL, 0x0,
"", HFILL }
},
{ &hf_ansi_tcapsrt_BeginSession,
{ "Begin Session",
"tcap.srt.begin",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"SRT Begin of Session", HFILL }
},
{ &hf_ansi_tcapsrt_EndSession,
{ "End Session",
"tcap.srt.end",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"SRT End of Session", HFILL }
},
{ &hf_ansi_tcapsrt_SessionTime,
{ "Session duration",
"tcap.srt.sessiontime",
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
"Duration of the TCAP session", HFILL }
},
{ &hf_ansi_tcapsrt_Duplicate,
{ "Request Duplicate",
"tcap.srt.duplicate",
FT_UINT32, BASE_DEC, NULL, 0x0,
"", HFILL }
},
/*--- Included file: packet-ansi_tcap-hfarr.c ---*/
#line 1 "packet-ansi_tcap-hfarr.c"
{ &hf_ansi_tcap_national,
{ "national", "ansi_tcap.national",
FT_INT32, BASE_DEC, NULL, 0,
"ansi_tcap.INTEGER_M32768_32767", HFILL }},
{ &hf_ansi_tcap_private,
{ "private", "ansi_tcap.private",
FT_INT32, BASE_DEC, NULL, 0,
"ansi_tcap.INTEGER", HFILL }},
{ &hf_ansi_tcap_national_01,
{ "national", "ansi_tcap.national",
FT_INT32, BASE_DEC, NULL, 0,
"ansi_tcap.INTEGER_M128_127", HFILL }},
{ &hf_ansi_tcap_unidirectional,
{ "unidirectional", "ansi_tcap.unidirectional",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.UniTransactionPDU", HFILL }},
{ &hf_ansi_tcap_queryWithPerm,
{ "queryWithPerm", "ansi_tcap.queryWithPerm",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.TransactionPDU", HFILL }},
{ &hf_ansi_tcap_queryWithoutPerm,
{ "queryWithoutPerm", "ansi_tcap.queryWithoutPerm",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.TransactionPDU", HFILL }},
{ &hf_ansi_tcap_response,
{ "response", "ansi_tcap.response",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.TransactionPDU", HFILL }},
{ &hf_ansi_tcap_conversationWithPerm,
{ "conversationWithPerm", "ansi_tcap.conversationWithPerm",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.TransactionPDU", HFILL }},
{ &hf_ansi_tcap_conversationWithoutPerm,
{ "conversationWithoutPerm", "ansi_tcap.conversationWithoutPerm",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.TransactionPDU", HFILL }},
{ &hf_ansi_tcap_abort,
{ "abort", "ansi_tcap.abort",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.Abort", HFILL }},
{ &hf_ansi_tcap_identifier,
{ "identifier", "ansi_tcap.identifier",
FT_BYTES, BASE_HEX, NULL, 0,
"ansi_tcap.TransactionID", HFILL }},
{ &hf_ansi_tcap_dialoguePortion,
{ "dialoguePortion", "ansi_tcap.dialoguePortion",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.DialoguePortion", HFILL }},
{ &hf_ansi_tcap_componentPortion,
{ "componentPortion", "ansi_tcap.componentPortion",
FT_UINT32, BASE_DEC, NULL, 0,
"ansi_tcap.ComponentSequence", HFILL }},
{ &hf_ansi_tcap_dialogPortion,
{ "dialogPortion", "ansi_tcap.dialogPortion",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.DialoguePortion", HFILL }},
{ &hf_ansi_tcap_causeInformation,
{ "causeInformation", "ansi_tcap.causeInformation",
FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_causeInformation_vals), 0,
"ansi_tcap.T_causeInformation", HFILL }},
{ &hf_ansi_tcap_abortCause,
{ "abortCause", "ansi_tcap.abortCause",
FT_INT32, BASE_DEC, NULL, 0,
"ansi_tcap.P_Abort_cause", HFILL }},
{ &hf_ansi_tcap_userInformation,
{ "userInformation", "ansi_tcap.userInformation",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.UserAbortInformation", HFILL }},
{ &hf_ansi_tcap_version,
{ "version", "ansi_tcap.version",
FT_BYTES, BASE_HEX, NULL, 0,
"ansi_tcap.ProtocolVersion", HFILL }},
{ &hf_ansi_tcap_applicationContext,
{ "applicationContext", "ansi_tcap.applicationContext",
FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_applicationContext_vals), 0,
"ansi_tcap.T_applicationContext", HFILL }},
{ &hf_ansi_tcap_integerApplicationId,
{ "integerApplicationId", "ansi_tcap.integerApplicationId",
FT_INT32, BASE_DEC, NULL, 0,
"ansi_tcap.IntegerApplicationContext", HFILL }},
{ &hf_ansi_tcap_objectApplicationId,
{ "objectApplicationId", "ansi_tcap.objectApplicationId",
FT_OID, BASE_NONE, NULL, 0,
"ansi_tcap.ObjectIDApplicationContext", HFILL }},
{ &hf_ansi_tcap_userInformation_01,
{ "userInformation", "ansi_tcap.userInformation",
FT_UINT32, BASE_DEC, NULL, 0,
"ansi_tcap.UserInformation", HFILL }},
{ &hf_ansi_tcap_securityContext,
{ "securityContext", "ansi_tcap.securityContext",
FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_securityContext_vals), 0,
"ansi_tcap.T_securityContext", HFILL }},
{ &hf_ansi_tcap_integerSecurityId,
{ "integerSecurityId", "ansi_tcap.integerSecurityId",
FT_INT32, BASE_DEC, NULL, 0,
"ansi_tcap.INTEGER", HFILL }},
{ &hf_ansi_tcap_objectSecurityId,
{ "objectSecurityId", "ansi_tcap.objectSecurityId",
FT_OID, BASE_NONE, NULL, 0,
"ansi_tcap.OBJECT_IDENTIFIER", HFILL }},
{ &hf_ansi_tcap_confidentiality,
{ "confidentiality", "ansi_tcap.confidentiality",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.Confidentiality", HFILL }},
{ &hf_ansi_tcap__untag_item,
{ "Item", "ansi_tcap._untag_item",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.EXTERNAL", HFILL }},
{ &hf_ansi_tcap_confidentialityId,
{ "confidentialityId", "ansi_tcap.confidentialityId",
FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_confidentialityId_vals), 0,
"ansi_tcap.T_confidentialityId", HFILL }},
{ &hf_ansi_tcap_integerConfidentialityId,
{ "integerConfidentialityId", "ansi_tcap.integerConfidentialityId",
FT_INT32, BASE_DEC, NULL, 0,
"ansi_tcap.INTEGER", HFILL }},
{ &hf_ansi_tcap_objectConfidentialityId,
{ "objectConfidentialityId", "ansi_tcap.objectConfidentialityId",
FT_OID, BASE_NONE, NULL, 0,
"ansi_tcap.OBJECT_IDENTIFIER", HFILL }},
{ &hf_ansi_tcap__untag_item_01,
{ "Item", "ansi_tcap._untag_item",
FT_UINT32, BASE_DEC, VALS(ansi_tcap_ComponentPDU_vals), 0,
"ansi_tcap.ComponentPDU", HFILL }},
{ &hf_ansi_tcap_invokeLast,
{ "invokeLast", "ansi_tcap.invokeLast",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.Invoke", HFILL }},
{ &hf_ansi_tcap_returnResultLast,
{ "returnResultLast", "ansi_tcap.returnResultLast",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.ReturnResult", HFILL }},
{ &hf_ansi_tcap_returnError,
{ "returnError", "ansi_tcap.returnError",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.ReturnError", HFILL }},
{ &hf_ansi_tcap_reject,
{ "reject", "ansi_tcap.reject",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.Reject", HFILL }},
{ &hf_ansi_tcap_invokeNotLast,
{ "invokeNotLast", "ansi_tcap.invokeNotLast",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.Invoke", HFILL }},
{ &hf_ansi_tcap_returnResultNotLast,
{ "returnResultNotLast", "ansi_tcap.returnResultNotLast",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.ReturnResult", HFILL }},
{ &hf_ansi_tcap_componentIDs,
{ "componentIDs", "ansi_tcap.componentIDs",
FT_BYTES, BASE_HEX, NULL, 0,
"ansi_tcap.T_componentIDs", HFILL }},
{ &hf_ansi_tcap_operationCode,
{ "operationCode", "ansi_tcap.operationCode",
FT_UINT32, BASE_DEC, VALS(ansi_tcap_OperationCode_vals), 0,
"ansi_tcap.OperationCode", HFILL }},
{ &hf_ansi_tcap_parameter,
{ "parameter", "ansi_tcap.parameter",
FT_BYTES, BASE_HEX, NULL, 0,
"ansi_tcap.T_parameter", HFILL }},
{ &hf_ansi_tcap_componentID,
{ "componentID", "ansi_tcap.componentID",
FT_BYTES, BASE_HEX, NULL, 0,
"ansi_tcap.T_componentID", HFILL }},
{ &hf_ansi_tcap_parameter_01,
{ "parameter", "ansi_tcap.parameter",
FT_BYTES, BASE_HEX, NULL, 0,
"ansi_tcap.T_parameter_01", HFILL }},
{ &hf_ansi_tcap_componentID_01,
{ "componentID", "ansi_tcap.componentID",
FT_BYTES, BASE_HEX, NULL, 0,
"ansi_tcap.T_componentID_01", HFILL }},
{ &hf_ansi_tcap_errorCode,
{ "errorCode", "ansi_tcap.errorCode",
FT_UINT32, BASE_DEC, VALS(ansi_tcap_ErrorCode_vals), 0,
"ansi_tcap.ErrorCode", HFILL }},
{ &hf_ansi_tcap_parameter_02,
{ "parameter", "ansi_tcap.parameter",
FT_BYTES, BASE_HEX, NULL, 0,
"ansi_tcap.T_parameter_02", HFILL }},
{ &hf_ansi_tcap_componentID_02,
{ "componentID", "ansi_tcap.componentID",
FT_BYTES, BASE_HEX, NULL, 0,
"ansi_tcap.OCTET_STRING_SIZE_0_1", HFILL }},
{ &hf_ansi_tcap_rejectProblem,
{ "rejectProblem", "ansi_tcap.rejectProblem",
FT_INT32, BASE_DEC, VALS(ansi_tcap_Problem_vals), 0,
"ansi_tcap.Problem", HFILL }},
{ &hf_ansi_tcap_parameter_03,
{ "parameter", "ansi_tcap.parameter",
FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_parameter_03_vals), 0,
"ansi_tcap.T_parameter_03", HFILL }},
{ &hf_ansi_tcap_paramSequence,
{ "paramSequence", "ansi_tcap.paramSequence",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.T_paramSequence", HFILL }},
{ &hf_ansi_tcap_paramSet,
{ "paramSet", "ansi_tcap.paramSet",
FT_NONE, BASE_NONE, NULL, 0,
"ansi_tcap.T_paramSet", HFILL }},
/*--- End of included file: packet-ansi_tcap-hfarr.c ---*/
#line 270 "packet-ansi_tcap-template.c"
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_tcap,
&ett_param,
&ett_otid,
&ett_dtid,
&ett_ansi_tcap_stat,
/*--- Included file: packet-ansi_tcap-ettarr.c ---*/
#line 1 "packet-ansi_tcap-ettarr.c"
&ett_ansi_tcap_OperationCode,
&ett_ansi_tcap_ErrorCode,
&ett_ansi_tcap_PackageType,
&ett_ansi_tcap_UniTransactionPDU,
&ett_ansi_tcap_TransactionPDU,
&ett_ansi_tcap_Abort,
&ett_ansi_tcap_T_causeInformation,
&ett_ansi_tcap_DialoguePortion_U,
&ett_ansi_tcap_T_applicationContext,
&ett_ansi_tcap_T_securityContext,
&ett_ansi_tcap_UserInformation_U,
&ett_ansi_tcap_Confidentiality,
&ett_ansi_tcap_T_confidentialityId,
&ett_ansi_tcap_SEQUENCE_OF_ComponentPDU,
&ett_ansi_tcap_ComponentPDU,
&ett_ansi_tcap_Invoke,
&ett_ansi_tcap_ReturnResult,
&ett_ansi_tcap_ReturnError,
&ett_ansi_tcap_Reject,
&ett_ansi_tcap_T_parameter_03,
&ett_ansi_tcap_T_paramSequence,
&ett_ansi_tcap_T_paramSet,
/*--- End of included file: packet-ansi_tcap-ettarr.c ---*/
#line 280 "packet-ansi_tcap-template.c"
};
/*static enum_val_t tcap_options[] = {
{ "itu", "ITU", ITU_TCAP_STANDARD },
{ "ansi", "ANSI", ANSI_TCAP_STANDARD },
{ NULL, NULL, 0 }
};*/
/* Register the protocol name and description */
proto_ansi_tcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
register_dissector("ansi_tcap", dissect_ansi_tcap, proto_ansi_tcap);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_ansi_tcap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}