remove // comments
[metze/wireshark/wip.git] / epan / dissectors / packet-tcap.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
3 /* ./packet-tcap.c                                                            */
4 /* ../../tools/asn2eth.py -X -b -e -p tcap -c tcap.cnf -s packet-tcap-template tcap.asn */
5
6 /* Input file: packet-tcap-template.c */
7
8 #line 1 "packet-tcap-template.c"
9 /* packet-tcap-template.c
10  * Routines for  TCAP
11  * Copyright 2004 - 2005, Tim Endean <endeant@hotmail.com>
12  * Built from the gsm-map dissector Copyright 2004 - 2005, Anders Broman <anders.broman@ericsson.com>
13  *
14  * $Id$
15  * Ethereal - Network traffic analyzer
16  * By Gerald Combs <gerald@ethereal.com>
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: ETSI 300 374
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
44 #include <stdio.h>
45 #include <string.h>
46 #include "packet-ber.h"
47 #include "packet-tcap.h"
48
49 #define PNAME  "Transaction Capabilities Application Part"
50 #define PSNAME "TCAP"
51 #define PFNAME "tcap"
52
53 /* Initialize the protocol and registered fields */
54 int proto_tcap = -1;
55 static int hf_tcap_tag = -1; 
56 static int hf_tcap_length = -1; 
57 static int hf_tcap_data = -1;
58 static int hf_tcap_tid = -1;
59
60
61 /*--- Included file: packet-tcap-hf.c ---*/
62 #line 1 "packet-tcap-hf.c"
63 static int hf_tcap_dialogueRequest = -1;          /* AARQ_apdu */
64 static int hf_tcap_dialogueResponse = -1;         /* AARE_apdu */
65 static int hf_tcap_dialogueAbort = -1;            /* ABRT_apdu */
66 static int hf_tcap_oid = -1;                      /* OBJECT_IDENTIFIER */
67 static int hf_tcap_dialog = -1;                   /* Dialog1 */
68 static int hf_tcap_useroid = -1;                  /* UserInfoOID */
69 static int hf_tcap_externuserinfo = -1;           /* ExternUserInfo */
70 static int hf_tcap_protocol_versionrq = -1;       /* T_protocol_versionrq */
71 static int hf_tcap_application_context_name = -1;  /* Applicationcontext */
72 static int hf_tcap_user_information = -1;         /* User_information */
73 static int hf_tcap_protocol_versionre = -1;       /* T_protocol_versionre */
74 static int hf_tcap_result = -1;                   /* Associate_result */
75 static int hf_tcap_result_source_diagnostic = -1;  /* Associate_source_diagnostic */
76 static int hf_tcap_reasonrq = -1;                 /* Release_request_reason */
77 static int hf_tcap_reasonre = -1;                 /* Release_response_reason */
78 static int hf_tcap_abort_source = -1;             /* ABRT_source */
79 static int hf_tcap_dialogue_service_user = -1;    /* T_dialogue_service_user */
80 static int hf_tcap_dialogue_service_provider = -1;  /* T_dialogue_service_provider */
81 static int hf_tcap_unidialoguePDU = -1;           /* AUDT_apdu */
82 static int hf_tcap_protocol_version3 = -1;        /* T_protocol_version3 */
83 static int hf_tcap_unidirectional = -1;           /* Unidirectional */
84 static int hf_tcap_begin = -1;                    /* Begin */
85 static int hf_tcap_end = -1;                      /* End */
86 static int hf_tcap_continue = -1;                 /* Continue */
87 static int hf_tcap_abort = -1;                    /* Abort */
88 static int hf_tcap_ansiunidirectional = -1;       /* UniTransactionPDU */
89 static int hf_tcap_ansiqueryWithPerm = -1;        /* TransactionPDU */
90 static int hf_tcap_ansiqueryWithoutPerm = -1;     /* TransactionPDU */
91 static int hf_tcap_ansiresponse = -1;             /* TransactionPDU */
92 static int hf_tcap_ansiconversationWithPerm = -1;  /* TransactionPDU */
93 static int hf_tcap_ansiconversationWithoutPerm = -1;  /* TransactionPDU */
94 static int hf_tcap_ansiabort = -1;                /* AbortPDU */
95 static int hf_tcap_dialoguePortion = -1;          /* DialoguePortion */
96 static int hf_tcap_components = -1;               /* ComponentPortion */
97 static int hf_tcap_otid = -1;                     /* OrigTransactionID */
98 static int hf_tcap_dtid = -1;                     /* DestTransactionID */
99 static int hf_tcap_reason = -1;                   /* Reason */
100 static int hf_tcap_p_abortCause = -1;             /* P_AbortCause */
101 static int hf_tcap_u_abortCause = -1;             /* DialoguePortion */
102 static int hf_tcap_ComponentPortion_item = -1;    /* Component */
103 static int hf_tcap_invoke = -1;                   /* Invoke */
104 static int hf_tcap_returnResultLast = -1;         /* ReturnResult */
105 static int hf_tcap_returnError = -1;              /* ReturnError */
106 static int hf_tcap_reject = -1;                   /* Reject */
107 static int hf_tcap_returnResultNotLast = -1;      /* ReturnResult */
108 static int hf_tcap_invokeID = -1;                 /* InvokeIdType */
109 static int hf_tcap_linkedID = -1;                 /* InvokeIdType */
110 static int hf_tcap_opCode = -1;                   /* OPERATION */
111 static int hf_tcap_parameter = -1;                /* Parameter */
112 static int hf_tcap_resultretres = -1;             /* T_resultretres */
113 static int hf_tcap_errorCode = -1;                /* ErrorCode */
114 static int hf_tcap_invokeIDRej = -1;              /* T_invokeIDRej */
115 static int hf_tcap_derivable = -1;                /* InvokeIdType */
116 static int hf_tcap_not_derivable = -1;            /* NULL */
117 static int hf_tcap_problem = -1;                  /* T_problem */
118 static int hf_tcap_generalProblem = -1;           /* GeneralProblem */
119 static int hf_tcap_invokeProblem = -1;            /* InvokeProblem */
120 static int hf_tcap_returnResultProblem = -1;      /* ReturnResultProblem */
121 static int hf_tcap_returnErrorProblem = -1;       /* ReturnErrorProblem */
122 static int hf_tcap_localValue = -1;               /* INTEGER */
123 static int hf_tcap_globalValue = -1;              /* OBJECT_IDENTIFIER */
124 static int hf_tcap_identifier = -1;               /* TransactionID */
125 static int hf_tcap_dialoguePortionansi = -1;      /* DialoguePortionANSI */
126 static int hf_tcap_componentPortion = -1;         /* ComponentSequence */
127 static int hf_tcap_causeInformation = -1;         /* T_causeInformation */
128 static int hf_tcap_abortCause = -1;               /* P_Abort_cause */
129 static int hf_tcap_userInformation = -1;          /* UserInformation */
130 static int hf_tcap_version = -1;                  /* ProtocolVersion */
131 static int hf_tcap_applicationContext = -1;       /* T_applicationContext */
132 static int hf_tcap_integerApplicationId = -1;     /* IntegerApplicationContext */
133 static int hf_tcap_objectApplicationId = -1;      /* ObjectIDApplicationContext */
134 static int hf_tcap_securityContext = -1;          /* T_securityContext */
135 static int hf_tcap_integerSecurityId = -1;        /* INTEGER */
136 static int hf_tcap_objectSecurityId = -1;         /* OBJECT_IDENTIFIER */
137 static int hf_tcap_confidentiality = -1;          /* Confidentiality */
138 static int hf_tcap_confidentialityId = -1;        /* T_confidentialityId */
139 static int hf_tcap_integerConfidentialityId = -1;  /* INTEGER */
140 static int hf_tcap_objectConfidentialityId = -1;  /* OBJECT_IDENTIFIER */
141 static int hf_tcap_ComponentSequence_item = -1;   /* ComponentPDU */
142 static int hf_tcap_invokeLastansi = -1;           /* InvokePDU */
143 static int hf_tcap_returnResultLastansi = -1;     /* ReturnResultPDU */
144 static int hf_tcap_returnErroransi = -1;          /* ReturnErrorPDU */
145 static int hf_tcap_rejectansi = -1;               /* RejectPDU */
146 static int hf_tcap_invokeNotLastansi = -1;        /* InvokePDU */
147 static int hf_tcap_returnResultNotLastansi = -1;  /* ReturnResultPDU */
148 static int hf_tcap_componentIDs = -1;             /* OCTET_STRING_SIZE_0_2 */
149 static int hf_tcap_operationCode = -1;            /* OperationCode */
150 static int hf_tcap_parameterinv = -1;             /* ANSIparamch */
151 static int hf_tcap_ansiparams = -1;               /* ANSIParameters */
152 static int hf_tcap_ansiparams1 = -1;              /* ANSIParameters */
153 static int hf_tcap_ansiparams2 = -1;              /* ANSIParameters */
154 static int hf_tcap_ansiparams3 = -1;              /* ANSIParameters */
155 static int hf_tcap_ansiparams4 = -1;              /* ANSIParameters */
156 static int hf_tcap_ansiparams5 = -1;              /* ANSIParameters */
157 static int hf_tcap_ansiparams6 = -1;              /* ANSIParameters */
158 static int hf_tcap_ansiparams7 = -1;              /* ANSIParameters */
159 static int hf_tcap_ansiparams8 = -1;              /* ANSIParameters */
160 static int hf_tcap_ansiparams9 = -1;              /* ANSIParameters */
161 static int hf_tcap_ansiparams10 = -1;             /* ANSIParameters */
162 static int hf_tcap_ansiparams11 = -1;             /* ANSIParameters */
163 static int hf_tcap_ansiparams12 = -1;             /* ANSIParameters */
164 static int hf_tcap_ansiparams13 = -1;             /* ANSIParameters */
165 static int hf_tcap_ansiparams14 = -1;             /* ANSIParameters */
166 static int hf_tcap_ansiparams15 = -1;             /* ANSIParameters */
167 static int hf_tcap_ansiparams16 = -1;             /* ANSIParameters */
168 static int hf_tcap_ansiparams17 = -1;             /* ANSIParameters */
169 static int hf_tcap_ansiparams18 = -1;             /* ANSIParameters */
170 static int hf_tcap_ansiparams19 = -1;             /* ANSIParameters */
171 static int hf_tcap_ansiparams20 = -1;             /* ANSIParameters */
172 static int hf_tcap_ansiparams21 = -1;             /* ANSIParameters */
173 static int hf_tcap_componentID = -1;              /* ComponentID */
174 static int hf_tcap_parameterrr = -1;              /* ANSIparamch */
175 static int hf_tcap_parameterre = -1;              /* ANSIparamch */
176 static int hf_tcap_rejectProblem = -1;            /* ProblemPDU */
177 static int hf_tcap_parameterrj = -1;              /* ANSIparamch */
178 static int hf_tcap_national = -1;                 /* INTEGER_M32768_32767 */
179 static int hf_tcap_private = -1;                  /* INTEGER */
180 static int hf_tcap_nationaler = -1;               /* INTEGER_M32768_32767 */
181 static int hf_tcap_privateer = -1;                /* INTEGER */
182 /* named bits */
183 static int hf_tcap_T_protocol_versionrq_version1 = -1;
184 static int hf_tcap_T_protocol_versionre_version1 = -1;
185 static int hf_tcap_T_protocol_version3_version1 = -1;
186
187 /*--- End of included file: packet-tcap-hf.c ---*/
188 #line 53 "packet-tcap-template.c"
189
190 /* Initialize the subtree pointers */
191 static gint ett_tcap = -1;
192 static gint ett_param = -1;
193
194 static gint ett_otid = -1;
195 static gint ett_dtid = -1;
196
197
198
199 /*--- Included file: packet-tcap-ett.c ---*/
200 #line 1 "packet-tcap-ett.c"
201 static gint ett_tcap_DialoguePDU = -1;
202 static gint ett_tcap_ExternalPDU = -1;
203 static gint ett_tcap_UserInformation = -1;
204 static gint ett_tcap_AARQ_apdu = -1;
205 static gint ett_tcap_T_protocol_versionrq = -1;
206 static gint ett_tcap_AARE_apdu = -1;
207 static gint ett_tcap_T_protocol_versionre = -1;
208 static gint ett_tcap_RLRQ_apdu = -1;
209 static gint ett_tcap_RLRE_apdu = -1;
210 static gint ett_tcap_ABRT_apdu = -1;
211 static gint ett_tcap_Associate_source_diagnostic = -1;
212 static gint ett_tcap_UniDialoguePDU = -1;
213 static gint ett_tcap_AUDT_apdu = -1;
214 static gint ett_tcap_T_protocol_version3 = -1;
215 static gint ett_tcap_MessageType = -1;
216 static gint ett_tcap_Unidirectional = -1;
217 static gint ett_tcap_Begin = -1;
218 static gint ett_tcap_End = -1;
219 static gint ett_tcap_Continue = -1;
220 static gint ett_tcap_Abort = -1;
221 static gint ett_tcap_Reason = -1;
222 static gint ett_tcap_ComponentPortion = -1;
223 static gint ett_tcap_Component = -1;
224 static gint ett_tcap_Invoke = -1;
225 static gint ett_tcap_ReturnResult = -1;
226 static gint ett_tcap_T_resultretres = -1;
227 static gint ett_tcap_ReturnError = -1;
228 static gint ett_tcap_Reject = -1;
229 static gint ett_tcap_T_invokeIDRej = -1;
230 static gint ett_tcap_T_problem = -1;
231 static gint ett_tcap_OPERATION = -1;
232 static gint ett_tcap_ERROR = -1;
233 static gint ett_tcap_UniTransactionPDU = -1;
234 static gint ett_tcap_TransactionPDU = -1;
235 static gint ett_tcap_AbortPDU = -1;
236 static gint ett_tcap_T_causeInformation = -1;
237 static gint ett_tcap_DialoguePortionANSI = -1;
238 static gint ett_tcap_T_applicationContext = -1;
239 static gint ett_tcap_T_securityContext = -1;
240 static gint ett_tcap_Confidentiality = -1;
241 static gint ett_tcap_T_confidentialityId = -1;
242 static gint ett_tcap_ComponentSequence = -1;
243 static gint ett_tcap_ComponentPDU = -1;
244 static gint ett_tcap_InvokePDU = -1;
245 static gint ett_tcap_ANSIparamch = -1;
246 static gint ett_tcap_ReturnResultPDU = -1;
247 static gint ett_tcap_ReturnErrorPDU = -1;
248 static gint ett_tcap_RejectPDU = -1;
249 static gint ett_tcap_OperationCode = -1;
250 static gint ett_tcap_ErrorCode = -1;
251
252 /*--- End of included file: packet-tcap-ett.c ---*/
253 #line 63 "packet-tcap-template.c"
254
255 #define MAX_SSN 254
256 static range_t *global_ssn_range;
257 static range_t *ssn_range;
258
259 dissector_handle_t      tcap_handle = NULL;
260 static dissector_table_t ber_oid_dissector_table=NULL;
261 static const char * cur_oid;
262 static const char * tcapext_oid;
263 static proto_tree       *tcap_top_tree=NULL;
264 static dissector_handle_t data_handle;
265
266 static dissector_table_t sccp_ssn_table;
267 static int dissect_tcap_param(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset);
268 static int dissect_tcap_UserInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_);
269
270
271 static GHashTable* ansi_sub_dissectors = NULL;
272 static GHashTable* itu_sub_dissectors = NULL;
273
274 static void dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
275
276 extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
277     g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
278     dissector_add("sccp.ssn",ssn,tcap_handle);
279 }
280
281 extern void add_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
282     g_hash_table_insert(itu_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
283     dissector_add("sccp.ssn",ssn,tcap_handle);
284 }
285
286 extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) {
287     g_hash_table_remove(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
288     dissector_delete("sccp.ssn",ssn,tcap_handle);
289 }
290 extern void delete_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) {
291     g_hash_table_remove(itu_sub_dissectors,GUINT_TO_POINTER(ssn));
292         dissector_delete("sccp.ssn", ssn,tcap_handle);
293 }
294
295 static dissector_handle_t get_ansi_tcap_subdissector(guint32 ssn) {
296     return g_hash_table_lookup(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
297 }
298
299 static dissector_handle_t get_itu_tcap_subdissector(guint32 ssn) {
300     return g_hash_table_lookup(itu_sub_dissectors,GUINT_TO_POINTER(ssn));
301 }
302
303
304
305
306 /*--- Included file: packet-tcap-fn.c ---*/
307 #line 1 "packet-tcap-fn.c"
308 /*--- Fields for imported types ---*/
309
310
311
312 static const asn_namedbit T_protocol_versionrq_bits[] = {
313   {  0, &hf_tcap_T_protocol_versionrq_version1, -1, -1, "version1", NULL },
314   { 0, NULL, 0, 0, NULL, NULL }
315 };
316
317 static int
318 dissect_tcap_T_protocol_versionrq(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
319   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
320                                     T_protocol_versionrq_bits, hf_index, ett_tcap_T_protocol_versionrq,
321                                     NULL);
322
323   return offset;
324 }
325 static int dissect_protocol_versionrq_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
326   return dissect_tcap_T_protocol_versionrq(TRUE, tvb, offset, pinfo, tree, hf_tcap_protocol_versionrq);
327 }
328
329
330
331 static int
332 dissect_tcap_Applicationcontext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
333 #line 142 "tcap.cnf"
334   offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &cur_oid);
335
336         pinfo->private_data = (void*)cur_oid;
337
338
339
340   return offset;
341 }
342 static int dissect_application_context_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
343   return dissect_tcap_Applicationcontext(FALSE, tvb, offset, pinfo, tree, hf_tcap_application_context_name);
344 }
345
346
347
348 static int
349 dissect_tcap_User_information(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
350 #line 77 "tcap.cnf"
351 tvbuff_t        *next_tvb;
352 gint8 class;
353         gboolean pc;
354         gint tag;
355         guint32 len;
356         gint ind_field;
357
358
359 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
360 offset = get_ber_length(tree, tvb, offset, &len, &ind_field);
361 next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field));           
362 if (!next_tvb)
363         return offset+len; 
364 dissect_tcap_UserInformation(TRUE, next_tvb, 0, pinfo, tree, -1);
365  
366  
367 return offset+len;
368
369
370   return offset;
371 }
372 static int dissect_user_information_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
373   return dissect_tcap_User_information(TRUE, tvb, offset, pinfo, tree, hf_tcap_user_information);
374 }
375
376
377 static const ber_sequence_t AARQ_apdu_sequence[] = {
378   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_protocol_versionrq_impl },
379   { BER_CLASS_CON, 1, 0, dissect_application_context_name },
380   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_information_impl },
381   { 0, 0, 0, NULL }
382 };
383
384 static int
385 dissect_tcap_AARQ_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
386   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
387                                    AARQ_apdu_sequence, hf_index, ett_tcap_AARQ_apdu);
388
389   return offset;
390 }
391 static int dissect_dialogueRequest(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
392   return dissect_tcap_AARQ_apdu(FALSE, tvb, offset, pinfo, tree, hf_tcap_dialogueRequest);
393 }
394
395
396 static const asn_namedbit T_protocol_versionre_bits[] = {
397   {  0, &hf_tcap_T_protocol_versionre_version1, -1, -1, "version1", NULL },
398   { 0, NULL, 0, 0, NULL, NULL }
399 };
400
401 static int
402 dissect_tcap_T_protocol_versionre(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
403   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
404                                     T_protocol_versionre_bits, hf_index, ett_tcap_T_protocol_versionre,
405                                     NULL);
406
407   return offset;
408 }
409 static int dissect_protocol_versionre_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
410   return dissect_tcap_T_protocol_versionre(TRUE, tvb, offset, pinfo, tree, hf_tcap_protocol_versionre);
411 }
412
413
414 static const value_string tcap_Associate_result_vals[] = {
415   {   0, "accepted" },
416   {   1, "reject-permanent" },
417   { 0, NULL }
418 };
419
420
421 static int
422 dissect_tcap_Associate_result(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
423   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
424                                   NULL);
425
426   return offset;
427 }
428 static int dissect_result(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
429   return dissect_tcap_Associate_result(FALSE, tvb, offset, pinfo, tree, hf_tcap_result);
430 }
431
432
433 static const value_string tcap_T_dialogue_service_user_vals[] = {
434   {   0, "null" },
435   {   1, "no-reason-given" },
436   {   2, "application-context-name-not-supported" },
437   { 0, NULL }
438 };
439
440
441 static int
442 dissect_tcap_T_dialogue_service_user(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
443   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
444                                   NULL);
445
446   return offset;
447 }
448 static int dissect_dialogue_service_user(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
449   return dissect_tcap_T_dialogue_service_user(FALSE, tvb, offset, pinfo, tree, hf_tcap_dialogue_service_user);
450 }
451
452
453 static const value_string tcap_T_dialogue_service_provider_vals[] = {
454   {   0, "null" },
455   {   1, "no-reason-given" },
456   {   2, "no-common-dialogue-portion" },
457   { 0, NULL }
458 };
459
460
461 static int
462 dissect_tcap_T_dialogue_service_provider(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
463   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
464                                   NULL);
465
466   return offset;
467 }
468 static int dissect_dialogue_service_provider(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
469   return dissect_tcap_T_dialogue_service_provider(FALSE, tvb, offset, pinfo, tree, hf_tcap_dialogue_service_provider);
470 }
471
472
473 static const value_string tcap_Associate_source_diagnostic_vals[] = {
474   {   1, "dialogue-service-user" },
475   {   2, "dialogue-service-provider" },
476   { 0, NULL }
477 };
478
479 static const ber_choice_t Associate_source_diagnostic_choice[] = {
480   {   1, BER_CLASS_CON, 1, 0, dissect_dialogue_service_user },
481   {   2, BER_CLASS_CON, 2, 0, dissect_dialogue_service_provider },
482   { 0, 0, 0, 0, NULL }
483 };
484
485 static int
486 dissect_tcap_Associate_source_diagnostic(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
487   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
488                                  Associate_source_diagnostic_choice, hf_index, ett_tcap_Associate_source_diagnostic,
489                                  NULL);
490
491   return offset;
492 }
493 static int dissect_result_source_diagnostic(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
494   return dissect_tcap_Associate_source_diagnostic(FALSE, tvb, offset, pinfo, tree, hf_tcap_result_source_diagnostic);
495 }
496
497
498 static const ber_sequence_t AARE_apdu_sequence[] = {
499   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_protocol_versionre_impl },
500   { BER_CLASS_CON, 1, 0, dissect_application_context_name },
501   { BER_CLASS_CON, 2, 0, dissect_result },
502   { BER_CLASS_CON, 3, BER_FLAGS_NOTCHKTAG, dissect_result_source_diagnostic },
503   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_information_impl },
504   { 0, 0, 0, NULL }
505 };
506
507 static int
508 dissect_tcap_AARE_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
509   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
510                                    AARE_apdu_sequence, hf_index, ett_tcap_AARE_apdu);
511
512   return offset;
513 }
514 static int dissect_dialogueResponse(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
515   return dissect_tcap_AARE_apdu(FALSE, tvb, offset, pinfo, tree, hf_tcap_dialogueResponse);
516 }
517
518
519 static const value_string tcap_ABRT_source_vals[] = {
520   {   0, "dialogue-service-user" },
521   {   1, "dialogue-service-provider" },
522   { 0, NULL }
523 };
524
525
526 static int
527 dissect_tcap_ABRT_source(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
528   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
529                                   NULL);
530
531   return offset;
532 }
533 static int dissect_abort_source_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
534   return dissect_tcap_ABRT_source(TRUE, tvb, offset, pinfo, tree, hf_tcap_abort_source);
535 }
536
537
538 static const ber_sequence_t ABRT_apdu_sequence[] = {
539   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_abort_source_impl },
540   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_information_impl },
541   { 0, 0, 0, NULL }
542 };
543
544 static int
545 dissect_tcap_ABRT_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
546   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
547                                    ABRT_apdu_sequence, hf_index, ett_tcap_ABRT_apdu);
548
549   return offset;
550 }
551 static int dissect_dialogueAbort(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
552   return dissect_tcap_ABRT_apdu(FALSE, tvb, offset, pinfo, tree, hf_tcap_dialogueAbort);
553 }
554
555
556 static const value_string tcap_DialoguePDU_vals[] = {
557   {   0, "dialogueRequest" },
558   {   1, "dialogueResponse" },
559   {   4, "dialogueAbort" },
560   { 0, NULL }
561 };
562
563 static const ber_choice_t DialoguePDU_choice[] = {
564   {   0, BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_dialogueRequest },
565   {   1, BER_CLASS_APP, 1, BER_FLAGS_NOOWNTAG, dissect_dialogueResponse },
566   {   4, BER_CLASS_APP, 4, BER_FLAGS_NOOWNTAG, dissect_dialogueAbort },
567   { 0, 0, 0, 0, NULL }
568 };
569
570 static int
571 dissect_tcap_DialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
572   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
573                                  DialoguePDU_choice, hf_index, ett_tcap_DialoguePDU,
574                                  NULL);
575
576   return offset;
577 }
578
579
580
581 static int
582 dissect_tcap_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
583   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
584
585   return offset;
586 }
587 static int dissect_oid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
588   return dissect_tcap_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_tcap_oid);
589 }
590 static int dissect_globalValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
591   return dissect_tcap_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_tcap_globalValue);
592 }
593 static int dissect_objectSecurityId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
594   return dissect_tcap_OBJECT_IDENTIFIER(TRUE, tvb, offset, pinfo, tree, hf_tcap_objectSecurityId);
595 }
596 static int dissect_objectConfidentialityId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
597   return dissect_tcap_OBJECT_IDENTIFIER(TRUE, tvb, offset, pinfo, tree, hf_tcap_objectConfidentialityId);
598 }
599
600
601
602 static int
603 dissect_tcap_Dialog1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
604 #line 43 "tcap.cnf"
605 gint8 class;
606         gboolean pc;
607         gint tag;
608         guint32 len;
609         gint ind_field;
610         
611
612 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
613 offset = get_ber_length(tree, tvb, offset, &len, &ind_field);
614  dissect_tcap_DialoguePDU(TRUE, tvb, 0, pinfo, tree, -1);
615
616 return offset+len;
617
618
619
620   return offset;
621 }
622 static int dissect_dialog_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
623   return dissect_tcap_Dialog1(TRUE, tvb, offset, pinfo, tree, hf_tcap_dialog);
624 }
625
626
627 static const ber_sequence_t ExternalPDU_sequence[] = {
628   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_oid },
629   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_dialog_impl },
630   { 0, 0, 0, NULL }
631 };
632
633 static int
634 dissect_tcap_ExternalPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
635   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
636                                    ExternalPDU_sequence, hf_index, ett_tcap_ExternalPDU);
637
638   return offset;
639 }
640
641
642
643 static int
644 dissect_tcap_UserInfoOID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
645 #line 146 "tcap.cnf"
646   offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &tcapext_oid);
647
648         pinfo->private_data = (void*)tcapext_oid;
649
650
651
652   return offset;
653 }
654 static int dissect_useroid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
655   return dissect_tcap_UserInfoOID(FALSE, tvb, offset, pinfo, tree, hf_tcap_useroid);
656 }
657
658
659
660 static int
661 dissect_tcap_ExternUserInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
662 #line 150 "tcap.cnf"
663 tvbuff_t        *next_tvb;
664 gint8 class;
665         gboolean pc;
666         gint tag;
667         guint32 len, start_offset;
668         gint ind_field;
669 /* 
670  * ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it.
671  */
672 ber_oid_dissector_table = find_dissector_table("ber.oid");
673 start_offset = offset;
674 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
675 offset = get_ber_length(tree, tvb, offset, &len, &ind_field);
676 /* Use the recived length, XXX What if it was indefenet? length is good now */
677 next_tvb = tvb_new_subset(tvb, start_offset, len +(offset - start_offset), len+(offset - start_offset));                
678 if (!next_tvb)
679         return offset+len;
680 if (ber_oid_dissector_table && tcapext_oid){
681 if(!dissector_try_string(ber_oid_dissector_table, tcapext_oid, next_tvb, pinfo, tcap_top_tree)) 
682         {
683         }
684         }
685 dissect_tcap_param(pinfo,tree,next_tvb,0);
686         offset+=len;
687
688
689
690
691   return offset;
692 }
693 static int dissect_externuserinfo_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
694   return dissect_tcap_ExternUserInfo(TRUE, tvb, offset, pinfo, tree, hf_tcap_externuserinfo);
695 }
696
697
698 static const ber_sequence_t UserInformation_sequence[] = {
699   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_useroid },
700   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_externuserinfo_impl },
701   { 0, 0, 0, NULL }
702 };
703
704 static int
705 dissect_tcap_UserInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
706   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
707                                    UserInformation_sequence, hf_index, ett_tcap_UserInformation);
708
709   return offset;
710 }
711 static int dissect_userInformation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
712   return dissect_tcap_UserInformation(FALSE, tvb, offset, pinfo, tree, hf_tcap_userInformation);
713 }
714
715
716 static const value_string tcap_Release_request_reason_vals[] = {
717   {   0, "normal" },
718   {   1, "urgent" },
719   {  30, "user-defined" },
720   { 0, NULL }
721 };
722
723
724 static int
725 dissect_tcap_Release_request_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
726   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
727                                   NULL);
728
729   return offset;
730 }
731 static int dissect_reasonrq_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
732   return dissect_tcap_Release_request_reason(TRUE, tvb, offset, pinfo, tree, hf_tcap_reasonrq);
733 }
734
735
736 static const ber_sequence_t RLRQ_apdu_sequence[] = {
737   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_reasonrq_impl },
738   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_information_impl },
739   { 0, 0, 0, NULL }
740 };
741
742 static int
743 dissect_tcap_RLRQ_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
744   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
745                                    RLRQ_apdu_sequence, hf_index, ett_tcap_RLRQ_apdu);
746
747   return offset;
748 }
749
750
751 static const value_string tcap_Release_response_reason_vals[] = {
752   {   0, "normal" },
753   {   1, "not-finished" },
754   {  30, "user-defined" },
755   { 0, NULL }
756 };
757
758
759 static int
760 dissect_tcap_Release_response_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
761   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
762                                   NULL);
763
764   return offset;
765 }
766 static int dissect_reasonre_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
767   return dissect_tcap_Release_response_reason(TRUE, tvb, offset, pinfo, tree, hf_tcap_reasonre);
768 }
769
770
771 static const ber_sequence_t RLRE_apdu_sequence[] = {
772   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_reasonre_impl },
773   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_information_impl },
774   { 0, 0, 0, NULL }
775 };
776
777 static int
778 dissect_tcap_RLRE_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
779   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
780                                    RLRE_apdu_sequence, hf_index, ett_tcap_RLRE_apdu);
781
782   return offset;
783 }
784
785
786 static const asn_namedbit T_protocol_version3_bits[] = {
787   {  0, &hf_tcap_T_protocol_version3_version1, -1, -1, "version1", NULL },
788   { 0, NULL, 0, 0, NULL, NULL }
789 };
790
791 static int
792 dissect_tcap_T_protocol_version3(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
793   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
794                                     T_protocol_version3_bits, hf_index, ett_tcap_T_protocol_version3,
795                                     NULL);
796
797   return offset;
798 }
799 static int dissect_protocol_version3_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
800   return dissect_tcap_T_protocol_version3(TRUE, tvb, offset, pinfo, tree, hf_tcap_protocol_version3);
801 }
802
803
804 static const ber_sequence_t AUDT_apdu_sequence[] = {
805   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_protocol_version3_impl },
806   { BER_CLASS_CON, 1, 0, dissect_application_context_name },
807   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_information_impl },
808   { 0, 0, 0, NULL }
809 };
810
811 static int
812 dissect_tcap_AUDT_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
813   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
814                                    AUDT_apdu_sequence, hf_index, ett_tcap_AUDT_apdu);
815
816   return offset;
817 }
818 static int dissect_unidialoguePDU(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
819   return dissect_tcap_AUDT_apdu(FALSE, tvb, offset, pinfo, tree, hf_tcap_unidialoguePDU);
820 }
821
822
823 static const value_string tcap_UniDialoguePDU_vals[] = {
824   {   0, "unidialoguePDU" },
825   { 0, NULL }
826 };
827
828 static const ber_choice_t UniDialoguePDU_choice[] = {
829   {   0, BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_unidialoguePDU },
830   { 0, 0, 0, 0, NULL }
831 };
832
833 static int
834 dissect_tcap_UniDialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
835   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
836                                  UniDialoguePDU_choice, hf_index, ett_tcap_UniDialoguePDU,
837                                  NULL);
838
839   return offset;
840 }
841
842
843
844 static int
845 dissect_tcap_DialogueOC(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
846 #line 21 "tcap.cnf"
847 tvbuff_t        *next_tvb;
848 gint8 class;
849         gboolean pc;
850         gint tag;
851         guint32 len;
852         gint ind_field;
853         
854
855 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
856 offset = get_ber_length(tree, tvb, offset, &len, &ind_field);
857         next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field));
858                                     
859  
860  if (!next_tvb)
861         return offset;
862
863   dissect_tcap_ExternalPDU(TRUE, next_tvb, 2, pinfo, tree, -1);
864
865
866 return offset+len;
867
868
869
870   return offset;
871 }
872
873
874
875 static int
876 dissect_tcap_DialoguePortion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
877   offset = dissect_tcap_DialogueOC(implicit_tag, tvb, offset, pinfo, tree, hf_index);
878
879   return offset;
880 }
881 static int dissect_dialoguePortion(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
882   return dissect_tcap_DialoguePortion(FALSE, tvb, offset, pinfo, tree, hf_tcap_dialoguePortion);
883 }
884 static int dissect_u_abortCause(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
885   return dissect_tcap_DialoguePortion(FALSE, tvb, offset, pinfo, tree, hf_tcap_u_abortCause);
886 }
887
888
889
890 static int
891 dissect_tcap_InvokeIdType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
892   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
893                                   NULL);
894
895   return offset;
896 }
897 static int dissect_invokeID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
898   return dissect_tcap_InvokeIdType(FALSE, tvb, offset, pinfo, tree, hf_tcap_invokeID);
899 }
900 static int dissect_linkedID_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
901   return dissect_tcap_InvokeIdType(TRUE, tvb, offset, pinfo, tree, hf_tcap_linkedID);
902 }
903 static int dissect_derivable(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
904   return dissect_tcap_InvokeIdType(FALSE, tvb, offset, pinfo, tree, hf_tcap_derivable);
905 }
906
907
908
909 static int
910 dissect_tcap_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
911   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
912                                   NULL);
913
914   return offset;
915 }
916 static int dissect_localValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
917   return dissect_tcap_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_tcap_localValue);
918 }
919 static int dissect_integerSecurityId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
920   return dissect_tcap_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_tcap_integerSecurityId);
921 }
922 static int dissect_integerConfidentialityId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
923   return dissect_tcap_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_tcap_integerConfidentialityId);
924 }
925 static int dissect_private_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
926   return dissect_tcap_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_tcap_private);
927 }
928 static int dissect_privateer_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
929   return dissect_tcap_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_tcap_privateer);
930 }
931
932
933 static const value_string tcap_OPERATION_vals[] = {
934   {   0, "localValue" },
935   {   1, "globalValue" },
936   { 0, NULL }
937 };
938
939 static const ber_choice_t OPERATION_choice[] = {
940   {   0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_localValue },
941   {   1, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_globalValue },
942   { 0, 0, 0, 0, NULL }
943 };
944
945 static int
946 dissect_tcap_OPERATION(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
947   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
948                                  OPERATION_choice, hf_index, ett_tcap_OPERATION,
949                                  NULL);
950
951   return offset;
952 }
953 static int dissect_opCode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
954   return dissect_tcap_OPERATION(FALSE, tvb, offset, pinfo, tree, hf_tcap_opCode);
955 }
956
957
958
959 static int
960 dissect_tcap_Parameter(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
961 #line 57 "tcap.cnf"
962 tvbuff_t        *next_tvb;
963 gint8 class;
964         gboolean pc;
965         gint tag;
966         guint32 len;
967         gint ind_field;
968
969
970  offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
971  offset = get_ber_length(tree, tvb, offset, &len, &ind_field);
972         /* need to strip the EOC off the next_tvb */
973         next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field));           
974
975 if (!next_tvb)
976         return offset; 
977  dissect_tcap_param(pinfo,tree,tvb,0);
978  offset += len;
979   return offset;
980
981
982
983   return offset;
984 }
985 static int dissect_parameter(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
986   return dissect_tcap_Parameter(FALSE, tvb, offset, pinfo, tree, hf_tcap_parameter);
987 }
988
989
990 static const ber_sequence_t Invoke_sequence[] = {
991   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeID },
992   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_linkedID_impl },
993   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_opCode },
994   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_parameter },
995   { 0, 0, 0, NULL }
996 };
997
998 static int
999 dissect_tcap_Invoke(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1000   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1001                                    Invoke_sequence, hf_index, ett_tcap_Invoke);
1002
1003   return offset;
1004 }
1005 static int dissect_invoke_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1006   return dissect_tcap_Invoke(TRUE, tvb, offset, pinfo, tree, hf_tcap_invoke);
1007 }
1008
1009
1010 static const ber_sequence_t T_resultretres_sequence[] = {
1011   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_opCode },
1012   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_parameter },
1013   { 0, 0, 0, NULL }
1014 };
1015
1016 static int
1017 dissect_tcap_T_resultretres(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1018   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1019                                    T_resultretres_sequence, hf_index, ett_tcap_T_resultretres);
1020
1021   return offset;
1022 }
1023 static int dissect_resultretres(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1024   return dissect_tcap_T_resultretres(FALSE, tvb, offset, pinfo, tree, hf_tcap_resultretres);
1025 }
1026
1027
1028 static const ber_sequence_t ReturnResult_sequence[] = {
1029   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeID },
1030   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_resultretres },
1031   { 0, 0, 0, NULL }
1032 };
1033
1034 static int
1035 dissect_tcap_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1036   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1037                                    ReturnResult_sequence, hf_index, ett_tcap_ReturnResult);
1038
1039   return offset;
1040 }
1041 static int dissect_returnResultLast_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1042   return dissect_tcap_ReturnResult(TRUE, tvb, offset, pinfo, tree, hf_tcap_returnResultLast);
1043 }
1044 static int dissect_returnResultNotLast_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1045   return dissect_tcap_ReturnResult(TRUE, tvb, offset, pinfo, tree, hf_tcap_returnResultNotLast);
1046 }
1047
1048
1049
1050 static int
1051 dissect_tcap_INTEGER_M32768_32767(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1052   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1053                                   NULL);
1054
1055   return offset;
1056 }
1057 static int dissect_national_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1058   return dissect_tcap_INTEGER_M32768_32767(TRUE, tvb, offset, pinfo, tree, hf_tcap_national);
1059 }
1060 static int dissect_nationaler_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1061   return dissect_tcap_INTEGER_M32768_32767(TRUE, tvb, offset, pinfo, tree, hf_tcap_nationaler);
1062 }
1063
1064
1065 static const value_string tcap_ErrorCode_vals[] = {
1066   {  19, "nationaler" },
1067   {  20, "privateer" },
1068   { 0, NULL }
1069 };
1070
1071 static const ber_choice_t ErrorCode_choice[] = {
1072   {  19, BER_CLASS_PRI, 19, BER_FLAGS_IMPLTAG, dissect_nationaler_impl },
1073   {  20, BER_CLASS_PRI, 20, BER_FLAGS_IMPLTAG, dissect_privateer_impl },
1074   { 0, 0, 0, 0, NULL }
1075 };
1076
1077 static int
1078 dissect_tcap_ErrorCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1079   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1080                                  ErrorCode_choice, hf_index, ett_tcap_ErrorCode,
1081                                  NULL);
1082
1083   return offset;
1084 }
1085 static int dissect_errorCode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1086   return dissect_tcap_ErrorCode(FALSE, tvb, offset, pinfo, tree, hf_tcap_errorCode);
1087 }
1088
1089
1090 static const ber_sequence_t ReturnError_sequence[] = {
1091   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeID },
1092   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_errorCode },
1093   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_parameter },
1094   { 0, 0, 0, NULL }
1095 };
1096
1097 static int
1098 dissect_tcap_ReturnError(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1099   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1100                                    ReturnError_sequence, hf_index, ett_tcap_ReturnError);
1101
1102   return offset;
1103 }
1104 static int dissect_returnError_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1105   return dissect_tcap_ReturnError(TRUE, tvb, offset, pinfo, tree, hf_tcap_returnError);
1106 }
1107
1108
1109
1110 static int
1111 dissect_tcap_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1112   offset = dissect_ber_null(implicit_tag, pinfo, tree, tvb, offset, hf_index);
1113
1114   return offset;
1115 }
1116 static int dissect_not_derivable(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1117   return dissect_tcap_NULL(FALSE, tvb, offset, pinfo, tree, hf_tcap_not_derivable);
1118 }
1119
1120
1121 static const value_string tcap_T_invokeIDRej_vals[] = {
1122   {   0, "derivable" },
1123   {   1, "not-derivable" },
1124   { 0, NULL }
1125 };
1126
1127 static const ber_choice_t T_invokeIDRej_choice[] = {
1128   {   0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_derivable },
1129   {   1, BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_not_derivable },
1130   { 0, 0, 0, 0, NULL }
1131 };
1132
1133 static int
1134 dissect_tcap_T_invokeIDRej(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1135   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1136                                  T_invokeIDRej_choice, hf_index, ett_tcap_T_invokeIDRej,
1137                                  NULL);
1138
1139   return offset;
1140 }
1141 static int dissect_invokeIDRej(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1142   return dissect_tcap_T_invokeIDRej(FALSE, tvb, offset, pinfo, tree, hf_tcap_invokeIDRej);
1143 }
1144
1145
1146 static const value_string tcap_GeneralProblem_vals[] = {
1147   {   0, "unrecognizedComponent" },
1148   {   1, "mistypedComponent" },
1149   {   2, "badlyStructuredComponent" },
1150   { 0, NULL }
1151 };
1152
1153
1154 static int
1155 dissect_tcap_GeneralProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1156   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1157                                   NULL);
1158
1159   return offset;
1160 }
1161 static int dissect_generalProblem_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1162   return dissect_tcap_GeneralProblem(TRUE, tvb, offset, pinfo, tree, hf_tcap_generalProblem);
1163 }
1164
1165
1166 static const value_string tcap_InvokeProblem_vals[] = {
1167   {   0, "duplicateInvokeID" },
1168   {   1, "unrecognizedOperation" },
1169   {   2, "mistypedParameter" },
1170   {   3, "resourceLimitation" },
1171   {   4, "initiatingRelease" },
1172   {   5, "unrecognizedLinkedID" },
1173   {   6, "linkedResponseUnexpected" },
1174   {   7, "unexpectedLinkedOperation" },
1175   { 0, NULL }
1176 };
1177
1178
1179 static int
1180 dissect_tcap_InvokeProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1181   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1182                                   NULL);
1183
1184   return offset;
1185 }
1186 static int dissect_invokeProblem_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1187   return dissect_tcap_InvokeProblem(TRUE, tvb, offset, pinfo, tree, hf_tcap_invokeProblem);
1188 }
1189
1190
1191 static const value_string tcap_ReturnResultProblem_vals[] = {
1192   {   0, "unrecognizedInvokeID" },
1193   {   1, "returnResultUnexpected" },
1194   {   2, "mistypedParameter" },
1195   { 0, NULL }
1196 };
1197
1198
1199 static int
1200 dissect_tcap_ReturnResultProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1201   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1202                                   NULL);
1203
1204   return offset;
1205 }
1206 static int dissect_returnResultProblem_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1207   return dissect_tcap_ReturnResultProblem(TRUE, tvb, offset, pinfo, tree, hf_tcap_returnResultProblem);
1208 }
1209
1210
1211 static const value_string tcap_ReturnErrorProblem_vals[] = {
1212   {   0, "unrecognizedInvokeID" },
1213   {   1, "returnErrorUnexpected" },
1214   {   2, "unrecognizedError" },
1215   {   3, "unexpectedError" },
1216   {   4, "mistypedParameter" },
1217   { 0, NULL }
1218 };
1219
1220
1221 static int
1222 dissect_tcap_ReturnErrorProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1223   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1224                                   NULL);
1225
1226   return offset;
1227 }
1228 static int dissect_returnErrorProblem_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1229   return dissect_tcap_ReturnErrorProblem(TRUE, tvb, offset, pinfo, tree, hf_tcap_returnErrorProblem);
1230 }
1231
1232
1233 static const value_string tcap_T_problem_vals[] = {
1234   {   0, "generalProblem" },
1235   {   1, "invokeProblem" },
1236   {   2, "returnResultProblem" },
1237   {   3, "returnErrorProblem" },
1238   { 0, NULL }
1239 };
1240
1241 static const ber_choice_t T_problem_choice[] = {
1242   {   0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_generalProblem_impl },
1243   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_invokeProblem_impl },
1244   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_returnResultProblem_impl },
1245   {   3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_returnErrorProblem_impl },
1246   { 0, 0, 0, 0, NULL }
1247 };
1248
1249 static int
1250 dissect_tcap_T_problem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1251   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1252                                  T_problem_choice, hf_index, ett_tcap_T_problem,
1253                                  NULL);
1254
1255   return offset;
1256 }
1257 static int dissect_problem(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1258   return dissect_tcap_T_problem(FALSE, tvb, offset, pinfo, tree, hf_tcap_problem);
1259 }
1260
1261
1262 static const ber_sequence_t Reject_sequence[] = {
1263   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeIDRej },
1264   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_problem },
1265   { 0, 0, 0, NULL }
1266 };
1267
1268 static int
1269 dissect_tcap_Reject(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1270   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1271                                    Reject_sequence, hf_index, ett_tcap_Reject);
1272
1273   return offset;
1274 }
1275 static int dissect_reject_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1276   return dissect_tcap_Reject(TRUE, tvb, offset, pinfo, tree, hf_tcap_reject);
1277 }
1278
1279
1280 static const value_string tcap_Component_vals[] = {
1281   {   1, "invoke" },
1282   {   2, "returnResultLast" },
1283   {   3, "returnError" },
1284   {   4, "reject" },
1285   {   7, "returnResultNotLast" },
1286   { 0, NULL }
1287 };
1288
1289 static const ber_choice_t Component_choice[] = {
1290   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_invoke_impl },
1291   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_returnResultLast_impl },
1292   {   3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_returnError_impl },
1293   {   4, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_reject_impl },
1294   {   7, BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG, dissect_returnResultNotLast_impl },
1295   { 0, 0, 0, 0, NULL }
1296 };
1297
1298 static int
1299 dissect_tcap_Component(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1300 #line 95 "tcap.cnf"
1301 tvbuff_t        *next_tvb;
1302 gint8 class;
1303         gboolean pc;
1304         gint tag;
1305         guint32 len, s_offset;
1306         gint ind_field;
1307 /* 
1308  * ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it.
1309  */
1310 ber_oid_dissector_table = find_dissector_table("ber.oid");
1311 s_offset = offset;
1312 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
1313 offset = get_ber_length(tree, tvb, offset, &len, &ind_field);
1314 /* we can believe the length now */
1315 next_tvb = tvb_new_subset(tvb, s_offset, len+(offset-s_offset), len+(offset-s_offset));         
1316 if (!next_tvb)
1317         return offset+len;
1318         
1319 dissect_ber_choice(pinfo, tree, next_tvb, 0,
1320                         Component_choice, hf_index, ett_tcap_Component,NULL);
1321
1322 if (ber_oid_dissector_table && cur_oid){
1323 if(!dissector_try_string(ber_oid_dissector_table, cur_oid, next_tvb, pinfo, tcap_top_tree))     
1324         {
1325         dissector_handle_t subdissector_handle;
1326
1327     if (! (subdissector_handle = get_itu_tcap_subdissector(pinfo->match_port))) {
1328         subdissector_handle = data_handle;
1329     } 
1330
1331     call_dissector(subdissector_handle, next_tvb, pinfo, tcap_top_tree);
1332
1333         }
1334 }
1335 else {
1336     dissector_handle_t subdissector_handle;
1337
1338     if (! (subdissector_handle = get_itu_tcap_subdissector(pinfo->match_port))) {
1339         subdissector_handle = data_handle;
1340     } 
1341
1342     call_dissector(subdissector_handle, next_tvb, pinfo, tcap_top_tree);
1343 }
1344      
1345 return offset+len;
1346
1347
1348
1349   return offset;
1350 }
1351 static int dissect_ComponentPortion_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1352   return dissect_tcap_Component(FALSE, tvb, offset, pinfo, tree, hf_tcap_ComponentPortion_item);
1353 }
1354
1355
1356 static const ber_sequence_t ComponentPortion_sequence_of[1] = {
1357   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ComponentPortion_item },
1358 };
1359
1360 static int
1361 dissect_tcap_ComponentPortion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1362   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1363                                       ComponentPortion_sequence_of, hf_index, ett_tcap_ComponentPortion);
1364
1365   return offset;
1366 }
1367 static int dissect_components(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1368   return dissect_tcap_ComponentPortion(FALSE, tvb, offset, pinfo, tree, hf_tcap_components);
1369 }
1370
1371
1372 static const ber_sequence_t Unidirectional_sequence[] = {
1373   { BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_dialoguePortion },
1374   { BER_CLASS_APP, 12, BER_FLAGS_NOOWNTAG, dissect_components },
1375   { 0, 0, 0, NULL }
1376 };
1377
1378 static int
1379 dissect_tcap_Unidirectional(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1380   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1381                                    Unidirectional_sequence, hf_index, ett_tcap_Unidirectional);
1382
1383   return offset;
1384 }
1385 static int dissect_unidirectional_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1386   return dissect_tcap_Unidirectional(TRUE, tvb, offset, pinfo, tree, hf_tcap_unidirectional);
1387 }
1388
1389
1390
1391 static int
1392 dissect_tcap_OrigTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1393 #line 203 "tcap.cnf"
1394 tvbuff_t *parameter_tvb;
1395 guint8 len, i;
1396 proto_item *tid_item;
1397 proto_tree *subtree;
1398 tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Source Transaction ID");
1399 subtree = proto_item_add_subtree(tid_item, ett_otid);
1400 offset = dissect_ber_octet_string(implicit_tag, pinfo, subtree, tvb, offset, hf_tcap_tid,
1401                                     &parameter_tvb);
1402
1403 if (parameter_tvb){
1404         len = tvb_length_remaining(parameter_tvb, 0);
1405         if ((len)&&(check_col(pinfo->cinfo, COL_INFO))){
1406                 col_append_fstr(pinfo->cinfo, COL_INFO, "otid(");
1407                 for(i=0;i<len;i++)
1408                           col_append_fstr(pinfo->cinfo, COL_INFO, "%02x",tvb_get_guint8(parameter_tvb,i));
1409                 col_append_fstr(pinfo->cinfo, COL_INFO, ") ");
1410         }
1411
1412 }       
1413
1414
1415
1416
1417   return offset;
1418 }
1419 static int dissect_otid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1420   return dissect_tcap_OrigTransactionID(FALSE, tvb, offset, pinfo, tree, hf_tcap_otid);
1421 }
1422
1423
1424 static const ber_sequence_t Begin_sequence[] = {
1425   { BER_CLASS_APP, 8, BER_FLAGS_NOOWNTAG, dissect_otid },
1426   { BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_dialoguePortion },
1427   { BER_CLASS_APP, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_components },
1428   { 0, 0, 0, NULL }
1429 };
1430
1431 static int
1432 dissect_tcap_Begin(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1433 #line 244 "tcap.cnf"
1434 if (check_col(pinfo->cinfo, COL_INFO))
1435                 col_append_fstr(pinfo->cinfo, COL_INFO, " Begin ");
1436   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1437                                 Begin_sequence, hf_index, ett_tcap_Begin);
1438
1439
1440   return offset;
1441 }
1442 static int dissect_begin_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1443   return dissect_tcap_Begin(TRUE, tvb, offset, pinfo, tree, hf_tcap_begin);
1444 }
1445
1446
1447
1448 static int
1449 dissect_tcap_DestTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1450 #line 225 "tcap.cnf"
1451 tvbuff_t *parameter_tvb;
1452 guint8 len , i;
1453 proto_item *tid_item;
1454 proto_tree *subtree;
1455 tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Destination Transaction ID");
1456 subtree = proto_item_add_subtree(tid_item, ett_otid);
1457 offset = dissect_ber_octet_string(implicit_tag, pinfo, subtree, tvb, offset, hf_tcap_tid,
1458                                     &parameter_tvb);
1459
1460 if (parameter_tvb){
1461         len = tvb_length_remaining(parameter_tvb, 0);
1462         if ((len)&&(check_col(pinfo->cinfo, COL_INFO))){
1463                 col_append_fstr(pinfo->cinfo, COL_INFO, "dtid(");
1464                 for(i=0;i<len;i++)
1465                         col_append_fstr(pinfo->cinfo, COL_INFO, "%02x",tvb_get_guint8(parameter_tvb,i));
1466                 col_append_fstr(pinfo->cinfo, COL_INFO, ") ");
1467            }
1468 }
1469
1470
1471   return offset;
1472 }
1473 static int dissect_dtid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1474   return dissect_tcap_DestTransactionID(FALSE, tvb, offset, pinfo, tree, hf_tcap_dtid);
1475 }
1476
1477
1478 static const ber_sequence_t End_sequence[] = {
1479   { BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_dtid },
1480   { BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_dialoguePortion },
1481   { BER_CLASS_APP, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_components },
1482   { 0, 0, 0, NULL }
1483 };
1484
1485 static int
1486 dissect_tcap_End(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1487 #line 249 "tcap.cnf"
1488 if (check_col(pinfo->cinfo, COL_INFO))
1489                 col_append_fstr(pinfo->cinfo, COL_INFO, " End ");
1490 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1491                                 End_sequence, hf_index, ett_tcap_End);
1492
1493
1494   return offset;
1495 }
1496 static int dissect_end_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1497   return dissect_tcap_End(TRUE, tvb, offset, pinfo, tree, hf_tcap_end);
1498 }
1499
1500
1501 static const ber_sequence_t Continue_sequence[] = {
1502   { BER_CLASS_APP, 8, BER_FLAGS_NOOWNTAG, dissect_otid },
1503   { BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_dtid },
1504   { BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_dialoguePortion },
1505   { BER_CLASS_APP, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_components },
1506   { 0, 0, 0, NULL }
1507 };
1508
1509 static int
1510 dissect_tcap_Continue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1511 #line 254 "tcap.cnf"
1512 if (check_col(pinfo->cinfo, COL_INFO))
1513                 col_append_fstr(pinfo->cinfo, COL_INFO, " Continue ");
1514 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1515                                 Continue_sequence, hf_index, ett_tcap_Continue);
1516
1517
1518   return offset;
1519 }
1520 static int dissect_continue_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1521   return dissect_tcap_Continue(TRUE, tvb, offset, pinfo, tree, hf_tcap_continue);
1522 }
1523
1524
1525 static const value_string tcap_P_AbortCause_vals[] = {
1526   {   0, "unrecognizedMessageType" },
1527   {   1, "unrecognizedTransactionID" },
1528   {   2, "badlyFormattedTransactionPortion" },
1529   {   3, "incorrectTransactionPortion" },
1530   {   4, "resourceLimitation" },
1531   { 0, NULL }
1532 };
1533
1534
1535 static int
1536 dissect_tcap_P_AbortCause(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1537   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1538                                   NULL);
1539
1540   return offset;
1541 }
1542 static int dissect_p_abortCause(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1543   return dissect_tcap_P_AbortCause(FALSE, tvb, offset, pinfo, tree, hf_tcap_p_abortCause);
1544 }
1545
1546
1547 static const value_string tcap_Reason_vals[] = {
1548   {  10, "p-abortCause" },
1549   {  11, "u-abortCause" },
1550   { 0, NULL }
1551 };
1552
1553 static const ber_choice_t Reason_choice[] = {
1554   {  10, BER_CLASS_APP, 10, BER_FLAGS_NOOWNTAG, dissect_p_abortCause },
1555   {  11, BER_CLASS_APP, 11, BER_FLAGS_NOOWNTAG, dissect_u_abortCause },
1556   { 0, 0, 0, 0, NULL }
1557 };
1558
1559 static int
1560 dissect_tcap_Reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1561   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1562                                  Reason_choice, hf_index, ett_tcap_Reason,
1563                                  NULL);
1564
1565   return offset;
1566 }
1567 static int dissect_reason(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1568   return dissect_tcap_Reason(FALSE, tvb, offset, pinfo, tree, hf_tcap_reason);
1569 }
1570
1571
1572 static const ber_sequence_t Abort_sequence[] = {
1573   { BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_dtid },
1574   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_reason },
1575   { 0, 0, 0, NULL }
1576 };
1577
1578 static int
1579 dissect_tcap_Abort(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1580 #line 259 "tcap.cnf"
1581 if (check_col(pinfo->cinfo, COL_INFO))
1582                 col_append_fstr(pinfo->cinfo, COL_INFO, " Abort ");
1583  offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1584                                 Abort_sequence, hf_index, ett_tcap_Abort); 
1585
1586
1587   return offset;
1588 }
1589 static int dissect_abort_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1590   return dissect_tcap_Abort(TRUE, tvb, offset, pinfo, tree, hf_tcap_abort);
1591 }
1592
1593
1594
1595 static int
1596 dissect_tcap_TransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1597   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1598                                        NULL);
1599
1600   return offset;
1601 }
1602 static int dissect_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1603   return dissect_tcap_TransactionID(FALSE, tvb, offset, pinfo, tree, hf_tcap_identifier);
1604 }
1605
1606
1607
1608 static int
1609 dissect_tcap_ProtocolVersion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1610   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1611                                        NULL);
1612
1613   return offset;
1614 }
1615 static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1616   return dissect_tcap_ProtocolVersion(FALSE, tvb, offset, pinfo, tree, hf_tcap_version);
1617 }
1618
1619
1620
1621 static int
1622 dissect_tcap_IntegerApplicationContext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1623   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1624                                   NULL);
1625
1626   return offset;
1627 }
1628 static int dissect_integerApplicationId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1629   return dissect_tcap_IntegerApplicationContext(FALSE, tvb, offset, pinfo, tree, hf_tcap_integerApplicationId);
1630 }
1631
1632
1633
1634 static int
1635 dissect_tcap_ObjectIDApplicationContext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1636   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
1637
1638   return offset;
1639 }
1640 static int dissect_objectApplicationId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1641   return dissect_tcap_ObjectIDApplicationContext(FALSE, tvb, offset, pinfo, tree, hf_tcap_objectApplicationId);
1642 }
1643
1644
1645 static const value_string tcap_T_applicationContext_vals[] = {
1646   {  27, "integerApplicationId" },
1647   {  28, "objectApplicationId" },
1648   { 0, NULL }
1649 };
1650
1651 static const ber_choice_t T_applicationContext_choice[] = {
1652   {  27, BER_CLASS_PRI, 27, BER_FLAGS_NOOWNTAG, dissect_integerApplicationId },
1653   {  28, BER_CLASS_PRI, 28, BER_FLAGS_NOOWNTAG, dissect_objectApplicationId },
1654   { 0, 0, 0, 0, NULL }
1655 };
1656
1657 static int
1658 dissect_tcap_T_applicationContext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1659   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1660                                  T_applicationContext_choice, hf_index, ett_tcap_T_applicationContext,
1661                                  NULL);
1662
1663   return offset;
1664 }
1665 static int dissect_applicationContext(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1666   return dissect_tcap_T_applicationContext(FALSE, tvb, offset, pinfo, tree, hf_tcap_applicationContext);
1667 }
1668
1669
1670 static const value_string tcap_T_securityContext_vals[] = {
1671   {   0, "integerSecurityId" },
1672   {   1, "objectSecurityId" },
1673   { 0, NULL }
1674 };
1675
1676 static const ber_choice_t T_securityContext_choice[] = {
1677   {   0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_integerSecurityId_impl },
1678   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_objectSecurityId_impl },
1679   { 0, 0, 0, 0, NULL }
1680 };
1681
1682 static int
1683 dissect_tcap_T_securityContext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1684   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1685                                  T_securityContext_choice, hf_index, ett_tcap_T_securityContext,
1686                                  NULL);
1687
1688   return offset;
1689 }
1690 static int dissect_securityContext(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1691   return dissect_tcap_T_securityContext(FALSE, tvb, offset, pinfo, tree, hf_tcap_securityContext);
1692 }
1693
1694
1695 static const value_string tcap_T_confidentialityId_vals[] = {
1696   {   0, "integerConfidentialityId" },
1697   {   1, "objectConfidentialityId" },
1698   { 0, NULL }
1699 };
1700
1701 static const ber_choice_t T_confidentialityId_choice[] = {
1702   {   0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_integerConfidentialityId_impl },
1703   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_objectConfidentialityId_impl },
1704   { 0, 0, 0, 0, NULL }
1705 };
1706
1707 static int
1708 dissect_tcap_T_confidentialityId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1709   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1710                                  T_confidentialityId_choice, hf_index, ett_tcap_T_confidentialityId,
1711                                  NULL);
1712
1713   return offset;
1714 }
1715 static int dissect_confidentialityId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1716   return dissect_tcap_T_confidentialityId(FALSE, tvb, offset, pinfo, tree, hf_tcap_confidentialityId);
1717 }
1718
1719
1720 static const ber_sequence_t Confidentiality_sequence[] = {
1721   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_confidentialityId },
1722   { 0, 0, 0, NULL }
1723 };
1724
1725 static int
1726 dissect_tcap_Confidentiality(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1727   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1728                                    Confidentiality_sequence, hf_index, ett_tcap_Confidentiality);
1729
1730   return offset;
1731 }
1732 static int dissect_confidentiality_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1733   return dissect_tcap_Confidentiality(TRUE, tvb, offset, pinfo, tree, hf_tcap_confidentiality);
1734 }
1735
1736
1737 static const ber_sequence_t DialoguePortionANSI_sequence[] = {
1738   { BER_CLASS_PRI, 26, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_version },
1739   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_applicationContext },
1740   { BER_CLASS_UNI, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_userInformation },
1741   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_securityContext },
1742   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_confidentiality_impl },
1743   { 0, 0, 0, NULL }
1744 };
1745
1746 static int
1747 dissect_tcap_DialoguePortionANSI(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1748   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1749                                    DialoguePortionANSI_sequence, hf_index, ett_tcap_DialoguePortionANSI);
1750
1751   return offset;
1752 }
1753 static int dissect_dialoguePortionansi(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1754   return dissect_tcap_DialoguePortionANSI(FALSE, tvb, offset, pinfo, tree, hf_tcap_dialoguePortionansi);
1755 }
1756
1757
1758
1759 static int
1760 dissect_tcap_OCTET_STRING_SIZE_0_2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1761   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1762                                        NULL);
1763
1764   return offset;
1765 }
1766 static int dissect_componentIDs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1767   return dissect_tcap_OCTET_STRING_SIZE_0_2(TRUE, tvb, offset, pinfo, tree, hf_tcap_componentIDs);
1768 }
1769
1770
1771 static const value_string tcap_OperationCode_vals[] = {
1772   {  16, "national" },
1773   {  17, "private" },
1774   { 0, NULL }
1775 };
1776
1777 static const ber_choice_t OperationCode_choice[] = {
1778   {  16, BER_CLASS_PRI, 16, BER_FLAGS_IMPLTAG, dissect_national_impl },
1779   {  17, BER_CLASS_PRI, 17, BER_FLAGS_IMPLTAG, dissect_private_impl },
1780   { 0, 0, 0, 0, NULL }
1781 };
1782
1783 static int
1784 dissect_tcap_OperationCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1785   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1786                                  OperationCode_choice, hf_index, ett_tcap_OperationCode,
1787                                  NULL);
1788
1789   return offset;
1790 }
1791 static int dissect_operationCode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1792   return dissect_tcap_OperationCode(FALSE, tvb, offset, pinfo, tree, hf_tcap_operationCode);
1793 }
1794
1795
1796
1797 static int
1798 dissect_tcap_ANSIParameters(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1799 #line 177 "tcap.cnf"
1800 /* we are doing the ParamSet here so need to look at the tags*/
1801         guint32 len;
1802 len = tvb_length_remaining(tvb, offset);
1803 if (len > 2)  /* arghhh I dont know whether this is constructed or not! */
1804                 offset = dissect_tcap_param(pinfo,tree,tvb,offset);
1805 else
1806 offset = dissect_ber_octet_string(TRUE, pinfo, tree, tvb, 0, hf_index,
1807                                     NULL);
1808
1809
1810
1811
1812   return offset;
1813 }
1814 static int dissect_ansiparams(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1815   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams);
1816 }
1817 static int dissect_ansiparams1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1818   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams1);
1819 }
1820 static int dissect_ansiparams2(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1821   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams2);
1822 }
1823 static int dissect_ansiparams3(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1824   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams3);
1825 }
1826 static int dissect_ansiparams4(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1827   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams4);
1828 }
1829 static int dissect_ansiparams5(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1830   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams5);
1831 }
1832 static int dissect_ansiparams6(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1833   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams6);
1834 }
1835 static int dissect_ansiparams7(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1836   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams7);
1837 }
1838 static int dissect_ansiparams8(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1839   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams8);
1840 }
1841 static int dissect_ansiparams9(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1842   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams9);
1843 }
1844 static int dissect_ansiparams10(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1845   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams10);
1846 }
1847 static int dissect_ansiparams11(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1848   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams11);
1849 }
1850 static int dissect_ansiparams12(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1851   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams12);
1852 }
1853 static int dissect_ansiparams13(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1854   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams13);
1855 }
1856 static int dissect_ansiparams14(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1857   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams14);
1858 }
1859 static int dissect_ansiparams15(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1860   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams15);
1861 }
1862 static int dissect_ansiparams16(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1863   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams16);
1864 }
1865 static int dissect_ansiparams17(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1866   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams17);
1867 }
1868 static int dissect_ansiparams18(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1869   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams18);
1870 }
1871 static int dissect_ansiparams19(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1872   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams19);
1873 }
1874 static int dissect_ansiparams20(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1875   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams20);
1876 }
1877 static int dissect_ansiparams21(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1878   return dissect_tcap_ANSIParameters(FALSE, tvb, offset, pinfo, tree, hf_tcap_ansiparams21);
1879 }
1880
1881
1882 static const ber_sequence_t ANSIparamch_sequence[] = {
1883   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams },
1884   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams1 },
1885   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams2 },
1886   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams3 },
1887   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams4 },
1888   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams5 },
1889   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams6 },
1890   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams7 },
1891   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams8 },
1892   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams9 },
1893   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams10 },
1894   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams11 },
1895   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams12 },
1896   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams13 },
1897   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams14 },
1898   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams15 },
1899   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams16 },
1900   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams17 },
1901   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams18 },
1902   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams19 },
1903   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams20 },
1904   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansiparams21 },
1905   { 0, 0, 0, NULL }
1906 };
1907
1908 static int
1909 dissect_tcap_ANSIparamch(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1910   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1911                                    ANSIparamch_sequence, hf_index, ett_tcap_ANSIparamch);
1912
1913   return offset;
1914 }
1915 static int dissect_parameterinv(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1916   return dissect_tcap_ANSIparamch(FALSE, tvb, offset, pinfo, tree, hf_tcap_parameterinv);
1917 }
1918 static int dissect_parameterrr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1919   return dissect_tcap_ANSIparamch(FALSE, tvb, offset, pinfo, tree, hf_tcap_parameterrr);
1920 }
1921 static int dissect_parameterre(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1922   return dissect_tcap_ANSIparamch(FALSE, tvb, offset, pinfo, tree, hf_tcap_parameterre);
1923 }
1924 static int dissect_parameterrj(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1925   return dissect_tcap_ANSIparamch(FALSE, tvb, offset, pinfo, tree, hf_tcap_parameterrj);
1926 }
1927
1928
1929 static const ber_sequence_t InvokePDU_sequence[] = {
1930   { BER_CLASS_PRI, 15, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_componentIDs_impl },
1931   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_operationCode },
1932   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_parameterinv },
1933   { 0, 0, 0, NULL }
1934 };
1935
1936 static int
1937 dissect_tcap_InvokePDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1938   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1939                                    InvokePDU_sequence, hf_index, ett_tcap_InvokePDU);
1940
1941   return offset;
1942 }
1943 static int dissect_invokeLastansi_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1944   return dissect_tcap_InvokePDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_invokeLastansi);
1945 }
1946 static int dissect_invokeNotLastansi_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1947   return dissect_tcap_InvokePDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_invokeNotLastansi);
1948 }
1949
1950
1951
1952 static int
1953 dissect_tcap_ComponentID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1954   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1955                                        NULL);
1956
1957   return offset;
1958 }
1959 static int dissect_componentID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1960   return dissect_tcap_ComponentID(FALSE, tvb, offset, pinfo, tree, hf_tcap_componentID);
1961 }
1962
1963
1964 static const ber_sequence_t ReturnResultPDU_sequence[] = {
1965   { BER_CLASS_PRI, 15, BER_FLAGS_NOOWNTAG, dissect_componentID },
1966   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_parameterrr },
1967   { 0, 0, 0, NULL }
1968 };
1969
1970 static int
1971 dissect_tcap_ReturnResultPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1972   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1973                                    ReturnResultPDU_sequence, hf_index, ett_tcap_ReturnResultPDU);
1974
1975   return offset;
1976 }
1977 static int dissect_returnResultLastansi_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1978   return dissect_tcap_ReturnResultPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_returnResultLastansi);
1979 }
1980 static int dissect_returnResultNotLastansi_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1981   return dissect_tcap_ReturnResultPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_returnResultNotLastansi);
1982 }
1983
1984
1985 static const ber_sequence_t ReturnErrorPDU_sequence[] = {
1986   { BER_CLASS_PRI, 15, BER_FLAGS_NOOWNTAG, dissect_componentID },
1987   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_errorCode },
1988   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_parameterre },
1989   { 0, 0, 0, NULL }
1990 };
1991
1992 static int
1993 dissect_tcap_ReturnErrorPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1994   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1995                                    ReturnErrorPDU_sequence, hf_index, ett_tcap_ReturnErrorPDU);
1996
1997   return offset;
1998 }
1999 static int dissect_returnErroransi_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2000   return dissect_tcap_ReturnErrorPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_returnErroransi);
2001 }
2002
2003
2004 static const value_string tcap_ProblemPDU_vals[] = {
2005   { 257, "general-unrecognisedComponentType" },
2006   { 258, "general-incorrectComponentPortion" },
2007   { 259, "general-badlyStructuredCompPortion" },
2008   { 0, NULL }
2009 };
2010
2011
2012 static int
2013 dissect_tcap_ProblemPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2014   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
2015                                   NULL);
2016
2017   return offset;
2018 }
2019 static int dissect_rejectProblem_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2020   return dissect_tcap_ProblemPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_rejectProblem);
2021 }
2022
2023
2024 static const ber_sequence_t RejectPDU_sequence[] = {
2025   { BER_CLASS_PRI, 15, BER_FLAGS_NOOWNTAG, dissect_componentID },
2026   { BER_CLASS_PRI, 21, BER_FLAGS_IMPLTAG, dissect_rejectProblem_impl },
2027   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_parameterrj },
2028   { 0, 0, 0, NULL }
2029 };
2030
2031 static int
2032 dissect_tcap_RejectPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2033   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
2034                                    RejectPDU_sequence, hf_index, ett_tcap_RejectPDU);
2035
2036   return offset;
2037 }
2038 static int dissect_rejectansi_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2039   return dissect_tcap_RejectPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_rejectansi);
2040 }
2041
2042
2043 static const value_string tcap_ComponentPDU_vals[] = {
2044   {   9, "invokeLastansi" },
2045   {  10, "returnResultLastansi" },
2046   {  11, "returnErroransi" },
2047   {  12, "rejectansi" },
2048   {  13, "invokeNotLastansi" },
2049   {  14, "returnResultNotLastansi" },
2050   { 0, NULL }
2051 };
2052
2053 static const ber_choice_t ComponentPDU_choice[] = {
2054   {   9, BER_CLASS_PRI, 9, BER_FLAGS_IMPLTAG, dissect_invokeLastansi_impl },
2055   {  10, BER_CLASS_PRI, 10, BER_FLAGS_IMPLTAG, dissect_returnResultLastansi_impl },
2056   {  11, BER_CLASS_PRI, 11, BER_FLAGS_IMPLTAG, dissect_returnErroransi_impl },
2057   {  12, BER_CLASS_PRI, 12, BER_FLAGS_IMPLTAG, dissect_rejectansi_impl },
2058   {  13, BER_CLASS_PRI, 13, BER_FLAGS_IMPLTAG, dissect_invokeNotLastansi_impl },
2059   {  14, BER_CLASS_PRI, 14, BER_FLAGS_IMPLTAG, dissect_returnResultNotLastansi_impl },
2060   { 0, 0, 0, 0, NULL }
2061 };
2062
2063 static int
2064 dissect_tcap_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2065 #line 188 "tcap.cnf"
2066 tvbuff_t *next_tvb;
2067 dissector_handle_t subdissector_handle;
2068
2069 next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), tvb_length_remaining(tvb, offset));           
2070
2071 if (! (subdissector_handle = get_ansi_tcap_subdissector(pinfo->match_port))) {
2072     subdissector_handle = data_handle;
2073
2074
2075 call_dissector(subdissector_handle, next_tvb, pinfo, tcap_top_tree);
2076     
2077 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
2078                               ComponentPDU_choice, hf_index, ett_tcap_ComponentPDU,NULL);
2079         
2080
2081
2082   return offset;
2083 }
2084 static int dissect_ComponentSequence_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2085   return dissect_tcap_ComponentPDU(FALSE, tvb, offset, pinfo, tree, hf_tcap_ComponentSequence_item);
2086 }
2087
2088
2089 static const ber_sequence_t ComponentSequence_sequence_of[1] = {
2090   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ComponentSequence_item },
2091 };
2092
2093 static int
2094 dissect_tcap_ComponentSequence(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2095   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
2096                                       ComponentSequence_sequence_of, hf_index, ett_tcap_ComponentSequence);
2097
2098   return offset;
2099 }
2100 static int dissect_componentPortion(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2101   return dissect_tcap_ComponentSequence(FALSE, tvb, offset, pinfo, tree, hf_tcap_componentPortion);
2102 }
2103
2104
2105 static const ber_sequence_t UniTransactionPDU_sequence[] = {
2106   { BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_identifier },
2107   { BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_dialoguePortionansi },
2108   { BER_CLASS_PRI, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_componentPortion },
2109   { 0, 0, 0, NULL }
2110 };
2111
2112 static int
2113 dissect_tcap_UniTransactionPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2114   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
2115                                    UniTransactionPDU_sequence, hf_index, ett_tcap_UniTransactionPDU);
2116
2117   return offset;
2118 }
2119 static int dissect_ansiunidirectional_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2120   return dissect_tcap_UniTransactionPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_ansiunidirectional);
2121 }
2122
2123
2124 static const ber_sequence_t TransactionPDU_sequence[] = {
2125   { BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_identifier },
2126   { BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_dialoguePortionansi },
2127   { BER_CLASS_PRI, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_componentPortion },
2128   { 0, 0, 0, NULL }
2129 };
2130
2131 static int
2132 dissect_tcap_TransactionPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2133 #line 269 "tcap.cnf"
2134 if ((hf_index == hf_tcap_ansiqueryWithPerm)&&(check_col(pinfo->cinfo, COL_INFO)))
2135                                 col_append_fstr(pinfo->cinfo, COL_INFO, " QueryWithPerm");              
2136                                 
2137 if ((hf_index == hf_tcap_ansiqueryWithoutPerm)&&(check_col(pinfo->cinfo, COL_INFO)))
2138                                 col_append_fstr(pinfo->cinfo, COL_INFO, " QueryWithOutPerm");           
2139                                 
2140 if ((hf_index == hf_tcap_ansiresponse)&&(check_col(pinfo->cinfo, COL_INFO)))
2141                                 col_append_fstr(pinfo->cinfo, COL_INFO, " Response");           
2142                                 
2143 if ((hf_index == hf_tcap_ansiconversationWithPerm)&&(check_col(pinfo->cinfo, COL_INFO)))
2144                                 col_append_fstr(pinfo->cinfo, COL_INFO, " ConversationWithPerm");               
2145                                 
2146 if ((hf_index == hf_tcap_ansiconversationWithoutPerm)&&(check_col(pinfo->cinfo, COL_INFO)))
2147                                 col_append_fstr(pinfo->cinfo, COL_INFO, " ConversationWithoutPerm");            
2148                                 
2149  offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
2150                 TransactionPDU_sequence, hf_index, ett_tcap_TransactionPDU);  
2151           
2152
2153
2154   return offset;
2155 }
2156 static int dissect_ansiqueryWithPerm_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2157   return dissect_tcap_TransactionPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_ansiqueryWithPerm);
2158 }
2159 static int dissect_ansiqueryWithoutPerm_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2160   return dissect_tcap_TransactionPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_ansiqueryWithoutPerm);
2161 }
2162 static int dissect_ansiresponse_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2163   return dissect_tcap_TransactionPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_ansiresponse);
2164 }
2165 static int dissect_ansiconversationWithPerm_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2166   return dissect_tcap_TransactionPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_ansiconversationWithPerm);
2167 }
2168 static int dissect_ansiconversationWithoutPerm_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2169   return dissect_tcap_TransactionPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_ansiconversationWithoutPerm);
2170 }
2171
2172
2173 static const value_string tcap_P_Abort_cause_vals[] = {
2174   {   1, "unrecognizedPackageType" },
2175   {   2, "incorrestTransactionPortion" },
2176   {   3, "badlyStructuredTransactionPortion" },
2177   {   4, "unassignedRespondingTransactionID" },
2178   {   5, "permissionToReleaseProblem" },
2179   {   6, "resourceUnavilable" },
2180   {   7, "unrecognizedDialoguePortionID" },
2181   {   8, "badlyStructuredDialoguePortion" },
2182   {   9, "missingDialoguePortion" },
2183   {  10, "inconsistentDialoguePortion" },
2184   { 0, NULL }
2185 };
2186
2187
2188 static int
2189 dissect_tcap_P_Abort_cause(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2190   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
2191                                   NULL);
2192
2193   return offset;
2194 }
2195 static int dissect_abortCause(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2196   return dissect_tcap_P_Abort_cause(FALSE, tvb, offset, pinfo, tree, hf_tcap_abortCause);
2197 }
2198
2199
2200 static const value_string tcap_T_causeInformation_vals[] = {
2201   {   0, "abortCause" },
2202   {   1, "userInformation" },
2203   { 0, NULL }
2204 };
2205
2206 static const ber_choice_t T_causeInformation_choice[] = {
2207   {   0, BER_CLASS_PRI, 23, BER_FLAGS_NOOWNTAG, dissect_abortCause },
2208   {   1, BER_CLASS_UNI, 8, BER_FLAGS_NOOWNTAG, dissect_userInformation },
2209   { 0, 0, 0, 0, NULL }
2210 };
2211
2212 static int
2213 dissect_tcap_T_causeInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2214   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
2215                                  T_causeInformation_choice, hf_index, ett_tcap_T_causeInformation,
2216                                  NULL);
2217
2218   return offset;
2219 }
2220 static int dissect_causeInformation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2221   return dissect_tcap_T_causeInformation(FALSE, tvb, offset, pinfo, tree, hf_tcap_causeInformation);
2222 }
2223
2224
2225 static const ber_sequence_t AbortPDU_sequence[] = {
2226   { BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_identifier },
2227   { BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_dialoguePortionansi },
2228   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_causeInformation },
2229   { 0, 0, 0, NULL }
2230 };
2231
2232 static int
2233 dissect_tcap_AbortPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2234 #line 264 "tcap.cnf"
2235 if (check_col(pinfo->cinfo, COL_INFO))
2236                 col_append_fstr(pinfo->cinfo, COL_INFO, " Abort ");
2237    offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
2238                                 AbortPDU_sequence, hf_index, ett_tcap_AbortPDU);
2239
2240
2241   return offset;
2242 }
2243 static int dissect_ansiabort_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
2244   return dissect_tcap_AbortPDU(TRUE, tvb, offset, pinfo, tree, hf_tcap_ansiabort);
2245 }
2246
2247
2248 static const value_string tcap_MessageType_vals[] = {
2249   {   0, "unidirectional" },
2250   {   1, "begin" },
2251   {   2, "end" },
2252   {   3, "continue" },
2253   {   4, "abort" },
2254   {   5, "ansiunidirectional" },
2255   {   6, "ansiqueryWithPerm" },
2256   {   7, "ansiqueryWithoutPerm" },
2257   {   8, "ansiresponse" },
2258   {   9, "ansiconversationWithPerm" },
2259   {  10, "ansiconversationWithoutPerm" },
2260   {  11, "ansiabort" },
2261   { 0, NULL }
2262 };
2263
2264 static const ber_choice_t MessageType_choice[] = {
2265   {   0, BER_CLASS_APP, 1, BER_FLAGS_IMPLTAG, dissect_unidirectional_impl },
2266   {   1, BER_CLASS_APP, 2, BER_FLAGS_IMPLTAG, dissect_begin_impl },
2267   {   2, BER_CLASS_APP, 4, BER_FLAGS_IMPLTAG, dissect_end_impl },
2268   {   3, BER_CLASS_APP, 5, BER_FLAGS_IMPLTAG, dissect_continue_impl },
2269   {   4, BER_CLASS_APP, 7, BER_FLAGS_IMPLTAG, dissect_abort_impl },
2270   {   5, BER_CLASS_PRI, 1, BER_FLAGS_IMPLTAG, dissect_ansiunidirectional_impl },
2271   {   6, BER_CLASS_PRI, 2, BER_FLAGS_IMPLTAG, dissect_ansiqueryWithPerm_impl },
2272   {   7, BER_CLASS_PRI, 3, BER_FLAGS_IMPLTAG, dissect_ansiqueryWithoutPerm_impl },
2273   {   8, BER_CLASS_PRI, 4, BER_FLAGS_IMPLTAG, dissect_ansiresponse_impl },
2274   {   9, BER_CLASS_PRI, 5, BER_FLAGS_IMPLTAG, dissect_ansiconversationWithPerm_impl },
2275   {  10, BER_CLASS_PRI, 6, BER_FLAGS_IMPLTAG, dissect_ansiconversationWithoutPerm_impl },
2276   {  11, BER_CLASS_PRI, 22, BER_FLAGS_IMPLTAG, dissect_ansiabort_impl },
2277   { 0, 0, 0, 0, NULL }
2278 };
2279
2280 static int
2281 dissect_tcap_MessageType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2282   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
2283                                  MessageType_choice, hf_index, ett_tcap_MessageType,
2284                                  NULL);
2285
2286   return offset;
2287 }
2288
2289
2290 static const value_string tcap_ERROR_vals[] = {
2291   {   0, "localValue" },
2292   {   1, "globalValue" },
2293   { 0, NULL }
2294 };
2295
2296 static const ber_choice_t ERROR_choice[] = {
2297   {   0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_localValue },
2298   {   1, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_globalValue },
2299   { 0, 0, 0, 0, NULL }
2300 };
2301
2302 static int
2303 dissect_tcap_ERROR(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
2304   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
2305                                  ERROR_choice, hf_index, ett_tcap_ERROR,
2306                                  NULL);
2307
2308   return offset;
2309 }
2310
2311
2312 /*--- End of included file: packet-tcap-fn.c ---*/
2313 #line 115 "packet-tcap-template.c"
2314
2315
2316
2317 const value_string tcap_component_type_str[] = {
2318     { TCAP_COMP_INVOKE,         "Invoke" },
2319     { TCAP_COMP_RRL,            "Return Result(L)" },
2320     { TCAP_COMP_RE,                     "Return Error" },
2321     { TCAP_COMP_REJECT,         "Reject" },
2322     { TCAP_COMP_RRN,            "Return Result(NL)" },
2323     { 0,                        NULL } };
2324
2325
2326 static void
2327 dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
2328 {
2329     proto_item          *item=NULL;
2330     proto_tree          *tree=NULL;
2331
2332     tcap_top_tree = parent_tree;
2333     if (check_col(pinfo->cinfo, COL_PROTOCOL))
2334     {
2335                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "TCAP");
2336     }
2337
2338     /* create display subtree for the protocol */
2339     if(parent_tree){
2340        item = proto_tree_add_item(parent_tree, proto_tcap, tvb, 0, -1, FALSE);
2341        tree = proto_item_add_subtree(item, ett_tcap);
2342     }
2343     cur_oid = NULL;
2344     tcapext_oid = NULL;
2345     pinfo->private_data = NULL;
2346     dissect_tcap_MessageType(FALSE, tvb, 0, pinfo, tree, -1);
2347
2348
2349 }
2350
2351
2352 void
2353 proto_reg_handoff_tcap(void)
2354 {
2355     
2356     static gboolean prefs_initialized = FALSE;
2357     
2358     if (! prefs_initialized) {
2359         sccp_ssn_table = find_dissector_table("sccp.ssn");
2360         prefs_initialized = TRUE;
2361     }
2362     
2363     register_ber_oid_name("0.0.17.773.1.1.1",
2364                           "itu-t(0) recommendation(0) q(17) 773 as(1) dialogue-as(1) version1(1)");
2365     
2366 }
2367
2368 static void init_tcap(void);
2369
2370 void
2371 proto_register_tcap(void)
2372 {
2373
2374 /* Setup list of header fields  See Section 1.6.1 for details*/
2375     static hf_register_info hf[] = {
2376         { &hf_tcap_tag,
2377                 { "Tag",           "tcap.msgtype",
2378                 FT_UINT8, BASE_HEX, NULL, 0,
2379                 "", HFILL }
2380         },
2381         { &hf_tcap_length,
2382                 { "Length", "tcap.len",
2383                 FT_UINT8, BASE_HEX, NULL, 0,
2384                 "", HFILL }
2385         },
2386         { &hf_tcap_data,
2387                 { "Data", "tcap.data",
2388                 FT_BYTES, BASE_HEX, NULL, 0,
2389                 "", HFILL }
2390         },
2391                 { &hf_tcap_tid,
2392                 { "Transaction Id", "tcap.tid",
2393                 FT_BYTES, BASE_HEX, NULL, 0,
2394                 "", HFILL }
2395         },
2396
2397 /*--- Included file: packet-tcap-hfarr.c ---*/
2398 #line 1 "packet-tcap-hfarr.c"
2399     { &hf_tcap_dialogueRequest,
2400       { "dialogueRequest", "tcap.dialogueRequest",
2401         FT_NONE, BASE_NONE, NULL, 0,
2402         "DialoguePDU/dialogueRequest", HFILL }},
2403     { &hf_tcap_dialogueResponse,
2404       { "dialogueResponse", "tcap.dialogueResponse",
2405         FT_NONE, BASE_NONE, NULL, 0,
2406         "DialoguePDU/dialogueResponse", HFILL }},
2407     { &hf_tcap_dialogueAbort,
2408       { "dialogueAbort", "tcap.dialogueAbort",
2409         FT_NONE, BASE_NONE, NULL, 0,
2410         "DialoguePDU/dialogueAbort", HFILL }},
2411     { &hf_tcap_oid,
2412       { "oid", "tcap.oid",
2413         FT_OID, BASE_NONE, NULL, 0,
2414         "ExternalPDU/oid", HFILL }},
2415     { &hf_tcap_dialog,
2416       { "dialog", "tcap.dialog",
2417         FT_BYTES, BASE_HEX, NULL, 0,
2418         "ExternalPDU/dialog", HFILL }},
2419     { &hf_tcap_useroid,
2420       { "useroid", "tcap.useroid",
2421         FT_OID, BASE_NONE, NULL, 0,
2422         "UserInformation/useroid", HFILL }},
2423     { &hf_tcap_externuserinfo,
2424       { "externuserinfo", "tcap.externuserinfo",
2425         FT_BYTES, BASE_HEX, NULL, 0,
2426         "UserInformation/externuserinfo", HFILL }},
2427     { &hf_tcap_protocol_versionrq,
2428       { "protocol-versionrq", "tcap.protocol_versionrq",
2429         FT_BYTES, BASE_HEX, NULL, 0,
2430         "AARQ-apdu/protocol-versionrq", HFILL }},
2431     { &hf_tcap_application_context_name,
2432       { "application-context-name", "tcap.application_context_name",
2433         FT_OID, BASE_NONE, NULL, 0,
2434         "", HFILL }},
2435     { &hf_tcap_user_information,
2436       { "user-information", "tcap.user_information",
2437         FT_BYTES, BASE_HEX, NULL, 0,
2438         "", HFILL }},
2439     { &hf_tcap_protocol_versionre,
2440       { "protocol-versionre", "tcap.protocol_versionre",
2441         FT_BYTES, BASE_HEX, NULL, 0,
2442         "AARE-apdu/protocol-versionre", HFILL }},
2443     { &hf_tcap_result,
2444       { "result", "tcap.result",
2445         FT_INT32, BASE_DEC, VALS(tcap_Associate_result_vals), 0,
2446         "AARE-apdu/result", HFILL }},
2447     { &hf_tcap_result_source_diagnostic,
2448       { "result-source-diagnostic", "tcap.result_source_diagnostic",
2449         FT_UINT32, BASE_DEC, VALS(tcap_Associate_source_diagnostic_vals), 0,
2450         "AARE-apdu/result-source-diagnostic", HFILL }},
2451     { &hf_tcap_reasonrq,
2452       { "reasonrq", "tcap.reasonrq",
2453         FT_INT32, BASE_DEC, VALS(tcap_Release_request_reason_vals), 0,
2454         "RLRQ-apdu/reasonrq", HFILL }},
2455     { &hf_tcap_reasonre,
2456       { "reasonre", "tcap.reasonre",
2457         FT_INT32, BASE_DEC, VALS(tcap_Release_response_reason_vals), 0,
2458         "RLRE-apdu/reasonre", HFILL }},
2459     { &hf_tcap_abort_source,
2460       { "abort-source", "tcap.abort_source",
2461         FT_INT32, BASE_DEC, VALS(tcap_ABRT_source_vals), 0,
2462         "ABRT-apdu/abort-source", HFILL }},
2463     { &hf_tcap_dialogue_service_user,
2464       { "dialogue-service-user", "tcap.dialogue_service_user",
2465         FT_INT32, BASE_DEC, VALS(tcap_T_dialogue_service_user_vals), 0,
2466         "Associate-source-diagnostic/dialogue-service-user", HFILL }},
2467     { &hf_tcap_dialogue_service_provider,
2468       { "dialogue-service-provider", "tcap.dialogue_service_provider",
2469         FT_INT32, BASE_DEC, VALS(tcap_T_dialogue_service_provider_vals), 0,
2470         "Associate-source-diagnostic/dialogue-service-provider", HFILL }},
2471     { &hf_tcap_unidialoguePDU,
2472       { "unidialoguePDU", "tcap.unidialoguePDU",
2473         FT_NONE, BASE_NONE, NULL, 0,
2474         "UniDialoguePDU/unidialoguePDU", HFILL }},
2475     { &hf_tcap_protocol_version3,
2476       { "protocol-version3", "tcap.protocol_version3",
2477         FT_BYTES, BASE_HEX, NULL, 0,
2478         "AUDT-apdu/protocol-version3", HFILL }},
2479     { &hf_tcap_unidirectional,
2480       { "unidirectional", "tcap.unidirectional",
2481         FT_NONE, BASE_NONE, NULL, 0,
2482         "MessageType/unidirectional", HFILL }},
2483     { &hf_tcap_begin,
2484       { "begin", "tcap.begin",
2485         FT_NONE, BASE_NONE, NULL, 0,
2486         "MessageType/begin", HFILL }},
2487     { &hf_tcap_end,
2488       { "end", "tcap.end",
2489         FT_NONE, BASE_NONE, NULL, 0,
2490         "MessageType/end", HFILL }},
2491     { &hf_tcap_continue,
2492       { "continue", "tcap.continue",
2493         FT_NONE, BASE_NONE, NULL, 0,
2494         "MessageType/continue", HFILL }},
2495     { &hf_tcap_abort,
2496       { "abort", "tcap.abort",
2497         FT_NONE, BASE_NONE, NULL, 0,
2498         "MessageType/abort", HFILL }},
2499     { &hf_tcap_ansiunidirectional,
2500       { "ansiunidirectional", "tcap.ansiunidirectional",
2501         FT_NONE, BASE_NONE, NULL, 0,
2502         "MessageType/ansiunidirectional", HFILL }},
2503     { &hf_tcap_ansiqueryWithPerm,
2504       { "ansiqueryWithPerm", "tcap.ansiqueryWithPerm",
2505         FT_NONE, BASE_NONE, NULL, 0,
2506         "MessageType/ansiqueryWithPerm", HFILL }},
2507     { &hf_tcap_ansiqueryWithoutPerm,
2508       { "ansiqueryWithoutPerm", "tcap.ansiqueryWithoutPerm",
2509         FT_NONE, BASE_NONE, NULL, 0,
2510         "MessageType/ansiqueryWithoutPerm", HFILL }},
2511     { &hf_tcap_ansiresponse,
2512       { "ansiresponse", "tcap.ansiresponse",
2513         FT_NONE, BASE_NONE, NULL, 0,
2514         "MessageType/ansiresponse", HFILL }},
2515     { &hf_tcap_ansiconversationWithPerm,
2516       { "ansiconversationWithPerm", "tcap.ansiconversationWithPerm",
2517         FT_NONE, BASE_NONE, NULL, 0,
2518         "MessageType/ansiconversationWithPerm", HFILL }},
2519     { &hf_tcap_ansiconversationWithoutPerm,
2520       { "ansiconversationWithoutPerm", "tcap.ansiconversationWithoutPerm",
2521         FT_NONE, BASE_NONE, NULL, 0,
2522         "MessageType/ansiconversationWithoutPerm", HFILL }},
2523     { &hf_tcap_ansiabort,
2524       { "ansiabort", "tcap.ansiabort",
2525         FT_NONE, BASE_NONE, NULL, 0,
2526         "MessageType/ansiabort", HFILL }},
2527     { &hf_tcap_dialoguePortion,
2528       { "dialoguePortion", "tcap.dialoguePortion",
2529         FT_BYTES, BASE_HEX, NULL, 0,
2530         "", HFILL }},
2531     { &hf_tcap_components,
2532       { "components", "tcap.components",
2533         FT_UINT32, BASE_DEC, NULL, 0,
2534         "", HFILL }},
2535     { &hf_tcap_otid,
2536       { "otid", "tcap.otid",
2537         FT_BYTES, BASE_HEX, NULL, 0,
2538         "", HFILL }},
2539     { &hf_tcap_dtid,
2540       { "dtid", "tcap.dtid",
2541         FT_BYTES, BASE_HEX, NULL, 0,
2542         "", HFILL }},
2543     { &hf_tcap_reason,
2544       { "reason", "tcap.reason",
2545         FT_UINT32, BASE_DEC, VALS(tcap_Reason_vals), 0,
2546         "Abort/reason", HFILL }},
2547     { &hf_tcap_p_abortCause,
2548       { "p-abortCause", "tcap.p_abortCause",
2549         FT_INT32, BASE_DEC, VALS(tcap_P_AbortCause_vals), 0,
2550         "Reason/p-abortCause", HFILL }},
2551     { &hf_tcap_u_abortCause,
2552       { "u-abortCause", "tcap.u_abortCause",
2553         FT_BYTES, BASE_HEX, NULL, 0,
2554         "Reason/u-abortCause", HFILL }},
2555     { &hf_tcap_ComponentPortion_item,
2556       { "Item", "tcap.ComponentPortion_item",
2557         FT_UINT32, BASE_DEC, VALS(tcap_Component_vals), 0,
2558         "ComponentPortion/_item", HFILL }},
2559     { &hf_tcap_invoke,
2560       { "invoke", "tcap.invoke",
2561         FT_NONE, BASE_NONE, NULL, 0,
2562         "Component/invoke", HFILL }},
2563     { &hf_tcap_returnResultLast,
2564       { "returnResultLast", "tcap.returnResultLast",
2565         FT_NONE, BASE_NONE, NULL, 0,
2566         "Component/returnResultLast", HFILL }},
2567     { &hf_tcap_returnError,
2568       { "returnError", "tcap.returnError",
2569         FT_NONE, BASE_NONE, NULL, 0,
2570         "Component/returnError", HFILL }},
2571     { &hf_tcap_reject,
2572       { "reject", "tcap.reject",
2573         FT_NONE, BASE_NONE, NULL, 0,
2574         "Component/reject", HFILL }},
2575     { &hf_tcap_returnResultNotLast,
2576       { "returnResultNotLast", "tcap.returnResultNotLast",
2577         FT_NONE, BASE_NONE, NULL, 0,
2578         "Component/returnResultNotLast", HFILL }},
2579     { &hf_tcap_invokeID,
2580       { "invokeID", "tcap.invokeID",
2581         FT_INT32, BASE_DEC, NULL, 0,
2582         "", HFILL }},
2583     { &hf_tcap_linkedID,
2584       { "linkedID", "tcap.linkedID",
2585         FT_INT32, BASE_DEC, NULL, 0,
2586         "Invoke/linkedID", HFILL }},
2587     { &hf_tcap_opCode,
2588       { "opCode", "tcap.opCode",
2589         FT_UINT32, BASE_DEC, VALS(tcap_OPERATION_vals), 0,
2590         "", HFILL }},
2591     { &hf_tcap_parameter,
2592       { "parameter", "tcap.parameter",
2593         FT_NONE, BASE_NONE, NULL, 0,
2594         "", HFILL }},
2595     { &hf_tcap_resultretres,
2596       { "resultretres", "tcap.resultretres",
2597         FT_NONE, BASE_NONE, NULL, 0,
2598         "ReturnResult/resultretres", HFILL }},
2599     { &hf_tcap_errorCode,
2600       { "errorCode", "tcap.errorCode",
2601         FT_UINT32, BASE_DEC, VALS(tcap_ErrorCode_vals), 0,
2602         "", HFILL }},
2603     { &hf_tcap_invokeIDRej,
2604       { "invokeIDRej", "tcap.invokeIDRej",
2605         FT_UINT32, BASE_DEC, VALS(tcap_T_invokeIDRej_vals), 0,
2606         "Reject/invokeIDRej", HFILL }},
2607     { &hf_tcap_derivable,
2608       { "derivable", "tcap.derivable",
2609         FT_INT32, BASE_DEC, NULL, 0,
2610         "Reject/invokeIDRej/derivable", HFILL }},
2611     { &hf_tcap_not_derivable,
2612       { "not-derivable", "tcap.not_derivable",
2613         FT_NONE, BASE_NONE, NULL, 0,
2614         "Reject/invokeIDRej/not-derivable", HFILL }},
2615     { &hf_tcap_problem,
2616       { "problem", "tcap.problem",
2617         FT_UINT32, BASE_DEC, VALS(tcap_T_problem_vals), 0,
2618         "Reject/problem", HFILL }},
2619     { &hf_tcap_generalProblem,
2620       { "generalProblem", "tcap.generalProblem",
2621         FT_INT32, BASE_DEC, VALS(tcap_GeneralProblem_vals), 0,
2622         "Reject/problem/generalProblem", HFILL }},
2623     { &hf_tcap_invokeProblem,
2624       { "invokeProblem", "tcap.invokeProblem",
2625         FT_INT32, BASE_DEC, VALS(tcap_InvokeProblem_vals), 0,
2626         "Reject/problem/invokeProblem", HFILL }},
2627     { &hf_tcap_returnResultProblem,
2628       { "returnResultProblem", "tcap.returnResultProblem",
2629         FT_INT32, BASE_DEC, VALS(tcap_ReturnResultProblem_vals), 0,
2630         "Reject/problem/returnResultProblem", HFILL }},
2631     { &hf_tcap_returnErrorProblem,
2632       { "returnErrorProblem", "tcap.returnErrorProblem",
2633         FT_INT32, BASE_DEC, VALS(tcap_ReturnErrorProblem_vals), 0,
2634         "Reject/problem/returnErrorProblem", HFILL }},
2635     { &hf_tcap_localValue,
2636       { "localValue", "tcap.localValue",
2637         FT_INT32, BASE_DEC, NULL, 0,
2638         "", HFILL }},
2639     { &hf_tcap_globalValue,
2640       { "globalValue", "tcap.globalValue",
2641         FT_OID, BASE_NONE, NULL, 0,
2642         "", HFILL }},
2643     { &hf_tcap_identifier,
2644       { "identifier", "tcap.identifier",
2645         FT_BYTES, BASE_HEX, NULL, 0,
2646         "", HFILL }},
2647     { &hf_tcap_dialoguePortionansi,
2648       { "dialoguePortionansi", "tcap.dialoguePortionansi",
2649         FT_NONE, BASE_NONE, NULL, 0,
2650         "", HFILL }},
2651     { &hf_tcap_componentPortion,
2652       { "componentPortion", "tcap.componentPortion",
2653         FT_UINT32, BASE_DEC, NULL, 0,
2654         "", HFILL }},
2655     { &hf_tcap_causeInformation,
2656       { "causeInformation", "tcap.causeInformation",
2657         FT_UINT32, BASE_DEC, VALS(tcap_T_causeInformation_vals), 0,
2658         "AbortPDU/causeInformation", HFILL }},
2659     { &hf_tcap_abortCause,
2660       { "abortCause", "tcap.abortCause",
2661         FT_INT32, BASE_DEC, VALS(tcap_P_Abort_cause_vals), 0,
2662         "AbortPDU/causeInformation/abortCause", HFILL }},
2663     { &hf_tcap_userInformation,
2664       { "userInformation", "tcap.userInformation",
2665         FT_NONE, BASE_NONE, NULL, 0,
2666         "", HFILL }},
2667     { &hf_tcap_version,
2668       { "version", "tcap.version",
2669         FT_BYTES, BASE_HEX, NULL, 0,
2670         "DialoguePortionANSI/version", HFILL }},
2671     { &hf_tcap_applicationContext,
2672       { "applicationContext", "tcap.applicationContext",
2673         FT_UINT32, BASE_DEC, VALS(tcap_T_applicationContext_vals), 0,
2674         "DialoguePortionANSI/applicationContext", HFILL }},
2675     { &hf_tcap_integerApplicationId,
2676       { "integerApplicationId", "tcap.integerApplicationId",
2677         FT_INT32, BASE_DEC, NULL, 0,
2678         "DialoguePortionANSI/applicationContext/integerApplicationId", HFILL }},
2679     { &hf_tcap_objectApplicationId,
2680       { "objectApplicationId", "tcap.objectApplicationId",
2681         FT_OID, BASE_NONE, NULL, 0,
2682         "DialoguePortionANSI/applicationContext/objectApplicationId", HFILL }},
2683     { &hf_tcap_securityContext,
2684       { "securityContext", "tcap.securityContext",
2685         FT_UINT32, BASE_DEC, VALS(tcap_T_securityContext_vals), 0,
2686         "DialoguePortionANSI/securityContext", HFILL }},
2687     { &hf_tcap_integerSecurityId,
2688       { "integerSecurityId", "tcap.integerSecurityId",
2689         FT_INT32, BASE_DEC, NULL, 0,
2690         "DialoguePortionANSI/securityContext/integerSecurityId", HFILL }},
2691     { &hf_tcap_objectSecurityId,
2692       { "objectSecurityId", "tcap.objectSecurityId",
2693         FT_OID, BASE_NONE, NULL, 0,
2694         "DialoguePortionANSI/securityContext/objectSecurityId", HFILL }},
2695     { &hf_tcap_confidentiality,
2696       { "confidentiality", "tcap.confidentiality",
2697         FT_NONE, BASE_NONE, NULL, 0,
2698         "DialoguePortionANSI/confidentiality", HFILL }},
2699     { &hf_tcap_confidentialityId,
2700       { "confidentialityId", "tcap.confidentialityId",
2701         FT_UINT32, BASE_DEC, VALS(tcap_T_confidentialityId_vals), 0,
2702         "Confidentiality/confidentialityId", HFILL }},
2703     { &hf_tcap_integerConfidentialityId,
2704       { "integerConfidentialityId", "tcap.integerConfidentialityId",
2705         FT_INT32, BASE_DEC, NULL, 0,
2706         "Confidentiality/confidentialityId/integerConfidentialityId", HFILL }},
2707     { &hf_tcap_objectConfidentialityId,
2708       { "objectConfidentialityId", "tcap.objectConfidentialityId",
2709         FT_OID, BASE_NONE, NULL, 0,
2710         "Confidentiality/confidentialityId/objectConfidentialityId", HFILL }},
2711     { &hf_tcap_ComponentSequence_item,
2712       { "Item", "tcap.ComponentSequence_item",
2713         FT_UINT32, BASE_DEC, VALS(tcap_ComponentPDU_vals), 0,
2714         "ComponentSequence/_item", HFILL }},
2715     { &hf_tcap_invokeLastansi,
2716       { "invokeLastansi", "tcap.invokeLastansi",
2717         FT_NONE, BASE_NONE, NULL, 0,
2718         "ComponentPDU/invokeLastansi", HFILL }},
2719     { &hf_tcap_returnResultLastansi,
2720       { "returnResultLastansi", "tcap.returnResultLastansi",
2721         FT_NONE, BASE_NONE, NULL, 0,
2722         "ComponentPDU/returnResultLastansi", HFILL }},
2723     { &hf_tcap_returnErroransi,
2724       { "returnErroransi", "tcap.returnErroransi",
2725         FT_NONE, BASE_NONE, NULL, 0,
2726         "ComponentPDU/returnErroransi", HFILL }},
2727     { &hf_tcap_rejectansi,
2728       { "rejectansi", "tcap.rejectansi",
2729         FT_NONE, BASE_NONE, NULL, 0,
2730         "ComponentPDU/rejectansi", HFILL }},
2731     { &hf_tcap_invokeNotLastansi,
2732       { "invokeNotLastansi", "tcap.invokeNotLastansi",
2733         FT_NONE, BASE_NONE, NULL, 0,
2734         "ComponentPDU/invokeNotLastansi", HFILL }},
2735     { &hf_tcap_returnResultNotLastansi,
2736       { "returnResultNotLastansi", "tcap.returnResultNotLastansi",
2737         FT_NONE, BASE_NONE, NULL, 0,
2738         "ComponentPDU/returnResultNotLastansi", HFILL }},
2739     { &hf_tcap_componentIDs,
2740       { "componentIDs", "tcap.componentIDs",
2741         FT_BYTES, BASE_HEX, NULL, 0,
2742         "InvokePDU/componentIDs", HFILL }},
2743     { &hf_tcap_operationCode,
2744       { "operationCode", "tcap.operationCode",
2745         FT_UINT32, BASE_DEC, VALS(tcap_OperationCode_vals), 0,
2746         "InvokePDU/operationCode", HFILL }},
2747     { &hf_tcap_parameterinv,
2748       { "parameterinv", "tcap.parameterinv",
2749         FT_NONE, BASE_NONE, NULL, 0,
2750         "InvokePDU/parameterinv", HFILL }},
2751     { &hf_tcap_ansiparams,
2752       { "ansiparams", "tcap.ansiparams",
2753         FT_NONE, BASE_NONE, NULL, 0,
2754         "ANSIparamch/ansiparams", HFILL }},
2755     { &hf_tcap_ansiparams1,
2756       { "ansiparams1", "tcap.ansiparams1",
2757         FT_NONE, BASE_NONE, NULL, 0,
2758         "ANSIparamch/ansiparams1", HFILL }},
2759     { &hf_tcap_ansiparams2,
2760       { "ansiparams2", "tcap.ansiparams2",
2761         FT_NONE, BASE_NONE, NULL, 0,
2762         "ANSIparamch/ansiparams2", HFILL }},
2763     { &hf_tcap_ansiparams3,
2764       { "ansiparams3", "tcap.ansiparams3",
2765         FT_NONE, BASE_NONE, NULL, 0,
2766         "ANSIparamch/ansiparams3", HFILL }},
2767     { &hf_tcap_ansiparams4,
2768       { "ansiparams4", "tcap.ansiparams4",
2769         FT_NONE, BASE_NONE, NULL, 0,
2770         "ANSIparamch/ansiparams4", HFILL }},
2771     { &hf_tcap_ansiparams5,
2772       { "ansiparams5", "tcap.ansiparams5",
2773         FT_NONE, BASE_NONE, NULL, 0,
2774         "ANSIparamch/ansiparams5", HFILL }},
2775     { &hf_tcap_ansiparams6,
2776       { "ansiparams6", "tcap.ansiparams6",
2777         FT_NONE, BASE_NONE, NULL, 0,
2778         "ANSIparamch/ansiparams6", HFILL }},
2779     { &hf_tcap_ansiparams7,
2780       { "ansiparams7", "tcap.ansiparams7",
2781         FT_NONE, BASE_NONE, NULL, 0,
2782         "ANSIparamch/ansiparams7", HFILL }},
2783     { &hf_tcap_ansiparams8,
2784       { "ansiparams8", "tcap.ansiparams8",
2785         FT_NONE, BASE_NONE, NULL, 0,
2786         "ANSIparamch/ansiparams8", HFILL }},
2787     { &hf_tcap_ansiparams9,
2788       { "ansiparams9", "tcap.ansiparams9",
2789         FT_NONE, BASE_NONE, NULL, 0,
2790         "ANSIparamch/ansiparams9", HFILL }},
2791     { &hf_tcap_ansiparams10,
2792       { "ansiparams10", "tcap.ansiparams10",
2793         FT_NONE, BASE_NONE, NULL, 0,
2794         "ANSIparamch/ansiparams10", HFILL }},
2795     { &hf_tcap_ansiparams11,
2796       { "ansiparams11", "tcap.ansiparams11",
2797         FT_NONE, BASE_NONE, NULL, 0,
2798         "ANSIparamch/ansiparams11", HFILL }},
2799     { &hf_tcap_ansiparams12,
2800       { "ansiparams12", "tcap.ansiparams12",
2801         FT_NONE, BASE_NONE, NULL, 0,
2802         "ANSIparamch/ansiparams12", HFILL }},
2803     { &hf_tcap_ansiparams13,
2804       { "ansiparams13", "tcap.ansiparams13",
2805         FT_NONE, BASE_NONE, NULL, 0,
2806         "ANSIparamch/ansiparams13", HFILL }},
2807     { &hf_tcap_ansiparams14,
2808       { "ansiparams14", "tcap.ansiparams14",
2809         FT_NONE, BASE_NONE, NULL, 0,
2810         "ANSIparamch/ansiparams14", HFILL }},
2811     { &hf_tcap_ansiparams15,
2812       { "ansiparams15", "tcap.ansiparams15",
2813         FT_NONE, BASE_NONE, NULL, 0,
2814         "ANSIparamch/ansiparams15", HFILL }},
2815     { &hf_tcap_ansiparams16,
2816       { "ansiparams16", "tcap.ansiparams16",
2817         FT_NONE, BASE_NONE, NULL, 0,
2818         "ANSIparamch/ansiparams16", HFILL }},
2819     { &hf_tcap_ansiparams17,
2820       { "ansiparams17", "tcap.ansiparams17",
2821         FT_NONE, BASE_NONE, NULL, 0,
2822         "ANSIparamch/ansiparams17", HFILL }},
2823     { &hf_tcap_ansiparams18,
2824       { "ansiparams18", "tcap.ansiparams18",
2825         FT_NONE, BASE_NONE, NULL, 0,
2826         "ANSIparamch/ansiparams18", HFILL }},
2827     { &hf_tcap_ansiparams19,
2828       { "ansiparams19", "tcap.ansiparams19",
2829         FT_NONE, BASE_NONE, NULL, 0,
2830         "ANSIparamch/ansiparams19", HFILL }},
2831     { &hf_tcap_ansiparams20,
2832       { "ansiparams20", "tcap.ansiparams20",
2833         FT_NONE, BASE_NONE, NULL, 0,
2834         "ANSIparamch/ansiparams20", HFILL }},
2835     { &hf_tcap_ansiparams21,
2836       { "ansiparams21", "tcap.ansiparams21",
2837         FT_NONE, BASE_NONE, NULL, 0,
2838         "ANSIparamch/ansiparams21", HFILL }},
2839     { &hf_tcap_componentID,
2840       { "componentID", "tcap.componentID",
2841         FT_BYTES, BASE_HEX, NULL, 0,
2842         "", HFILL }},
2843     { &hf_tcap_parameterrr,
2844       { "parameterrr", "tcap.parameterrr",
2845         FT_NONE, BASE_NONE, NULL, 0,
2846         "ReturnResultPDU/parameterrr", HFILL }},
2847     { &hf_tcap_parameterre,
2848       { "parameterre", "tcap.parameterre",
2849         FT_NONE, BASE_NONE, NULL, 0,
2850         "ReturnErrorPDU/parameterre", HFILL }},
2851     { &hf_tcap_rejectProblem,
2852       { "rejectProblem", "tcap.rejectProblem",
2853         FT_INT32, BASE_DEC, VALS(tcap_ProblemPDU_vals), 0,
2854         "RejectPDU/rejectProblem", HFILL }},
2855     { &hf_tcap_parameterrj,
2856       { "parameterrj", "tcap.parameterrj",
2857         FT_NONE, BASE_NONE, NULL, 0,
2858         "RejectPDU/parameterrj", HFILL }},
2859     { &hf_tcap_national,
2860       { "national", "tcap.national",
2861         FT_INT32, BASE_DEC, NULL, 0,
2862         "OperationCode/national", HFILL }},
2863     { &hf_tcap_private,
2864       { "private", "tcap.private",
2865         FT_INT32, BASE_DEC, NULL, 0,
2866         "OperationCode/private", HFILL }},
2867     { &hf_tcap_nationaler,
2868       { "nationaler", "tcap.nationaler",
2869         FT_INT32, BASE_DEC, NULL, 0,
2870         "ErrorCode/nationaler", HFILL }},
2871     { &hf_tcap_privateer,
2872       { "privateer", "tcap.privateer",
2873         FT_INT32, BASE_DEC, NULL, 0,
2874         "ErrorCode/privateer", HFILL }},
2875     { &hf_tcap_T_protocol_versionrq_version1,
2876       { "version1", "tcap.version1",
2877         FT_BOOLEAN, 8, NULL, 0x80,
2878         "", HFILL }},
2879     { &hf_tcap_T_protocol_versionre_version1,
2880       { "version1", "tcap.version1",
2881         FT_BOOLEAN, 8, NULL, 0x80,
2882         "", HFILL }},
2883     { &hf_tcap_T_protocol_version3_version1,
2884       { "version1", "tcap.version1",
2885         FT_BOOLEAN, 8, NULL, 0x80,
2886         "", HFILL }},
2887
2888 /*--- End of included file: packet-tcap-hfarr.c ---*/
2889 #line 198 "packet-tcap-template.c"
2890     };
2891
2892 /* Setup protocol subtree array */
2893     static gint *ett[] = {
2894         &ett_tcap,
2895         &ett_param,
2896         &ett_otid,
2897         &ett_dtid,
2898
2899 /*--- Included file: packet-tcap-ettarr.c ---*/
2900 #line 1 "packet-tcap-ettarr.c"
2901     &ett_tcap_DialoguePDU,
2902     &ett_tcap_ExternalPDU,
2903     &ett_tcap_UserInformation,
2904     &ett_tcap_AARQ_apdu,
2905     &ett_tcap_T_protocol_versionrq,
2906     &ett_tcap_AARE_apdu,
2907     &ett_tcap_T_protocol_versionre,
2908     &ett_tcap_RLRQ_apdu,
2909     &ett_tcap_RLRE_apdu,
2910     &ett_tcap_ABRT_apdu,
2911     &ett_tcap_Associate_source_diagnostic,
2912     &ett_tcap_UniDialoguePDU,
2913     &ett_tcap_AUDT_apdu,
2914     &ett_tcap_T_protocol_version3,
2915     &ett_tcap_MessageType,
2916     &ett_tcap_Unidirectional,
2917     &ett_tcap_Begin,
2918     &ett_tcap_End,
2919     &ett_tcap_Continue,
2920     &ett_tcap_Abort,
2921     &ett_tcap_Reason,
2922     &ett_tcap_ComponentPortion,
2923     &ett_tcap_Component,
2924     &ett_tcap_Invoke,
2925     &ett_tcap_ReturnResult,
2926     &ett_tcap_T_resultretres,
2927     &ett_tcap_ReturnError,
2928     &ett_tcap_Reject,
2929     &ett_tcap_T_invokeIDRej,
2930     &ett_tcap_T_problem,
2931     &ett_tcap_OPERATION,
2932     &ett_tcap_ERROR,
2933     &ett_tcap_UniTransactionPDU,
2934     &ett_tcap_TransactionPDU,
2935     &ett_tcap_AbortPDU,
2936     &ett_tcap_T_causeInformation,
2937     &ett_tcap_DialoguePortionANSI,
2938     &ett_tcap_T_applicationContext,
2939     &ett_tcap_T_securityContext,
2940     &ett_tcap_Confidentiality,
2941     &ett_tcap_T_confidentialityId,
2942     &ett_tcap_ComponentSequence,
2943     &ett_tcap_ComponentPDU,
2944     &ett_tcap_InvokePDU,
2945     &ett_tcap_ANSIparamch,
2946     &ett_tcap_ReturnResultPDU,
2947     &ett_tcap_ReturnErrorPDU,
2948     &ett_tcap_RejectPDU,
2949     &ett_tcap_OperationCode,
2950     &ett_tcap_ErrorCode,
2951
2952 /*--- End of included file: packet-tcap-ettarr.c ---*/
2953 #line 207 "packet-tcap-template.c"
2954     };
2955
2956     /*static enum_val_t tcap_options[] = {
2957         { "itu", "ITU",  ITU_TCAP_STANDARD },
2958         { "ansi", "ANSI", ANSI_TCAP_STANDARD },
2959         { NULL, NULL, 0 }
2960     };*/
2961
2962     module_t *tcap_module;
2963
2964 /* Register the protocol name and description */
2965     proto_tcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
2966
2967 /* Required function calls to register the header fields and subtrees used */
2968     proto_register_field_array(proto_tcap, hf, array_length(hf));
2969     proto_register_subtree_array(ett, array_length(ett));
2970
2971     tcap_module = prefs_register_protocol(proto_tcap, proto_reg_handoff_tcap);
2972
2973 #if 0
2974     prefs_register_enum_preference(tcap_module, "standard", "ITU TCAP standard",
2975         "The SS7 standard used in ITU TCAP packets",
2976         &tcap_standard, tcap_options, FALSE);
2977 #else
2978     prefs_register_obsolete_preference(tcap_module, "standard");
2979 #endif
2980
2981 #if 0
2982     prefs_register_bool_preference(tcap_module, "lock_info_col", "Lock Info column",
2983         "Always show TCAP in Info column",
2984         &lock_info_col);
2985 #else
2986     prefs_register_obsolete_preference(tcap_module, "lock_info_col");
2987 #endif
2988
2989     /* Set default SSNs */
2990     range_convert_str(&global_ssn_range, "", MAX_SSN);
2991     ssn_range = range_empty();
2992
2993     prefs_register_range_preference(tcap_module, "ssn", "SCCP SSNs",
2994         "SCCP (and SUA) SSNs to decode as TCAP",
2995         &global_ssn_range, MAX_SSN);
2996     
2997     ansi_sub_dissectors = g_hash_table_new(g_direct_hash,g_direct_equal);
2998     itu_sub_dissectors = g_hash_table_new(g_direct_hash,g_direct_equal);
2999
3000     /* 'globally' register dissector */
3001     register_dissector("tcap", dissect_tcap, proto_tcap);
3002
3003     tcap_handle = create_dissector_handle(dissect_tcap, proto_tcap);
3004
3005     register_init_routine(&init_tcap);
3006 }
3007
3008
3009 static void range_delete_callback(guint32 ssn)
3010 {
3011     if ( ssn && !get_ansi_tcap_subdissector(ssn) && !get_itu_tcap_subdissector(ssn) ) {
3012         dissector_delete("sccp.ssn", ssn, tcap_handle);
3013     }
3014 }
3015
3016 static void range_add_callback(guint32 ssn)
3017 {
3018     if (ssn && !get_ansi_tcap_subdissector(ssn) && !get_itu_tcap_subdissector(ssn) ) {
3019         dissector_add("sccp.ssn", ssn, tcap_handle);
3020     }
3021 }
3022
3023
3024 static void init_tcap(void) {
3025     if (ssn_range) {
3026         range_foreach(ssn_range, range_delete_callback);
3027         g_free(ssn_range);
3028     }
3029     
3030     ssn_range = range_copy(global_ssn_range);
3031     range_foreach(ssn_range, range_add_callback);
3032     
3033 }
3034
3035 static int
3036 dissect_tcap_param(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
3037 {
3038     gint tag_offset, saved_offset, len_offset;
3039     tvbuff_t    *next_tvb;
3040     proto_tree *subtree;
3041     proto_item *pi;
3042     gint8 class;
3043     gboolean pc;
3044     gint32 tag;
3045     guint32 len;
3046     gboolean ind_field;
3047     
3048     while (tvb_reported_length_remaining(tvb, offset) > 0)
3049     {
3050         saved_offset = offset;
3051     
3052         offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
3053         tag_offset = offset;
3054         offset = get_ber_length(tree, tvb, offset, &len, &ind_field);
3055         len_offset = offset;
3056
3057         if (pc)
3058         {
3059             pi =
3060                 proto_tree_add_text(tree, tvb, saved_offset, len + (len_offset - saved_offset), "CONSTRUCTOR");
3061             subtree = proto_item_add_subtree(pi, ett_param);
3062             proto_tree_add_uint_format(subtree, hf_tcap_tag, tvb,
3063                 saved_offset, tag_offset-saved_offset, tag, "CONSTRUCTOR Tag");
3064             proto_tree_add_uint(subtree, hf_tcap_tag, tvb,
3065                 saved_offset, tag_offset-saved_offset, class);
3066
3067             proto_tree_add_uint(subtree, hf_tcap_length, tvb,
3068                 tag_offset, len_offset-tag_offset, len);
3069                 if (len-(2*ind_field)) /*should always be positive unless we get an empty contructor pointless? */
3070                 {
3071                 next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field));           
3072                         dissect_tcap_param(pinfo, subtree,next_tvb,0);
3073             }           
3074                 if (ind_field)
3075                         proto_tree_add_text(subtree, tvb, offset+len-2, 2, "CONSTRUCTOR EOC");
3076             offset += len;
3077         }
3078         else
3079         {
3080             pi = proto_tree_add_text(tree, tvb,
3081                 saved_offset, len + (len_offset - saved_offset), "Parameter (0x%.2x)", tag);
3082
3083             subtree = proto_item_add_subtree(pi, ett_param);
3084
3085             proto_tree_add_uint(subtree, hf_tcap_tag, tvb,
3086                 saved_offset, 1, tag);
3087
3088             proto_tree_add_uint(subtree, hf_tcap_length, tvb,
3089                 saved_offset+1, 1, len);
3090                 if (len) /* check for NULLS */
3091                         {
3092                 next_tvb = tvb_new_subset(tvb, offset, len, len);               
3093                 dissect_ber_octet_string(TRUE, pinfo, tree, next_tvb, 0, hf_tcap_data,
3094                                         NULL);
3095                 }
3096             offset += len;
3097         }
3098     }
3099     return offset;
3100 }