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