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