1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
4 /* ../../tools/asn2wrs.py -b -p tcap -c ./tcap.cnf -s ./packet-tcap-template -D . tcap.asn UnidialoguePDUs.asn DialoguePDUs.asn */
6 /* Input file: packet-tcap-template.c */
8 #line 1 "packet-tcap-template.c"
9 /* packet-tcap-template.c
11 * Copyright 2004 - 2005, Tim Endean <endeant@hotmail.com>
12 * Built from the gsm-map dissector Copyright 2004 - 2005, Anders Broman <anders.broman@ericsson.com>
16 * Wireshark - Network traffic analyzer
17 * By Gerald Combs <gerald@wireshark.org>
18 * Copyright 1998 Gerald Combs
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version 2
23 * of the License, or (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 * References: ETSI 300 374
41 #include <epan/packet.h>
42 #include <epan/prefs.h>
43 #include <epan/oids.h>
44 #include <epan/asn1.h>
45 #include <epan/strutil.h>
48 #include "packet-ber.h"
49 #include "packet-tcap.h"
50 #include <epan/tcap-persistentdata.h>
52 #define PNAME "Transaction Capabilities Application Part"
56 /* Initialize the protocol and registered fields */
57 static int proto_tcap = -1;
58 static int hf_tcap_tag = -1;
59 static int hf_tcap_length = -1;
60 static int hf_tcap_data = -1;
61 static int hf_tcap_tid = -1;
63 int hf_tcapsrt_SessionId=-1;
64 int hf_tcapsrt_Duplicate=-1;
65 int hf_tcapsrt_BeginSession=-1;
66 int hf_tcapsrt_EndSession=-1;
67 int hf_tcapsrt_SessionTime=-1;
70 /*--- Included file: packet-tcap-hf.c ---*/
71 #line 1 "packet-tcap-hf.c"
72 static int hf_tcap_UniDialoguePDU_PDU = -1; /* UniDialoguePDU */
73 static int hf_tcap_DialoguePDU_PDU = -1; /* DialoguePDU */
74 static int hf_tcap_oid = -1; /* OBJECT_IDENTIFIER */
75 static int hf_tcap_dialog = -1; /* Dialog1 */
76 static int hf_tcap_unidirectional = -1; /* Unidirectional */
77 static int hf_tcap_begin = -1; /* Begin */
78 static int hf_tcap_end = -1; /* End */
79 static int hf_tcap_continue = -1; /* Continue */
80 static int hf_tcap_abort = -1; /* Abort */
81 static int hf_tcap_dialoguePortion = -1; /* DialoguePortion */
82 static int hf_tcap_components = -1; /* ComponentPortion */
83 static int hf_tcap_otid = -1; /* OrigTransactionID */
84 static int hf_tcap_dtid = -1; /* DestTransactionID */
85 static int hf_tcap_reason = -1; /* Reason */
86 static int hf_tcap_p_abortCause = -1; /* P_AbortCause */
87 static int hf_tcap_u_abortCause = -1; /* DialoguePortion */
88 static int hf_tcap__untag_item = -1; /* Component */
89 static int hf_tcap_invoke = -1; /* Invoke */
90 static int hf_tcap_returnResultLast = -1; /* ReturnResult */
91 static int hf_tcap_returnError = -1; /* ReturnError */
92 static int hf_tcap_reject = -1; /* Reject */
93 static int hf_tcap_returnResultNotLast = -1; /* ReturnResult */
94 static int hf_tcap_invokeID = -1; /* InvokeIdType */
95 static int hf_tcap_linkedID = -1; /* InvokeIdType */
96 static int hf_tcap_opCode = -1; /* OPERATION */
97 static int hf_tcap_parameter = -1; /* Parameter */
98 static int hf_tcap_resultretres = -1; /* T_resultretres */
99 static int hf_tcap_errorCode = -1; /* ErrorCode */
100 static int hf_tcap_invokeIDRej = -1; /* T_invokeIDRej */
101 static int hf_tcap_derivable = -1; /* InvokeIdType */
102 static int hf_tcap_not_derivable = -1; /* NULL */
103 static int hf_tcap_problem = -1; /* T_problem */
104 static int hf_tcap_generalProblem = -1; /* GeneralProblem */
105 static int hf_tcap_invokeProblem = -1; /* InvokeProblem */
106 static int hf_tcap_returnResultProblem = -1; /* ReturnResultProblem */
107 static int hf_tcap_returnErrorProblem = -1; /* ReturnErrorProblem */
108 static int hf_tcap_localValue = -1; /* INTEGER */
109 static int hf_tcap_globalValue = -1; /* OBJECT_IDENTIFIER */
110 static int hf_tcap_nationaler = -1; /* INTEGER_M32768_32767 */
111 static int hf_tcap_privateer = -1; /* INTEGER */
112 static int hf_tcap_unidialoguePDU = -1; /* AUDT_apdu */
113 static int hf_tcap_audt_protocol_version = -1; /* AUDT_protocol_version */
114 static int hf_tcap_audt_application_context_name = -1; /* AUDT_application_context_name */
115 static int hf_tcap_audt_user_information = -1; /* AUDT_user_information */
116 static int hf_tcap_audt_user_information_item = -1; /* EXTERNAL */
117 static int hf_tcap_dialogueRequest = -1; /* AARQ_apdu */
118 static int hf_tcap_dialogueResponse = -1; /* AARE_apdu */
119 static int hf_tcap_dialogueAbort = -1; /* ABRT_apdu */
120 static int hf_tcap_aarq_protocol_version = -1; /* AARQ_protocol_version */
121 static int hf_tcap_aarq_application_context_name = -1; /* AARQ_application_context_name */
122 static int hf_tcap_aarq_user_information = -1; /* AARQ_user_information */
123 static int hf_tcap_aarq_user_information_item = -1; /* EXTERNAL */
124 static int hf_tcap_aare_protocol_version = -1; /* AARE_protocol_version */
125 static int hf_tcap_aare_application_context_name = -1; /* AARE_application_context_name */
126 static int hf_tcap_result = -1; /* Associate_result */
127 static int hf_tcap_result_source_diagnostic = -1; /* Associate_source_diagnostic */
128 static int hf_tcap_aare_user_information = -1; /* AARE_user_information */
129 static int hf_tcap_aare_user_information_item = -1; /* EXTERNAL */
130 static int hf_tcap_abort_source = -1; /* ABRT_source */
131 static int hf_tcap_abrt_user_information = -1; /* ABRT_user_information */
132 static int hf_tcap_abrt_user_information_item = -1; /* EXTERNAL */
133 static int hf_tcap_dialogue_service_user = -1; /* T_dialogue_service_user */
134 static int hf_tcap_dialogue_service_provider = -1; /* T_dialogue_service_provider */
136 static int hf_tcap_AUDT_protocol_version_version1 = -1;
137 static int hf_tcap_AARQ_protocol_version_version1 = -1;
138 static int hf_tcap_AARE_protocol_version_version1 = -1;
140 /*--- End of included file: packet-tcap-hf.c ---*/
141 #line 62 "packet-tcap-template.c"
143 /* Initialize the subtree pointers */
144 static gint ett_tcap = -1;
145 static gint ett_param = -1;
147 static gint ett_otid = -1;
148 static gint ett_dtid = -1;
149 gint ett_tcap_stat = -1;
151 static struct tcapsrt_info_t * gp_tcapsrt_info;
152 static gboolean tcap_subdissector_used=FALSE;
153 static dissector_handle_t requested_subdissector_handle = NULL;
155 static struct tcaphash_context_t * gp_tcap_context=NULL;
158 /*--- Included file: packet-tcap-ett.c ---*/
159 #line 1 "packet-tcap-ett.c"
160 static gint ett_tcap_ExternalPDU_U = -1;
161 static gint ett_tcap_TCMessage = -1;
162 static gint ett_tcap_Unidirectional = -1;
163 static gint ett_tcap_Begin = -1;
164 static gint ett_tcap_End = -1;
165 static gint ett_tcap_Continue = -1;
166 static gint ett_tcap_Abort = -1;
167 static gint ett_tcap_Reason = -1;
168 static gint ett_tcap_SEQUENCE_SIZE_1_MAX_OF_Component = -1;
169 static gint ett_tcap_Component = -1;
170 static gint ett_tcap_Invoke = -1;
171 static gint ett_tcap_ReturnResult = -1;
172 static gint ett_tcap_T_resultretres = -1;
173 static gint ett_tcap_ReturnError = -1;
174 static gint ett_tcap_Reject = -1;
175 static gint ett_tcap_T_invokeIDRej = -1;
176 static gint ett_tcap_T_problem = -1;
177 static gint ett_tcap_OPERATION = -1;
178 static gint ett_tcap_ERROR = -1;
179 static gint ett_tcap_ErrorCode = -1;
180 static gint ett_tcap_UniDialoguePDU = -1;
181 static gint ett_tcap_AUDT_apdu_U = -1;
182 static gint ett_tcap_AUDT_protocol_version = -1;
183 static gint ett_tcap_AUDT_user_information = -1;
184 static gint ett_tcap_DialoguePDU = -1;
185 static gint ett_tcap_AARQ_apdu_U = -1;
186 static gint ett_tcap_AARQ_protocol_version = -1;
187 static gint ett_tcap_AARQ_user_information = -1;
188 static gint ett_tcap_AARE_apdu_U = -1;
189 static gint ett_tcap_AARE_protocol_version = -1;
190 static gint ett_tcap_AARE_user_information = -1;
191 static gint ett_tcap_ABRT_apdu_U = -1;
192 static gint ett_tcap_ABRT_user_information = -1;
193 static gint ett_tcap_Associate_source_diagnostic = -1;
195 /*--- End of included file: packet-tcap-ett.c ---*/
196 #line 78 "packet-tcap-template.c"
199 static range_t *global_ssn_range;
200 static range_t *ssn_range;
201 struct tcap_private_t tcap_private;
203 gboolean gtcap_HandleSRT=FALSE;
204 extern gboolean gtcap_PersistentSRT;
205 extern gboolean gtcap_DisplaySRT;
206 extern guint gtcap_RepetitionTimeout;
207 extern guint gtcap_LostTimeout;
209 static dissector_handle_t tcap_handle = NULL;
210 static dissector_table_t ber_oid_dissector_table;
211 static const char * cur_oid;
212 static const char * tcapext_oid;
213 static proto_tree * tcap_top_tree=NULL;
214 static proto_tree * tcap_stat_tree=NULL;
216 static dissector_handle_t data_handle;
217 static dissector_handle_t ansi_tcap_handle;
219 static void raz_tcap_private(struct tcap_private_t * p_tcap_private);
220 static int dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset);
221 static int dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_);
223 static GHashTable* ansi_sub_dissectors = NULL;
224 static GHashTable* itu_sub_dissectors = NULL;
226 static void dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
228 extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
229 g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
230 dissector_add("sccp.ssn",ssn,tcap_handle);
233 extern void add_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
234 g_hash_table_insert(itu_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
235 dissector_add("sccp.ssn",ssn,tcap_handle);
238 extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) {
239 g_hash_table_remove(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
240 if (!get_itu_tcap_subdissector(ssn))
241 dissector_delete("sccp.ssn",ssn,tcap_handle);
243 extern void delete_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) {
244 g_hash_table_remove(itu_sub_dissectors,GUINT_TO_POINTER(ssn));
245 if (!get_ansi_tcap_subdissector(ssn))
246 dissector_delete("sccp.ssn", ssn,tcap_handle);
249 dissector_handle_t get_ansi_tcap_subdissector(guint32 ssn) {
250 return g_hash_table_lookup(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
253 dissector_handle_t get_itu_tcap_subdissector(guint32 ssn) {
254 return g_hash_table_lookup(itu_sub_dissectors,GUINT_TO_POINTER(ssn));
260 /*--- Included file: packet-tcap-fn.c ---*/
261 #line 1 "packet-tcap-fn.c"
265 dissect_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_) {
266 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
274 dissect_tcap_Dialog1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
277 offset = dissect_tcap_DialoguePDU(TRUE, tvb, offset, actx, tree, -1);
285 static const ber_sequence_t ExternalPDU_U_sequence[] = {
286 { &hf_tcap_oid , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_tcap_OBJECT_IDENTIFIER },
287 { &hf_tcap_dialog , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_tcap_Dialog1 },
288 { NULL, 0, 0, 0, NULL }
292 dissect_tcap_ExternalPDU_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_) {
293 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
294 ExternalPDU_U_sequence, hf_index, ett_tcap_ExternalPDU_U);
302 dissect_tcap_ExternalPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
305 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
306 hf_index, BER_CLASS_UNI, 8, TRUE, dissect_tcap_ExternalPDU_U);
317 dissect_tcap_DialogueOC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
320 offset = dissect_tcap_ExternalPDU(FALSE /*implicit_tag*/, tvb, offset, actx, tree, -1);
330 dissect_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_) {
331 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
332 hf_index, BER_CLASS_APP, 11, TRUE, dissect_tcap_DialogueOC);
340 dissect_tcap_InvokeIdType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
341 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
350 dissect_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_) {
351 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
358 static const value_string tcap_OPERATION_vals[] = {
360 { 1, "globalValue" },
364 static const ber_choice_t OPERATION_choice[] = {
365 { 0, &hf_tcap_localValue , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_INTEGER },
366 { 1, &hf_tcap_globalValue , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_tcap_OBJECT_IDENTIFIER },
367 { 0, NULL, 0, 0, 0, NULL }
371 dissect_tcap_OPERATION(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
372 offset = dissect_ber_choice(actx, tree, tvb, offset,
373 OPERATION_choice, hf_index, ett_tcap_OPERATION,
382 dissect_tcap_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_) {
385 offset = dissect_tcap_param(actx,tree,tvb,offset);
393 static const ber_sequence_t Invoke_sequence[] = {
394 { &hf_tcap_invokeID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_InvokeIdType },
395 { &hf_tcap_linkedID , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_InvokeIdType },
396 { &hf_tcap_opCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_OPERATION },
397 { &hf_tcap_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_Parameter },
398 { NULL, 0, 0, 0, NULL }
402 dissect_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_) {
403 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
404 Invoke_sequence, hf_index, ett_tcap_Invoke);
410 static const ber_sequence_t T_resultretres_sequence[] = {
411 { &hf_tcap_opCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_OPERATION },
412 { &hf_tcap_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_Parameter },
413 { NULL, 0, 0, 0, NULL }
417 dissect_tcap_T_resultretres(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
418 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
419 T_resultretres_sequence, hf_index, ett_tcap_T_resultretres);
425 static const ber_sequence_t ReturnResult_sequence[] = {
426 { &hf_tcap_invokeID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_InvokeIdType },
427 { &hf_tcap_resultretres , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_T_resultretres },
428 { NULL, 0, 0, 0, NULL }
432 dissect_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_) {
433 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
434 ReturnResult_sequence, hf_index, ett_tcap_ReturnResult);
442 dissect_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_) {
443 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
450 static const value_string tcap_ErrorCode_vals[] = {
451 { 19, "nationaler" },
456 static const ber_choice_t ErrorCode_choice[] = {
457 { 19, &hf_tcap_nationaler , BER_CLASS_PRI, 19, BER_FLAGS_IMPLTAG, dissect_tcap_INTEGER_M32768_32767 },
458 { 20, &hf_tcap_privateer , BER_CLASS_PRI, 20, BER_FLAGS_IMPLTAG, dissect_tcap_INTEGER },
459 { 0, NULL, 0, 0, 0, NULL }
463 dissect_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_) {
464 offset = dissect_ber_choice(actx, tree, tvb, offset,
465 ErrorCode_choice, hf_index, ett_tcap_ErrorCode,
472 static const ber_sequence_t ReturnError_sequence[] = {
473 { &hf_tcap_invokeID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_InvokeIdType },
474 { &hf_tcap_errorCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_ErrorCode },
475 { &hf_tcap_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_Parameter },
476 { NULL, 0, 0, 0, NULL }
480 dissect_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_) {
481 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
482 ReturnError_sequence, hf_index, ett_tcap_ReturnError);
490 dissect_tcap_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_) {
491 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
497 static const value_string tcap_T_invokeIDRej_vals[] = {
499 { 1, "not-derivable" },
503 static const ber_choice_t T_invokeIDRej_choice[] = {
504 { 0, &hf_tcap_derivable , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_InvokeIdType },
505 { 1, &hf_tcap_not_derivable , BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_tcap_NULL },
506 { 0, NULL, 0, 0, 0, NULL }
510 dissect_tcap_T_invokeIDRej(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
511 offset = dissect_ber_choice(actx, tree, tvb, offset,
512 T_invokeIDRej_choice, hf_index, ett_tcap_T_invokeIDRej,
519 static const value_string tcap_GeneralProblem_vals[] = {
520 { 0, "unrecognizedComponent" },
521 { 1, "mistypedComponent" },
522 { 2, "badlyStructuredComponent" },
528 dissect_tcap_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_) {
529 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
536 static const value_string tcap_InvokeProblem_vals[] = {
537 { 0, "duplicateInvokeID" },
538 { 1, "unrecognizedOperation" },
539 { 2, "mistypedParameter" },
540 { 3, "resourceLimitation" },
541 { 4, "initiatingRelease" },
542 { 5, "unrecognizedLinkedID" },
543 { 6, "linkedResponseUnexpected" },
544 { 7, "unexpectedLinkedOperation" },
550 dissect_tcap_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_) {
551 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
558 static const value_string tcap_ReturnResultProblem_vals[] = {
559 { 0, "unrecognizedInvokeID" },
560 { 1, "returnResultUnexpected" },
561 { 2, "mistypedParameter" },
567 dissect_tcap_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_) {
568 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
575 static const value_string tcap_ReturnErrorProblem_vals[] = {
576 { 0, "unrecognizedInvokeID" },
577 { 1, "returnErrorUnexpected" },
578 { 2, "unrecognizedError" },
579 { 3, "unexpectedError" },
580 { 4, "mistypedParameter" },
586 dissect_tcap_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_) {
587 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
594 static const value_string tcap_T_problem_vals[] = {
595 { 0, "generalProblem" },
596 { 1, "invokeProblem" },
597 { 2, "returnResultProblem" },
598 { 3, "returnErrorProblem" },
602 static const ber_choice_t T_problem_choice[] = {
603 { 0, &hf_tcap_generalProblem , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_tcap_GeneralProblem },
604 { 1, &hf_tcap_invokeProblem , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_tcap_InvokeProblem },
605 { 2, &hf_tcap_returnResultProblem, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnResultProblem },
606 { 3, &hf_tcap_returnErrorProblem, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnErrorProblem },
607 { 0, NULL, 0, 0, 0, NULL }
611 dissect_tcap_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_) {
612 offset = dissect_ber_choice(actx, tree, tvb, offset,
613 T_problem_choice, hf_index, ett_tcap_T_problem,
620 static const ber_sequence_t Reject_sequence[] = {
621 { &hf_tcap_invokeIDRej , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_T_invokeIDRej },
622 { &hf_tcap_problem , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_T_problem },
623 { NULL, 0, 0, 0, NULL }
627 dissect_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_) {
628 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
629 Reject_sequence, hf_index, ett_tcap_Reject);
635 static const value_string tcap_Component_vals[] = {
637 { 2, "returnResultLast" },
638 { 3, "returnError" },
640 { 7, "returnResultNotLast" },
644 static const ber_choice_t Component_choice[] = {
645 { 1, &hf_tcap_invoke , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_tcap_Invoke },
646 { 2, &hf_tcap_returnResultLast, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnResult },
647 { 3, &hf_tcap_returnError , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnError },
648 { 4, &hf_tcap_reject , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_tcap_Reject },
649 { 7, &hf_tcap_returnResultNotLast, BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnResult },
650 { 0, NULL, 0, 0, 0, NULL }
654 dissect_tcap_Component(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
660 guint32 len, comp_offset;
663 comp_offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag);
664 comp_offset = dissect_ber_length(actx->pinfo, tree, tvb, comp_offset, &len, &ind_field);
665 /* we can believe the length now */
666 next_tvb = tvb_new_subset(tvb, offset, len+comp_offset-offset, len+comp_offset-offset);
671 offset = dissect_ber_choice(actx, tree, tvb, offset,
672 Component_choice, hf_index, ett_tcap_Component,
676 dissect_tcap_ITU_ComponentPDU(implicit_tag, next_tvb, 0, actx, tcap_top_tree, hf_index);
678 /* return comp_offset+len; or return offset (will be automatically added) */
686 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_Component_sequence_of[1] = {
687 { &hf_tcap__untag_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_Component },
691 dissect_tcap_SEQUENCE_SIZE_1_MAX_OF_Component(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
692 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
693 SEQUENCE_SIZE_1_MAX_OF_Component_sequence_of, hf_index, ett_tcap_SEQUENCE_SIZE_1_MAX_OF_Component);
701 dissect_tcap_ComponentPortion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
702 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
703 hf_index, BER_CLASS_APP, 12, TRUE, dissect_tcap_SEQUENCE_SIZE_1_MAX_OF_Component);
709 static const ber_sequence_t Unidirectional_sequence[] = {
710 { &hf_tcap_dialoguePortion, BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
711 { &hf_tcap_components , BER_CLASS_APP, 12, BER_FLAGS_NOOWNTAG, dissect_tcap_ComponentPortion },
712 { NULL, 0, 0, 0, NULL }
716 dissect_tcap_Unidirectional(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
717 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
718 Unidirectional_sequence, hf_index, ett_tcap_Unidirectional);
726 dissect_tcap_OCTET_STRING_SIZE_1_4(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
727 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
736 dissect_tcap_OrigTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
738 tvbuff_t *parameter_tvb;
740 proto_item *tid_item;
742 tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Source Transaction ID");
743 subtree = proto_item_add_subtree(tid_item, ett_otid);
745 offset = dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_tid,
749 len = tvb_length_remaining(parameter_tvb, 0);
752 gp_tcapsrt_info->src_tid=tvb_get_guint8(parameter_tvb, 0);
755 gp_tcapsrt_info->src_tid=tvb_get_ntohs(parameter_tvb, 0);
758 gp_tcapsrt_info->src_tid=tvb_get_ntohl(parameter_tvb, 0);
761 gp_tcapsrt_info->src_tid=0;
765 if ((len)&&(check_col(actx->pinfo->cinfo, COL_INFO))){
766 col_append_str(actx->pinfo->cinfo, COL_INFO, "otid(");
768 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%02x",tvb_get_guint8(parameter_tvb,i));
769 col_append_str(actx->pinfo->cinfo, COL_INFO, ") ");
781 static const ber_sequence_t Begin_sequence[] = {
782 { &hf_tcap_otid , BER_CLASS_APP, 8, BER_FLAGS_NOOWNTAG, dissect_tcap_OrigTransactionID },
783 { &hf_tcap_dialoguePortion, BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
784 { &hf_tcap_components , BER_CLASS_APP, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_ComponentPortion },
785 { NULL, 0, 0, 0, NULL }
789 dissect_tcap_Begin(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
791 gp_tcapsrt_info->ope=TC_BEGIN;
793 /* Do not change col_add_str() to col_append_str() here: we _want_ this call
794 * to overwrite whatever's currently in the INFO column (e.g., "UDT" from
795 * the SCCP dissector).
797 * If there's something there that should not be overwritten, whoever
798 * put that info there should call col_set_fence() to protect it.
800 if (check_col(actx->pinfo->cinfo, COL_INFO))
801 col_set_str(actx->pinfo->cinfo, COL_INFO, "Begin ");
803 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
804 Begin_sequence, hf_index, ett_tcap_Begin);
812 dissect_tcap_DestTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
814 tvbuff_t *parameter_tvb;
816 proto_item *tid_item;
818 tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Destination Transaction ID");
819 subtree = proto_item_add_subtree(tid_item, ett_otid);
821 offset = dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_tid,
825 len = tvb_length_remaining(parameter_tvb, 0);
828 gp_tcapsrt_info->dst_tid=tvb_get_guint8(parameter_tvb, 0);
831 gp_tcapsrt_info->dst_tid=tvb_get_ntohs(parameter_tvb, 0);
834 gp_tcapsrt_info->dst_tid=tvb_get_ntohl(parameter_tvb, 0);
837 gp_tcapsrt_info->dst_tid=0;
841 if ((len)&&(check_col(actx->pinfo->cinfo, COL_INFO))){
842 col_append_str(actx->pinfo->cinfo, COL_INFO, "dtid(");
844 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%02x",tvb_get_guint8(parameter_tvb,i));
845 col_append_str(actx->pinfo->cinfo, COL_INFO, ") ");
854 static const ber_sequence_t End_sequence[] = {
855 { &hf_tcap_dtid , BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_tcap_DestTransactionID },
856 { &hf_tcap_dialoguePortion, BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
857 { &hf_tcap_components , BER_CLASS_APP, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_ComponentPortion },
858 { NULL, 0, 0, 0, NULL }
862 dissect_tcap_End(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
864 gp_tcapsrt_info->ope=TC_END;
866 if (check_col(actx->pinfo->cinfo, COL_INFO))
867 col_set_str(actx->pinfo->cinfo, COL_INFO, "End ");
869 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
870 End_sequence, hf_index, ett_tcap_End);
876 static const ber_sequence_t Continue_sequence[] = {
877 { &hf_tcap_otid , BER_CLASS_APP, 8, BER_FLAGS_NOOWNTAG, dissect_tcap_OrigTransactionID },
878 { &hf_tcap_dtid , BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_tcap_DestTransactionID },
879 { &hf_tcap_dialoguePortion, BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
880 { &hf_tcap_components , BER_CLASS_APP, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_ComponentPortion },
881 { NULL, 0, 0, 0, NULL }
885 dissect_tcap_Continue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
887 gp_tcapsrt_info->ope=TC_CONT;
889 if (check_col(actx->pinfo->cinfo, COL_INFO))
890 col_set_str(actx->pinfo->cinfo, COL_INFO, "Continue ");
892 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
893 Continue_sequence, hf_index, ett_tcap_Continue);
899 static const value_string tcap_P_AbortCause_U_vals[] = {
900 { 0, "unrecognizedMessageType" },
901 { 1, "unrecognizedTransactionID" },
902 { 2, "badlyFormattedTransactionPortion" },
903 { 3, "incorrectTransactionPortion" },
904 { 4, "resourceLimitation" },
910 dissect_tcap_P_AbortCause_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_) {
911 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
920 dissect_tcap_P_AbortCause(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
921 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
922 hf_index, BER_CLASS_APP, 10, TRUE, dissect_tcap_P_AbortCause_U);
928 static const value_string tcap_Reason_vals[] = {
929 { 10, "p-abortCause" },
930 { 11, "u-abortCause" },
934 static const ber_choice_t Reason_choice[] = {
935 { 10, &hf_tcap_p_abortCause , BER_CLASS_APP, 10, BER_FLAGS_NOOWNTAG, dissect_tcap_P_AbortCause },
936 { 11, &hf_tcap_u_abortCause , BER_CLASS_APP, 11, BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
937 { 0, NULL, 0, 0, 0, NULL }
941 dissect_tcap_Reason(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
942 offset = dissect_ber_choice(actx, tree, tvb, offset,
943 Reason_choice, hf_index, ett_tcap_Reason,
950 static const ber_sequence_t Abort_sequence[] = {
951 { &hf_tcap_dtid , BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_tcap_DestTransactionID },
952 { &hf_tcap_reason , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_Reason },
953 { NULL, 0, 0, 0, NULL }
957 dissect_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_) {
959 gp_tcapsrt_info->ope=TC_ABORT;
961 if (check_col(actx->pinfo->cinfo, COL_INFO))
962 col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort ");
964 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
965 Abort_sequence, hf_index, ett_tcap_Abort);
971 static const value_string tcap_TCMessage_vals[] = {
972 { 1, "unidirectional" },
980 static const ber_choice_t TCMessage_choice[] = {
981 { 1, &hf_tcap_unidirectional , BER_CLASS_APP, 1, BER_FLAGS_IMPLTAG, dissect_tcap_Unidirectional },
982 { 2, &hf_tcap_begin , BER_CLASS_APP, 2, BER_FLAGS_IMPLTAG, dissect_tcap_Begin },
983 { 4, &hf_tcap_end , BER_CLASS_APP, 4, BER_FLAGS_IMPLTAG, dissect_tcap_End },
984 { 5, &hf_tcap_continue , BER_CLASS_APP, 5, BER_FLAGS_IMPLTAG, dissect_tcap_Continue },
985 { 7, &hf_tcap_abort , BER_CLASS_APP, 7, BER_FLAGS_IMPLTAG, dissect_tcap_Abort },
986 { 0, NULL, 0, 0, 0, NULL }
990 dissect_tcap_TCMessage(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
991 offset = dissect_ber_choice(actx, tree, tvb, offset,
992 TCMessage_choice, hf_index, ett_tcap_TCMessage,
999 static const value_string tcap_ERROR_vals[] = {
1000 { 0, "localValue" },
1001 { 1, "globalValue" },
1005 static const ber_choice_t ERROR_choice[] = {
1006 { 0, &hf_tcap_localValue , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_INTEGER },
1007 { 1, &hf_tcap_globalValue , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_tcap_OBJECT_IDENTIFIER },
1008 { 0, NULL, 0, 0, 0, NULL }
1012 dissect_tcap_ERROR(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1013 offset = dissect_ber_choice(actx, tree, tvb, offset,
1014 ERROR_choice, hf_index, ett_tcap_ERROR,
1021 static const asn_namedbit AUDT_protocol_version_bits[] = {
1022 { 0, &hf_tcap_AUDT_protocol_version_version1, -1, -1, "version1", NULL },
1023 { 0, NULL, 0, 0, NULL, NULL }
1027 dissect_tcap_AUDT_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1028 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
1029 AUDT_protocol_version_bits, hf_index, ett_tcap_AUDT_protocol_version,
1038 dissect_tcap_AUDT_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1039 #line 102 "tcap.cnf"
1040 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid);
1042 tcap_private.oid= (void*) cur_oid;
1043 tcap_private.acv=TRUE;
1052 dissect_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_) {
1053 offset = dissect_ber_external_type(implicit_tag, tree, tvb, offset, actx, hf_index, NULL);
1059 static const ber_sequence_t AUDT_user_information_sequence_of[1] = {
1060 { &hf_tcap_audt_user_information_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_tcap_EXTERNAL },
1064 dissect_tcap_AUDT_user_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1065 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1066 AUDT_user_information_sequence_of, hf_index, ett_tcap_AUDT_user_information);
1072 static const ber_sequence_t AUDT_apdu_U_sequence[] = {
1073 { &hf_tcap_audt_protocol_version, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AUDT_protocol_version },
1074 { &hf_tcap_audt_application_context_name, BER_CLASS_CON, 1, 0, dissect_tcap_AUDT_application_context_name },
1075 { &hf_tcap_audt_user_information, BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AUDT_user_information },
1076 { NULL, 0, 0, 0, NULL }
1080 dissect_tcap_AUDT_apdu_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_) {
1081 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1082 AUDT_apdu_U_sequence, hf_index, ett_tcap_AUDT_apdu_U);
1090 dissect_tcap_AUDT_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1091 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1092 hf_index, BER_CLASS_APP, 0, TRUE, dissect_tcap_AUDT_apdu_U);
1098 const value_string tcap_UniDialoguePDU_vals[] = {
1099 { 0, "unidialoguePDU" },
1103 static const ber_choice_t UniDialoguePDU_choice[] = {
1104 { 0, &hf_tcap_unidialoguePDU , BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_tcap_AUDT_apdu },
1105 { 0, NULL, 0, 0, 0, NULL }
1109 dissect_tcap_UniDialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1110 offset = dissect_ber_choice(actx, tree, tvb, offset,
1111 UniDialoguePDU_choice, hf_index, ett_tcap_UniDialoguePDU,
1118 static const asn_namedbit AARQ_protocol_version_bits[] = {
1119 { 0, &hf_tcap_AARQ_protocol_version_version1, -1, -1, "version1", NULL },
1120 { 0, NULL, 0, 0, NULL, NULL }
1124 dissect_tcap_AARQ_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1125 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
1126 AARQ_protocol_version_bits, hf_index, ett_tcap_AARQ_protocol_version,
1135 dissect_tcap_AARQ_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1136 #line 107 "tcap.cnf"
1137 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid);
1139 tcap_private.oid= (void*) cur_oid;
1140 tcap_private.acv=TRUE;
1147 static const ber_sequence_t AARQ_user_information_sequence_of[1] = {
1148 { &hf_tcap_aarq_user_information_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_tcap_EXTERNAL },
1152 dissect_tcap_AARQ_user_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1153 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1154 AARQ_user_information_sequence_of, hf_index, ett_tcap_AARQ_user_information);
1160 static const ber_sequence_t AARQ_apdu_U_sequence[] = {
1161 { &hf_tcap_aarq_protocol_version, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AARQ_protocol_version },
1162 { &hf_tcap_aarq_application_context_name, BER_CLASS_CON, 1, 0, dissect_tcap_AARQ_application_context_name },
1163 { &hf_tcap_aarq_user_information, BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AARQ_user_information },
1164 { NULL, 0, 0, 0, NULL }
1168 dissect_tcap_AARQ_apdu_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_) {
1169 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1170 AARQ_apdu_U_sequence, hf_index, ett_tcap_AARQ_apdu_U);
1178 dissect_tcap_AARQ_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1179 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1180 hf_index, BER_CLASS_APP, 0, TRUE, dissect_tcap_AARQ_apdu_U);
1186 static const asn_namedbit AARE_protocol_version_bits[] = {
1187 { 0, &hf_tcap_AARE_protocol_version_version1, -1, -1, "version1", NULL },
1188 { 0, NULL, 0, 0, NULL, NULL }
1192 dissect_tcap_AARE_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1193 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
1194 AARE_protocol_version_bits, hf_index, ett_tcap_AARE_protocol_version,
1203 dissect_tcap_AARE_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1204 #line 112 "tcap.cnf"
1205 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid);
1207 tcap_private.oid= (void*) cur_oid;
1208 tcap_private.acv=TRUE;
1215 static const value_string tcap_Associate_result_vals[] = {
1217 { 1, "reject-permanent" },
1223 dissect_tcap_Associate_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_) {
1224 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1231 static const value_string tcap_T_dialogue_service_user_vals[] = {
1233 { 1, "no-reason-given" },
1234 { 2, "application-context-name-not-supported" },
1240 dissect_tcap_T_dialogue_service_user(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1241 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1248 static const value_string tcap_T_dialogue_service_provider_vals[] = {
1250 { 1, "no-reason-given" },
1251 { 2, "no-common-dialogue-portion" },
1257 dissect_tcap_T_dialogue_service_provider(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1258 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1265 static const value_string tcap_Associate_source_diagnostic_vals[] = {
1266 { 1, "dialogue-service-user" },
1267 { 2, "dialogue-service-provider" },
1271 static const ber_choice_t Associate_source_diagnostic_choice[] = {
1272 { 1, &hf_tcap_dialogue_service_user, BER_CLASS_CON, 1, 0, dissect_tcap_T_dialogue_service_user },
1273 { 2, &hf_tcap_dialogue_service_provider, BER_CLASS_CON, 2, 0, dissect_tcap_T_dialogue_service_provider },
1274 { 0, NULL, 0, 0, 0, NULL }
1278 dissect_tcap_Associate_source_diagnostic(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1279 offset = dissect_ber_choice(actx, tree, tvb, offset,
1280 Associate_source_diagnostic_choice, hf_index, ett_tcap_Associate_source_diagnostic,
1287 static const ber_sequence_t AARE_user_information_sequence_of[1] = {
1288 { &hf_tcap_aare_user_information_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_tcap_EXTERNAL },
1292 dissect_tcap_AARE_user_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1293 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1294 AARE_user_information_sequence_of, hf_index, ett_tcap_AARE_user_information);
1300 static const ber_sequence_t AARE_apdu_U_sequence[] = {
1301 { &hf_tcap_aare_protocol_version, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AARE_protocol_version },
1302 { &hf_tcap_aare_application_context_name, BER_CLASS_CON, 1, 0, dissect_tcap_AARE_application_context_name },
1303 { &hf_tcap_result , BER_CLASS_CON, 2, 0, dissect_tcap_Associate_result },
1304 { &hf_tcap_result_source_diagnostic, BER_CLASS_CON, 3, BER_FLAGS_NOTCHKTAG, dissect_tcap_Associate_source_diagnostic },
1305 { &hf_tcap_aare_user_information, BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AARE_user_information },
1306 { NULL, 0, 0, 0, NULL }
1310 dissect_tcap_AARE_apdu_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_) {
1311 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1312 AARE_apdu_U_sequence, hf_index, ett_tcap_AARE_apdu_U);
1320 dissect_tcap_AARE_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1321 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1322 hf_index, BER_CLASS_APP, 1, TRUE, dissect_tcap_AARE_apdu_U);
1328 static const value_string tcap_ABRT_source_vals[] = {
1329 { 0, "dialogue-service-user" },
1330 { 1, "dialogue-service-provider" },
1336 dissect_tcap_ABRT_source(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1337 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1344 static const ber_sequence_t ABRT_user_information_sequence_of[1] = {
1345 { &hf_tcap_abrt_user_information_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_tcap_EXTERNAL },
1349 dissect_tcap_ABRT_user_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1350 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1351 ABRT_user_information_sequence_of, hf_index, ett_tcap_ABRT_user_information);
1357 static const ber_sequence_t ABRT_apdu_U_sequence[] = {
1358 { &hf_tcap_abort_source , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_tcap_ABRT_source },
1359 { &hf_tcap_abrt_user_information, BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_ABRT_user_information },
1360 { NULL, 0, 0, 0, NULL }
1364 dissect_tcap_ABRT_apdu_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_) {
1365 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1366 ABRT_apdu_U_sequence, hf_index, ett_tcap_ABRT_apdu_U);
1374 dissect_tcap_ABRT_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1375 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1376 hf_index, BER_CLASS_APP, 4, TRUE, dissect_tcap_ABRT_apdu_U);
1382 const value_string tcap_DialoguePDU_vals[] = {
1383 { 0, "dialogueRequest" },
1384 { 1, "dialogueResponse" },
1385 { 4, "dialogueAbort" },
1389 static const ber_choice_t DialoguePDU_choice[] = {
1390 { 0, &hf_tcap_dialogueRequest, BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_tcap_AARQ_apdu },
1391 { 1, &hf_tcap_dialogueResponse, BER_CLASS_APP, 1, BER_FLAGS_NOOWNTAG, dissect_tcap_AARE_apdu },
1392 { 4, &hf_tcap_dialogueAbort , BER_CLASS_APP, 4, BER_FLAGS_NOOWNTAG, dissect_tcap_ABRT_apdu },
1393 { 0, NULL, 0, 0, 0, NULL }
1397 dissect_tcap_DialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1398 offset = dissect_ber_choice(actx, tree, tvb, offset,
1399 DialoguePDU_choice, hf_index, ett_tcap_DialoguePDU,
1407 static void dissect_UniDialoguePDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1408 asn1_ctx_t asn1_ctx;
1409 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1410 dissect_tcap_UniDialoguePDU(FALSE, tvb, 0, &asn1_ctx, tree, hf_tcap_UniDialoguePDU_PDU);
1412 static void dissect_DialoguePDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1413 asn1_ctx_t asn1_ctx;
1414 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1415 dissect_tcap_DialoguePDU(FALSE, tvb, 0, &asn1_ctx, tree, hf_tcap_DialoguePDU_PDU);
1419 /*--- End of included file: packet-tcap-fn.c ---*/
1420 #line 141 "packet-tcap-template.c"
1424 const value_string tcap_component_type_str[] = {
1425 { TCAP_COMP_INVOKE, "Invoke" },
1426 { TCAP_COMP_RRL, "Return Result(L)" },
1427 { TCAP_COMP_RE, "Return Error" },
1428 { TCAP_COMP_REJECT, "Reject" },
1429 { TCAP_COMP_RRN, "Return Result(NL)" },
1434 dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
1436 proto_item *item=NULL;
1437 proto_tree *tree=NULL;
1439 struct tcaphash_context_t * p_tcap_context;
1440 dissector_handle_t subdissector_handle;
1441 asn1_ctx_t asn1_ctx;
1446 /* Check if ANSI TCAP and call the ANSI TCAP dissector if that's the case
1447 * PackageType ::= CHOICE { unidirectional [PRIVATE 1] IMPLICIT UniTransactionPDU,
1448 * queryWithPerm [PRIVATE 2] IMPLICIT TransactionPDU,
1449 * queryWithoutPerm [PRIVATE 3] IMPLICIT TransactionPDU,
1450 * response [PRIVATE 4] IMPLICIT TransactionPDU,
1451 * conversationWithPerm [PRIVATE 5] IMPLICIT TransactionPDU,
1452 * conversationWithoutPerm [PRIVATE 6] IMPLICIT TransactionPDU,
1453 * abort [PRIVATE 22] IMPLICIT Abort
1458 get_ber_identifier(tvb, 0, &class, &pc, &tag);
1460 if(class == BER_CLASS_PRI){
1469 call_dissector(ansi_tcap_handle, tvb, pinfo, parent_tree);
1478 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1480 tcap_top_tree = parent_tree;
1481 tcap_stat_tree = NULL;
1483 col_set_str(pinfo->cinfo, COL_PROTOCOL, "TCAP");
1485 /* create display subtree for the protocol */
1487 item = proto_tree_add_item(parent_tree, proto_tcap, tvb, 0, -1, FALSE);
1488 tree = proto_item_add_subtree(item, ett_tcap);
1489 tcap_stat_tree=tree;
1493 raz_tcap_private(&tcap_private);
1495 pinfo->private_data = &tcap_private;
1496 gp_tcapsrt_info=tcapsrt_razinfo();
1497 tcap_subdissector_used=FALSE;
1498 gp_tcap_context=NULL;
1499 dissect_tcap_TCMessage(FALSE, tvb, 0, &asn1_ctx, tree, -1);
1501 if (gtcap_HandleSRT && !tcap_subdissector_used ) {
1502 p_tcap_context=tcapsrt_call_matching(tvb, pinfo, tcap_stat_tree, gp_tcapsrt_info);
1503 tcap_private.context=p_tcap_context;
1505 /* If the current message is TCAP only,
1506 * save the Application Context Name for the next messages
1508 if ( p_tcap_context && cur_oid && !p_tcap_context->oid_present ) {
1509 /* Save the application context and the sub dissector */
1510 g_strlcpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
1511 p_tcap_context->oid_present=TRUE;
1512 if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
1513 p_tcap_context->subdissector_handle=subdissector_handle;
1514 p_tcap_context->subdissector_present=TRUE;
1517 if (gtcap_HandleSRT && p_tcap_context && p_tcap_context->callback) {
1518 /* Callback fonction for the upper layer */
1519 (p_tcap_context->callback)(tvb, pinfo, tcap_stat_tree, p_tcap_context);
1525 proto_reg_handoff_tcap(void)
1528 data_handle = find_dissector("data");
1529 ansi_tcap_handle = find_dissector("ansi_tcap");
1530 ber_oid_dissector_table = find_dissector_table("ber.oid");
1533 /*--- Included file: packet-tcap-dis-tab.c ---*/
1534 #line 1 "packet-tcap-dis-tab.c"
1535 register_ber_oid_dissector("0.0.17.773.1.1.1", dissect_DialoguePDU_PDU, proto_tcap, "id-as-dialogue");
1536 register_ber_oid_dissector("0.0.17.773.1.2.1", dissect_UniDialoguePDU_PDU, proto_tcap, "id-as-uniDialogue");
1539 /*--- End of included file: packet-tcap-dis-tab.c ---*/
1540 #line 253 "packet-tcap-template.c"
1543 static void init_tcap(void);
1546 proto_register_tcap(void)
1549 /* Setup list of header fields See Section 1.6.1 for details*/
1550 static hf_register_info hf[] = {
1552 { "Tag", "tcap.msgtype",
1553 FT_UINT8, BASE_HEX, NULL, 0,
1557 { "Length", "tcap.len",
1558 FT_UINT8, BASE_DEC, NULL, 0,
1562 { "Data", "tcap.data",
1563 FT_BYTES, BASE_NONE, NULL, 0,
1567 { "Transaction Id", "tcap.tid",
1568 FT_BYTES, BASE_NONE, NULL, 0,
1571 /* Tcap Service Response Time */
1572 { &hf_tcapsrt_SessionId,
1574 "tcap.srt.session_id",
1575 FT_UINT32, BASE_DEC, NULL, 0x0,
1578 { &hf_tcapsrt_BeginSession,
1581 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1582 "SRT Begin of Session", HFILL }
1584 { &hf_tcapsrt_EndSession,
1587 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1588 "SRT End of Session", HFILL }
1590 { &hf_tcapsrt_SessionTime,
1591 { "Session duration",
1592 "tcap.srt.sessiontime",
1593 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
1594 "Duration of the TCAP session", HFILL }
1596 { &hf_tcapsrt_Duplicate,
1597 { "Session Duplicate",
1598 "tcap.srt.duplicate",
1599 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1600 "SRT Duplicated with Session", HFILL }
1603 /*--- Included file: packet-tcap-hfarr.c ---*/
1604 #line 1 "packet-tcap-hfarr.c"
1605 { &hf_tcap_UniDialoguePDU_PDU,
1606 { "UniDialoguePDU", "tcap.UniDialoguePDU",
1607 FT_UINT32, BASE_DEC, VALS(tcap_UniDialoguePDU_vals), 0,
1608 "tcap.UniDialoguePDU", HFILL }},
1609 { &hf_tcap_DialoguePDU_PDU,
1610 { "DialoguePDU", "tcap.DialoguePDU",
1611 FT_UINT32, BASE_DEC, VALS(tcap_DialoguePDU_vals), 0,
1612 "tcap.DialoguePDU", HFILL }},
1614 { "oid", "tcap.oid",
1615 FT_OID, BASE_NONE, NULL, 0,
1616 "tcap.OBJECT_IDENTIFIER", HFILL }},
1618 { "dialog", "tcap.dialog",
1619 FT_BYTES, BASE_NONE, NULL, 0,
1620 "tcap.Dialog1", HFILL }},
1621 { &hf_tcap_unidirectional,
1622 { "unidirectional", "tcap.unidirectional",
1623 FT_NONE, BASE_NONE, NULL, 0,
1624 "tcap.Unidirectional", HFILL }},
1626 { "begin", "tcap.begin",
1627 FT_NONE, BASE_NONE, NULL, 0,
1628 "tcap.Begin", HFILL }},
1630 { "end", "tcap.end",
1631 FT_NONE, BASE_NONE, NULL, 0,
1632 "tcap.End", HFILL }},
1633 { &hf_tcap_continue,
1634 { "continue", "tcap.continue",
1635 FT_NONE, BASE_NONE, NULL, 0,
1636 "tcap.Continue", HFILL }},
1638 { "abort", "tcap.abort",
1639 FT_NONE, BASE_NONE, NULL, 0,
1640 "tcap.Abort", HFILL }},
1641 { &hf_tcap_dialoguePortion,
1642 { "dialoguePortion", "tcap.dialoguePortion",
1643 FT_BYTES, BASE_NONE, NULL, 0,
1644 "tcap.DialoguePortion", HFILL }},
1645 { &hf_tcap_components,
1646 { "components", "tcap.components",
1647 FT_UINT32, BASE_DEC, NULL, 0,
1648 "tcap.ComponentPortion", HFILL }},
1650 { "otid", "tcap.otid",
1651 FT_BYTES, BASE_NONE, NULL, 0,
1652 "tcap.OrigTransactionID", HFILL }},
1654 { "dtid", "tcap.dtid",
1655 FT_BYTES, BASE_NONE, NULL, 0,
1656 "tcap.DestTransactionID", HFILL }},
1658 { "reason", "tcap.reason",
1659 FT_UINT32, BASE_DEC, VALS(tcap_Reason_vals), 0,
1660 "tcap.Reason", HFILL }},
1661 { &hf_tcap_p_abortCause,
1662 { "p-abortCause", "tcap.p_abortCause",
1663 FT_UINT32, BASE_DEC, VALS(tcap_P_AbortCause_U_vals), 0,
1664 "tcap.P_AbortCause", HFILL }},
1665 { &hf_tcap_u_abortCause,
1666 { "u-abortCause", "tcap.u_abortCause",
1667 FT_BYTES, BASE_NONE, NULL, 0,
1668 "tcap.DialoguePortion", HFILL }},
1669 { &hf_tcap__untag_item,
1670 { "Component", "tcap.Component",
1671 FT_UINT32, BASE_DEC, VALS(tcap_Component_vals), 0,
1672 "tcap.Component", HFILL }},
1674 { "invoke", "tcap.invoke",
1675 FT_NONE, BASE_NONE, NULL, 0,
1676 "tcap.Invoke", HFILL }},
1677 { &hf_tcap_returnResultLast,
1678 { "returnResultLast", "tcap.returnResultLast",
1679 FT_NONE, BASE_NONE, NULL, 0,
1680 "tcap.ReturnResult", HFILL }},
1681 { &hf_tcap_returnError,
1682 { "returnError", "tcap.returnError",
1683 FT_NONE, BASE_NONE, NULL, 0,
1684 "tcap.ReturnError", HFILL }},
1686 { "reject", "tcap.reject",
1687 FT_NONE, BASE_NONE, NULL, 0,
1688 "tcap.Reject", HFILL }},
1689 { &hf_tcap_returnResultNotLast,
1690 { "returnResultNotLast", "tcap.returnResultNotLast",
1691 FT_NONE, BASE_NONE, NULL, 0,
1692 "tcap.ReturnResult", HFILL }},
1693 { &hf_tcap_invokeID,
1694 { "invokeID", "tcap.invokeID",
1695 FT_INT32, BASE_DEC, NULL, 0,
1696 "tcap.InvokeIdType", HFILL }},
1697 { &hf_tcap_linkedID,
1698 { "linkedID", "tcap.linkedID",
1699 FT_INT32, BASE_DEC, NULL, 0,
1700 "tcap.InvokeIdType", HFILL }},
1702 { "opCode", "tcap.opCode",
1703 FT_UINT32, BASE_DEC, VALS(tcap_OPERATION_vals), 0,
1704 "tcap.OPERATION", HFILL }},
1705 { &hf_tcap_parameter,
1706 { "parameter", "tcap.parameter",
1707 FT_NONE, BASE_NONE, NULL, 0,
1708 "tcap.Parameter", HFILL }},
1709 { &hf_tcap_resultretres,
1710 { "resultretres", "tcap.resultretres",
1711 FT_NONE, BASE_NONE, NULL, 0,
1712 "tcap.T_resultretres", HFILL }},
1713 { &hf_tcap_errorCode,
1714 { "errorCode", "tcap.errorCode",
1715 FT_UINT32, BASE_DEC, VALS(tcap_ErrorCode_vals), 0,
1716 "tcap.ErrorCode", HFILL }},
1717 { &hf_tcap_invokeIDRej,
1718 { "invokeIDRej", "tcap.invokeIDRej",
1719 FT_UINT32, BASE_DEC, VALS(tcap_T_invokeIDRej_vals), 0,
1720 "tcap.T_invokeIDRej", HFILL }},
1721 { &hf_tcap_derivable,
1722 { "derivable", "tcap.derivable",
1723 FT_INT32, BASE_DEC, NULL, 0,
1724 "tcap.InvokeIdType", HFILL }},
1725 { &hf_tcap_not_derivable,
1726 { "not-derivable", "tcap.not_derivable",
1727 FT_NONE, BASE_NONE, NULL, 0,
1728 "tcap.NULL", HFILL }},
1730 { "problem", "tcap.problem",
1731 FT_UINT32, BASE_DEC, VALS(tcap_T_problem_vals), 0,
1732 "tcap.T_problem", HFILL }},
1733 { &hf_tcap_generalProblem,
1734 { "generalProblem", "tcap.generalProblem",
1735 FT_INT32, BASE_DEC, VALS(tcap_GeneralProblem_vals), 0,
1736 "tcap.GeneralProblem", HFILL }},
1737 { &hf_tcap_invokeProblem,
1738 { "invokeProblem", "tcap.invokeProblem",
1739 FT_INT32, BASE_DEC, VALS(tcap_InvokeProblem_vals), 0,
1740 "tcap.InvokeProblem", HFILL }},
1741 { &hf_tcap_returnResultProblem,
1742 { "returnResultProblem", "tcap.returnResultProblem",
1743 FT_INT32, BASE_DEC, VALS(tcap_ReturnResultProblem_vals), 0,
1744 "tcap.ReturnResultProblem", HFILL }},
1745 { &hf_tcap_returnErrorProblem,
1746 { "returnErrorProblem", "tcap.returnErrorProblem",
1747 FT_INT32, BASE_DEC, VALS(tcap_ReturnErrorProblem_vals), 0,
1748 "tcap.ReturnErrorProblem", HFILL }},
1749 { &hf_tcap_localValue,
1750 { "localValue", "tcap.localValue",
1751 FT_INT32, BASE_DEC, NULL, 0,
1752 "tcap.INTEGER", HFILL }},
1753 { &hf_tcap_globalValue,
1754 { "globalValue", "tcap.globalValue",
1755 FT_OID, BASE_NONE, NULL, 0,
1756 "tcap.OBJECT_IDENTIFIER", HFILL }},
1757 { &hf_tcap_nationaler,
1758 { "nationaler", "tcap.nationaler",
1759 FT_INT32, BASE_DEC, NULL, 0,
1760 "tcap.INTEGER_M32768_32767", HFILL }},
1761 { &hf_tcap_privateer,
1762 { "privateer", "tcap.privateer",
1763 FT_INT32, BASE_DEC, NULL, 0,
1764 "tcap.INTEGER", HFILL }},
1765 { &hf_tcap_unidialoguePDU,
1766 { "unidialoguePDU", "tcap.unidialoguePDU",
1767 FT_NONE, BASE_NONE, NULL, 0,
1768 "tcap.AUDT_apdu", HFILL }},
1769 { &hf_tcap_audt_protocol_version,
1770 { "protocol-version", "tcap.protocol_version",
1771 FT_BYTES, BASE_NONE, NULL, 0,
1772 "tcap.AUDT_protocol_version", HFILL }},
1773 { &hf_tcap_audt_application_context_name,
1774 { "application-context-name", "tcap.application_context_name",
1775 FT_OID, BASE_NONE, NULL, 0,
1776 "tcap.AUDT_application_context_name", HFILL }},
1777 { &hf_tcap_audt_user_information,
1778 { "user-information", "tcap.user_information",
1779 FT_UINT32, BASE_DEC, NULL, 0,
1780 "tcap.AUDT_user_information", HFILL }},
1781 { &hf_tcap_audt_user_information_item,
1782 { "user-information item", "tcap.user_information_item",
1783 FT_NONE, BASE_NONE, NULL, 0,
1784 "tcap.EXTERNAL", HFILL }},
1785 { &hf_tcap_dialogueRequest,
1786 { "dialogueRequest", "tcap.dialogueRequest",
1787 FT_NONE, BASE_NONE, NULL, 0,
1788 "tcap.AARQ_apdu", HFILL }},
1789 { &hf_tcap_dialogueResponse,
1790 { "dialogueResponse", "tcap.dialogueResponse",
1791 FT_NONE, BASE_NONE, NULL, 0,
1792 "tcap.AARE_apdu", HFILL }},
1793 { &hf_tcap_dialogueAbort,
1794 { "dialogueAbort", "tcap.dialogueAbort",
1795 FT_NONE, BASE_NONE, NULL, 0,
1796 "tcap.ABRT_apdu", HFILL }},
1797 { &hf_tcap_aarq_protocol_version,
1798 { "protocol-version", "tcap.protocol_version",
1799 FT_BYTES, BASE_NONE, NULL, 0,
1800 "tcap.AARQ_protocol_version", HFILL }},
1801 { &hf_tcap_aarq_application_context_name,
1802 { "application-context-name", "tcap.application_context_name",
1803 FT_OID, BASE_NONE, NULL, 0,
1804 "tcap.AARQ_application_context_name", HFILL }},
1805 { &hf_tcap_aarq_user_information,
1806 { "user-information", "tcap.user_information",
1807 FT_UINT32, BASE_DEC, NULL, 0,
1808 "tcap.AARQ_user_information", HFILL }},
1809 { &hf_tcap_aarq_user_information_item,
1810 { "user-information item", "tcap.user_information_item",
1811 FT_NONE, BASE_NONE, NULL, 0,
1812 "tcap.EXTERNAL", HFILL }},
1813 { &hf_tcap_aare_protocol_version,
1814 { "protocol-version", "tcap.protocol_version",
1815 FT_BYTES, BASE_NONE, NULL, 0,
1816 "tcap.AARE_protocol_version", HFILL }},
1817 { &hf_tcap_aare_application_context_name,
1818 { "application-context-name", "tcap.application_context_name",
1819 FT_OID, BASE_NONE, NULL, 0,
1820 "tcap.AARE_application_context_name", HFILL }},
1822 { "result", "tcap.result",
1823 FT_INT32, BASE_DEC, VALS(tcap_Associate_result_vals), 0,
1824 "tcap.Associate_result", HFILL }},
1825 { &hf_tcap_result_source_diagnostic,
1826 { "result-source-diagnostic", "tcap.result_source_diagnostic",
1827 FT_UINT32, BASE_DEC, VALS(tcap_Associate_source_diagnostic_vals), 0,
1828 "tcap.Associate_source_diagnostic", HFILL }},
1829 { &hf_tcap_aare_user_information,
1830 { "user-information", "tcap.user_information",
1831 FT_UINT32, BASE_DEC, NULL, 0,
1832 "tcap.AARE_user_information", HFILL }},
1833 { &hf_tcap_aare_user_information_item,
1834 { "user-information item", "tcap.user_information_item",
1835 FT_NONE, BASE_NONE, NULL, 0,
1836 "tcap.EXTERNAL", HFILL }},
1837 { &hf_tcap_abort_source,
1838 { "abort-source", "tcap.abort_source",
1839 FT_INT32, BASE_DEC, VALS(tcap_ABRT_source_vals), 0,
1840 "tcap.ABRT_source", HFILL }},
1841 { &hf_tcap_abrt_user_information,
1842 { "user-information", "tcap.user_information",
1843 FT_UINT32, BASE_DEC, NULL, 0,
1844 "tcap.ABRT_user_information", HFILL }},
1845 { &hf_tcap_abrt_user_information_item,
1846 { "user-information item", "tcap.user_information_item",
1847 FT_NONE, BASE_NONE, NULL, 0,
1848 "tcap.EXTERNAL", HFILL }},
1849 { &hf_tcap_dialogue_service_user,
1850 { "dialogue-service-user", "tcap.dialogue_service_user",
1851 FT_INT32, BASE_DEC, VALS(tcap_T_dialogue_service_user_vals), 0,
1852 "tcap.T_dialogue_service_user", HFILL }},
1853 { &hf_tcap_dialogue_service_provider,
1854 { "dialogue-service-provider", "tcap.dialogue_service_provider",
1855 FT_INT32, BASE_DEC, VALS(tcap_T_dialogue_service_provider_vals), 0,
1856 "tcap.T_dialogue_service_provider", HFILL }},
1857 { &hf_tcap_AUDT_protocol_version_version1,
1858 { "version1", "tcap.version1",
1859 FT_BOOLEAN, 8, NULL, 0x80,
1861 { &hf_tcap_AARQ_protocol_version_version1,
1862 { "version1", "tcap.version1",
1863 FT_BOOLEAN, 8, NULL, 0x80,
1865 { &hf_tcap_AARE_protocol_version_version1,
1866 { "version1", "tcap.version1",
1867 FT_BOOLEAN, 8, NULL, 0x80,
1870 /*--- End of included file: packet-tcap-hfarr.c ---*/
1871 #line 315 "packet-tcap-template.c"
1874 /* Setup protocol subtree array */
1875 static gint *ett[] = {
1882 /*--- Included file: packet-tcap-ettarr.c ---*/
1883 #line 1 "packet-tcap-ettarr.c"
1884 &ett_tcap_ExternalPDU_U,
1885 &ett_tcap_TCMessage,
1886 &ett_tcap_Unidirectional,
1892 &ett_tcap_SEQUENCE_SIZE_1_MAX_OF_Component,
1893 &ett_tcap_Component,
1895 &ett_tcap_ReturnResult,
1896 &ett_tcap_T_resultretres,
1897 &ett_tcap_ReturnError,
1899 &ett_tcap_T_invokeIDRej,
1900 &ett_tcap_T_problem,
1901 &ett_tcap_OPERATION,
1903 &ett_tcap_ErrorCode,
1904 &ett_tcap_UniDialoguePDU,
1905 &ett_tcap_AUDT_apdu_U,
1906 &ett_tcap_AUDT_protocol_version,
1907 &ett_tcap_AUDT_user_information,
1908 &ett_tcap_DialoguePDU,
1909 &ett_tcap_AARQ_apdu_U,
1910 &ett_tcap_AARQ_protocol_version,
1911 &ett_tcap_AARQ_user_information,
1912 &ett_tcap_AARE_apdu_U,
1913 &ett_tcap_AARE_protocol_version,
1914 &ett_tcap_AARE_user_information,
1915 &ett_tcap_ABRT_apdu_U,
1916 &ett_tcap_ABRT_user_information,
1917 &ett_tcap_Associate_source_diagnostic,
1919 /*--- End of included file: packet-tcap-ettarr.c ---*/
1920 #line 325 "packet-tcap-template.c"
1923 /*static enum_val_t tcap_options[] = {
1924 { "itu", "ITU", ITU_TCAP_STANDARD },
1925 { "ansi", "ANSI", ANSI_TCAP_STANDARD },
1929 module_t *tcap_module;
1931 /* Register the protocol name and description */
1932 proto_tcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
1934 /* Required function calls to register the header fields and subtrees used */
1935 proto_register_field_array(proto_tcap, hf, array_length(hf));
1936 proto_register_subtree_array(ett, array_length(ett));
1938 tcap_module = prefs_register_protocol(proto_tcap, NULL);
1941 prefs_register_enum_preference(tcap_module, "standard", "ITU TCAP standard",
1942 "The SS7 standard used in ITU TCAP packets",
1943 &tcap_standard, tcap_options, FALSE);
1945 prefs_register_obsolete_preference(tcap_module, "standard");
1949 prefs_register_bool_preference(tcap_module, "lock_info_col", "Lock Info column",
1950 "Always show TCAP in Info column",
1953 prefs_register_obsolete_preference(tcap_module, "lock_info_col");
1956 /* Set default SSNs */
1957 range_convert_str(&global_ssn_range, "", MAX_SSN);
1958 ssn_range = range_empty();
1960 prefs_register_range_preference(tcap_module, "ssn", "SCCP SSNs",
1961 "SCCP (and SUA) SSNs to decode as TCAP",
1962 &global_ssn_range, MAX_SSN);
1964 prefs_register_bool_preference(tcap_module, "srt",
1965 "Service Response Time Analyse",
1966 "Activate the analyse for Response Time",
1969 prefs_register_bool_preference(tcap_module, "persistentsrt",
1970 "Persistent stats for SRT",
1971 "Statistics for Response Time",
1972 >cap_PersistentSRT);
1974 prefs_register_uint_preference(tcap_module, "repetitiontimeout",
1975 "Repetition timeout",
1976 "Maximal delay for message repetion",
1977 10, >cap_RepetitionTimeout);
1979 prefs_register_uint_preference(tcap_module, "losttimeout",
1981 "Maximal delay for message lost",
1982 10, >cap_LostTimeout);
1984 ansi_sub_dissectors = g_hash_table_new(g_direct_hash,g_direct_equal);
1985 itu_sub_dissectors = g_hash_table_new(g_direct_hash,g_direct_equal);
1987 /* 'globally' register dissector */
1988 register_dissector("tcap", dissect_tcap, proto_tcap);
1990 tcap_handle = create_dissector_handle(dissect_tcap, proto_tcap);
1992 register_init_routine(&init_tcap);
1996 static void range_delete_callback(guint32 ssn)
1998 if ( ssn && !get_ansi_tcap_subdissector(ssn) && !get_itu_tcap_subdissector(ssn) ) {
1999 dissector_delete("sccp.ssn", ssn, tcap_handle);
2003 static void range_add_callback(guint32 ssn)
2005 if (ssn && !get_ansi_tcap_subdissector(ssn) && !get_itu_tcap_subdissector(ssn) ) {
2006 dissector_add("sccp.ssn", ssn, tcap_handle);
2011 static void init_tcap(void) {
2013 range_foreach(ssn_range, range_delete_callback);
2017 ssn_range = range_copy(global_ssn_range);
2018 range_foreach(ssn_range, range_add_callback);
2019 tcapsrt_init_routine();
2023 dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset)
2025 gint tag_offset, saved_offset, len_offset;
2027 proto_tree *subtree;
2037 while (tvb_reported_length_remaining(tvb, offset) > 0)
2039 saved_offset = offset;
2041 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
2042 tag_offset = offset;
2043 offset = get_ber_length(tvb, offset, &len, &ind_field);
2044 len_offset = offset;
2046 tag_length = tag_offset - saved_offset;
2047 len_length = len_offset - tag_offset;
2051 pi = proto_tree_add_text(tree, tvb, saved_offset,
2052 len + (len_offset - saved_offset),
2054 subtree = proto_item_add_subtree(pi, ett_param);
2055 proto_tree_add_uint_format(subtree, hf_tcap_tag, tvb,
2056 saved_offset, tag_length, tag,
2058 proto_tree_add_uint(subtree, hf_tcap_tag, tvb, saved_offset,
2061 proto_tree_add_uint(subtree, hf_tcap_length, tvb, tag_offset,
2064 if (len-(2*ind_field)) /*should always be positive unless we get an empty contructor pointless? */
2066 next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field),
2068 dissect_tcap_param(actx, subtree,next_tvb,0);
2072 proto_tree_add_text(subtree, tvb, offset+len-2, 2, "CONSTRUCTOR EOC");
2078 pi = proto_tree_add_text(tree, tvb, saved_offset,
2079 len + (len_offset - saved_offset),
2080 "Parameter (0x%.2x)", tag);
2082 subtree = proto_item_add_subtree(pi, ett_param);
2084 proto_tree_add_uint(subtree, hf_tcap_tag, tvb, saved_offset,
2087 proto_tree_add_uint(subtree, hf_tcap_length, tvb,
2088 saved_offset+tag_length, len_length, len);
2090 if (len) /* check for NULLS */
2092 next_tvb = tvb_new_subset(tvb, offset, len, len);
2093 dissect_ber_octet_string(TRUE, actx, tree, next_tvb, 0,
2094 hf_tcap_data, NULL);
2103 static void raz_tcap_private(struct tcap_private_t * p_tcap_private)
2105 memset(p_tcap_private,0,sizeof(struct tcap_private_t) );
2109 * Call ITU Subdissector to decode the Tcap Component
2112 dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_)
2114 dissector_handle_t subdissector_handle=NULL;
2115 gboolean is_subdissector=FALSE;
2116 struct tcaphash_context_t * p_tcap_context=NULL;
2119 * ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it.
2123 * Handle The TCAP Service Response Time
2125 if ( gtcap_HandleSRT ) {
2126 if (!tcap_subdissector_used) {
2127 p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info);
2128 tcap_subdissector_used=TRUE;
2129 gp_tcap_context=p_tcap_context;
2130 tcap_private.context=p_tcap_context;
2132 /* Take the last TCAP context */
2133 p_tcap_context = gp_tcap_context;
2134 tcap_private.context=p_tcap_context;
2137 if (p_tcap_context) {
2139 if (p_tcap_context->oid_present) {
2140 /* We have already an Application Context, check if we have
2141 to fallback to a lower version */
2142 if ( strncmp(p_tcap_context->oid,cur_oid, LENGTH_OID)!=0) {
2143 /* ACN, changed, Fallback to lower version
2144 * and update the subdissector (purely formal)
2146 g_strlcpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
2147 if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
2148 p_tcap_context->subdissector_handle=subdissector_handle;
2149 p_tcap_context->subdissector_present=TRUE;
2153 /* We do not have the OID in the TCAP context, so store it */
2154 g_strlcpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
2155 p_tcap_context->oid_present=TRUE;
2156 /* Try to find a subdissector according to OID */
2157 if ( (subdissector_handle
2158 = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
2159 p_tcap_context->subdissector_handle=subdissector_handle;
2160 p_tcap_context->subdissector_present=TRUE;
2162 /* Not found, so try to find a subdissector according to SSN */
2163 if ( (subdissector_handle = get_itu_tcap_subdissector(actx->pinfo->match_port))) {
2164 /* Found according to SSN */
2165 p_tcap_context->subdissector_handle=subdissector_handle;
2166 p_tcap_context->subdissector_present=TRUE;
2171 /* Copy the OID from the TCAP context to the current oid */
2172 if (p_tcap_context->oid_present) {
2173 tcap_private.oid= (void*) p_tcap_context->oid;
2174 tcap_private.acv=TRUE;
2177 } /* no TCAP context */
2181 && p_tcap_context->subdissector_present) {
2182 /* Take the subdissector from the context */
2183 subdissector_handle=p_tcap_context->subdissector_handle;
2184 is_subdissector=TRUE;
2187 /* Have SccpUsersTable protocol taking precedence over sccp.ssn table */
2188 if (!is_subdissector && requested_subdissector_handle) {
2189 is_subdissector = TRUE;
2190 subdissector_handle = requested_subdissector_handle;
2193 if (!is_subdissector) {
2195 * If we do not currently know the subdissector, we have to find it
2196 * - first, according to the OID
2197 * - then according to the SSN
2198 * - and at least, take the default Data handler
2200 if (ber_oid_dissector_table && cur_oid) {
2201 /* Search if we can find the sub protocol according to the A.C.N */
2202 if ( (subdissector_handle
2203 = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
2205 is_subdissector=TRUE;
2207 /* Search if we can found the sub protocol according to the SSN table */
2208 if ( (subdissector_handle
2209 = get_itu_tcap_subdissector(actx->pinfo->match_port))) {
2210 /* Found according to SSN */
2211 is_subdissector=TRUE;
2213 /* Nothing found, take the Data handler */
2214 subdissector_handle = data_handle;
2215 is_subdissector=TRUE;
2219 /* There is no A.C.N for this transaction, so search in the SSN table */
2220 if ( (subdissector_handle = get_itu_tcap_subdissector(actx->pinfo->match_port))) {
2221 /* Found according to SSN */
2222 is_subdissector=TRUE;
2224 subdissector_handle = data_handle;
2225 is_subdissector=TRUE;
2229 /* We have it already */
2232 /* Call the sub dissector if present, and not already called */
2233 if (is_subdissector)
2234 call_dissector(subdissector_handle, tvb, actx->pinfo, tree);
2239 void call_tcap_dissector(dissector_handle_t handle, tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
2241 requested_subdissector_handle = handle;
2244 dissect_tcap(tvb, pinfo, tree);
2246 requested_subdissector_handle = NULL;
2250 requested_subdissector_handle = NULL;