Rewrote to use g_strlcpy and g_strlcat.
[obnox/wireshark/wip.git] / epan / dissectors / packet-ansi_tcap.c
1 /* Do not modify this file.                                                   */
2 /* It is created 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 . TCAP-Remote-Operations-Information-Objects.asn TCAPPackage.asn */
5
6 /* Input file: packet-ansi_tcap-template.c */
7
8 #line 1 "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>
13  *
14  * $Id$
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
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.
23  *
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.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
32  * References: T1.114
33  */
34
35 #ifdef HAVE_CONFIG_H
36 # include "config.h"
37 #endif
38
39 #include <glib.h>
40 #include <epan/packet.h>
41 #include <epan/prefs.h>
42 #include <epan/conversation.h>
43 #include <epan/oids.h>
44 #include <epan/emem.h>
45 #include <epan/asn1.h>
46 #include <epan/strutil.h>
47
48 #include <stdio.h>
49 #include <string.h>
50 #include "packet-ber.h"
51 #include "packet-tcap.h"
52 #include "packet-ansi_tcap.h"
53 #include "epan/tcap-persistentdata.h"
54
55 #define PNAME  "ANSI Transaction Capabilities Application Part"
56 #define PSNAME "ANSI_TCAP"
57 #define PFNAME "ansi_tcap"
58
59 /* Initialize the protocol and registered fields */
60 int proto_ansi_tcap = -1;
61
62 int hf_ansi_tcapsrt_SessionId=-1;
63 int hf_ansi_tcapsrt_Duplicate=-1;
64 int hf_ansi_tcapsrt_BeginSession=-1;
65 int hf_ansi_tcapsrt_EndSession=-1;
66 int hf_ansi_tcapsrt_SessionTime=-1;
67
68
69 /*--- Included file: packet-ansi_tcap-hf.c ---*/
70 #line 1 "packet-ansi_tcap-hf.c"
71 static int hf_ansi_tcap_national = -1;            /* T_national */
72 static int hf_ansi_tcap_private = -1;             /* T_private */
73 static int hf_ansi_tcap_national_01 = -1;         /* INTEGER_M128_127 */
74 static int hf_ansi_tcap_private_01 = -1;          /* INTEGER */
75 static int hf_ansi_tcap_unidirectional = -1;      /* T_unidirectional */
76 static int hf_ansi_tcap_queryWithPerm = -1;       /* T_queryWithPerm */
77 static int hf_ansi_tcap_queryWithoutPerm = -1;    /* T_queryWithoutPerm */
78 static int hf_ansi_tcap_response = -1;            /* T_response */
79 static int hf_ansi_tcap_conversationWithPerm = -1;  /* T_conversationWithPerm */
80 static int hf_ansi_tcap_conversationWithoutPerm = -1;  /* T_conversationWithoutPerm */
81 static int hf_ansi_tcap_abort = -1;               /* T_abort */
82 static int hf_ansi_tcap_identifier = -1;          /* TransactionID */
83 static int hf_ansi_tcap_dialoguePortion = -1;     /* DialoguePortion */
84 static int hf_ansi_tcap_componentPortion = -1;    /* ComponentSequence */
85 static int hf_ansi_tcap_dialogPortion = -1;       /* DialoguePortion */
86 static int hf_ansi_tcap_causeInformation = -1;    /* T_causeInformation */
87 static int hf_ansi_tcap_abortCause = -1;          /* P_Abort_cause */
88 static int hf_ansi_tcap_userInformation = -1;     /* UserAbortInformation */
89 static int hf_ansi_tcap_version = -1;             /* ProtocolVersion */
90 static int hf_ansi_tcap_applicationContext = -1;  /* T_applicationContext */
91 static int hf_ansi_tcap_integerApplicationId = -1;  /* IntegerApplicationContext */
92 static int hf_ansi_tcap_objectApplicationId = -1;  /* ObjectIDApplicationContext */
93 static int hf_ansi_tcap_userInformation_01 = -1;  /* UserInformation */
94 static int hf_ansi_tcap_securityContext = -1;     /* T_securityContext */
95 static int hf_ansi_tcap_integerSecurityId = -1;   /* INTEGER */
96 static int hf_ansi_tcap_objectSecurityId = -1;    /* OBJECT_IDENTIFIER */
97 static int hf_ansi_tcap_confidentiality = -1;     /* Confidentiality */
98 static int hf_ansi_tcap__untag_item = -1;         /* EXTERNAL */
99 static int hf_ansi_tcap_confidentialityId = -1;   /* T_confidentialityId */
100 static int hf_ansi_tcap_integerConfidentialityId = -1;  /* INTEGER */
101 static int hf_ansi_tcap_objectConfidentialityId = -1;  /* OBJECT_IDENTIFIER */
102 static int hf_ansi_tcap__untag_item_01 = -1;      /* ComponentPDU */
103 static int hf_ansi_tcap_invokeLast = -1;          /* Invoke */
104 static int hf_ansi_tcap_returnResultLast = -1;    /* ReturnResult */
105 static int hf_ansi_tcap_returnError = -1;         /* ReturnError */
106 static int hf_ansi_tcap_reject = -1;              /* Reject */
107 static int hf_ansi_tcap_invokeNotLast = -1;       /* Invoke */
108 static int hf_ansi_tcap_returnResultNotLast = -1;  /* ReturnResult */
109 static int hf_ansi_tcap_componentIDs = -1;        /* T_componentIDs */
110 static int hf_ansi_tcap_operationCode = -1;       /* OperationCode */
111 static int hf_ansi_tcap_parameter = -1;           /* T_parameter */
112 static int hf_ansi_tcap_componentID = -1;         /* T_componentID */
113 static int hf_ansi_tcap_parameter_01 = -1;        /* T_parameter_01 */
114 static int hf_ansi_tcap_componentID_01 = -1;      /* T_componentID_01 */
115 static int hf_ansi_tcap_errorCode = -1;           /* ErrorCode */
116 static int hf_ansi_tcap_parameter_02 = -1;        /* T_parameter_02 */
117 static int hf_ansi_tcap_componentID_02 = -1;      /* OCTET_STRING_SIZE_0_1 */
118 static int hf_ansi_tcap_rejectProblem = -1;       /* Problem */
119 static int hf_ansi_tcap_parameter_03 = -1;        /* T_parameter_03 */
120 static int hf_ansi_tcap_paramSequence = -1;       /* T_paramSequence */
121 static int hf_ansi_tcap_paramSet = -1;            /* T_paramSet */
122
123 /*--- End of included file: packet-ansi_tcap-hf.c ---*/
124 #line 61 "packet-ansi_tcap-template.c"
125
126 /* Initialize the subtree pointers */
127 static gint ett_tcap = -1;
128 static gint ett_param = -1;
129
130 static gint ett_otid = -1;
131 static gint ett_dtid = -1;
132 gint ett_ansi_tcap_stat = -1;
133
134 static struct tcapsrt_info_t * gp_tcapsrt_info;
135 static gboolean tcap_subdissector_used=FALSE;
136 static dissector_handle_t requested_subdissector_handle = NULL;
137
138 static struct tcaphash_context_t * gp_tcap_context=NULL;
139
140
141 /*--- Included file: packet-ansi_tcap-ett.c ---*/
142 #line 1 "packet-ansi_tcap-ett.c"
143 static gint ett_ansi_tcap_OperationCode = -1;
144 static gint ett_ansi_tcap_ErrorCode = -1;
145 static gint ett_ansi_tcap_PackageType = -1;
146 static gint ett_ansi_tcap_UniTransactionPDU = -1;
147 static gint ett_ansi_tcap_TransactionPDU = -1;
148 static gint ett_ansi_tcap_Abort = -1;
149 static gint ett_ansi_tcap_T_causeInformation = -1;
150 static gint ett_ansi_tcap_DialoguePortion_U = -1;
151 static gint ett_ansi_tcap_T_applicationContext = -1;
152 static gint ett_ansi_tcap_T_securityContext = -1;
153 static gint ett_ansi_tcap_UserInformation_U = -1;
154 static gint ett_ansi_tcap_Confidentiality = -1;
155 static gint ett_ansi_tcap_T_confidentialityId = -1;
156 static gint ett_ansi_tcap_SEQUENCE_OF_ComponentPDU = -1;
157 static gint ett_ansi_tcap_ComponentPDU = -1;
158 static gint ett_ansi_tcap_Invoke = -1;
159 static gint ett_ansi_tcap_ReturnResult = -1;
160 static gint ett_ansi_tcap_ReturnError = -1;
161 static gint ett_ansi_tcap_Reject = -1;
162 static gint ett_ansi_tcap_T_parameter_03 = -1;
163 static gint ett_ansi_tcap_T_paramSequence = -1;
164 static gint ett_ansi_tcap_T_paramSet = -1;
165
166 /*--- End of included file: packet-ansi_tcap-ett.c ---*/
167 #line 77 "packet-ansi_tcap-template.c"
168
169 #define MAX_SSN 254
170
171 gboolean g_ansi_tcap_HandleSRT=FALSE;
172 extern gboolean gtcap_PersistentSRT;
173 extern gboolean gtcap_DisplaySRT;
174 extern guint gtcap_RepetitionTimeout;
175 extern guint gtcap_LostTimeout;
176
177 /* static dissector_handle_t    tcap_handle = NULL; */
178 static dissector_table_t ber_oid_dissector_table=NULL;
179 static const char * cur_oid;
180 static const char * tcapext_oid;
181 static proto_tree * tcap_top_tree=NULL;
182 static proto_tree * tcap_stat_tree=NULL;
183 static proto_item * tcap_stat_item=NULL;
184
185 static dissector_handle_t data_handle;
186 static dissector_handle_t ansi_map_handle;
187
188
189 struct ansi_tcap_private_t ansi_tcap_private;
190 #define MAX_TID_STR_LEN 1024
191
192 static void ansi_tcap_ctx_init(struct ansi_tcap_private_t *a_tcap_ctx) {
193   memset(a_tcap_ctx, '\0', sizeof(*a_tcap_ctx));
194   a_tcap_ctx->signature = ANSI_TCAP_CTX_SIGNATURE;
195   a_tcap_ctx->oid_is_present = FALSE;
196   a_tcap_ctx->TransactionID_str = NULL;
197 }
198
199 static void dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
200 /*
201 static dissector_table_t sccp_ssn_table;
202
203 static GHashTable* ansi_sub_dissectors = NULL;
204 static GHashTable* itu_sub_dissectors = NULL;
205
206   extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
207     g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
208     dissector_add("sccp.ssn",ssn,tcap_handle);
209 }
210
211 extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) {
212     g_hash_table_remove(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
213     dissector_delete("sccp.ssn",ssn,tcap_handle);
214 }
215
216 dissector_handle_t get_ansi_tcap_subdissector(guint32 ssn) {
217     return g_hash_table_lookup(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
218 }
219 */
220
221 /* Transaction tracking */
222 /* Transaction table */
223 struct ansi_tcap_invokedata_t {
224     gint OperationCode;
225       /*
226          0 : national,
227          1 : private
228       */
229     gint32 OperationCode_private;
230     gint32 OperationCode_national;
231 };
232
233 static GHashTable *TransactionId_table=NULL;
234
235 static void
236 TransactionId_table_cleanup(gpointer key , gpointer value, gpointer user_data _U_){
237
238         struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata = value;
239         gchar *TransactionId_str = key;
240
241         if ( TransactionId_str ){
242                 g_free(TransactionId_str);
243         }
244         if (ansi_tcap_saved_invokedata){
245                 g_free(ansi_tcap_saved_invokedata);
246         }
247
248 }
249
250 void
251 ansi_tcap_init_transaction_table(void){
252
253         /* Destroy any existing memory chunks / hashes. */
254         if (TransactionId_table){
255                 g_hash_table_foreach(TransactionId_table, TransactionId_table_cleanup, NULL);
256                 g_hash_table_destroy(TransactionId_table);
257                 TransactionId_table = NULL;
258         }
259
260         TransactionId_table = g_hash_table_new(g_str_hash, g_str_equal);
261
262 }
263
264 static void
265 ansi_tcap_init_protocol(void)
266 {
267         ansi_tcap_init_transaction_table();
268 }
269
270 /* Store Invoke information needed for the corresponding reply */
271 static void
272 save_invoke_data(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){
273   struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata;
274   address* src = &(pinfo->src);
275   address* dst = &(pinfo->dst);
276   char *buf;
277
278   if ((!pinfo->fd->flags.visited)&&(ansi_tcap_private.TransactionID_str)){
279
280           /* Only do this once XXX I hope its the right thing to do */
281           /* The hash string needs to contain src and dest to distiguish differnt flows */
282           buf = ep_alloc(MAX_TID_STR_LEN);
283           buf[0] = '\0';
284           g_snprintf(buf, MAX_TID_STR_LEN, "%s%s%s",
285                 ansi_tcap_private.TransactionID_str, address_to_str(src),
286                 address_to_str(dst));
287
288           /* If the entry allready exists don't owervrite it */
289           ansi_tcap_saved_invokedata = g_hash_table_lookup(TransactionId_table,buf);
290           if(ansi_tcap_saved_invokedata)
291                   return;
292
293           ansi_tcap_saved_invokedata = g_malloc(sizeof(struct ansi_tcap_invokedata_t));
294           ansi_tcap_saved_invokedata->OperationCode = ansi_tcap_private.d.OperationCode;
295           ansi_tcap_saved_invokedata->OperationCode_national = ansi_tcap_private.d.OperationCode_national;
296           ansi_tcap_saved_invokedata->OperationCode_private = ansi_tcap_private.d.OperationCode_private;
297
298           g_hash_table_insert(TransactionId_table,
299                         g_strdup(buf),
300                         ansi_tcap_saved_invokedata);
301           /*
302           g_warning("Tcap Invoke Hash string %s",buf);
303           */
304   }
305 }
306
307 static gboolean
308 find_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){
309   struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata;
310   address* src = &(pinfo->src);
311   address* dst = &(pinfo->dst);
312   char *buf;
313
314   if (!ansi_tcap_private.TransactionID_str) {
315     return FALSE;
316   }
317
318   /* The hash string needs to contain src and dest to distiguish differnt flows */
319   buf = ep_alloc(MAX_TID_STR_LEN);
320   buf[0] = '\0';
321   /* Reverse order to invoke */
322   g_snprintf(buf, MAX_TID_STR_LEN, "%s%s%s",
323         ansi_tcap_private.TransactionID_str, address_to_str(dst),
324         address_to_str(src));
325
326   ansi_tcap_saved_invokedata = g_hash_table_lookup(TransactionId_table, buf);
327   if(ansi_tcap_saved_invokedata){
328           ansi_tcap_private.d.OperationCode                      = ansi_tcap_saved_invokedata->OperationCode;
329           ansi_tcap_private.d.OperationCode_national = ansi_tcap_saved_invokedata->OperationCode_national;
330           ansi_tcap_private.d.OperationCode_private  = ansi_tcap_saved_invokedata->OperationCode_private;
331           return TRUE;
332   }
333   return FALSE;
334 }
335
336 /* As currently ANSI MAP is the only possible sub dissector this function
337  *  must be improved to handle general cases.
338  *
339  *
340  *
341  * TODO:
342  * 1)Handle national codes
343  *     Design option
344  *     - Create a ansi.tcap.national dissector table and have dissectors for
345  *       national codes register there and let ansi tcap call them.
346  * 2)Handle Private codes properly
347  *     Design question
348  *     Unclear how to differentiate between different private "code sets".
349  *     Use SCCP SSN table as before? or a ansi.tcap.private dissector table?
350  *
351  */
352 static gboolean
353 find_tcap_subdissector(tvbuff_t *tvb, asn1_ctx_t *actx, proto_tree *tree){
354         proto_item *item;
355
356         /* If "DialoguePortion objectApplicationId ObjectIDApplicationContext
357          * points to the subdissector this code can be used.
358          *
359         if(ansi_tcap_private.d.oid_is_present){
360                 call_ber_oid_callback(ansi_tcap_private.objectApplicationId_oid, tvb, 0, actx-pinfo, tree);
361                 return TRUE;
362         }
363         */
364         if(ansi_tcap_private.d.pdu == 1){
365                 /* Save Invoke data for this transaction */
366                 save_invoke_data(actx->pinfo, tree, tvb);
367         }else{
368                 /* Get saved data for this transaction */
369                 if(find_saved_invokedata(actx->pinfo, tree, tvb)){
370                         if(ansi_tcap_private.d.OperationCode == 0){
371                                 /* national */
372                                 item = proto_tree_add_int(tree, hf_ansi_tcap_national, tvb, 0, 0, ansi_tcap_private.d.OperationCode_national);
373                         }else{
374                                 item = proto_tree_add_int(tree, hf_ansi_tcap_private, tvb, 0, 0, ansi_tcap_private.d.OperationCode_private);
375                         }
376                         PROTO_ITEM_SET_GENERATED(item);
377                         ansi_tcap_private.d.OperationCode_item = item;
378                 }
379         }
380         if(ansi_tcap_private.d.OperationCode == 0){
381                 /* national */
382                 item = proto_tree_add_text(tree, tvb, 0, -1,
383                         "Dissector for ANSI TCAP NATIONAL code:%u not implemented. Contact Wireshark developers if you want this supported",
384                         ansi_tcap_private.d.OperationCode_national);
385                 PROTO_ITEM_SET_GENERATED(item);
386                 return FALSE;
387         }else if(ansi_tcap_private.d.OperationCode == 1){
388                 /* private */
389                 if((ansi_tcap_private.d.OperationCode_private & 0x0900) != 0x0900){
390                         item = proto_tree_add_text(tree, tvb, 0, -1,
391                                 "Dissector for ANSI TCAP PRIVATE code:%u not implemented. Contact Wireshark developers if you want this supported",
392                                 ansi_tcap_private.d.OperationCode_private);
393                         PROTO_ITEM_SET_GENERATED(item);
394                         return FALSE;
395                 }
396         }
397         /* This is abit of a hack as it assumes the private codes with a "family" of 0x09 is ANSI MAP
398          * Se TODO above.
399          * N.S0005-0 v 1.0 TCAP Formats and Procedures 5-16 Application Services
400          * 6.3.2 Component Portion
401          * The Operation Code is partitioned into an Operation Family followed by a
402          * Specifier associated with each Operation Family member. For TIA/EIA-41 the
403          * Operation Family is coded as decimal 9. Bit H of the Operation Family is always
404          * coded as 0.
405          */
406         call_dissector(ansi_map_handle, tvb, actx->pinfo, tcap_top_tree);
407
408         return TRUE;
409 }
410
411
412 /*--- Included file: packet-ansi_tcap-fn.c ---*/
413 #line 1 "packet-ansi_tcap-fn.c"
414
415
416 static int
417 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_) {
418   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
419                                                 &ansi_tcap_private.d.OperationCode_national);
420
421   return offset;
422 }
423
424
425
426 static int
427 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_) {
428   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
429                                                 &ansi_tcap_private.d.OperationCode_private);
430
431   return offset;
432 }
433
434
435 static const value_string ansi_tcap_OperationCode_vals[] = {
436   {  16, "national" },
437   {  17, "private" },
438   { 0, NULL }
439 };
440
441 static const ber_choice_t OperationCode_choice[] = {
442   {  16, &hf_ansi_tcap_national  , BER_CLASS_PRI, 16, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_national },
443   {  17, &hf_ansi_tcap_private   , BER_CLASS_PRI, 17, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_private },
444   { 0, NULL, 0, 0, 0, NULL }
445 };
446
447 static int
448 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_) {
449   offset = dissect_ber_choice(actx, tree, tvb, offset,
450                                  OperationCode_choice, hf_index, ett_ansi_tcap_OperationCode,
451                                  &ansi_tcap_private.d.OperationCode);
452
453 #line 12 "ansi_tcap.cnf"
454   ansi_tcap_private.d.OperationCode_item = actx->created_item;
455
456   return offset;
457 }
458
459
460
461 static int
462 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_) {
463   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
464                                                 NULL);
465
466   return offset;
467 }
468
469
470
471 static int
472 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_) {
473   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
474                                                 NULL);
475
476   return offset;
477 }
478
479
480 static const value_string ansi_tcap_ErrorCode_vals[] = {
481   {  19, "national" },
482   {  20, "private" },
483   { 0, NULL }
484 };
485
486 static const ber_choice_t ErrorCode_choice[] = {
487   {  19, &hf_ansi_tcap_national_01, BER_CLASS_PRI, 19, 0, dissect_ansi_tcap_INTEGER_M128_127 },
488   {  20, &hf_ansi_tcap_private_01, BER_CLASS_PRI, 20, 0, dissect_ansi_tcap_INTEGER },
489   { 0, NULL, 0, 0, 0, NULL }
490 };
491
492 static int
493 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_) {
494   offset = dissect_ber_choice(actx, tree, tvb, offset,
495                                  ErrorCode_choice, hf_index, ett_ansi_tcap_ErrorCode,
496                                  NULL);
497
498   return offset;
499 }
500
501
502
503 static int
504 dissect_ansi_tcap_Priority(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
505   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
506                                                 NULL);
507
508   return offset;
509 }
510
511
512
513 static int
514 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_) {
515 #line 115 "ansi_tcap.cnf"
516
517 tvbuff_t *next_tvb;
518 guint8 len;
519
520   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
521                                        &next_tvb);
522
523
524 if(next_tvb) {
525         if(tvb_length(next_tvb) !=0)
526                 ansi_tcap_private.TransactionID_str = tvb_bytes_to_str(next_tvb, 0,tvb_length(next_tvb));
527         len = tvb_length_remaining(next_tvb, 0);
528         switch(len) {
529         case 1:
530                 gp_tcapsrt_info->src_tid=tvb_get_guint8(next_tvb, 0);
531                 break;
532         case 2:
533                 gp_tcapsrt_info->src_tid=tvb_get_ntohs(next_tvb, 0);
534                 break;
535         case 4:
536                 gp_tcapsrt_info->src_tid=tvb_get_ntohl(next_tvb, 0);
537                 break;
538         default:
539                 gp_tcapsrt_info->src_tid=0;
540                 break;
541         }
542 }
543
544
545
546   return offset;
547 }
548
549
550
551 static int
552 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_) {
553   offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
554                                       hf_index, BER_CLASS_PRI, 7, TRUE, dissect_ansi_tcap_TransactionID_U);
555
556   return offset;
557 }
558
559
560
561 static int
562 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_) {
563   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
564                                        NULL);
565
566   return offset;
567 }
568
569
570
571 static int
572 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_) {
573   offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
574                                       hf_index, BER_CLASS_PRI, 26, TRUE, dissect_ansi_tcap_OCTET_STRING_SIZE_1);
575
576   return offset;
577 }
578
579
580
581 static int
582 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_) {
583   offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
584                                       hf_index, BER_CLASS_PRI, 27, TRUE, dissect_ansi_tcap_INTEGER);
585
586   return offset;
587 }
588
589
590
591 static int
592 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_) {
593   offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
594
595   return offset;
596 }
597
598
599
600 static int
601 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_) {
602 #line 72 "ansi_tcap.cnf"
603
604  static const char * oid_str;
605
606    offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
607                                       hf_index, BER_CLASS_PRI, 28, TRUE, dissect_ansi_tcap_OBJECT_IDENTIFIER);
608
609         ansi_tcap_private.objectApplicationId_oid= (void*) oid_str;
610         ansi_tcap_private.oid_is_present=TRUE;
611
612
613
614   return offset;
615 }
616
617
618 static const value_string ansi_tcap_T_applicationContext_vals[] = {
619   {  27, "integerApplicationId" },
620   {  28, "objectApplicationId" },
621   { 0, NULL }
622 };
623
624 static const ber_choice_t T_applicationContext_choice[] = {
625   {  27, &hf_ansi_tcap_integerApplicationId, BER_CLASS_PRI, 27, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_IntegerApplicationContext },
626   {  28, &hf_ansi_tcap_objectApplicationId, BER_CLASS_PRI, 28, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ObjectIDApplicationContext },
627   { 0, NULL, 0, 0, 0, NULL }
628 };
629
630 static int
631 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_) {
632   offset = dissect_ber_choice(actx, tree, tvb, offset,
633                                  T_applicationContext_choice, hf_index, ett_ansi_tcap_T_applicationContext,
634                                  NULL);
635
636   return offset;
637 }
638
639
640
641 static int
642 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_) {
643   offset = dissect_ber_external_type(implicit_tag, tree, tvb, offset, actx, hf_index, NULL);
644
645   return offset;
646 }
647
648
649 static const ber_sequence_t UserInformation_U_sequence_of[1] = {
650   { &hf_ansi_tcap__untag_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_EXTERNAL },
651 };
652
653 static int
654 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_) {
655   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
656                                       UserInformation_U_sequence_of, hf_index, ett_ansi_tcap_UserInformation_U);
657
658   return offset;
659 }
660
661
662
663 static int
664 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_) {
665   offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
666                                       hf_index, BER_CLASS_PRI, 29, TRUE, dissect_ansi_tcap_UserInformation_U);
667
668   return offset;
669 }
670
671
672 static const value_string ansi_tcap_T_securityContext_vals[] = {
673   {   0, "integerSecurityId" },
674   {   1, "objectSecurityId" },
675   { 0, NULL }
676 };
677
678 static const ber_choice_t T_securityContext_choice[] = {
679   {   0, &hf_ansi_tcap_integerSecurityId, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER },
680   {   1, &hf_ansi_tcap_objectSecurityId, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OBJECT_IDENTIFIER },
681   { 0, NULL, 0, 0, 0, NULL }
682 };
683
684 static int
685 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_) {
686   offset = dissect_ber_choice(actx, tree, tvb, offset,
687                                  T_securityContext_choice, hf_index, ett_ansi_tcap_T_securityContext,
688                                  NULL);
689
690   return offset;
691 }
692
693
694 static const value_string ansi_tcap_T_confidentialityId_vals[] = {
695   {   0, "integerConfidentialityId" },
696   {   1, "objectConfidentialityId" },
697   { 0, NULL }
698 };
699
700 static const ber_choice_t T_confidentialityId_choice[] = {
701   {   0, &hf_ansi_tcap_integerConfidentialityId, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER },
702   {   1, &hf_ansi_tcap_objectConfidentialityId, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OBJECT_IDENTIFIER },
703   { 0, NULL, 0, 0, 0, NULL }
704 };
705
706 static int
707 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_) {
708   offset = dissect_ber_choice(actx, tree, tvb, offset,
709                                  T_confidentialityId_choice, hf_index, ett_ansi_tcap_T_confidentialityId,
710                                  NULL);
711
712   return offset;
713 }
714
715
716 static const ber_sequence_t Confidentiality_sequence[] = {
717   { &hf_ansi_tcap_confidentialityId, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_confidentialityId },
718   { NULL, 0, 0, 0, NULL }
719 };
720
721 static int
722 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_) {
723   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
724                                    Confidentiality_sequence, hf_index, ett_ansi_tcap_Confidentiality);
725
726   return offset;
727 }
728
729
730 static const ber_sequence_t DialoguePortion_U_sequence[] = {
731   { &hf_ansi_tcap_version   , BER_CLASS_PRI, 26, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ProtocolVersion },
732   { &hf_ansi_tcap_applicationContext, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_applicationContext },
733   { &hf_ansi_tcap_userInformation_01, BER_CLASS_PRI, 29, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_UserInformation },
734   { &hf_ansi_tcap_securityContext, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_securityContext },
735   { &hf_ansi_tcap_confidentiality, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Confidentiality },
736   { NULL, 0, 0, 0, NULL }
737 };
738
739 static int
740 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_) {
741   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
742                                    DialoguePortion_U_sequence, hf_index, ett_ansi_tcap_DialoguePortion_U);
743
744   return offset;
745 }
746
747
748
749 static int
750 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_) {
751   offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
752                                       hf_index, BER_CLASS_PRI, 25, TRUE, dissect_ansi_tcap_DialoguePortion_U);
753
754   return offset;
755 }
756
757
758
759 static int
760 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_) {
761   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
762                                        NULL);
763
764   return offset;
765 }
766
767
768
769 static int
770 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_) {
771 #line 20 "ansi_tcap.cnf"
772 tvbuff_t        *parameter_tvb;
773
774   offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index,
775                                        &parameter_tvb);
776   if(!parameter_tvb)
777     return offset;
778   
779   find_tcap_subdissector(parameter_tvb, actx, tree);
780
781
782
783   return offset;
784 }
785
786
787 static const ber_sequence_t Invoke_sequence[] = {
788   { &hf_ansi_tcap_componentIDs, BER_CLASS_PRI, 15, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentIDs },
789   { &hf_ansi_tcap_operationCode, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_OperationCode },
790   { &hf_ansi_tcap_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_parameter },
791   { NULL, 0, 0, 0, NULL }
792 };
793
794 static int
795 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_) {
796 #line 30 "ansi_tcap.cnf"
797   ansi_tcap_private.d.pdu = 1;
798
799
800
801   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
802                                    Invoke_sequence, hf_index, ett_ansi_tcap_Invoke);
803
804   return offset;
805 }
806
807
808
809 static int
810 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_) {
811   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
812                                        NULL);
813
814   return offset;
815 }
816
817
818
819 static int
820 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_) {
821 #line 38 "ansi_tcap.cnf"
822 tvbuff_t        *parameter_tvb;
823
824
825   offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index,
826                                        &parameter_tvb);
827   if(!parameter_tvb)
828     return offset;
829   
830   find_tcap_subdissector(parameter_tvb, actx, tree);
831
832
833
834   return offset;
835 }
836
837
838 static const ber_sequence_t ReturnResult_sequence[] = {
839   { &hf_ansi_tcap_componentID, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentID },
840   { &hf_ansi_tcap_parameter_01, BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_parameter_01 },
841   { NULL, 0, 0, 0, NULL }
842 };
843
844 static int
845 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_) {
846 #line 49 "ansi_tcap.cnf"
847   ansi_tcap_private.d.pdu = 2;
848
849
850
851
852   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
853                                    ReturnResult_sequence, hf_index, ett_ansi_tcap_ReturnResult);
854
855   return offset;
856 }
857
858
859
860 static int
861 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_) {
862   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
863                                        NULL);
864
865   return offset;
866 }
867
868
869
870 static int
871 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_) {
872 #line 58 "ansi_tcap.cnf"
873 tvbuff_t        *parameter_tvb;
874
875   offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index,
876                                        &parameter_tvb);
877   if(!parameter_tvb)
878     return offset;
879   
880   find_tcap_subdissector(parameter_tvb, actx, tree);
881
882
883
884   return offset;
885 }
886
887
888 static const ber_sequence_t ReturnError_sequence[] = {
889   { &hf_ansi_tcap_componentID_01, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentID_01 },
890   { &hf_ansi_tcap_errorCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_ErrorCode },
891   { &hf_ansi_tcap_parameter_02, BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_parameter_02 },
892   { NULL, 0, 0, 0, NULL }
893 };
894
895 static int
896 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_) {
897 #line 68 "ansi_tcap.cnf"
898   ansi_tcap_private.d.pdu = 3;
899
900
901   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
902                                    ReturnError_sequence, hf_index, ett_ansi_tcap_ReturnError);
903
904   return offset;
905 }
906
907
908
909 static int
910 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_) {
911   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
912                                        NULL);
913
914   return offset;
915 }
916
917
918 static const value_string ansi_tcap_Problem_vals[] = {
919   { 257, "general-unrecognisedComponentType" },
920   { 258, "general-incorrectComponentPortion" },
921   { 259, "general-badlyStructuredCompPortion" },
922   { 260, "general-incorrectComponentCoding" },
923   { 513, "invoke-duplicateInvocation" },
924   { 514, "invoke-unrecognisedOperation" },
925   { 515, "invoke-incorrectParameter" },
926   { 516, "invoke-unrecognisedCorrelationID" },
927   { 769, "returnResult-unrecognisedCorrelationID" },
928   { 770, "returnResult-unexpectedReturnResult" },
929   { 771, "returnResult-incorrectParameter" },
930   { 1025, "returnError-unrecognisedCorrelationID" },
931   { 1026, "returnError-unexpectedReturnError" },
932   { 1027, "returnError-unrecognisedError" },
933   { 1028, "returnError-unexpectedError" },
934   { 1029, "returnError-incorrectParameter" },
935   { 1281, "transaction-unrecognizedPackageType" },
936   { 1282, "transaction-incorrectTransPortion" },
937   { 1283, "transaction-badlyStructuredTransPortion" },
938   { 1284, "transaction-unassignedRespondingTransID" },
939   { 1285, "transaction-permissionToReleaseProblem" },
940   { 1286, "transaction-resourceUnavailable" },
941   { 0, NULL }
942 };
943
944
945 static int
946 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_) {
947   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
948                                                 NULL);
949
950   return offset;
951 }
952
953
954 static const ber_sequence_t T_paramSequence_sequence[] = {
955   { NULL, 0, 0, 0, NULL }
956 };
957
958 static int
959 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_) {
960   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
961                                    T_paramSequence_sequence, hf_index, ett_ansi_tcap_T_paramSequence);
962
963   return offset;
964 }
965
966
967 static const ber_sequence_t T_paramSet_set[] = {
968   { NULL, 0, 0, 0, NULL }
969 };
970
971 static int
972 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_) {
973   offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset,
974                               T_paramSet_set, hf_index, ett_ansi_tcap_T_paramSet);
975
976   return offset;
977 }
978
979
980 static const value_string ansi_tcap_T_parameter_03_vals[] = {
981   {  16, "paramSequence" },
982   {  18, "paramSet" },
983   { 0, NULL }
984 };
985
986 static const ber_choice_t T_parameter_03_choice[] = {
987   {  16, &hf_ansi_tcap_paramSequence, BER_CLASS_PRI, 16, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_paramSequence },
988   {  18, &hf_ansi_tcap_paramSet  , BER_CLASS_PRI, 18, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_paramSet },
989   { 0, NULL, 0, 0, 0, NULL }
990 };
991
992 static int
993 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_) {
994   offset = dissect_ber_choice(actx, tree, tvb, offset,
995                                  T_parameter_03_choice, hf_index, ett_ansi_tcap_T_parameter_03,
996                                  NULL);
997
998   return offset;
999 }
1000
1001
1002 static const ber_sequence_t Reject_sequence[] = {
1003   { &hf_ansi_tcap_componentID_02, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OCTET_STRING_SIZE_0_1 },
1004   { &hf_ansi_tcap_rejectProblem, BER_CLASS_PRI, 21, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Problem },
1005   { &hf_ansi_tcap_parameter_03, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_parameter_03 },
1006   { NULL, 0, 0, 0, NULL }
1007 };
1008
1009 static int
1010 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_) {
1011   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1012                                    Reject_sequence, hf_index, ett_ansi_tcap_Reject);
1013
1014   return offset;
1015 }
1016
1017
1018 static const value_string ansi_tcap_ComponentPDU_vals[] = {
1019   {   9, "invokeLast" },
1020   {  10, "returnResultLast" },
1021   {  11, "returnError" },
1022   {  12, "reject" },
1023   {  13, "invokeNotLast" },
1024   {  14, "returnResultNotLast" },
1025   { 0, NULL }
1026 };
1027
1028 static const ber_choice_t ComponentPDU_choice[] = {
1029   {   9, &hf_ansi_tcap_invokeLast, BER_CLASS_PRI, 9, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Invoke },
1030   {  10, &hf_ansi_tcap_returnResultLast, BER_CLASS_PRI, 10, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnResult },
1031   {  11, &hf_ansi_tcap_returnError, BER_CLASS_PRI, 11, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnError },
1032   {  12, &hf_ansi_tcap_reject    , BER_CLASS_PRI, 12, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Reject },
1033   {  13, &hf_ansi_tcap_invokeNotLast, BER_CLASS_PRI, 13, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Invoke },
1034   {  14, &hf_ansi_tcap_returnResultNotLast, BER_CLASS_PRI, 14, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnResult },
1035   { 0, NULL, 0, 0, 0, NULL }
1036 };
1037
1038 static int
1039 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_) {
1040   offset = dissect_ber_choice(actx, tree, tvb, offset,
1041                                  ComponentPDU_choice, hf_index, ett_ansi_tcap_ComponentPDU,
1042                                  NULL);
1043
1044   return offset;
1045 }
1046
1047
1048 static const ber_sequence_t SEQUENCE_OF_ComponentPDU_sequence_of[1] = {
1049   { &hf_ansi_tcap__untag_item_01, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_ComponentPDU },
1050 };
1051
1052 static int
1053 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_) {
1054   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1055                                       SEQUENCE_OF_ComponentPDU_sequence_of, hf_index, ett_ansi_tcap_SEQUENCE_OF_ComponentPDU);
1056
1057   return offset;
1058 }
1059
1060
1061
1062 static int
1063 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_) {
1064   offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1065                                       hf_index, BER_CLASS_PRI, 8, TRUE, dissect_ansi_tcap_SEQUENCE_OF_ComponentPDU);
1066
1067   return offset;
1068 }
1069
1070
1071 static const ber_sequence_t UniTransactionPDU_sequence[] = {
1072   { &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
1073   { &hf_ansi_tcap_dialoguePortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
1074   { &hf_ansi_tcap_componentPortion, BER_CLASS_PRI, 8, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ComponentSequence },
1075   { NULL, 0, 0, 0, NULL }
1076 };
1077
1078 static int
1079 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_) {
1080   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1081                                    UniTransactionPDU_sequence, hf_index, ett_ansi_tcap_UniTransactionPDU);
1082
1083   return offset;
1084 }
1085
1086
1087
1088 static int
1089 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_) {
1090 #line 80 "ansi_tcap.cnf"
1091 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1092 if (check_col(actx->pinfo->cinfo, COL_INFO))
1093                 col_add_str(actx->pinfo->cinfo, COL_INFO, "unidirectional ");
1094
1095
1096   offset = dissect_ansi_tcap_UniTransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1097
1098   return offset;
1099 }
1100
1101
1102 static const ber_sequence_t TransactionPDU_sequence[] = {
1103   { &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
1104   { &hf_ansi_tcap_dialoguePortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
1105   { &hf_ansi_tcap_componentPortion, BER_CLASS_PRI, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ComponentSequence },
1106   { NULL, 0, 0, 0, NULL }
1107 };
1108
1109 static int
1110 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_) {
1111   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1112                                    TransactionPDU_sequence, hf_index, ett_ansi_tcap_TransactionPDU);
1113
1114   return offset;
1115 }
1116
1117
1118
1119 static int
1120 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_) {
1121 #line 85 "ansi_tcap.cnf"
1122 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1123 if (check_col(actx->pinfo->cinfo, COL_INFO))
1124                 col_add_str(actx->pinfo->cinfo, COL_INFO, "queryWithPerm ");
1125
1126
1127   offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1128
1129   return offset;
1130 }
1131
1132
1133
1134 static int
1135 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_) {
1136 #line 90 "ansi_tcap.cnf"
1137 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1138 if (check_col(actx->pinfo->cinfo, COL_INFO))
1139                 col_add_str(actx->pinfo->cinfo, COL_INFO, "queryWithoutPerm ");
1140
1141
1142   offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1143
1144   return offset;
1145 }
1146
1147
1148
1149 static int
1150 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_) {
1151 #line 95 "ansi_tcap.cnf"
1152 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1153 if (check_col(actx->pinfo->cinfo, COL_INFO))
1154                 col_add_str(actx->pinfo->cinfo, COL_INFO, "response ");
1155
1156
1157   offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1158
1159   return offset;
1160 }
1161
1162
1163
1164 static int
1165 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_) {
1166 #line 100 "ansi_tcap.cnf"
1167 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1168 if (check_col(actx->pinfo->cinfo, COL_INFO))
1169                 col_add_str(actx->pinfo->cinfo, COL_INFO, "conversationWithPerm ");
1170
1171
1172   offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1173
1174   return offset;
1175 }
1176
1177
1178
1179 static int
1180 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_) {
1181 #line 105 "ansi_tcap.cnf"
1182 gp_tcapsrt_info->ope=TC_ANSI_ALL;
1183 if (check_col(actx->pinfo->cinfo, COL_INFO))
1184                 col_add_str(actx->pinfo->cinfo, COL_INFO, "conversationWithoutPerm ");
1185
1186
1187   offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1188
1189   return offset;
1190 }
1191
1192
1193 static const value_string ansi_tcap_P_Abort_cause_U_vals[] = {
1194   {   1, "unrecognizedPackageType" },
1195   {   2, "incorrectTransactionPortion" },
1196   {   3, "badlyStructuredTransactionPortion" },
1197   {   4, "unassignedRespondingTransactionID" },
1198   {   5, "permissionToReleaseProblem" },
1199   {   6, "resourceUnavailable" },
1200   {   7, "unrecognizedDialoguePortionID" },
1201   {   8, "badlyStructuredDialoguePortion" },
1202   {   9, "missingDialoguePortion" },
1203   {  10, "inconsistentDialoguePortion" },
1204   { 0, NULL }
1205 };
1206
1207
1208 static int
1209 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_) {
1210   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1211                                                 NULL);
1212
1213   return offset;
1214 }
1215
1216
1217
1218 static int
1219 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_) {
1220   offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1221                                       hf_index, BER_CLASS_PRI, 23, TRUE, dissect_ansi_tcap_P_Abort_cause_U);
1222
1223   return offset;
1224 }
1225
1226
1227
1228 static int
1229 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_) {
1230   offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1231                                       hf_index, BER_CLASS_PRI, 24, FALSE, dissect_ansi_tcap_EXTERNAL);
1232
1233   return offset;
1234 }
1235
1236
1237 static const value_string ansi_tcap_T_causeInformation_vals[] = {
1238   {  23, "abortCause" },
1239   {  24, "userInformation" },
1240   { 0, NULL }
1241 };
1242
1243 static const ber_choice_t T_causeInformation_choice[] = {
1244   {  23, &hf_ansi_tcap_abortCause, BER_CLASS_PRI, 23, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_P_Abort_cause },
1245   {  24, &hf_ansi_tcap_userInformation, BER_CLASS_PRI, 24, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_UserAbortInformation },
1246   { 0, NULL, 0, 0, 0, NULL }
1247 };
1248
1249 static int
1250 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_) {
1251   offset = dissect_ber_choice(actx, tree, tvb, offset,
1252                                  T_causeInformation_choice, hf_index, ett_ansi_tcap_T_causeInformation,
1253                                  NULL);
1254
1255   return offset;
1256 }
1257
1258
1259 static const ber_sequence_t Abort_sequence[] = {
1260   { &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
1261   { &hf_ansi_tcap_dialogPortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
1262   { &hf_ansi_tcap_causeInformation, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_causeInformation },
1263   { NULL, 0, 0, 0, NULL }
1264 };
1265
1266 static int
1267 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_) {
1268   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1269                                    Abort_sequence, hf_index, ett_ansi_tcap_Abort);
1270
1271   return offset;
1272 }
1273
1274
1275
1276 static int
1277 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_) {
1278 #line 110 "ansi_tcap.cnf"
1279 gp_tcapsrt_info->ope=TC_ANSI_ABORT;
1280 if (check_col(actx->pinfo->cinfo, COL_INFO))
1281                 col_add_str(actx->pinfo->cinfo, COL_INFO, "Abort ");
1282
1283
1284   offset = dissect_ansi_tcap_Abort(implicit_tag, tvb, offset, actx, tree, hf_index);
1285
1286   return offset;
1287 }
1288
1289
1290 static const value_string ansi_tcap_PackageType_vals[] = {
1291   {   1, "unidirectional" },
1292   {   2, "queryWithPerm" },
1293   {   3, "queryWithoutPerm" },
1294   {   4, "response" },
1295   {   5, "conversationWithPerm" },
1296   {   6, "conversationWithoutPerm" },
1297   {  22, "abort" },
1298   { 0, NULL }
1299 };
1300
1301 static const ber_choice_t PackageType_choice[] = {
1302   {   1, &hf_ansi_tcap_unidirectional, BER_CLASS_PRI, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_unidirectional },
1303   {   2, &hf_ansi_tcap_queryWithPerm, BER_CLASS_PRI, 2, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_queryWithPerm },
1304   {   3, &hf_ansi_tcap_queryWithoutPerm, BER_CLASS_PRI, 3, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_queryWithoutPerm },
1305   {   4, &hf_ansi_tcap_response  , BER_CLASS_PRI, 4, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_response },
1306   {   5, &hf_ansi_tcap_conversationWithPerm, BER_CLASS_PRI, 5, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_conversationWithPerm },
1307   {   6, &hf_ansi_tcap_conversationWithoutPerm, BER_CLASS_PRI, 6, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_conversationWithoutPerm },
1308   {  22, &hf_ansi_tcap_abort     , BER_CLASS_PRI, 22, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_abort },
1309   { 0, NULL, 0, 0, 0, NULL }
1310 };
1311
1312 static int
1313 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_) {
1314   offset = dissect_ber_choice(actx, tree, tvb, offset,
1315                                  PackageType_choice, hf_index, ett_ansi_tcap_PackageType,
1316                                  NULL);
1317
1318   return offset;
1319 }
1320
1321
1322 /*--- End of included file: packet-ansi_tcap-fn.c ---*/
1323 #line 321 "packet-ansi_tcap-template.c"
1324
1325
1326
1327
1328 static void
1329 dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
1330 {
1331     proto_item          *item=NULL;
1332     proto_tree          *tree=NULL;
1333 #if 0
1334     proto_item          *stat_item=NULL;
1335     proto_tree          *stat_tree=NULL;
1336         gint                    offset = 0;
1337     struct tcaphash_context_t * p_tcap_context;
1338     dissector_handle_t subdissector_handle;
1339 #endif
1340         asn1_ctx_t asn1_ctx;
1341
1342         asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1343         ansi_tcap_ctx_init(&ansi_tcap_private);
1344
1345     tcap_top_tree = parent_tree;
1346     if (check_col(pinfo->cinfo, COL_PROTOCOL))
1347     {
1348                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI TCAP");
1349     }
1350
1351     /* create display subtree for the protocol */
1352     if(parent_tree){
1353       item = proto_tree_add_item(parent_tree, proto_ansi_tcap, tvb, 0, -1, FALSE);
1354       tree = proto_item_add_subtree(item, ett_tcap);
1355       tcap_stat_item=item;
1356       tcap_stat_tree=tree;
1357     }
1358     cur_oid = NULL;
1359     tcapext_oid = NULL;
1360
1361     pinfo->private_data = &ansi_tcap_private;
1362     gp_tcapsrt_info=tcapsrt_razinfo();
1363     tcap_subdissector_used=FALSE;
1364     gp_tcap_context=NULL;
1365     dissect_ansi_tcap_PackageType(FALSE, tvb, 0, &asn1_ctx, tree, -1);
1366
1367 #if 0 /* Skipp this part for now it will be rewritten */
1368
1369     if (g_ansi_tcap_HandleSRT && !tcap_subdissector_used ) {
1370                 if (gtcap_DisplaySRT && tree) {
1371                         stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat");
1372                         PROTO_ITEM_SET_GENERATED(stat_item);
1373                         stat_tree = proto_item_add_subtree(stat_item, ett_ansi_tcap_stat);
1374                 }
1375                 p_tcap_context=tcapsrt_call_matching(tvb, pinfo, stat_tree, gp_tcapsrt_info);
1376                 ansi_tcap_private.context=p_tcap_context;
1377
1378                 /* If the current message is TCAP only,
1379                  * save the Application contexte name for the next messages
1380                  */
1381                 if ( p_tcap_context && cur_oid && !p_tcap_context->oid_present ) {
1382                         /* Save the application context and the sub dissector */
1383                         ber_oid_dissector_table = find_dissector_table("ber.oid");
1384                         g_strlcpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
1385                         if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
1386                                 p_tcap_context->subdissector_handle=subdissector_handle;
1387                                 p_tcap_context->oid_present=TRUE;
1388                         }
1389                 }
1390                 if (g_ansi_tcap_HandleSRT && p_tcap_context && p_tcap_context->callback) {
1391                         /* Callback fonction for the upper layer */
1392                         (p_tcap_context->callback)(tvb, pinfo, stat_tree, p_tcap_context);
1393                 }
1394         }
1395 #endif
1396 }
1397
1398
1399 void
1400 proto_reg_handoff_ansi_tcap(void)
1401 {
1402
1403         data_handle = find_dissector("data");
1404         ansi_map_handle = find_dissector("ansi_map");
1405         ber_oid_dissector_table = find_dissector_table("ber.oid");
1406 }
1407
1408
1409
1410 void
1411 proto_register_ansi_tcap(void)
1412 {
1413
1414 /* Setup list of header fields  See Section 1.6.1 for details*/
1415     static hf_register_info hf[] = {
1416         /* Tcap Service Response Time */
1417         { &hf_ansi_tcapsrt_SessionId,
1418           { "Session Id",
1419             "ansi_tcap.srt.session_id",
1420             FT_UINT32, BASE_DEC, NULL, 0x0,
1421             "", HFILL }
1422         },
1423         { &hf_ansi_tcapsrt_BeginSession,
1424           { "Begin Session",
1425             "ansi_tcap.srt.begin",
1426             FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1427             "SRT Begin of Session", HFILL }
1428         },
1429         { &hf_ansi_tcapsrt_EndSession,
1430           { "End Session",
1431             "ansi_tcap.srt.end",
1432             FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1433             "SRT End of Session", HFILL }
1434         },
1435         { &hf_ansi_tcapsrt_SessionTime,
1436           { "Session duration",
1437             "ansi_tcap.srt.sessiontime",
1438             FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
1439             "Duration of the TCAP session", HFILL }
1440         },
1441         { &hf_ansi_tcapsrt_Duplicate,
1442           { "Request Duplicate",
1443             "ansi_tcap.srt.duplicate",
1444             FT_UINT32, BASE_DEC, NULL, 0x0,
1445             "", HFILL }
1446         },
1447
1448 /*--- Included file: packet-ansi_tcap-hfarr.c ---*/
1449 #line 1 "packet-ansi_tcap-hfarr.c"
1450     { &hf_ansi_tcap_national,
1451       { "national", "ansi_tcap.national",
1452         FT_INT32, BASE_DEC, NULL, 0,
1453         "ansi_tcap.T_national", HFILL }},
1454     { &hf_ansi_tcap_private,
1455       { "private", "ansi_tcap.private",
1456         FT_INT32, BASE_DEC, NULL, 0,
1457         "ansi_tcap.T_private", HFILL }},
1458     { &hf_ansi_tcap_national_01,
1459       { "national", "ansi_tcap.national",
1460         FT_INT32, BASE_DEC, NULL, 0,
1461         "ansi_tcap.INTEGER_M128_127", HFILL }},
1462     { &hf_ansi_tcap_private_01,
1463       { "private", "ansi_tcap.private",
1464         FT_INT32, BASE_DEC, NULL, 0,
1465         "ansi_tcap.INTEGER", HFILL }},
1466     { &hf_ansi_tcap_unidirectional,
1467       { "unidirectional", "ansi_tcap.unidirectional",
1468         FT_NONE, BASE_NONE, NULL, 0,
1469         "ansi_tcap.T_unidirectional", HFILL }},
1470     { &hf_ansi_tcap_queryWithPerm,
1471       { "queryWithPerm", "ansi_tcap.queryWithPerm",
1472         FT_NONE, BASE_NONE, NULL, 0,
1473         "ansi_tcap.T_queryWithPerm", HFILL }},
1474     { &hf_ansi_tcap_queryWithoutPerm,
1475       { "queryWithoutPerm", "ansi_tcap.queryWithoutPerm",
1476         FT_NONE, BASE_NONE, NULL, 0,
1477         "ansi_tcap.T_queryWithoutPerm", HFILL }},
1478     { &hf_ansi_tcap_response,
1479       { "response", "ansi_tcap.response",
1480         FT_NONE, BASE_NONE, NULL, 0,
1481         "ansi_tcap.T_response", HFILL }},
1482     { &hf_ansi_tcap_conversationWithPerm,
1483       { "conversationWithPerm", "ansi_tcap.conversationWithPerm",
1484         FT_NONE, BASE_NONE, NULL, 0,
1485         "ansi_tcap.T_conversationWithPerm", HFILL }},
1486     { &hf_ansi_tcap_conversationWithoutPerm,
1487       { "conversationWithoutPerm", "ansi_tcap.conversationWithoutPerm",
1488         FT_NONE, BASE_NONE, NULL, 0,
1489         "ansi_tcap.T_conversationWithoutPerm", HFILL }},
1490     { &hf_ansi_tcap_abort,
1491       { "abort", "ansi_tcap.abort",
1492         FT_NONE, BASE_NONE, NULL, 0,
1493         "ansi_tcap.T_abort", HFILL }},
1494     { &hf_ansi_tcap_identifier,
1495       { "identifier", "ansi_tcap.identifier",
1496         FT_BYTES, BASE_HEX, NULL, 0,
1497         "ansi_tcap.TransactionID", HFILL }},
1498     { &hf_ansi_tcap_dialoguePortion,
1499       { "dialoguePortion", "ansi_tcap.dialoguePortion",
1500         FT_NONE, BASE_NONE, NULL, 0,
1501         "ansi_tcap.DialoguePortion", HFILL }},
1502     { &hf_ansi_tcap_componentPortion,
1503       { "componentPortion", "ansi_tcap.componentPortion",
1504         FT_UINT32, BASE_DEC, NULL, 0,
1505         "ansi_tcap.ComponentSequence", HFILL }},
1506     { &hf_ansi_tcap_dialogPortion,
1507       { "dialogPortion", "ansi_tcap.dialogPortion",
1508         FT_NONE, BASE_NONE, NULL, 0,
1509         "ansi_tcap.DialoguePortion", HFILL }},
1510     { &hf_ansi_tcap_causeInformation,
1511       { "causeInformation", "ansi_tcap.causeInformation",
1512         FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_causeInformation_vals), 0,
1513         "ansi_tcap.T_causeInformation", HFILL }},
1514     { &hf_ansi_tcap_abortCause,
1515       { "abortCause", "ansi_tcap.abortCause",
1516         FT_INT32, BASE_DEC, VALS(ansi_tcap_P_Abort_cause_U_vals), 0,
1517         "ansi_tcap.P_Abort_cause", HFILL }},
1518     { &hf_ansi_tcap_userInformation,
1519       { "userInformation", "ansi_tcap.userInformation",
1520         FT_NONE, BASE_NONE, NULL, 0,
1521         "ansi_tcap.UserAbortInformation", HFILL }},
1522     { &hf_ansi_tcap_version,
1523       { "version", "ansi_tcap.version",
1524         FT_BYTES, BASE_HEX, NULL, 0,
1525         "ansi_tcap.ProtocolVersion", HFILL }},
1526     { &hf_ansi_tcap_applicationContext,
1527       { "applicationContext", "ansi_tcap.applicationContext",
1528         FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_applicationContext_vals), 0,
1529         "ansi_tcap.T_applicationContext", HFILL }},
1530     { &hf_ansi_tcap_integerApplicationId,
1531       { "integerApplicationId", "ansi_tcap.integerApplicationId",
1532         FT_INT32, BASE_DEC, NULL, 0,
1533         "ansi_tcap.IntegerApplicationContext", HFILL }},
1534     { &hf_ansi_tcap_objectApplicationId,
1535       { "objectApplicationId", "ansi_tcap.objectApplicationId",
1536         FT_OID, BASE_NONE, NULL, 0,
1537         "ansi_tcap.ObjectIDApplicationContext", HFILL }},
1538     { &hf_ansi_tcap_userInformation_01,
1539       { "userInformation", "ansi_tcap.userInformation",
1540         FT_UINT32, BASE_DEC, NULL, 0,
1541         "ansi_tcap.UserInformation", HFILL }},
1542     { &hf_ansi_tcap_securityContext,
1543       { "securityContext", "ansi_tcap.securityContext",
1544         FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_securityContext_vals), 0,
1545         "ansi_tcap.T_securityContext", HFILL }},
1546     { &hf_ansi_tcap_integerSecurityId,
1547       { "integerSecurityId", "ansi_tcap.integerSecurityId",
1548         FT_INT32, BASE_DEC, NULL, 0,
1549         "ansi_tcap.INTEGER", HFILL }},
1550     { &hf_ansi_tcap_objectSecurityId,
1551       { "objectSecurityId", "ansi_tcap.objectSecurityId",
1552         FT_OID, BASE_NONE, NULL, 0,
1553         "ansi_tcap.OBJECT_IDENTIFIER", HFILL }},
1554     { &hf_ansi_tcap_confidentiality,
1555       { "confidentiality", "ansi_tcap.confidentiality",
1556         FT_NONE, BASE_NONE, NULL, 0,
1557         "ansi_tcap.Confidentiality", HFILL }},
1558     { &hf_ansi_tcap__untag_item,
1559       { "Item", "ansi_tcap._untag_item",
1560         FT_NONE, BASE_NONE, NULL, 0,
1561         "ansi_tcap.EXTERNAL", HFILL }},
1562     { &hf_ansi_tcap_confidentialityId,
1563       { "confidentialityId", "ansi_tcap.confidentialityId",
1564         FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_confidentialityId_vals), 0,
1565         "ansi_tcap.T_confidentialityId", HFILL }},
1566     { &hf_ansi_tcap_integerConfidentialityId,
1567       { "integerConfidentialityId", "ansi_tcap.integerConfidentialityId",
1568         FT_INT32, BASE_DEC, NULL, 0,
1569         "ansi_tcap.INTEGER", HFILL }},
1570     { &hf_ansi_tcap_objectConfidentialityId,
1571       { "objectConfidentialityId", "ansi_tcap.objectConfidentialityId",
1572         FT_OID, BASE_NONE, NULL, 0,
1573         "ansi_tcap.OBJECT_IDENTIFIER", HFILL }},
1574     { &hf_ansi_tcap__untag_item_01,
1575       { "Item", "ansi_tcap._untag_item",
1576         FT_UINT32, BASE_DEC, VALS(ansi_tcap_ComponentPDU_vals), 0,
1577         "ansi_tcap.ComponentPDU", HFILL }},
1578     { &hf_ansi_tcap_invokeLast,
1579       { "invokeLast", "ansi_tcap.invokeLast",
1580         FT_NONE, BASE_NONE, NULL, 0,
1581         "ansi_tcap.Invoke", HFILL }},
1582     { &hf_ansi_tcap_returnResultLast,
1583       { "returnResultLast", "ansi_tcap.returnResultLast",
1584         FT_NONE, BASE_NONE, NULL, 0,
1585         "ansi_tcap.ReturnResult", HFILL }},
1586     { &hf_ansi_tcap_returnError,
1587       { "returnError", "ansi_tcap.returnError",
1588         FT_NONE, BASE_NONE, NULL, 0,
1589         "ansi_tcap.ReturnError", HFILL }},
1590     { &hf_ansi_tcap_reject,
1591       { "reject", "ansi_tcap.reject",
1592         FT_NONE, BASE_NONE, NULL, 0,
1593         "ansi_tcap.Reject", HFILL }},
1594     { &hf_ansi_tcap_invokeNotLast,
1595       { "invokeNotLast", "ansi_tcap.invokeNotLast",
1596         FT_NONE, BASE_NONE, NULL, 0,
1597         "ansi_tcap.Invoke", HFILL }},
1598     { &hf_ansi_tcap_returnResultNotLast,
1599       { "returnResultNotLast", "ansi_tcap.returnResultNotLast",
1600         FT_NONE, BASE_NONE, NULL, 0,
1601         "ansi_tcap.ReturnResult", HFILL }},
1602     { &hf_ansi_tcap_componentIDs,
1603       { "componentIDs", "ansi_tcap.componentIDs",
1604         FT_BYTES, BASE_HEX, NULL, 0,
1605         "ansi_tcap.T_componentIDs", HFILL }},
1606     { &hf_ansi_tcap_operationCode,
1607       { "operationCode", "ansi_tcap.operationCode",
1608         FT_UINT32, BASE_DEC, VALS(ansi_tcap_OperationCode_vals), 0,
1609         "ansi_tcap.OperationCode", HFILL }},
1610     { &hf_ansi_tcap_parameter,
1611       { "parameter", "ansi_tcap.parameter",
1612         FT_BYTES, BASE_HEX, NULL, 0,
1613         "ansi_tcap.T_parameter", HFILL }},
1614     { &hf_ansi_tcap_componentID,
1615       { "componentID", "ansi_tcap.componentID",
1616         FT_BYTES, BASE_HEX, NULL, 0,
1617         "ansi_tcap.T_componentID", HFILL }},
1618     { &hf_ansi_tcap_parameter_01,
1619       { "parameter", "ansi_tcap.parameter",
1620         FT_BYTES, BASE_HEX, NULL, 0,
1621         "ansi_tcap.T_parameter_01", HFILL }},
1622     { &hf_ansi_tcap_componentID_01,
1623       { "componentID", "ansi_tcap.componentID",
1624         FT_BYTES, BASE_HEX, NULL, 0,
1625         "ansi_tcap.T_componentID_01", HFILL }},
1626     { &hf_ansi_tcap_errorCode,
1627       { "errorCode", "ansi_tcap.errorCode",
1628         FT_UINT32, BASE_DEC, VALS(ansi_tcap_ErrorCode_vals), 0,
1629         "ansi_tcap.ErrorCode", HFILL }},
1630     { &hf_ansi_tcap_parameter_02,
1631       { "parameter", "ansi_tcap.parameter",
1632         FT_BYTES, BASE_HEX, NULL, 0,
1633         "ansi_tcap.T_parameter_02", HFILL }},
1634     { &hf_ansi_tcap_componentID_02,
1635       { "componentID", "ansi_tcap.componentID",
1636         FT_BYTES, BASE_HEX, NULL, 0,
1637         "ansi_tcap.OCTET_STRING_SIZE_0_1", HFILL }},
1638     { &hf_ansi_tcap_rejectProblem,
1639       { "rejectProblem", "ansi_tcap.rejectProblem",
1640         FT_INT32, BASE_DEC, VALS(ansi_tcap_Problem_vals), 0,
1641         "ansi_tcap.Problem", HFILL }},
1642     { &hf_ansi_tcap_parameter_03,
1643       { "parameter", "ansi_tcap.parameter",
1644         FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_parameter_03_vals), 0,
1645         "ansi_tcap.T_parameter_03", HFILL }},
1646     { &hf_ansi_tcap_paramSequence,
1647       { "paramSequence", "ansi_tcap.paramSequence",
1648         FT_NONE, BASE_NONE, NULL, 0,
1649         "ansi_tcap.T_paramSequence", HFILL }},
1650     { &hf_ansi_tcap_paramSet,
1651       { "paramSet", "ansi_tcap.paramSet",
1652         FT_NONE, BASE_NONE, NULL, 0,
1653         "ansi_tcap.T_paramSet", HFILL }},
1654
1655 /*--- End of included file: packet-ansi_tcap-hfarr.c ---*/
1656 #line 445 "packet-ansi_tcap-template.c"
1657     };
1658
1659 /* Setup protocol subtree array */
1660     static gint *ett[] = {
1661         &ett_tcap,
1662         &ett_param,
1663         &ett_otid,
1664         &ett_dtid,
1665         &ett_ansi_tcap_stat,
1666
1667 /*--- Included file: packet-ansi_tcap-ettarr.c ---*/
1668 #line 1 "packet-ansi_tcap-ettarr.c"
1669     &ett_ansi_tcap_OperationCode,
1670     &ett_ansi_tcap_ErrorCode,
1671     &ett_ansi_tcap_PackageType,
1672     &ett_ansi_tcap_UniTransactionPDU,
1673     &ett_ansi_tcap_TransactionPDU,
1674     &ett_ansi_tcap_Abort,
1675     &ett_ansi_tcap_T_causeInformation,
1676     &ett_ansi_tcap_DialoguePortion_U,
1677     &ett_ansi_tcap_T_applicationContext,
1678     &ett_ansi_tcap_T_securityContext,
1679     &ett_ansi_tcap_UserInformation_U,
1680     &ett_ansi_tcap_Confidentiality,
1681     &ett_ansi_tcap_T_confidentialityId,
1682     &ett_ansi_tcap_SEQUENCE_OF_ComponentPDU,
1683     &ett_ansi_tcap_ComponentPDU,
1684     &ett_ansi_tcap_Invoke,
1685     &ett_ansi_tcap_ReturnResult,
1686     &ett_ansi_tcap_ReturnError,
1687     &ett_ansi_tcap_Reject,
1688     &ett_ansi_tcap_T_parameter_03,
1689     &ett_ansi_tcap_T_paramSequence,
1690     &ett_ansi_tcap_T_paramSet,
1691
1692 /*--- End of included file: packet-ansi_tcap-ettarr.c ---*/
1693 #line 455 "packet-ansi_tcap-template.c"
1694     };
1695
1696     /*static enum_val_t tcap_options[] = {
1697         { "itu", "ITU",  ITU_TCAP_STANDARD },
1698         { "ansi", "ANSI", ANSI_TCAP_STANDARD },
1699         { NULL, NULL, 0 }
1700     };*/
1701
1702
1703 /* Register the protocol name and description */
1704     proto_ansi_tcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
1705         register_dissector("ansi_tcap", dissect_ansi_tcap, proto_ansi_tcap);
1706
1707 /* Required function calls to register the header fields and subtrees used */
1708     proto_register_field_array(proto_ansi_tcap, hf, array_length(hf));
1709     proto_register_subtree_array(ett, array_length(ett));
1710
1711
1712         register_init_routine(&ansi_tcap_init_protocol);
1713 }
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726