HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-ansi_tcap.c
blob12ce6297a80316f49724237e0d6f21854fbb33f1
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-ansi_tcap.c */
4 /* ../../tools/asn2wrs.py -b -p ansi_tcap -c ./ansi_tcap.cnf -s ./packet-ansi_tcap-template -D . -O ../../epan/dissectors TCAP-Remote-Operations-Information-Objects.asn TCAPPackage.asn */
6 /* Input file: packet-ansi_tcap-template.c */
8 #line 1 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c"
9 /* packet-ansi_tcap-template.c
10 * Routines for ANSI TCAP
11 * Copyright 2007 Anders Broman <anders.broman@ericsson.com>
12 * Built from the gsm-map dissector Copyright 2004 - 2005, Anders Broman <anders.broman@ericsson.com>
14 * $Id$
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 * References: T1.114
35 #include "config.h"
37 #include <glib.h>
38 #include <epan/packet.h>
39 #include <epan/prefs.h>
40 #include <epan/oids.h>
41 #include <epan/wmem/wmem.h>
42 #include <epan/asn1.h>
43 #include <epan/strutil.h>
45 #include <string.h>
46 #include "packet-ber.h"
47 #include "packet-tcap.h"
48 #include "packet-ansi_tcap.h"
49 #include <epan/tcap-persistentdata.h>
51 #define PNAME "ANSI Transaction Capabilities Application Part"
52 #define PSNAME "ANSI_TCAP"
53 #define PFNAME "ansi_tcap"
55 void proto_register_ansi_tcap(void);
56 void proto_reg_handoff_ansi_tcap(void);
58 /* Preferences defaults */
59 gint ansi_tcap_response_matching_type = 0;
61 /* Initialize the protocol and registered fields */
62 static int proto_ansi_tcap = -1;
64 static int hf_ansi_tcapsrt_SessionId = -1;
65 static int hf_ansi_tcapsrt_Duplicate = -1;
66 static int hf_ansi_tcapsrt_BeginSession = -1;
67 static int hf_ansi_tcapsrt_EndSession = -1;
68 static int hf_ansi_tcapsrt_SessionTime = -1;
69 static int hf_ansi_tcap_bit_h = -1;
70 static int hf_ansi_tcap_op_family = -1;
71 static int hf_ansi_tcap_op_specifier = -1;
74 /*--- Included file: packet-ansi_tcap-hf.c ---*/
75 #line 1 "../../asn1/ansi_tcap/packet-ansi_tcap-hf.c"
76 static int hf_ansi_tcap_national = -1; /* T_national */
77 static int hf_ansi_tcap_private = -1; /* T_private */
78 static int hf_ansi_tcap_national_01 = -1; /* INTEGER_M128_127 */
79 static int hf_ansi_tcap_private_01 = -1; /* INTEGER */
80 static int hf_ansi_tcap_unidirectional = -1; /* T_unidirectional */
81 static int hf_ansi_tcap_queryWithPerm = -1; /* T_queryWithPerm */
82 static int hf_ansi_tcap_queryWithoutPerm = -1; /* T_queryWithoutPerm */
83 static int hf_ansi_tcap_response = -1; /* T_response */
84 static int hf_ansi_tcap_conversationWithPerm = -1; /* T_conversationWithPerm */
85 static int hf_ansi_tcap_conversationWithoutPerm = -1; /* T_conversationWithoutPerm */
86 static int hf_ansi_tcap_abort = -1; /* T_abort */
87 static int hf_ansi_tcap_identifier = -1; /* TransactionID */
88 static int hf_ansi_tcap_dialoguePortion = -1; /* DialoguePortion */
89 static int hf_ansi_tcap_componentPortion = -1; /* ComponentSequence */
90 static int hf_ansi_tcap_dialogPortion = -1; /* DialoguePortion */
91 static int hf_ansi_tcap_causeInformation = -1; /* T_causeInformation */
92 static int hf_ansi_tcap_abortCause = -1; /* P_Abort_cause */
93 static int hf_ansi_tcap_userInformation = -1; /* UserAbortInformation */
94 static int hf_ansi_tcap_version = -1; /* ProtocolVersion */
95 static int hf_ansi_tcap_applicationContext = -1; /* T_applicationContext */
96 static int hf_ansi_tcap_integerApplicationId = -1; /* IntegerApplicationContext */
97 static int hf_ansi_tcap_objectApplicationId = -1; /* ObjectIDApplicationContext */
98 static int hf_ansi_tcap_userInformation_01 = -1; /* UserInformation */
99 static int hf_ansi_tcap_securityContext = -1; /* T_securityContext */
100 static int hf_ansi_tcap_integerSecurityId = -1; /* INTEGER */
101 static int hf_ansi_tcap_objectSecurityId = -1; /* OBJECT_IDENTIFIER */
102 static int hf_ansi_tcap_confidentiality = -1; /* Confidentiality */
103 static int hf_ansi_tcap__untag_item = -1; /* EXTERNAL */
104 static int hf_ansi_tcap_confidentialityId = -1; /* T_confidentialityId */
105 static int hf_ansi_tcap_integerConfidentialityId = -1; /* INTEGER */
106 static int hf_ansi_tcap_objectConfidentialityId = -1; /* OBJECT_IDENTIFIER */
107 static int hf_ansi_tcap__untag_item_01 = -1; /* ComponentPDU */
108 static int hf_ansi_tcap_invokeLast = -1; /* Invoke */
109 static int hf_ansi_tcap_returnResultLast = -1; /* ReturnResult */
110 static int hf_ansi_tcap_returnError = -1; /* ReturnError */
111 static int hf_ansi_tcap_reject = -1; /* Reject */
112 static int hf_ansi_tcap_invokeNotLast = -1; /* Invoke */
113 static int hf_ansi_tcap_returnResultNotLast = -1; /* ReturnResult */
114 static int hf_ansi_tcap_componentIDs = -1; /* T_componentIDs */
115 static int hf_ansi_tcap_operationCode = -1; /* OperationCode */
116 static int hf_ansi_tcap_parameter = -1; /* T_parameter */
117 static int hf_ansi_tcap_componentID = -1; /* T_componentID */
118 static int hf_ansi_tcap_parameter_01 = -1; /* T_parameter_01 */
119 static int hf_ansi_tcap_componentID_01 = -1; /* T_componentID_01 */
120 static int hf_ansi_tcap_errorCode = -1; /* ErrorCode */
121 static int hf_ansi_tcap_parameter_02 = -1; /* T_parameter_02 */
122 static int hf_ansi_tcap_componentID_02 = -1; /* OCTET_STRING_SIZE_0_1 */
123 static int hf_ansi_tcap_rejectProblem = -1; /* Problem */
124 static int hf_ansi_tcap_parameter_03 = -1; /* T_parameter_03 */
125 static int hf_ansi_tcap_paramSequence = -1; /* T_paramSequence */
126 static int hf_ansi_tcap_paramSet = -1; /* T_paramSet */
128 /*--- End of included file: packet-ansi_tcap-hf.c ---*/
129 #line 66 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c"
131 /* Initialize the subtree pointers */
132 static gint ett_tcap = -1;
133 static gint ett_param = -1;
134 static gint ett_ansi_tcap_op_code_nat = -1;
136 static gint ett_otid = -1;
137 static gint ett_dtid = -1;
138 static gint ett_ansi_tcap_stat = -1;
140 static struct tcapsrt_info_t * gp_tcapsrt_info;
141 static gboolean tcap_subdissector_used=FALSE;
143 static struct tcaphash_context_t * gp_tcap_context=NULL;
145 /* Note the high bit should be masked off when registering in this table (0x7fff)*/
146 static dissector_table_t ansi_tcap_national_opcode_table; /* National Operation Codes */
149 /*--- Included file: packet-ansi_tcap-ett.c ---*/
150 #line 1 "../../asn1/ansi_tcap/packet-ansi_tcap-ett.c"
151 static gint ett_ansi_tcap_OperationCode = -1;
152 static gint ett_ansi_tcap_ErrorCode = -1;
153 static gint ett_ansi_tcap_PackageType = -1;
154 static gint ett_ansi_tcap_UniTransactionPDU = -1;
155 static gint ett_ansi_tcap_TransactionPDU = -1;
156 static gint ett_ansi_tcap_Abort = -1;
157 static gint ett_ansi_tcap_T_causeInformation = -1;
158 static gint ett_ansi_tcap_DialoguePortion_U = -1;
159 static gint ett_ansi_tcap_T_applicationContext = -1;
160 static gint ett_ansi_tcap_T_securityContext = -1;
161 static gint ett_ansi_tcap_UserInformation_U = -1;
162 static gint ett_ansi_tcap_Confidentiality = -1;
163 static gint ett_ansi_tcap_T_confidentialityId = -1;
164 static gint ett_ansi_tcap_SEQUENCE_OF_ComponentPDU = -1;
165 static gint ett_ansi_tcap_ComponentPDU = -1;
166 static gint ett_ansi_tcap_Invoke = -1;
167 static gint ett_ansi_tcap_ReturnResult = -1;
168 static gint ett_ansi_tcap_ReturnError = -1;
169 static gint ett_ansi_tcap_Reject = -1;
170 static gint ett_ansi_tcap_T_parameter_03 = -1;
171 static gint ett_ansi_tcap_T_paramSequence = -1;
172 static gint ett_ansi_tcap_T_paramSet = -1;
174 /*--- End of included file: packet-ansi_tcap-ett.c ---*/
175 #line 85 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c"
177 #define MAX_SSN 254
179 extern gboolean gtcap_PersistentSRT;
180 extern guint gtcap_RepetitionTimeout;
181 extern guint gtcap_LostTimeout;
183 static dissector_table_t ber_oid_dissector_table=NULL;
184 static const char * cur_oid;
185 static const char * tcapext_oid;
186 static proto_tree * tcap_top_tree=NULL;
187 static proto_tree * tcap_stat_tree=NULL;
188 static proto_item * tcap_stat_item=NULL;
190 static dissector_handle_t ansi_map_handle;
192 struct ansi_tcap_private_t ansi_tcap_private;
193 #define MAX_TID_STR_LEN 1024
195 static void ansi_tcap_ctx_init(struct ansi_tcap_private_t *a_tcap_ctx) {
196 memset(a_tcap_ctx, '\0', sizeof(*a_tcap_ctx));
197 a_tcap_ctx->signature = ANSI_TCAP_CTX_SIGNATURE;
198 a_tcap_ctx->oid_is_present = FALSE;
199 a_tcap_ctx->TransactionID_str = NULL;
202 static const value_string ansi_tcap_national_op_code_family_vals[] = {
203 { 0x0, "All Families" },
204 { 0x1, "Parameter" },
205 { 0x2, "Charging" },
206 { 0x3, "Provide Instructions" },
207 { 0x4, "Connection Control" },
208 { 0x5, "Caller Interaction" },
209 { 0x6, "Send Notification" },
210 { 0x7, "Network Management" },
211 { 0x8, "Procedural" },
212 { 0x9, "Operation Control" },
213 { 0xa, "Report Event" },
214 /* Spare */
215 { 0x7e, "Miscellaneous" },
216 { 0x7f, "Reserved" },
217 { 0, NULL }
220 static void dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
223 static dissector_handle_t tcap_handle = NULL;
224 static dissector_table_t sccp_ssn_table;
226 static GHashTable* ansi_sub_dissectors = NULL;
227 static GHashTable* itu_sub_dissectors = NULL;
229 extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
230 g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
231 dissector_add_uint("sccp.ssn",ssn,tcap_handle);
234 extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) {
235 g_hash_table_remove(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
236 dissector_delete_uint("sccp.ssn",ssn,tcap_handle);
239 dissector_handle_t get_ansi_tcap_subdissector(guint32 ssn) {
240 return g_hash_table_lookup(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
244 /* Transaction tracking */
245 /* Transaction table */
246 struct ansi_tcap_invokedata_t {
247 gint OperationCode;
249 0 : national,
250 1 : private
252 gint32 OperationCode_private;
253 gint32 OperationCode_national;
256 static GHashTable *TransactionId_table=NULL;
258 static void
259 ansi_tcap_init_transaction_table(void){
261 /* Destroy any existing memory chunks / hashes. */
262 if (TransactionId_table){
263 g_hash_table_destroy(TransactionId_table);
264 TransactionId_table = NULL;
267 TransactionId_table = g_hash_table_new(g_str_hash, g_str_equal);
271 static void
272 ansi_tcap_init_protocol(void)
274 ansi_tcap_init_transaction_table();
277 /* Store Invoke information needed for the corresponding reply */
278 static void
279 save_invoke_data(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){
280 struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata;
281 address* src = &(pinfo->src);
282 address* dst = &(pinfo->dst);
283 char *buf;
285 if ((!pinfo->fd->flags.visited)&&(ansi_tcap_private.TransactionID_str)){
287 /* Only do this once XXX I hope its the right thing to do */
288 /* The hash string needs to contain src and dest to distiguish differnt flows */
289 switch(ansi_tcap_response_matching_type){
290 case 0:
291 buf = wmem_strdup(wmem_packet_scope(), ansi_tcap_private.TransactionID_str);
292 break;
293 case 1:
294 buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src));
295 break;
296 default:
297 buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src),ep_address_to_str(dst));
298 break;
301 /* If the entry allready exists don't owervrite it */
302 ansi_tcap_saved_invokedata = (struct ansi_tcap_invokedata_t *)g_hash_table_lookup(TransactionId_table,buf);
303 if(ansi_tcap_saved_invokedata)
304 return;
306 ansi_tcap_saved_invokedata = wmem_new(wmem_file_scope(), struct ansi_tcap_invokedata_t);
307 ansi_tcap_saved_invokedata->OperationCode = ansi_tcap_private.d.OperationCode;
308 ansi_tcap_saved_invokedata->OperationCode_national = ansi_tcap_private.d.OperationCode_national;
309 ansi_tcap_saved_invokedata->OperationCode_private = ansi_tcap_private.d.OperationCode_private;
311 g_hash_table_insert(TransactionId_table,
312 wmem_strdup(wmem_file_scope(), buf),
313 ansi_tcap_saved_invokedata);
315 g_warning("Tcap Invoke Hash string %s",buf);
320 static gboolean
321 find_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){
322 struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata;
323 address* src = &(pinfo->src);
324 address* dst = &(pinfo->dst);
325 char *buf;
327 if (!ansi_tcap_private.TransactionID_str) {
328 return FALSE;
331 /* The hash string needs to contain src and dest to distiguish differnt flows */
332 buf = (char *)wmem_alloc(wmem_packet_scope(), MAX_TID_STR_LEN);
333 buf[0] = '\0';
334 /* Reverse order to invoke */
335 g_snprintf(buf, MAX_TID_STR_LEN, "%s%s%s",
336 ansi_tcap_private.TransactionID_str, ep_address_to_str(dst),
337 ep_address_to_str(src));
338 switch(ansi_tcap_response_matching_type){
339 case 0:
340 g_snprintf(buf,MAX_TID_STR_LEN,"%s",ansi_tcap_private.TransactionID_str);
341 break;
342 case 1:
343 g_snprintf(buf,MAX_TID_STR_LEN,"%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst));
344 break;
345 default:
346 g_snprintf(buf,MAX_TID_STR_LEN,"%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst),ep_address_to_str(src));
347 break;
350 ansi_tcap_saved_invokedata = (struct ansi_tcap_invokedata_t *)g_hash_table_lookup(TransactionId_table, buf);
351 if(ansi_tcap_saved_invokedata){
352 ansi_tcap_private.d.OperationCode = ansi_tcap_saved_invokedata->OperationCode;
353 ansi_tcap_private.d.OperationCode_national = ansi_tcap_saved_invokedata->OperationCode_national;
354 ansi_tcap_private.d.OperationCode_private = ansi_tcap_saved_invokedata->OperationCode_private;
355 return TRUE;
357 return FALSE;
360 /* As currently ANSI MAP is the only possible sub dissector this function
361 * must be improved to handle general cases.
365 * TODO:
366 * 1)Handle national codes
367 * Design option
368 * - Create a ansi.tcap.national dissector table and have dissectors for
369 * national codes register there and let ansi tcap call them.
370 * 2)Handle Private codes properly
371 * Design question
372 * Unclear how to differentiate between different private "code sets".
373 * Use SCCP SSN table as before? or a ansi.tcap.private dissector table?
376 static gboolean
377 find_tcap_subdissector(tvbuff_t *tvb, asn1_ctx_t *actx, proto_tree *tree){
378 proto_item *item;
380 /* If "DialoguePortion objectApplicationId ObjectIDApplicationContext
381 * points to the subdissector this code can be used.
383 if(ansi_tcap_private.d.oid_is_present){
384 call_ber_oid_callback(ansi_tcap_private.objectApplicationId_oid, tvb, 0, actx-pinfo, tree, NULL);
385 return TRUE;
388 if(ansi_tcap_private.d.pdu == 1){
389 /* Save Invoke data for this transaction */
390 save_invoke_data(actx->pinfo, tree, tvb);
391 }else{
392 /* Get saved data for this transaction */
393 if(find_saved_invokedata(actx->pinfo, tree, tvb)){
394 if(ansi_tcap_private.d.OperationCode == 0){
395 /* national */
396 item = proto_tree_add_int(tree, hf_ansi_tcap_national, tvb, 0, 0, ansi_tcap_private.d.OperationCode_national);
397 }else{
398 item = proto_tree_add_int(tree, hf_ansi_tcap_private, tvb, 0, 0, ansi_tcap_private.d.OperationCode_private);
400 PROTO_ITEM_SET_GENERATED(item);
401 ansi_tcap_private.d.OperationCode_item = item;
404 if(ansi_tcap_private.d.OperationCode == 0){
405 /* national */
406 guint8 family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8;
407 guint8 specifier = (guint8)(ansi_tcap_private.d.OperationCode_national & 0xff);
408 if(!dissector_try_uint(ansi_tcap_national_opcode_table, ansi_tcap_private.d.OperationCode_national, tvb, actx->pinfo, tcap_top_tree)){
409 item = proto_tree_add_text(tree, tvb, 0, -1,
410 "Dissector for ANSI TCAP NATIONAL code:0x%x(Family %u, Specifier %u) \n"
411 "not implemented. Contact Wireshark developers if you want this supported(Spec required)",
412 ansi_tcap_private.d.OperationCode_national, family, specifier);
413 PROTO_ITEM_SET_GENERATED(item);
414 return FALSE;
416 return TRUE;
417 }else if(ansi_tcap_private.d.OperationCode == 1){
418 /* private */
419 if((ansi_tcap_private.d.OperationCode_private & 0x0900) != 0x0900){
420 item = proto_tree_add_text(tree, tvb, 0, -1,
421 "Dissector for ANSI TCAP PRIVATE code:%u not implemented.\n"
422 "Contact Wireshark developers if you want this supported(Spec required)",
423 ansi_tcap_private.d.OperationCode_private);
424 PROTO_ITEM_SET_GENERATED(item);
425 return FALSE;
428 /* This is abit of a hack as it assumes the private codes with a "family" of 0x09 is ANSI MAP
429 * See TODO above.
430 * N.S0005-0 v 1.0 TCAP Formats and Procedures 5-16 Application Services
431 * 6.3.2 Component Portion
432 * The Operation Code is partitioned into an Operation Family followed by a
433 * Specifier associated with each Operation Family member. For TIA/EIA-41 the
434 * Operation Family is coded as decimal 9. Bit H of the Operation Family is always
435 * coded as 0.
437 call_dissector_with_data(ansi_map_handle, tvb, actx->pinfo, tcap_top_tree, &ansi_tcap_private);
439 return TRUE;
443 /*--- Included file: packet-ansi_tcap-fn.c ---*/
444 #line 1 "../../asn1/ansi_tcap/packet-ansi_tcap-fn.c"
447 static int
448 dissect_ansi_tcap_T_national(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
449 #line 20 "../../asn1/ansi_tcap/ansi_tcap.cnf"
450 proto_tree *subtree;
451 proto_item *spcifier_item;
452 int start_offset = offset;
453 guint8 family;
454 guint8 specifier;
456 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
457 &ansi_tcap_private.d.OperationCode_national);
459 /* mask off the H bit */
460 ansi_tcap_private.d.OperationCode_national = (ansi_tcap_private.d.OperationCode_national&0x7fff);
462 subtree = proto_item_add_subtree(actx->created_item, ett_ansi_tcap_op_code_nat);
463 /* Bit H is used to distinguish between Operations that require a reply and those that do not. A value of 1
464 * indicates that a reply is required; a value of 0 indicates that a reply is not required.
466 family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8;
467 specifier = (guint8)(ansi_tcap_private.d.OperationCode_national & 0xff);
468 proto_tree_add_item(subtree, hf_ansi_tcap_bit_h, tvb, start_offset, 2, ENC_BIG_ENDIAN);
469 proto_tree_add_item(subtree, hf_ansi_tcap_op_family, tvb, start_offset, 2, ENC_BIG_ENDIAN);
470 spcifier_item = proto_tree_add_item(subtree, hf_ansi_tcap_op_specifier, tvb, start_offset, 2, ENC_BIG_ENDIAN);
472 switch(family){
473 case 0:
474 /* All Families ( Not used ) */
475 break;
476 case 1:
477 /* Parameter */
478 if(specifier== 1){
479 proto_item_append_text(spcifier_item, " Provide Value");
480 }else if (specifier== 2){
481 proto_item_append_text(spcifier_item, " Set Value");
483 break;
484 case 2:
485 /* Charging */
486 if (specifier== 1){
487 proto_item_append_text(spcifier_item, " Bill Call");
489 break;
490 case 3:
491 /* Provide Instructions */
492 if (specifier== 1){
493 proto_item_append_text(spcifier_item, " Start");
494 }else if (specifier== 2){
495 proto_item_append_text(spcifier_item, " Assist");
497 break;
498 case 4:
499 /* Connection Control */
500 if (specifier== 1){
501 proto_item_append_text(spcifier_item, " Connect");
502 }else if (specifier== 2){
503 proto_item_append_text(spcifier_item, " Temporary Connect");
504 }else if (specifier== 3){
505 proto_item_append_text(spcifier_item, " Disconnect");
506 }else if (specifier== 4){
507 proto_item_append_text(spcifier_item, " Forward Disconnect");
509 break;
510 default:
511 break;
517 return offset;
522 static int
523 dissect_ansi_tcap_T_private(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
524 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
525 &ansi_tcap_private.d.OperationCode_private);
527 return offset;
531 static const value_string ansi_tcap_OperationCode_vals[] = {
532 { 16, "national" },
533 { 17, "private" },
534 { 0, NULL }
537 static const ber_choice_t OperationCode_choice[] = {
538 { 16, &hf_ansi_tcap_national , BER_CLASS_PRI, 16, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_national },
539 { 17, &hf_ansi_tcap_private , BER_CLASS_PRI, 17, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_private },
540 { 0, NULL, 0, 0, 0, NULL }
543 static int
544 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_) {
545 offset = dissect_ber_choice(actx, tree, tvb, offset,
546 OperationCode_choice, hf_index, ett_ansi_tcap_OperationCode,
547 &ansi_tcap_private.d.OperationCode);
549 #line 16 "../../asn1/ansi_tcap/ansi_tcap.cnf"
550 ansi_tcap_private.d.OperationCode_item = actx->created_item;
552 return offset;
557 static int
558 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_) {
559 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
560 NULL);
562 return offset;
567 static int
568 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_) {
569 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
570 NULL);
572 return offset;
576 static const value_string ansi_tcap_ErrorCode_vals[] = {
577 { 19, "national" },
578 { 20, "private" },
579 { 0, NULL }
582 static const ber_choice_t ErrorCode_choice[] = {
583 { 19, &hf_ansi_tcap_national_01, BER_CLASS_PRI, 19, 0, dissect_ansi_tcap_INTEGER_M128_127 },
584 { 20, &hf_ansi_tcap_private_01, BER_CLASS_PRI, 20, 0, dissect_ansi_tcap_INTEGER },
585 { 0, NULL, 0, 0, 0, NULL }
588 static int
589 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_) {
590 offset = dissect_ber_choice(actx, tree, tvb, offset,
591 ErrorCode_choice, hf_index, ett_ansi_tcap_ErrorCode,
592 NULL);
594 return offset;
599 static int
600 dissect_ansi_tcap_TransactionID_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_) {
601 #line 152 "../../asn1/ansi_tcap/ansi_tcap.cnf"
603 tvbuff_t *next_tvb;
604 guint8 len;
606 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
607 &next_tvb);
610 if(next_tvb) {
611 len = tvb_length_remaining(next_tvb, 0);
612 if(len !=0){
613 /* 0 octets for the Unidirectional,
614 * 4 octets for Query, Response & Abort
615 * 8 octets for Conversation in the order Originating then Responding TID
617 * In order to match this it seems like we should only use the last 4 octets
618 * in the 8 octets case.
620 if (len > 4){
621 ansi_tcap_private.TransactionID_str = tvb_bytes_to_str(next_tvb, 4,len-4);
622 }else{
623 ansi_tcap_private.TransactionID_str = tvb_bytes_to_str(next_tvb, 0,len);
626 switch(len) {
627 case 1:
628 gp_tcapsrt_info->src_tid=tvb_get_guint8(next_tvb, 0);
629 break;
630 case 2:
631 gp_tcapsrt_info->src_tid=tvb_get_ntohs(next_tvb, 0);
632 break;
633 case 4:
634 gp_tcapsrt_info->src_tid=tvb_get_ntohl(next_tvb, 0);
635 break;
636 default:
637 gp_tcapsrt_info->src_tid=0;
638 break;
644 return offset;
649 static int
650 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_) {
651 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
652 hf_index, BER_CLASS_PRI, 7, TRUE, dissect_ansi_tcap_TransactionID_U);
654 return offset;
659 static int
660 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_) {
661 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
662 NULL);
664 return offset;
669 static int
670 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_) {
671 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
672 hf_index, BER_CLASS_PRI, 26, TRUE, dissect_ansi_tcap_OCTET_STRING_SIZE_1);
674 return offset;
679 static int
680 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_) {
681 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
682 hf_index, BER_CLASS_PRI, 27, TRUE, dissect_ansi_tcap_INTEGER);
684 return offset;
689 static int
690 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_) {
691 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
693 return offset;
698 static int
699 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_) {
700 #line 116 "../../asn1/ansi_tcap/ansi_tcap.cnf"
702 static const char * oid_str;
704 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
705 hf_index, BER_CLASS_PRI, 28, TRUE, dissect_ansi_tcap_OBJECT_IDENTIFIER);
707 ansi_tcap_private.objectApplicationId_oid= (void*) oid_str;
708 ansi_tcap_private.oid_is_present=TRUE;
712 return offset;
716 static const value_string ansi_tcap_T_applicationContext_vals[] = {
717 { 27, "integerApplicationId" },
718 { 28, "objectApplicationId" },
719 { 0, NULL }
722 static const ber_choice_t T_applicationContext_choice[] = {
723 { 27, &hf_ansi_tcap_integerApplicationId, BER_CLASS_PRI, 27, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_IntegerApplicationContext },
724 { 28, &hf_ansi_tcap_objectApplicationId, BER_CLASS_PRI, 28, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ObjectIDApplicationContext },
725 { 0, NULL, 0, 0, 0, NULL }
728 static int
729 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_) {
730 offset = dissect_ber_choice(actx, tree, tvb, offset,
731 T_applicationContext_choice, hf_index, ett_ansi_tcap_T_applicationContext,
732 NULL);
734 return offset;
739 static int
740 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_) {
741 offset = dissect_ber_external_type(implicit_tag, tree, tvb, offset, actx, hf_index, NULL);
743 return offset;
747 static const ber_sequence_t UserInformation_U_sequence_of[1] = {
748 { &hf_ansi_tcap__untag_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_EXTERNAL },
751 static int
752 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_) {
753 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
754 UserInformation_U_sequence_of, hf_index, ett_ansi_tcap_UserInformation_U);
756 return offset;
761 static int
762 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_) {
763 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
764 hf_index, BER_CLASS_PRI, 29, TRUE, dissect_ansi_tcap_UserInformation_U);
766 return offset;
770 static const value_string ansi_tcap_T_securityContext_vals[] = {
771 { 0, "integerSecurityId" },
772 { 1, "objectSecurityId" },
773 { 0, NULL }
776 static const ber_choice_t T_securityContext_choice[] = {
777 { 0, &hf_ansi_tcap_integerSecurityId, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER },
778 { 1, &hf_ansi_tcap_objectSecurityId, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OBJECT_IDENTIFIER },
779 { 0, NULL, 0, 0, 0, NULL }
782 static int
783 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_) {
784 offset = dissect_ber_choice(actx, tree, tvb, offset,
785 T_securityContext_choice, hf_index, ett_ansi_tcap_T_securityContext,
786 NULL);
788 return offset;
792 static const value_string ansi_tcap_T_confidentialityId_vals[] = {
793 { 0, "integerConfidentialityId" },
794 { 1, "objectConfidentialityId" },
795 { 0, NULL }
798 static const ber_choice_t T_confidentialityId_choice[] = {
799 { 0, &hf_ansi_tcap_integerConfidentialityId, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER },
800 { 1, &hf_ansi_tcap_objectConfidentialityId, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OBJECT_IDENTIFIER },
801 { 0, NULL, 0, 0, 0, NULL }
804 static int
805 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_) {
806 offset = dissect_ber_choice(actx, tree, tvb, offset,
807 T_confidentialityId_choice, hf_index, ett_ansi_tcap_T_confidentialityId,
808 NULL);
810 return offset;
814 static const ber_sequence_t Confidentiality_sequence[] = {
815 { &hf_ansi_tcap_confidentialityId, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_confidentialityId },
816 { NULL, 0, 0, 0, NULL }
819 static int
820 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_) {
821 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
822 Confidentiality_sequence, hf_index, ett_ansi_tcap_Confidentiality);
824 return offset;
828 static const ber_sequence_t DialoguePortion_U_sequence[] = {
829 { &hf_ansi_tcap_version , BER_CLASS_PRI, 26, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ProtocolVersion },
830 { &hf_ansi_tcap_applicationContext, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_applicationContext },
831 { &hf_ansi_tcap_userInformation_01, BER_CLASS_PRI, 29, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_UserInformation },
832 { &hf_ansi_tcap_securityContext, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_securityContext },
833 { &hf_ansi_tcap_confidentiality, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Confidentiality },
834 { NULL, 0, 0, 0, NULL }
837 static int
838 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_) {
839 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
840 DialoguePortion_U_sequence, hf_index, ett_ansi_tcap_DialoguePortion_U);
842 return offset;
847 static int
848 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_) {
849 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
850 hf_index, BER_CLASS_PRI, 25, TRUE, dissect_ansi_tcap_DialoguePortion_U);
852 return offset;
857 static int
858 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_) {
859 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
860 NULL);
862 return offset;
867 static int
868 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_) {
869 #line 85 "../../asn1/ansi_tcap/ansi_tcap.cnf"
871 if(find_tcap_subdissector(tvb, actx, tree))
872 offset = tvb_length(tvb);
877 return offset;
881 static const ber_sequence_t Invoke_sequence[] = {
882 { &hf_ansi_tcap_componentIDs, BER_CLASS_PRI, 15, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentIDs },
883 { &hf_ansi_tcap_operationCode, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_OperationCode },
884 { &hf_ansi_tcap_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_parameter },
885 { NULL, 0, 0, 0, NULL }
888 static int
889 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_) {
890 #line 91 "../../asn1/ansi_tcap/ansi_tcap.cnf"
891 ansi_tcap_private.d.pdu = 1;
895 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
896 Invoke_sequence, hf_index, ett_ansi_tcap_Invoke);
898 return offset;
903 static int
904 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_) {
905 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
906 NULL);
908 return offset;
913 static int
914 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_) {
915 #line 98 "../../asn1/ansi_tcap/ansi_tcap.cnf"
916 if(find_tcap_subdissector(tvb, actx, tree))
917 offset = tvb_length(tvb);
921 return offset;
925 static const ber_sequence_t ReturnResult_sequence[] = {
926 { &hf_ansi_tcap_componentID, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentID },
927 { &hf_ansi_tcap_parameter_01, BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_parameter_01 },
928 { NULL, 0, 0, 0, NULL }
931 static int
932 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_) {
933 #line 102 "../../asn1/ansi_tcap/ansi_tcap.cnf"
934 ansi_tcap_private.d.pdu = 2;
939 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
940 ReturnResult_sequence, hf_index, ett_ansi_tcap_ReturnResult);
942 return offset;
947 static int
948 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_) {
949 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
950 NULL);
952 return offset;
957 static int
958 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_) {
959 #line 108 "../../asn1/ansi_tcap/ansi_tcap.cnf"
960 if(find_tcap_subdissector(tvb, actx, tree))
961 offset = tvb_length(tvb);
965 return offset;
969 static const ber_sequence_t ReturnError_sequence[] = {
970 { &hf_ansi_tcap_componentID_01, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentID_01 },
971 { &hf_ansi_tcap_errorCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_ErrorCode },
972 { &hf_ansi_tcap_parameter_02, BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_parameter_02 },
973 { NULL, 0, 0, 0, NULL }
976 static int
977 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_) {
978 #line 112 "../../asn1/ansi_tcap/ansi_tcap.cnf"
979 ansi_tcap_private.d.pdu = 3;
982 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
983 ReturnError_sequence, hf_index, ett_ansi_tcap_ReturnError);
985 return offset;
990 static int
991 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_) {
992 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
993 NULL);
995 return offset;
999 static const value_string ansi_tcap_Problem_vals[] = {
1000 { 257, "general-unrecognisedComponentType" },
1001 { 258, "general-incorrectComponentPortion" },
1002 { 259, "general-badlyStructuredCompPortion" },
1003 { 260, "general-incorrectComponentCoding" },
1004 { 513, "invoke-duplicateInvocation" },
1005 { 514, "invoke-unrecognisedOperation" },
1006 { 515, "invoke-incorrectParameter" },
1007 { 516, "invoke-unrecognisedCorrelationID" },
1008 { 769, "returnResult-unrecognisedCorrelationID" },
1009 { 770, "returnResult-unexpectedReturnResult" },
1010 { 771, "returnResult-incorrectParameter" },
1011 { 1025, "returnError-unrecognisedCorrelationID" },
1012 { 1026, "returnError-unexpectedReturnError" },
1013 { 1027, "returnError-unrecognisedError" },
1014 { 1028, "returnError-unexpectedError" },
1015 { 1029, "returnError-incorrectParameter" },
1016 { 1281, "transaction-unrecognizedPackageType" },
1017 { 1282, "transaction-incorrectTransPortion" },
1018 { 1283, "transaction-badlyStructuredTransPortion" },
1019 { 1284, "transaction-unassignedRespondingTransID" },
1020 { 1285, "transaction-permissionToReleaseProblem" },
1021 { 1286, "transaction-resourceUnavailable" },
1022 { 0, NULL }
1026 static int
1027 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_) {
1028 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1029 NULL);
1031 return offset;
1035 static const ber_sequence_t T_paramSequence_sequence[] = {
1036 { NULL, 0, 0, 0, NULL }
1039 static int
1040 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_) {
1041 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1042 T_paramSequence_sequence, hf_index, ett_ansi_tcap_T_paramSequence);
1044 return offset;
1048 static const ber_sequence_t T_paramSet_set[] = {
1049 { NULL, 0, 0, 0, NULL }
1052 static int
1053 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_) {
1054 offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset,
1055 T_paramSet_set, hf_index, ett_ansi_tcap_T_paramSet);
1057 return offset;
1061 static const value_string ansi_tcap_T_parameter_03_vals[] = {
1062 { 16, "paramSequence" },
1063 { 18, "paramSet" },
1064 { 0, NULL }
1067 static const ber_choice_t T_parameter_03_choice[] = {
1068 { 16, &hf_ansi_tcap_paramSequence, BER_CLASS_PRI, 16, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_paramSequence },
1069 { 18, &hf_ansi_tcap_paramSet , BER_CLASS_PRI, 18, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_paramSet },
1070 { 0, NULL, 0, 0, 0, NULL }
1073 static int
1074 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_) {
1075 offset = dissect_ber_choice(actx, tree, tvb, offset,
1076 T_parameter_03_choice, hf_index, ett_ansi_tcap_T_parameter_03,
1077 NULL);
1079 return offset;
1083 static const ber_sequence_t Reject_sequence[] = {
1084 { &hf_ansi_tcap_componentID_02, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OCTET_STRING_SIZE_0_1 },
1085 { &hf_ansi_tcap_rejectProblem, BER_CLASS_PRI, 21, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Problem },
1086 { &hf_ansi_tcap_parameter_03, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_parameter_03 },
1087 { NULL, 0, 0, 0, NULL }
1090 static int
1091 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_) {
1092 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1093 Reject_sequence, hf_index, ett_ansi_tcap_Reject);
1095 return offset;
1099 static const value_string ansi_tcap_ComponentPDU_vals[] = {
1100 { 9, "invokeLast" },
1101 { 10, "returnResultLast" },
1102 { 11, "returnError" },
1103 { 12, "reject" },
1104 { 13, "invokeNotLast" },
1105 { 14, "returnResultNotLast" },
1106 { 0, NULL }
1109 static const ber_choice_t ComponentPDU_choice[] = {
1110 { 9, &hf_ansi_tcap_invokeLast, BER_CLASS_PRI, 9, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Invoke },
1111 { 10, &hf_ansi_tcap_returnResultLast, BER_CLASS_PRI, 10, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnResult },
1112 { 11, &hf_ansi_tcap_returnError, BER_CLASS_PRI, 11, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnError },
1113 { 12, &hf_ansi_tcap_reject , BER_CLASS_PRI, 12, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Reject },
1114 { 13, &hf_ansi_tcap_invokeNotLast, BER_CLASS_PRI, 13, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Invoke },
1115 { 14, &hf_ansi_tcap_returnResultNotLast, BER_CLASS_PRI, 14, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnResult },
1116 { 0, NULL, 0, 0, 0, NULL }
1119 static int
1120 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_) {
1121 offset = dissect_ber_choice(actx, tree, tvb, offset,
1122 ComponentPDU_choice, hf_index, ett_ansi_tcap_ComponentPDU,
1123 NULL);
1125 return offset;
1129 static const ber_sequence_t SEQUENCE_OF_ComponentPDU_sequence_of[1] = {
1130 { &hf_ansi_tcap__untag_item_01, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_ComponentPDU },
1133 static int
1134 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_) {
1135 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1136 SEQUENCE_OF_ComponentPDU_sequence_of, hf_index, ett_ansi_tcap_SEQUENCE_OF_ComponentPDU);
1138 return offset;
1143 static int
1144 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_) {
1145 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1146 hf_index, BER_CLASS_PRI, 8, TRUE, dissect_ansi_tcap_SEQUENCE_OF_ComponentPDU);
1148 return offset;
1152 static const ber_sequence_t UniTransactionPDU_sequence[] = {
1153 { &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
1154 { &hf_ansi_tcap_dialoguePortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
1155 { &hf_ansi_tcap_componentPortion, BER_CLASS_PRI, 8, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ComponentSequence },
1156 { NULL, 0, 0, 0, NULL }
1159 static int
1160 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_) {
1161 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1162 UniTransactionPDU_sequence, hf_index, ett_ansi_tcap_UniTransactionPDU);
1164 return offset;
1169 static int
1170 dissect_ansi_tcap_T_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_) {
1171 #line 124 "../../asn1/ansi_tcap/ansi_tcap.cnf"
1172 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1173 col_set_str(actx->pinfo->cinfo, COL_INFO, "unidirectional ");
1176 offset = dissect_ansi_tcap_UniTransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1178 return offset;
1182 static const ber_sequence_t TransactionPDU_sequence[] = {
1183 { &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
1184 { &hf_ansi_tcap_dialoguePortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
1185 { &hf_ansi_tcap_componentPortion, BER_CLASS_PRI, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ComponentSequence },
1186 { NULL, 0, 0, 0, NULL }
1189 static int
1190 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_) {
1191 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1192 TransactionPDU_sequence, hf_index, ett_ansi_tcap_TransactionPDU);
1194 return offset;
1199 static int
1200 dissect_ansi_tcap_T_queryWithPerm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1201 #line 128 "../../asn1/ansi_tcap/ansi_tcap.cnf"
1202 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1203 col_set_str(actx->pinfo->cinfo, COL_INFO, "queryWithPerm ");
1206 offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1208 return offset;
1213 static int
1214 dissect_ansi_tcap_T_queryWithoutPerm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1215 #line 132 "../../asn1/ansi_tcap/ansi_tcap.cnf"
1216 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1217 col_set_str(actx->pinfo->cinfo, COL_INFO, "queryWithoutPerm ");
1220 offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1222 return offset;
1227 static int
1228 dissect_ansi_tcap_T_response(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1229 #line 136 "../../asn1/ansi_tcap/ansi_tcap.cnf"
1230 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1231 col_set_str(actx->pinfo->cinfo, COL_INFO, "response ");
1234 offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1236 return offset;
1241 static int
1242 dissect_ansi_tcap_T_conversationWithPerm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1243 #line 140 "../../asn1/ansi_tcap/ansi_tcap.cnf"
1244 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1245 col_set_str(actx->pinfo->cinfo, COL_INFO, "conversationWithPerm ");
1248 offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1250 return offset;
1255 static int
1256 dissect_ansi_tcap_T_conversationWithoutPerm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1257 #line 144 "../../asn1/ansi_tcap/ansi_tcap.cnf"
1258 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1259 col_set_str(actx->pinfo->cinfo, COL_INFO, "conversationWithoutPerm ");
1262 offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1264 return offset;
1268 static const value_string ansi_tcap_P_Abort_cause_U_vals[] = {
1269 { 1, "unrecognizedPackageType" },
1270 { 2, "incorrectTransactionPortion" },
1271 { 3, "badlyStructuredTransactionPortion" },
1272 { 4, "unassignedRespondingTransactionID" },
1273 { 5, "permissionToReleaseProblem" },
1274 { 6, "resourceUnavailable" },
1275 { 7, "unrecognizedDialoguePortionID" },
1276 { 8, "badlyStructuredDialoguePortion" },
1277 { 9, "missingDialoguePortion" },
1278 { 10, "inconsistentDialoguePortion" },
1279 { 0, NULL }
1283 static int
1284 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_) {
1285 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1286 NULL);
1288 return offset;
1293 static int
1294 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_) {
1295 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1296 hf_index, BER_CLASS_PRI, 23, TRUE, dissect_ansi_tcap_P_Abort_cause_U);
1298 return offset;
1303 static int
1304 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_) {
1305 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1306 hf_index, BER_CLASS_PRI, 24, FALSE, dissect_ansi_tcap_EXTERNAL);
1308 return offset;
1312 static const value_string ansi_tcap_T_causeInformation_vals[] = {
1313 { 23, "abortCause" },
1314 { 24, "userInformation" },
1315 { 0, NULL }
1318 static const ber_choice_t T_causeInformation_choice[] = {
1319 { 23, &hf_ansi_tcap_abortCause, BER_CLASS_PRI, 23, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_P_Abort_cause },
1320 { 24, &hf_ansi_tcap_userInformation, BER_CLASS_PRI, 24, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_UserAbortInformation },
1321 { 0, NULL, 0, 0, 0, NULL }
1324 static int
1325 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_) {
1326 offset = dissect_ber_choice(actx, tree, tvb, offset,
1327 T_causeInformation_choice, hf_index, ett_ansi_tcap_T_causeInformation,
1328 NULL);
1330 return offset;
1334 static const ber_sequence_t Abort_sequence[] = {
1335 { &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
1336 { &hf_ansi_tcap_dialogPortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
1337 { &hf_ansi_tcap_causeInformation, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_causeInformation },
1338 { NULL, 0, 0, 0, NULL }
1341 static int
1342 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_) {
1343 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1344 Abort_sequence, hf_index, ett_ansi_tcap_Abort);
1346 return offset;
1351 static int
1352 dissect_ansi_tcap_T_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_) {
1353 #line 148 "../../asn1/ansi_tcap/ansi_tcap.cnf"
1354 gp_tcapsrt_info->ope=TC_ANSI_ABORT;
1355 col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort ");
1358 offset = dissect_ansi_tcap_Abort(implicit_tag, tvb, offset, actx, tree, hf_index);
1360 return offset;
1364 static const value_string ansi_tcap_PackageType_vals[] = {
1365 { 1, "unidirectional" },
1366 { 2, "queryWithPerm" },
1367 { 3, "queryWithoutPerm" },
1368 { 4, "response" },
1369 { 5, "conversationWithPerm" },
1370 { 6, "conversationWithoutPerm" },
1371 { 22, "abort" },
1372 { 0, NULL }
1375 static const ber_choice_t PackageType_choice[] = {
1376 { 1, &hf_ansi_tcap_unidirectional, BER_CLASS_PRI, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_unidirectional },
1377 { 2, &hf_ansi_tcap_queryWithPerm, BER_CLASS_PRI, 2, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_queryWithPerm },
1378 { 3, &hf_ansi_tcap_queryWithoutPerm, BER_CLASS_PRI, 3, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_queryWithoutPerm },
1379 { 4, &hf_ansi_tcap_response , BER_CLASS_PRI, 4, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_response },
1380 { 5, &hf_ansi_tcap_conversationWithPerm, BER_CLASS_PRI, 5, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_conversationWithPerm },
1381 { 6, &hf_ansi_tcap_conversationWithoutPerm, BER_CLASS_PRI, 6, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_conversationWithoutPerm },
1382 { 22, &hf_ansi_tcap_abort , BER_CLASS_PRI, 22, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_abort },
1383 { 0, NULL, 0, 0, 0, NULL }
1386 static int
1387 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_) {
1388 offset = dissect_ber_choice(actx, tree, tvb, offset,
1389 PackageType_choice, hf_index, ett_ansi_tcap_PackageType,
1390 NULL);
1392 return offset;
1396 /*--- End of included file: packet-ansi_tcap-fn.c ---*/
1397 #line 352 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c"
1402 static void
1403 dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
1405 proto_item *item=NULL;
1406 proto_tree *tree=NULL;
1407 #if 0
1408 proto_item *stat_item=NULL;
1409 proto_tree *stat_tree=NULL;
1410 gint offset = 0;
1411 struct tcaphash_context_t * p_tcap_context;
1412 dissector_handle_t subdissector_handle;
1413 #endif
1414 asn1_ctx_t asn1_ctx;
1416 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1417 ansi_tcap_ctx_init(&ansi_tcap_private);
1419 tcap_top_tree = parent_tree;
1420 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI TCAP");
1422 /* create display subtree for the protocol */
1423 if(parent_tree){
1424 item = proto_tree_add_item(parent_tree, proto_ansi_tcap, tvb, 0, -1, ENC_NA);
1425 tree = proto_item_add_subtree(item, ett_tcap);
1426 tcap_stat_item=item;
1427 tcap_stat_tree=tree;
1429 cur_oid = NULL;
1430 tcapext_oid = NULL;
1432 gp_tcapsrt_info=tcapsrt_razinfo();
1433 tcap_subdissector_used=FALSE;
1434 gp_tcap_context=NULL;
1435 dissect_ansi_tcap_PackageType(FALSE, tvb, 0, &asn1_ctx, tree, -1);
1437 #if 0 /* Skip this part for now it will be rewritten */
1438 if (g_ansi_tcap_HandleSRT && !tcap_subdissector_used ) {
1439 if (gtcap_DisplaySRT && tree) {
1440 stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat");
1441 PROTO_ITEM_SET_GENERATED(stat_item);
1442 stat_tree = proto_item_add_subtree(stat_item, ett_ansi_tcap_stat);
1444 p_tcap_context=tcapsrt_call_matching(tvb, pinfo, stat_tree, gp_tcapsrt_info);
1445 ansi_tcap_private.context=p_tcap_context;
1447 /* If the current message is TCAP only,
1448 * save the Application contexte name for the next messages
1450 if ( p_tcap_context && cur_oid && !p_tcap_context->oid_present ) {
1451 /* Save the application context and the sub dissector */
1452 g_strlcpy(p_tcap_context->oid, cur_oid, sizeof(p_tcap_context->oid));
1453 if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
1454 p_tcap_context->subdissector_handle=subdissector_handle;
1455 p_tcap_context->oid_present=TRUE;
1458 if (g_ansi_tcap_HandleSRT && p_tcap_context && p_tcap_context->callback) {
1459 /* Callback fonction for the upper layer */
1460 (p_tcap_context->callback)(tvb, pinfo, stat_tree, p_tcap_context);
1463 #endif
1467 void
1468 proto_reg_handoff_ansi_tcap(void)
1471 ansi_map_handle = find_dissector("ansi_map");
1472 ber_oid_dissector_table = find_dissector_table("ber.oid");
1477 void
1478 proto_register_ansi_tcap(void)
1480 module_t *ansi_tcap_module;
1483 /* Setup list of header fields See Section 1.6.1 for details*/
1484 static hf_register_info hf[] = {
1485 /* Tcap Service Response Time */
1486 { &hf_ansi_tcapsrt_SessionId,
1487 { "Session Id",
1488 "ansi_tcap.srt.session_id",
1489 FT_UINT32, BASE_DEC, NULL, 0x0,
1490 NULL, HFILL }
1492 { &hf_ansi_tcapsrt_BeginSession,
1493 { "Begin Session",
1494 "ansi_tcap.srt.begin",
1495 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1496 "SRT Begin of Session", HFILL }
1498 { &hf_ansi_tcapsrt_EndSession,
1499 { "End Session",
1500 "ansi_tcap.srt.end",
1501 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1502 "SRT End of Session", HFILL }
1504 { &hf_ansi_tcapsrt_SessionTime,
1505 { "Session duration",
1506 "ansi_tcap.srt.sessiontime",
1507 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
1508 "Duration of the TCAP session", HFILL }
1510 { &hf_ansi_tcapsrt_Duplicate,
1511 { "Request Duplicate",
1512 "ansi_tcap.srt.duplicate",
1513 FT_UINT32, BASE_DEC, NULL, 0x0,
1514 NULL, HFILL }
1516 { &hf_ansi_tcap_bit_h,
1517 { "Require Reply", "ansi_tcap.req_rep",
1518 FT_BOOLEAN, 16, NULL, 0x8000,
1519 NULL, HFILL }
1521 { &hf_ansi_tcap_op_family,
1522 { "Family",
1523 "ansi_tcap.op_family",
1524 FT_UINT16, BASE_DEC, VALS(ansi_tcap_national_op_code_family_vals), 0x7f00,
1525 NULL, HFILL }
1527 { &hf_ansi_tcap_op_specifier,
1528 { "Specifier",
1529 "ansi_tcap.op_specifier",
1530 FT_UINT16, BASE_DEC, NULL, 0x00ff,
1531 NULL, HFILL }
1534 /*--- Included file: packet-ansi_tcap-hfarr.c ---*/
1535 #line 1 "../../asn1/ansi_tcap/packet-ansi_tcap-hfarr.c"
1536 { &hf_ansi_tcap_national,
1537 { "national", "ansi_tcap.national",
1538 FT_INT32, BASE_DEC, NULL, 0,
1539 NULL, HFILL }},
1540 { &hf_ansi_tcap_private,
1541 { "private", "ansi_tcap.private",
1542 FT_INT32, BASE_DEC, NULL, 0,
1543 NULL, HFILL }},
1544 { &hf_ansi_tcap_national_01,
1545 { "national", "ansi_tcap.national",
1546 FT_INT32, BASE_DEC, NULL, 0,
1547 "INTEGER_M128_127", HFILL }},
1548 { &hf_ansi_tcap_private_01,
1549 { "private", "ansi_tcap.private",
1550 FT_INT32, BASE_DEC, NULL, 0,
1551 "INTEGER", HFILL }},
1552 { &hf_ansi_tcap_unidirectional,
1553 { "unidirectional", "ansi_tcap.unidirectional_element",
1554 FT_NONE, BASE_NONE, NULL, 0,
1555 NULL, HFILL }},
1556 { &hf_ansi_tcap_queryWithPerm,
1557 { "queryWithPerm", "ansi_tcap.queryWithPerm_element",
1558 FT_NONE, BASE_NONE, NULL, 0,
1559 NULL, HFILL }},
1560 { &hf_ansi_tcap_queryWithoutPerm,
1561 { "queryWithoutPerm", "ansi_tcap.queryWithoutPerm_element",
1562 FT_NONE, BASE_NONE, NULL, 0,
1563 NULL, HFILL }},
1564 { &hf_ansi_tcap_response,
1565 { "response", "ansi_tcap.response_element",
1566 FT_NONE, BASE_NONE, NULL, 0,
1567 NULL, HFILL }},
1568 { &hf_ansi_tcap_conversationWithPerm,
1569 { "conversationWithPerm", "ansi_tcap.conversationWithPerm_element",
1570 FT_NONE, BASE_NONE, NULL, 0,
1571 NULL, HFILL }},
1572 { &hf_ansi_tcap_conversationWithoutPerm,
1573 { "conversationWithoutPerm", "ansi_tcap.conversationWithoutPerm_element",
1574 FT_NONE, BASE_NONE, NULL, 0,
1575 NULL, HFILL }},
1576 { &hf_ansi_tcap_abort,
1577 { "abort", "ansi_tcap.abort_element",
1578 FT_NONE, BASE_NONE, NULL, 0,
1579 NULL, HFILL }},
1580 { &hf_ansi_tcap_identifier,
1581 { "identifier", "ansi_tcap.identifier",
1582 FT_BYTES, BASE_NONE, NULL, 0,
1583 "TransactionID", HFILL }},
1584 { &hf_ansi_tcap_dialoguePortion,
1585 { "dialoguePortion", "ansi_tcap.dialoguePortion_element",
1586 FT_NONE, BASE_NONE, NULL, 0,
1587 NULL, HFILL }},
1588 { &hf_ansi_tcap_componentPortion,
1589 { "componentPortion", "ansi_tcap.componentPortion",
1590 FT_UINT32, BASE_DEC, NULL, 0,
1591 "ComponentSequence", HFILL }},
1592 { &hf_ansi_tcap_dialogPortion,
1593 { "dialogPortion", "ansi_tcap.dialogPortion_element",
1594 FT_NONE, BASE_NONE, NULL, 0,
1595 "DialoguePortion", HFILL }},
1596 { &hf_ansi_tcap_causeInformation,
1597 { "causeInformation", "ansi_tcap.causeInformation",
1598 FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_causeInformation_vals), 0,
1599 NULL, HFILL }},
1600 { &hf_ansi_tcap_abortCause,
1601 { "abortCause", "ansi_tcap.abortCause",
1602 FT_INT32, BASE_DEC, VALS(ansi_tcap_P_Abort_cause_U_vals), 0,
1603 "P_Abort_cause", HFILL }},
1604 { &hf_ansi_tcap_userInformation,
1605 { "userInformation", "ansi_tcap.userInformation_element",
1606 FT_NONE, BASE_NONE, NULL, 0,
1607 "UserAbortInformation", HFILL }},
1608 { &hf_ansi_tcap_version,
1609 { "version", "ansi_tcap.version",
1610 FT_BYTES, BASE_NONE, NULL, 0,
1611 "ProtocolVersion", HFILL }},
1612 { &hf_ansi_tcap_applicationContext,
1613 { "applicationContext", "ansi_tcap.applicationContext",
1614 FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_applicationContext_vals), 0,
1615 NULL, HFILL }},
1616 { &hf_ansi_tcap_integerApplicationId,
1617 { "integerApplicationId", "ansi_tcap.integerApplicationId",
1618 FT_INT32, BASE_DEC, NULL, 0,
1619 "IntegerApplicationContext", HFILL }},
1620 { &hf_ansi_tcap_objectApplicationId,
1621 { "objectApplicationId", "ansi_tcap.objectApplicationId",
1622 FT_OID, BASE_NONE, NULL, 0,
1623 "ObjectIDApplicationContext", HFILL }},
1624 { &hf_ansi_tcap_userInformation_01,
1625 { "userInformation", "ansi_tcap.userInformation",
1626 FT_UINT32, BASE_DEC, NULL, 0,
1627 NULL, HFILL }},
1628 { &hf_ansi_tcap_securityContext,
1629 { "securityContext", "ansi_tcap.securityContext",
1630 FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_securityContext_vals), 0,
1631 NULL, HFILL }},
1632 { &hf_ansi_tcap_integerSecurityId,
1633 { "integerSecurityId", "ansi_tcap.integerSecurityId",
1634 FT_INT32, BASE_DEC, NULL, 0,
1635 "INTEGER", HFILL }},
1636 { &hf_ansi_tcap_objectSecurityId,
1637 { "objectSecurityId", "ansi_tcap.objectSecurityId",
1638 FT_OID, BASE_NONE, NULL, 0,
1639 "OBJECT_IDENTIFIER", HFILL }},
1640 { &hf_ansi_tcap_confidentiality,
1641 { "confidentiality", "ansi_tcap.confidentiality_element",
1642 FT_NONE, BASE_NONE, NULL, 0,
1643 NULL, HFILL }},
1644 { &hf_ansi_tcap__untag_item,
1645 { "_untag item", "ansi_tcap._untag_item_element",
1646 FT_NONE, BASE_NONE, NULL, 0,
1647 "EXTERNAL", HFILL }},
1648 { &hf_ansi_tcap_confidentialityId,
1649 { "confidentialityId", "ansi_tcap.confidentialityId",
1650 FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_confidentialityId_vals), 0,
1651 NULL, HFILL }},
1652 { &hf_ansi_tcap_integerConfidentialityId,
1653 { "integerConfidentialityId", "ansi_tcap.integerConfidentialityId",
1654 FT_INT32, BASE_DEC, NULL, 0,
1655 "INTEGER", HFILL }},
1656 { &hf_ansi_tcap_objectConfidentialityId,
1657 { "objectConfidentialityId", "ansi_tcap.objectConfidentialityId",
1658 FT_OID, BASE_NONE, NULL, 0,
1659 "OBJECT_IDENTIFIER", HFILL }},
1660 { &hf_ansi_tcap__untag_item_01,
1661 { "ComponentPDU", "ansi_tcap.ComponentPDU",
1662 FT_UINT32, BASE_DEC, VALS(ansi_tcap_ComponentPDU_vals), 0,
1663 NULL, HFILL }},
1664 { &hf_ansi_tcap_invokeLast,
1665 { "invokeLast", "ansi_tcap.invokeLast_element",
1666 FT_NONE, BASE_NONE, NULL, 0,
1667 "Invoke", HFILL }},
1668 { &hf_ansi_tcap_returnResultLast,
1669 { "returnResultLast", "ansi_tcap.returnResultLast_element",
1670 FT_NONE, BASE_NONE, NULL, 0,
1671 "ReturnResult", HFILL }},
1672 { &hf_ansi_tcap_returnError,
1673 { "returnError", "ansi_tcap.returnError_element",
1674 FT_NONE, BASE_NONE, NULL, 0,
1675 NULL, HFILL }},
1676 { &hf_ansi_tcap_reject,
1677 { "reject", "ansi_tcap.reject_element",
1678 FT_NONE, BASE_NONE, NULL, 0,
1679 NULL, HFILL }},
1680 { &hf_ansi_tcap_invokeNotLast,
1681 { "invokeNotLast", "ansi_tcap.invokeNotLast_element",
1682 FT_NONE, BASE_NONE, NULL, 0,
1683 "Invoke", HFILL }},
1684 { &hf_ansi_tcap_returnResultNotLast,
1685 { "returnResultNotLast", "ansi_tcap.returnResultNotLast_element",
1686 FT_NONE, BASE_NONE, NULL, 0,
1687 "ReturnResult", HFILL }},
1688 { &hf_ansi_tcap_componentIDs,
1689 { "componentIDs", "ansi_tcap.componentIDs",
1690 FT_BYTES, BASE_NONE, NULL, 0,
1691 NULL, HFILL }},
1692 { &hf_ansi_tcap_operationCode,
1693 { "operationCode", "ansi_tcap.operationCode",
1694 FT_UINT32, BASE_DEC, VALS(ansi_tcap_OperationCode_vals), 0,
1695 NULL, HFILL }},
1696 { &hf_ansi_tcap_parameter,
1697 { "parameter", "ansi_tcap.parameter_element",
1698 FT_NONE, BASE_NONE, NULL, 0,
1699 NULL, HFILL }},
1700 { &hf_ansi_tcap_componentID,
1701 { "componentID", "ansi_tcap.componentID",
1702 FT_BYTES, BASE_NONE, NULL, 0,
1703 NULL, HFILL }},
1704 { &hf_ansi_tcap_parameter_01,
1705 { "parameter", "ansi_tcap.parameter_element",
1706 FT_NONE, BASE_NONE, NULL, 0,
1707 "T_parameter_01", HFILL }},
1708 { &hf_ansi_tcap_componentID_01,
1709 { "componentID", "ansi_tcap.componentID",
1710 FT_BYTES, BASE_NONE, NULL, 0,
1711 "T_componentID_01", HFILL }},
1712 { &hf_ansi_tcap_errorCode,
1713 { "errorCode", "ansi_tcap.errorCode",
1714 FT_UINT32, BASE_DEC, VALS(ansi_tcap_ErrorCode_vals), 0,
1715 NULL, HFILL }},
1716 { &hf_ansi_tcap_parameter_02,
1717 { "parameter", "ansi_tcap.parameter_element",
1718 FT_NONE, BASE_NONE, NULL, 0,
1719 "T_parameter_02", HFILL }},
1720 { &hf_ansi_tcap_componentID_02,
1721 { "componentID", "ansi_tcap.componentID",
1722 FT_BYTES, BASE_NONE, NULL, 0,
1723 "OCTET_STRING_SIZE_0_1", HFILL }},
1724 { &hf_ansi_tcap_rejectProblem,
1725 { "rejectProblem", "ansi_tcap.rejectProblem",
1726 FT_INT32, BASE_DEC, VALS(ansi_tcap_Problem_vals), 0,
1727 "Problem", HFILL }},
1728 { &hf_ansi_tcap_parameter_03,
1729 { "parameter", "ansi_tcap.parameter",
1730 FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_parameter_03_vals), 0,
1731 "T_parameter_03", HFILL }},
1732 { &hf_ansi_tcap_paramSequence,
1733 { "paramSequence", "ansi_tcap.paramSequence_element",
1734 FT_NONE, BASE_NONE, NULL, 0,
1735 NULL, HFILL }},
1736 { &hf_ansi_tcap_paramSet,
1737 { "paramSet", "ansi_tcap.paramSet_element",
1738 FT_NONE, BASE_NONE, NULL, 0,
1739 NULL, HFILL }},
1741 /*--- End of included file: packet-ansi_tcap-hfarr.c ---*/
1742 #line 488 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c"
1745 /* Setup protocol subtree array */
1746 static gint *ett[] = {
1747 &ett_tcap,
1748 &ett_param,
1749 &ett_otid,
1750 &ett_dtid,
1751 &ett_ansi_tcap_stat,
1752 &ett_ansi_tcap_op_code_nat,
1754 /*--- Included file: packet-ansi_tcap-ettarr.c ---*/
1755 #line 1 "../../asn1/ansi_tcap/packet-ansi_tcap-ettarr.c"
1756 &ett_ansi_tcap_OperationCode,
1757 &ett_ansi_tcap_ErrorCode,
1758 &ett_ansi_tcap_PackageType,
1759 &ett_ansi_tcap_UniTransactionPDU,
1760 &ett_ansi_tcap_TransactionPDU,
1761 &ett_ansi_tcap_Abort,
1762 &ett_ansi_tcap_T_causeInformation,
1763 &ett_ansi_tcap_DialoguePortion_U,
1764 &ett_ansi_tcap_T_applicationContext,
1765 &ett_ansi_tcap_T_securityContext,
1766 &ett_ansi_tcap_UserInformation_U,
1767 &ett_ansi_tcap_Confidentiality,
1768 &ett_ansi_tcap_T_confidentialityId,
1769 &ett_ansi_tcap_SEQUENCE_OF_ComponentPDU,
1770 &ett_ansi_tcap_ComponentPDU,
1771 &ett_ansi_tcap_Invoke,
1772 &ett_ansi_tcap_ReturnResult,
1773 &ett_ansi_tcap_ReturnError,
1774 &ett_ansi_tcap_Reject,
1775 &ett_ansi_tcap_T_parameter_03,
1776 &ett_ansi_tcap_T_paramSequence,
1777 &ett_ansi_tcap_T_paramSet,
1779 /*--- End of included file: packet-ansi_tcap-ettarr.c ---*/
1780 #line 499 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c"
1783 static const enum_val_t ansi_tcap_response_matching_type_values[] = {
1784 {"Only Transaction ID will be used in Invoke/response matching", "Transaction ID only", 0},
1785 {"Transaction ID and Source will be used in Invoke/response matching", "Transaction ID and Source", 1},
1786 {"Transaction ID Source and Destination will be used in Invoke/response matching", "Transaction ID Source and Destination", 2},
1787 {NULL, NULL, -1}
1791 /* Register the protocol name and description */
1792 proto_ansi_tcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
1793 register_dissector("ansi_tcap", dissect_ansi_tcap, proto_ansi_tcap);
1795 /* Note the high bit should be masked off when registering in this table (0x7fff)*/
1796 ansi_tcap_national_opcode_table = register_dissector_table("ansi_tcap.nat.opcode", "ANSI TCAP National Opcodes", FT_UINT16, BASE_DEC);
1797 /* Required function calls to register the header fields and subtrees used */
1798 proto_register_field_array(proto_ansi_tcap, hf, array_length(hf));
1799 proto_register_subtree_array(ett, array_length(ett));
1801 ansi_tcap_module = prefs_register_protocol(proto_ansi_tcap, proto_reg_handoff_ansi_tcap);
1803 prefs_register_enum_preference(ansi_tcap_module, "transaction.matchtype",
1804 "Type of matching invoke/response",
1805 "Type of matching invoke/response, risk of missmatch if loose matching choosen",
1806 &ansi_tcap_response_matching_type, ansi_tcap_response_matching_type_values, FALSE);
1808 register_init_routine(&ansi_tcap_init_protocol);