Upadte to call Data dissector from PRES based on OID in Presentation Context,
[obnox/wireshark/wip.git] / epan / dissectors / packet-pres.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
3 /* .\packet-pres.c                                                            */
4 /* ../../tools/asn2eth.py -X -b -e -p pres -c pres.cnf -s packet-pres-template ISO8823-PRESENTATION.asn */
5
6 /* Input file: packet-pres-template.c */
7
8 /* packet-pres.c
9  * Routine to dissect ISO 8823 OSI Presentation Protocol packets
10  * Based on the dissector by 
11  * Yuriy Sidelnikov <YSidelnikov@hotmail.com>
12  *
13  * $Id$
14  *
15  * Ethereal - Network traffic analyzer
16  * By Gerald Combs <gerald@ethereal.com>
17  * Copyright 1998 Gerald Combs
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License
21  * as published by the Free Software Foundation; either version 2
22  * of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
32  */
33
34 #ifdef HAVE_CONFIG_H
35 # include "config.h"
36 #endif
37
38 #include <glib.h>
39 #include <epan/packet.h>
40 #include <epan/conversation.h>
41 #include <epan/emem.h>
42
43 #include <stdio.h>
44 #include <string.h>
45
46 #include "packet-ber.h"
47 #include "packet-ses.h"
48 #include "packet-pres.h"
49
50
51 #define PNAME  "ISO 8823 OSI Presentation Protocol"
52 #define PSNAME "PRES"
53 #define PFNAME "pres"
54
55 /* Initialize the protocol and registered fields */
56 int proto_pres = -1;
57 /*   type of session envelop */
58 static struct SESSION_DATA_STRUCTURE* session = NULL;
59
60 /*      pointers for acse dissector  */
61 proto_tree *global_tree  = NULL;
62 packet_info *global_pinfo = NULL;
63 /* dissector for data */
64 static dissector_handle_t data_handle;
65 static dissector_handle_t acse_handle;
66
67 static char abstract_syntax_name_oid[BER_MAX_OID_STR_LEN];
68 static guint32 presentation_context_identifier;
69
70 /* to keep track of presentation context identifiers and protocol-oids */
71 typedef struct _pres_ctx_oid_t {
72         /* XXX here we should keep track of ADDRESS/PORT as well */
73         guint32 ctx_id;
74         char *oid;
75 } pres_ctx_oid_t;
76 static GHashTable *pres_ctx_oid_table = NULL;
77
78
79 /*--- Included file: packet-pres-hf.c ---*/
80
81 static int hf_pres_checkpointSize = -1;           /* INTEGER */
82 static int hf_pres_windowSize = -1;               /* INTEGER */
83 static int hf_pres_dialogueMode = -1;             /* T_dialogueMode */
84 static int hf_pres_connectionDataRQ = -1;         /* ConnectionData */
85 static int hf_pres_applicationProtocol = -1;      /* INTEGER */
86 static int hf_pres_connectionDataAC = -1;         /* ConnectionData */
87 static int hf_pres_refuseReason = -1;             /* RefuseReason */
88 static int hf_pres_userDataRJ = -1;               /* OPEN */
89 static int hf_pres_abortReason = -1;              /* AbortReason */
90 static int hf_pres_reflectedParameter = -1;       /* BIT_STRING */
91 static int hf_pres_userdataAB = -1;               /* OPEN */
92 static int hf_pres_open = -1;                     /* OPEN */
93 static int hf_pres_recover = -1;                  /* SessionConnectionIdentifier */
94 static int hf_pres_callingSSuserReference = -1;   /* CallingSSuserReference */
95 static int hf_pres_commonReference = -1;          /* CommonReference */
96 static int hf_pres_additionalReferenceInformation = -1;  /* AdditionalReferenceInformation */
97 static int hf_pres_t61String = -1;                /* T61String */
98 static int hf_pres_octetString = -1;              /* OCTET_STRING */
99 static int hf_pres_mode_selector = -1;            /* Mode_selector */
100 static int hf_pres_x410_mode_parameters = -1;     /* RTORQapdu */
101 static int hf_pres_normal_mode_parameters = -1;   /* T_normal_mode_parameters */
102 static int hf_pres_protocol_version = -1;         /* Protocol_version */
103 static int hf_pres_calling_presentation_selector = -1;  /* Calling_presentation_selector */
104 static int hf_pres_called_presentation_selector = -1;  /* Called_presentation_selector */
105 static int hf_pres_presentation_context_definition_list = -1;  /* Presentation_context_definition_list */
106 static int hf_pres_default_context_name = -1;     /* Default_context_name */
107 static int hf_pres_presentation_requirements = -1;  /* Presentation_requirements */
108 static int hf_pres_user_session_requirements = -1;  /* User_session_requirements */
109 static int hf_pres_protocol_options = -1;         /* Protocol_options */
110 static int hf_pres_initiators_nominated_context = -1;  /* Presentation_context_identifier */
111 static int hf_pres_extensions = -1;               /* T_extensions */
112 static int hf_pres_user_data = -1;                /* User_data */
113 static int hf_pres_cPR_PPDU_x400_mode_parameters = -1;  /* RTOACapdu */
114 static int hf_pres_cPU_PPDU_normal_mode_parameters = -1;  /* T_CPA_PPDU_normal_mode_parameters */
115 static int hf_pres_responding_presentation_selector = -1;  /* Responding_presentation_selector */
116 static int hf_pres_presentation_context_definition_result_list = -1;  /* Presentation_context_definition_result_list */
117 static int hf_pres_responders_nominated_context = -1;  /* Presentation_context_identifier */
118 static int hf_pres_cPU_PPDU_x400_mode_parameters = -1;  /* RTORJapdu */
119 static int hf_pres_cPR_PPDU_normal_mode_parameters = -1;  /* T_CPR_PPDU_normal_mode_parameters */
120 static int hf_pres_default_context_result = -1;   /* Default_context_result */
121 static int hf_pres_cPR_PPDU__provider_reason = -1;  /* Provider_reason */
122 static int hf_pres_aru_ppdu = -1;                 /* ARU_PPDU */
123 static int hf_pres_arp_ppdu = -1;                 /* ARP_PPDU */
124 static int hf_pres_aRU_PPDU_x400_mode_parameters = -1;  /* RTABapdu */
125 static int hf_pres_aRU_PPDU_normal_mode_parameters = -1;  /* T_ARU_PPDU_normal_mode_parameters */
126 static int hf_pres_presentation_context_identifier_list = -1;  /* Presentation_context_identifier_list */
127 static int hf_pres_aRU_PPDU_provider_reason = -1;  /* Abort_reason */
128 static int hf_pres_event_identifier = -1;         /* Event_identifier */
129 static int hf_pres_acPPDU = -1;                   /* AC_PPDU */
130 static int hf_pres_acaPPDU = -1;                  /* ACA_PPDU */
131 static int hf_pres_ttdPPDU = -1;                  /* User_data */
132 static int hf_pres_presentation_context_addition_list = -1;  /* Presentation_context_addition_list */
133 static int hf_pres_presentation_context_deletion_list = -1;  /* Presentation_context_deletion_list */
134 static int hf_pres_presentation_context_addition_result_list = -1;  /* Presentation_context_addition_result_list */
135 static int hf_pres_presentation_context_deletion_result_list = -1;  /* Presentation_context_deletion_result_list */
136 static int hf_pres_Context_list_item = -1;        /* Context_list_item */
137 static int hf_pres_presentation_context_identifier = -1;  /* Presentation_context_identifier */
138 static int hf_pres_abstract_syntax_name = -1;     /* Abstract_syntax_name */
139 static int hf_pres_transfer_syntax_name_list = -1;  /* SEQUENCE_OF_Transfer_syntax_name */
140 static int hf_pres_transfer_syntax_name_list_item = -1;  /* Transfer_syntax_name */
141 static int hf_pres_transfer_syntax_name = -1;     /* Transfer_syntax_name */
142 static int hf_pres_mode_value = -1;               /* T_mode_value */
143 static int hf_pres_Presentation_context_deletion_list_item = -1;  /* Presentation_context_identifier */
144 static int hf_pres_Presentation_context_deletion_result_list_item = -1;  /* Presentation_context_deletion_result_list_item */
145 static int hf_pres_Presentation_context_identifier_list_item = -1;  /* Presentation_context_identifier_list_item */
146 static int hf_pres_Result_list_item = -1;         /* Result_list_item */
147 static int hf_pres_result = -1;                   /* Result */
148 static int hf_pres_provider_reason = -1;          /* T_provider_reason */
149 static int hf_pres_simply_encoded_data = -1;      /* Simply_encoded_data */
150 static int hf_pres_fully_encoded_data = -1;       /* Fully_encoded_data */
151 static int hf_pres_Fully_encoded_data_item = -1;  /* PDV_list */
152 static int hf_pres_presentation_data_values = -1;  /* T_presentation_data_values */
153 static int hf_pres_single_ASN1_type = -1;         /* T_single_ASN1_type */
154 static int hf_pres_octet_aligned = -1;            /* OCTET_STRING */
155 static int hf_pres_arbitrary = -1;                /* BIT_STRING */
156 /* named bits */
157 static int hf_pres_Presentation_requirements_context_management = -1;
158 static int hf_pres_Presentation_requirements_restoration = -1;
159 static int hf_pres_Protocol_options_nominated_context = -1;
160 static int hf_pres_Protocol_options_short_encoding = -1;
161 static int hf_pres_Protocol_options_packed_encoding_rules = -1;
162 static int hf_pres_Protocol_version_version_1 = -1;
163 static int hf_pres_User_session_requirements_half_duplex = -1;
164 static int hf_pres_User_session_requirements_duplex = -1;
165 static int hf_pres_User_session_requirements_expedited_data = -1;
166 static int hf_pres_User_session_requirements_minor_synchronize = -1;
167 static int hf_pres_User_session_requirements_major_synchronize = -1;
168 static int hf_pres_User_session_requirements_resynchronize = -1;
169 static int hf_pres_User_session_requirements_activity_management = -1;
170 static int hf_pres_User_session_requirements_negotiated_release = -1;
171 static int hf_pres_User_session_requirements_capability_data = -1;
172 static int hf_pres_User_session_requirements_exceptions = -1;
173 static int hf_pres_User_session_requirements_typed_data = -1;
174 static int hf_pres_User_session_requirements_symmetric_synchronize = -1;
175 static int hf_pres_User_session_requirements_data_separation = -1;
176
177 /*--- End of included file: packet-pres-hf.c ---*/
178
179
180 /* Initialize the subtree pointers */
181 static gint ett_pres           = -1;
182
183
184 /*--- Included file: packet-pres-ett.c ---*/
185
186 static gint ett_pres_RTORQapdu = -1;
187 static gint ett_pres_RTOACapdu = -1;
188 static gint ett_pres_RTORJapdu = -1;
189 static gint ett_pres_RTABapdu = -1;
190 static gint ett_pres_ConnectionData = -1;
191 static gint ett_pres_SessionConnectionIdentifier = -1;
192 static gint ett_pres_CallingSSuserReference = -1;
193 static gint ett_pres_CP_type = -1;
194 static gint ett_pres_T_normal_mode_parameters = -1;
195 static gint ett_pres_T_extensions = -1;
196 static gint ett_pres_CPA_PPDU = -1;
197 static gint ett_pres_T_CPA_PPDU_normal_mode_parameters = -1;
198 static gint ett_pres_CPR_PPDU = -1;
199 static gint ett_pres_T_CPR_PPDU_normal_mode_parameters = -1;
200 static gint ett_pres_Abort_type = -1;
201 static gint ett_pres_ARU_PPDU = -1;
202 static gint ett_pres_T_ARU_PPDU_normal_mode_parameters = -1;
203 static gint ett_pres_ARP_PPDU = -1;
204 static gint ett_pres_Typed_data_type = -1;
205 static gint ett_pres_AC_PPDU = -1;
206 static gint ett_pres_ACA_PPDU = -1;
207 static gint ett_pres_RS_PPDU = -1;
208 static gint ett_pres_RSA_PPDU = -1;
209 static gint ett_pres_Context_list = -1;
210 static gint ett_pres_Context_list_item = -1;
211 static gint ett_pres_SEQUENCE_OF_Transfer_syntax_name = -1;
212 static gint ett_pres_Default_context_name = -1;
213 static gint ett_pres_Mode_selector = -1;
214 static gint ett_pres_Presentation_context_deletion_list = -1;
215 static gint ett_pres_Presentation_context_deletion_result_list = -1;
216 static gint ett_pres_Presentation_context_identifier_list = -1;
217 static gint ett_pres_Presentation_context_identifier_list_item = -1;
218 static gint ett_pres_Presentation_requirements = -1;
219 static gint ett_pres_Protocol_options = -1;
220 static gint ett_pres_Protocol_version = -1;
221 static gint ett_pres_Result_list = -1;
222 static gint ett_pres_Result_list_item = -1;
223 static gint ett_pres_User_data = -1;
224 static gint ett_pres_Fully_encoded_data = -1;
225 static gint ett_pres_PDV_list = -1;
226 static gint ett_pres_T_presentation_data_values = -1;
227 static gint ett_pres_User_session_requirements = -1;
228
229 /*--- End of included file: packet-pres-ett.c ---*/
230
231
232
233 static guint
234 pres_ctx_oid_hash(gconstpointer k)
235 {
236         pres_ctx_oid_t *aco=(pres_ctx_oid_t *)k;
237         return aco->ctx_id;
238 }
239 /* XXX this one should be made ADDRESS/PORT aware */
240 static gint
241 pres_ctx_oid_equal(gconstpointer k1, gconstpointer k2)
242 {
243         pres_ctx_oid_t *aco1=(pres_ctx_oid_t *)k1;
244         pres_ctx_oid_t *aco2=(pres_ctx_oid_t *)k2;
245         return aco1->ctx_id==aco2->ctx_id;
246 }
247
248 static void
249 pres_init(void)
250 {
251         if( pres_ctx_oid_table ){
252                 g_hash_table_destroy(pres_ctx_oid_table);
253                 pres_ctx_oid_table = NULL;
254         }
255         pres_ctx_oid_table = g_hash_table_new(pres_ctx_oid_hash,
256                         pres_ctx_oid_equal);
257
258 }
259
260 static void
261 register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, char *oid)
262 {
263         pres_ctx_oid_t *aco, *tmpaco;
264         aco=se_alloc(sizeof(pres_ctx_oid_t));
265         aco->ctx_id=idx;
266         aco->oid=se_strdup(oid);
267
268         /* if this ctx already exists, remove the old one first */
269         tmpaco=(pres_ctx_oid_t *)g_hash_table_lookup(pres_ctx_oid_table, aco);
270         if(tmpaco){
271                 g_hash_table_remove(pres_ctx_oid_table, tmpaco);
272         }
273         g_hash_table_insert(pres_ctx_oid_table, aco, aco);
274 }
275 static char *
276 find_oid_by_ctx_id(packet_info *pinfo _U_, guint32 idx)
277 {
278         pres_ctx_oid_t aco, *tmpaco;
279         aco.ctx_id=idx;
280         tmpaco=(pres_ctx_oid_t *)g_hash_table_lookup(pres_ctx_oid_table, &aco);
281         if(tmpaco){
282                 return tmpaco->oid;
283         }
284         return NULL;
285 }
286
287
288
289 /*--- Included file: packet-pres-fn.c ---*/
290
291 /*--- Fields for imported types ---*/
292
293
294
295
296 static int
297 dissect_pres_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
298   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
299                                   NULL);
300
301   return offset;
302 }
303 static int dissect_checkpointSize_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
304   return dissect_pres_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_pres_checkpointSize);
305 }
306 static int dissect_windowSize_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
307   return dissect_pres_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_pres_windowSize);
308 }
309 static int dissect_applicationProtocol_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
310   return dissect_pres_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_pres_applicationProtocol);
311 }
312
313
314 static const value_string pres_T_dialogueMode_vals[] = {
315   {   0, "monologue" },
316   {   1, "twa" },
317   { 0, NULL }
318 };
319
320
321 static int
322 dissect_pres_T_dialogueMode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
323   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
324                                   NULL);
325
326   return offset;
327 }
328 static int dissect_dialogueMode_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
329   return dissect_pres_T_dialogueMode(TRUE, tvb, offset, pinfo, tree, hf_pres_dialogueMode);
330 }
331
332
333
334 static int
335 dissect_pres_OPEN(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
336 /* FIX ME*/
337
338
339   return offset;
340 }
341 static int dissect_userDataRJ(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
342   return dissect_pres_OPEN(FALSE, tvb, offset, pinfo, tree, hf_pres_userDataRJ);
343 }
344 static int dissect_userdataAB(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
345   return dissect_pres_OPEN(FALSE, tvb, offset, pinfo, tree, hf_pres_userdataAB);
346 }
347 static int dissect_open(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
348   return dissect_pres_OPEN(FALSE, tvb, offset, pinfo, tree, hf_pres_open);
349 }
350
351
352
353 static int
354 dissect_pres_T61String(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
355   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString,
356                                             pinfo, tree, tvb, offset, hf_index,
357                                             NULL);
358
359   return offset;
360 }
361 static int dissect_t61String(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
362   return dissect_pres_T61String(FALSE, tvb, offset, pinfo, tree, hf_pres_t61String);
363 }
364
365
366
367 static int
368 dissect_pres_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
369   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
370                                        NULL);
371
372   return offset;
373 }
374 static int dissect_octetString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
375   return dissect_pres_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_pres_octetString);
376 }
377 static int dissect_octet_aligned_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
378   return dissect_pres_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_pres_octet_aligned);
379 }
380
381
382 static const value_string pres_CallingSSuserReference_vals[] = {
383   {   0, "t61String" },
384   {   1, "octetString" },
385   { 0, NULL }
386 };
387
388 static const ber_choice_t CallingSSuserReference_choice[] = {
389   {   0, BER_CLASS_UNI, BER_UNI_TAG_TeletexString, BER_FLAGS_NOOWNTAG, dissect_t61String },
390   {   1, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_octetString },
391   { 0, 0, 0, 0, NULL }
392 };
393
394 static int
395 dissect_pres_CallingSSuserReference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
396   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
397                                  CallingSSuserReference_choice, hf_index, ett_pres_CallingSSuserReference,
398                                  NULL);
399
400   return offset;
401 }
402 static int dissect_callingSSuserReference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
403   return dissect_pres_CallingSSuserReference(FALSE, tvb, offset, pinfo, tree, hf_pres_callingSSuserReference);
404 }
405
406
407
408 static int
409 dissect_pres_CommonReference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
410   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTCTime,
411                                             pinfo, tree, tvb, offset, hf_index,
412                                             NULL);
413
414   return offset;
415 }
416 static int dissect_commonReference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
417   return dissect_pres_CommonReference(FALSE, tvb, offset, pinfo, tree, hf_pres_commonReference);
418 }
419
420
421
422 static int
423 dissect_pres_AdditionalReferenceInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
424   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString,
425                                             pinfo, tree, tvb, offset, hf_index,
426                                             NULL);
427
428   return offset;
429 }
430 static int dissect_additionalReferenceInformation_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
431   return dissect_pres_AdditionalReferenceInformation(TRUE, tvb, offset, pinfo, tree, hf_pres_additionalReferenceInformation);
432 }
433
434
435 static const ber_sequence_t SessionConnectionIdentifier_sequence[] = {
436   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_callingSSuserReference },
437   { BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_NOOWNTAG, dissect_commonReference },
438   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_additionalReferenceInformation_impl },
439   { 0, 0, 0, NULL }
440 };
441
442 static int
443 dissect_pres_SessionConnectionIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
444   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
445                                    SessionConnectionIdentifier_sequence, hf_index, ett_pres_SessionConnectionIdentifier);
446
447   return offset;
448 }
449 static int dissect_recover_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
450   return dissect_pres_SessionConnectionIdentifier(TRUE, tvb, offset, pinfo, tree, hf_pres_recover);
451 }
452
453
454 static const value_string pres_ConnectionData_vals[] = {
455   {   0, "open" },
456   {   1, "recover" },
457   { 0, NULL }
458 };
459
460 static const ber_choice_t ConnectionData_choice[] = {
461   {   0, BER_CLASS_CON, 0, 0, dissect_open },
462   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_recover_impl },
463   { 0, 0, 0, 0, NULL }
464 };
465
466 static int
467 dissect_pres_ConnectionData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
468   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
469                                  ConnectionData_choice, hf_index, ett_pres_ConnectionData,
470                                  NULL);
471
472   return offset;
473 }
474 static int dissect_connectionDataRQ(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
475   return dissect_pres_ConnectionData(FALSE, tvb, offset, pinfo, tree, hf_pres_connectionDataRQ);
476 }
477 static int dissect_connectionDataAC(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
478   return dissect_pres_ConnectionData(FALSE, tvb, offset, pinfo, tree, hf_pres_connectionDataAC);
479 }
480
481
482 static const ber_sequence_t RTORQapdu_set[] = {
483   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_checkpointSize_impl },
484   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_windowSize_impl },
485   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_dialogueMode_impl },
486   { BER_CLASS_CON, 3, BER_FLAGS_NOTCHKTAG, dissect_connectionDataRQ },
487   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_applicationProtocol_impl },
488   { 0, 0, 0, NULL }
489 };
490
491 static int
492 dissect_pres_RTORQapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
493   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
494                               RTORQapdu_set, hf_index, ett_pres_RTORQapdu);
495
496   return offset;
497 }
498 static int dissect_x410_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
499   return dissect_pres_RTORQapdu(TRUE, tvb, offset, pinfo, tree, hf_pres_x410_mode_parameters);
500 }
501
502
503 static const ber_sequence_t RTOACapdu_set[] = {
504   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_checkpointSize_impl },
505   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_windowSize_impl },
506   { BER_CLASS_CON, 2, BER_FLAGS_NOTCHKTAG, dissect_connectionDataAC },
507   { 0, 0, 0, NULL }
508 };
509
510 static int
511 dissect_pres_RTOACapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
512   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
513                               RTOACapdu_set, hf_index, ett_pres_RTOACapdu);
514
515   return offset;
516 }
517 static int dissect_cPR_PPDU_x400_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
518   return dissect_pres_RTOACapdu(TRUE, tvb, offset, pinfo, tree, hf_pres_cPR_PPDU_x400_mode_parameters);
519 }
520
521
522 static const value_string pres_RefuseReason_vals[] = {
523   {   0, "rtsBusy" },
524   {   1, "cannotRecover" },
525   {   2, "validationFailure" },
526   {   3, "unacceptableDialogueMode" },
527   { 0, NULL }
528 };
529
530
531 static int
532 dissect_pres_RefuseReason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
533   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
534                                   NULL);
535
536   return offset;
537 }
538 static int dissect_refuseReason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
539   return dissect_pres_RefuseReason(TRUE, tvb, offset, pinfo, tree, hf_pres_refuseReason);
540 }
541
542
543 static const ber_sequence_t RTORJapdu_set[] = {
544   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_refuseReason_impl },
545   { BER_CLASS_CON, 1, 0, dissect_userDataRJ },
546   { 0, 0, 0, NULL }
547 };
548
549 static int
550 dissect_pres_RTORJapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
551   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
552                               RTORJapdu_set, hf_index, ett_pres_RTORJapdu);
553
554   return offset;
555 }
556 static int dissect_cPU_PPDU_x400_mode_parameters(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
557   return dissect_pres_RTORJapdu(FALSE, tvb, offset, pinfo, tree, hf_pres_cPU_PPDU_x400_mode_parameters);
558 }
559
560
561 static const value_string pres_AbortReason_vals[] = {
562   {   0, "localSystemProblem" },
563   {   1, "invalidParameter" },
564   {   2, "unrecognizedActivity" },
565   {   3, "temporaryProblem" },
566   {   4, "protocolError" },
567   {   5, "permanentProblem" },
568   {   6, "userError" },
569   {   7, "transferCompleted" },
570   { 0, NULL }
571 };
572
573
574 static int
575 dissect_pres_AbortReason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
576   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
577                                   NULL);
578
579   return offset;
580 }
581 static int dissect_abortReason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
582   return dissect_pres_AbortReason(TRUE, tvb, offset, pinfo, tree, hf_pres_abortReason);
583 }
584
585
586
587 static int
588 dissect_pres_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
589   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
590                                     NULL, hf_index, -1,
591                                     NULL);
592
593   return offset;
594 }
595 static int dissect_reflectedParameter_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
596   return dissect_pres_BIT_STRING(TRUE, tvb, offset, pinfo, tree, hf_pres_reflectedParameter);
597 }
598 static int dissect_arbitrary_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
599   return dissect_pres_BIT_STRING(TRUE, tvb, offset, pinfo, tree, hf_pres_arbitrary);
600 }
601
602
603 static const ber_sequence_t RTABapdu_set[] = {
604   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_abortReason_impl },
605   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_reflectedParameter_impl },
606   { BER_CLASS_CON, 2, 0, dissect_userdataAB },
607   { 0, 0, 0, NULL }
608 };
609
610 static int
611 dissect_pres_RTABapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
612   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
613                               RTABapdu_set, hf_index, ett_pres_RTABapdu);
614
615   return offset;
616 }
617 static int dissect_aRU_PPDU_x400_mode_parameters(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
618   return dissect_pres_RTABapdu(FALSE, tvb, offset, pinfo, tree, hf_pres_aRU_PPDU_x400_mode_parameters);
619 }
620
621
622 static const value_string pres_T_mode_value_vals[] = {
623   {   0, "x410-1984-mode" },
624   {   1, "normal-mode" },
625   { 0, NULL }
626 };
627
628
629 static int
630 dissect_pres_T_mode_value(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
631   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
632                                   NULL);
633
634   return offset;
635 }
636 static int dissect_mode_value_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
637   return dissect_pres_T_mode_value(TRUE, tvb, offset, pinfo, tree, hf_pres_mode_value);
638 }
639
640
641 static const ber_sequence_t Mode_selector_set[] = {
642   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_mode_value_impl },
643   { 0, 0, 0, NULL }
644 };
645
646 static int
647 dissect_pres_Mode_selector(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
648   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
649                               Mode_selector_set, hf_index, ett_pres_Mode_selector);
650
651   return offset;
652 }
653 static int dissect_mode_selector_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
654   return dissect_pres_Mode_selector(TRUE, tvb, offset, pinfo, tree, hf_pres_mode_selector);
655 }
656
657
658 static const asn_namedbit Protocol_version_bits[] = {
659   {  0, &hf_pres_Protocol_version_version_1, -1, -1, "version-1", NULL },
660   { 0, NULL, 0, 0, NULL, NULL }
661 };
662
663 static int
664 dissect_pres_Protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
665   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
666                                     Protocol_version_bits, hf_index, ett_pres_Protocol_version,
667                                     NULL);
668
669   return offset;
670 }
671 static int dissect_protocol_version_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
672   return dissect_pres_Protocol_version(TRUE, tvb, offset, pinfo, tree, hf_pres_protocol_version);
673 }
674
675
676
677 static int
678 dissect_pres_Presentation_selector(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
679   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
680                                        NULL);
681
682   return offset;
683 }
684
685
686
687 static int
688 dissect_pres_Calling_presentation_selector(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
689   offset = dissect_pres_Presentation_selector(implicit_tag, tvb, offset, pinfo, tree, hf_index);
690
691   return offset;
692 }
693 static int dissect_calling_presentation_selector_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
694   return dissect_pres_Calling_presentation_selector(TRUE, tvb, offset, pinfo, tree, hf_pres_calling_presentation_selector);
695 }
696
697
698
699 static int
700 dissect_pres_Called_presentation_selector(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
701   offset = dissect_pres_Presentation_selector(implicit_tag, tvb, offset, pinfo, tree, hf_index);
702
703   return offset;
704 }
705 static int dissect_called_presentation_selector_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
706   return dissect_pres_Called_presentation_selector(TRUE, tvb, offset, pinfo, tree, hf_pres_called_presentation_selector);
707 }
708
709
710
711 static int
712 dissect_pres_Presentation_context_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
713   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
714                                   &presentation_context_identifier);
715
716   return offset;
717 }
718 static int dissect_initiators_nominated_context(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
719   return dissect_pres_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_pres_initiators_nominated_context);
720 }
721 static int dissect_responders_nominated_context(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
722   return dissect_pres_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_pres_responders_nominated_context);
723 }
724 static int dissect_presentation_context_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
725   return dissect_pres_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_pres_presentation_context_identifier);
726 }
727 static int dissect_Presentation_context_deletion_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
728   return dissect_pres_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_pres_Presentation_context_deletion_list_item);
729 }
730
731
732
733 static int
734 dissect_pres_Abstract_syntax_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
735   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
736                                             abstract_syntax_name_oid);
737
738   return offset;
739 }
740 static int dissect_abstract_syntax_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
741   return dissect_pres_Abstract_syntax_name(FALSE, tvb, offset, pinfo, tree, hf_pres_abstract_syntax_name);
742 }
743 static int dissect_abstract_syntax_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
744   return dissect_pres_Abstract_syntax_name(TRUE, tvb, offset, pinfo, tree, hf_pres_abstract_syntax_name);
745 }
746
747
748
749 static int
750 dissect_pres_Transfer_syntax_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
751   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
752                                             NULL);
753
754   return offset;
755 }
756 static int dissect_transfer_syntax_name_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
757   return dissect_pres_Transfer_syntax_name(FALSE, tvb, offset, pinfo, tree, hf_pres_transfer_syntax_name_list_item);
758 }
759 static int dissect_transfer_syntax_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
760   return dissect_pres_Transfer_syntax_name(FALSE, tvb, offset, pinfo, tree, hf_pres_transfer_syntax_name);
761 }
762 static int dissect_transfer_syntax_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
763   return dissect_pres_Transfer_syntax_name(TRUE, tvb, offset, pinfo, tree, hf_pres_transfer_syntax_name);
764 }
765
766
767 static const ber_sequence_t SEQUENCE_OF_Transfer_syntax_name_sequence_of[1] = {
768   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_transfer_syntax_name_list_item },
769 };
770
771 static int
772 dissect_pres_SEQUENCE_OF_Transfer_syntax_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
773   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
774                                       SEQUENCE_OF_Transfer_syntax_name_sequence_of, hf_index, ett_pres_SEQUENCE_OF_Transfer_syntax_name);
775
776   return offset;
777 }
778 static int dissect_transfer_syntax_name_list(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
779   return dissect_pres_SEQUENCE_OF_Transfer_syntax_name(FALSE, tvb, offset, pinfo, tree, hf_pres_transfer_syntax_name_list);
780 }
781
782
783 static const ber_sequence_t Context_list_item_sequence[] = {
784   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_presentation_context_identifier },
785   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_abstract_syntax_name },
786   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_transfer_syntax_name_list },
787   { 0, 0, 0, NULL }
788 };
789
790 static int
791 dissect_pres_Context_list_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
792   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
793                                    Context_list_item_sequence, hf_index, ett_pres_Context_list_item);
794
795         register_ctx_id_and_oid(pinfo, presentation_context_identifier, abstract_syntax_name_oid);
796   return offset;
797 }
798 static int dissect_Context_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
799   return dissect_pres_Context_list_item(FALSE, tvb, offset, pinfo, tree, hf_pres_Context_list_item);
800 }
801
802
803 static const ber_sequence_t Context_list_sequence_of[1] = {
804   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Context_list_item },
805 };
806
807 static int
808 dissect_pres_Context_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
809   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
810                                       Context_list_sequence_of, hf_index, ett_pres_Context_list);
811
812   return offset;
813 }
814
815
816
817 static int
818 dissect_pres_Presentation_context_definition_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
819   offset = dissect_pres_Context_list(implicit_tag, tvb, offset, pinfo, tree, hf_index);
820
821   return offset;
822 }
823 static int dissect_presentation_context_definition_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
824   return dissect_pres_Presentation_context_definition_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_definition_list);
825 }
826
827
828 static const ber_sequence_t Default_context_name_sequence[] = {
829   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_abstract_syntax_name_impl },
830   { BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_transfer_syntax_name_impl },
831   { 0, 0, 0, NULL }
832 };
833
834 static int
835 dissect_pres_Default_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
836   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
837                                    Default_context_name_sequence, hf_index, ett_pres_Default_context_name);
838
839   return offset;
840 }
841 static int dissect_default_context_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
842   return dissect_pres_Default_context_name(TRUE, tvb, offset, pinfo, tree, hf_pres_default_context_name);
843 }
844
845
846 static const asn_namedbit Presentation_requirements_bits[] = {
847   {  0, &hf_pres_Presentation_requirements_context_management, -1, -1, "context-management", NULL },
848   {  1, &hf_pres_Presentation_requirements_restoration, -1, -1, "restoration", NULL },
849   { 0, NULL, 0, 0, NULL, NULL }
850 };
851
852 static int
853 dissect_pres_Presentation_requirements(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
854   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
855                                     Presentation_requirements_bits, hf_index, ett_pres_Presentation_requirements,
856                                     NULL);
857
858   return offset;
859 }
860 static int dissect_presentation_requirements_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
861   return dissect_pres_Presentation_requirements(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_requirements);
862 }
863
864
865 static const asn_namedbit User_session_requirements_bits[] = {
866   {  0, &hf_pres_User_session_requirements_half_duplex, -1, -1, "half-duplex", NULL },
867   {  1, &hf_pres_User_session_requirements_duplex, -1, -1, "duplex", NULL },
868   {  2, &hf_pres_User_session_requirements_expedited_data, -1, -1, "expedited-data", NULL },
869   {  3, &hf_pres_User_session_requirements_minor_synchronize, -1, -1, "minor-synchronize", NULL },
870   {  4, &hf_pres_User_session_requirements_major_synchronize, -1, -1, "major-synchronize", NULL },
871   {  5, &hf_pres_User_session_requirements_resynchronize, -1, -1, "resynchronize", NULL },
872   {  6, &hf_pres_User_session_requirements_activity_management, -1, -1, "activity-management", NULL },
873   {  7, &hf_pres_User_session_requirements_negotiated_release, -1, -1, "negotiated-release", NULL },
874   {  8, &hf_pres_User_session_requirements_capability_data, -1, -1, "capability-data", NULL },
875   {  9, &hf_pres_User_session_requirements_exceptions, -1, -1, "exceptions", NULL },
876   { 10, &hf_pres_User_session_requirements_typed_data, -1, -1, "typed-data", NULL },
877   { 11, &hf_pres_User_session_requirements_symmetric_synchronize, -1, -1, "symmetric-synchronize", NULL },
878   { 12, &hf_pres_User_session_requirements_data_separation, -1, -1, "data-separation", NULL },
879   { 0, NULL, 0, 0, NULL, NULL }
880 };
881
882 static int
883 dissect_pres_User_session_requirements(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
884   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
885                                     User_session_requirements_bits, hf_index, ett_pres_User_session_requirements,
886                                     NULL);
887
888   return offset;
889 }
890 static int dissect_user_session_requirements_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
891   return dissect_pres_User_session_requirements(TRUE, tvb, offset, pinfo, tree, hf_pres_user_session_requirements);
892 }
893
894
895 static const asn_namedbit Protocol_options_bits[] = {
896   {  0, &hf_pres_Protocol_options_nominated_context, -1, -1, "nominated-context", NULL },
897   {  1, &hf_pres_Protocol_options_short_encoding, -1, -1, "short-encoding", NULL },
898   {  2, &hf_pres_Protocol_options_packed_encoding_rules, -1, -1, "packed-encoding-rules", NULL },
899   { 0, NULL, 0, 0, NULL, NULL }
900 };
901
902 static int
903 dissect_pres_Protocol_options(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
904   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
905                                     Protocol_options_bits, hf_index, ett_pres_Protocol_options,
906                                     NULL);
907
908   return offset;
909 }
910 static int dissect_protocol_options(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
911   return dissect_pres_Protocol_options(FALSE, tvb, offset, pinfo, tree, hf_pres_protocol_options);
912 }
913
914
915 static const ber_sequence_t T_extensions_sequence[] = {
916   { 0, 0, 0, NULL }
917 };
918
919 static int
920 dissect_pres_T_extensions(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
921   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
922                                    T_extensions_sequence, hf_index, ett_pres_T_extensions);
923
924   return offset;
925 }
926 static int dissect_extensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
927   return dissect_pres_T_extensions(FALSE, tvb, offset, pinfo, tree, hf_pres_extensions);
928 }
929
930
931
932 static int
933 dissect_pres_Simply_encoded_data(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
934   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
935                                        NULL);
936
937   return offset;
938 }
939 static int dissect_simply_encoded_data_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
940   return dissect_pres_Simply_encoded_data(TRUE, tvb, offset, pinfo, tree, hf_pres_simply_encoded_data);
941 }
942
943
944
945 static int
946 dissect_pres_T_single_ASN1_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
947
948  tvbuff_t       *next_tvb;
949  char *oid; 
950
951         oid=find_oid_by_ctx_id(pinfo, presentation_context_identifier);
952         if(oid){
953                 next_tvb = tvb_new_subset(tvb, offset, -1, -1);
954                 call_ber_oid_callback(oid, next_tvb, offset, pinfo, global_tree);
955         } else {
956                 proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available");
957                   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
958                                        NULL);
959         
960         }
961
962
963
964   return offset;
965 }
966 static int dissect_single_ASN1_type_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
967   return dissect_pres_T_single_ASN1_type(TRUE, tvb, offset, pinfo, tree, hf_pres_single_ASN1_type);
968 }
969
970
971 static const value_string pres_T_presentation_data_values_vals[] = {
972   {   0, "single-ASN1-type" },
973   {   1, "octet-aligned" },
974   {   2, "arbitrary" },
975   { 0, NULL }
976 };
977
978 static const ber_choice_t T_presentation_data_values_choice[] = {
979   {   0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_single_ASN1_type_impl },
980   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_octet_aligned_impl },
981   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_arbitrary_impl },
982   { 0, 0, 0, 0, NULL }
983 };
984
985 static int
986 dissect_pres_T_presentation_data_values(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
987   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
988                                  T_presentation_data_values_choice, hf_index, ett_pres_T_presentation_data_values,
989                                  NULL);
990
991   return offset;
992 }
993 static int dissect_presentation_data_values(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
994   return dissect_pres_T_presentation_data_values(FALSE, tvb, offset, pinfo, tree, hf_pres_presentation_data_values);
995 }
996
997
998 static const ber_sequence_t PDV_list_sequence[] = {
999   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_transfer_syntax_name },
1000   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_presentation_context_identifier },
1001   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_presentation_data_values },
1002   { 0, 0, 0, NULL }
1003 };
1004
1005 static int
1006 dissect_pres_PDV_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1007   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1008                                    PDV_list_sequence, hf_index, ett_pres_PDV_list);
1009
1010   return offset;
1011 }
1012 static int dissect_Fully_encoded_data_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1013   return dissect_pres_PDV_list(FALSE, tvb, offset, pinfo, tree, hf_pres_Fully_encoded_data_item);
1014 }
1015
1016
1017 static const ber_sequence_t Fully_encoded_data_sequence_of[1] = {
1018   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Fully_encoded_data_item },
1019 };
1020
1021 static int
1022 dissect_pres_Fully_encoded_data(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1023   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1024                                       Fully_encoded_data_sequence_of, hf_index, ett_pres_Fully_encoded_data);
1025
1026   return offset;
1027 }
1028 static int dissect_fully_encoded_data_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1029   return dissect_pres_Fully_encoded_data(TRUE, tvb, offset, pinfo, tree, hf_pres_fully_encoded_data);
1030 }
1031
1032
1033 static const value_string pres_User_data_vals[] = {
1034   {   0, "simply-encoded-data" },
1035   {   1, "fully-encoded-data" },
1036   { 0, NULL }
1037 };
1038
1039 static const ber_choice_t User_data_choice[] = {
1040   {   0, BER_CLASS_APP, 0, BER_FLAGS_IMPLTAG, dissect_simply_encoded_data_impl },
1041   {   1, BER_CLASS_APP, 1, BER_FLAGS_IMPLTAG, dissect_fully_encoded_data_impl },
1042   { 0, 0, 0, 0, NULL }
1043 };
1044
1045 static int
1046 dissect_pres_User_data(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1047   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1048                                  User_data_choice, hf_index, ett_pres_User_data,
1049                                  NULL);
1050
1051   return offset;
1052 }
1053 static int dissect_user_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1054   return dissect_pres_User_data(FALSE, tvb, offset, pinfo, tree, hf_pres_user_data);
1055 }
1056 static int dissect_ttdPPDU(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1057   return dissect_pres_User_data(FALSE, tvb, offset, pinfo, tree, hf_pres_ttdPPDU);
1058 }
1059
1060
1061 static const ber_sequence_t T_normal_mode_parameters_sequence[] = {
1062   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_protocol_version_impl },
1063   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_calling_presentation_selector_impl },
1064   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_called_presentation_selector_impl },
1065   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_definition_list_impl },
1066   { BER_CLASS_CON, 6, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_default_context_name_impl },
1067   { BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_requirements_impl },
1068   { BER_CLASS_CON, 9, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_session_requirements_impl },
1069   { BER_CLASS_CON, 11, BER_FLAGS_OPTIONAL, dissect_protocol_options },
1070   { BER_CLASS_CON, 12, BER_FLAGS_OPTIONAL, dissect_initiators_nominated_context },
1071   { BER_CLASS_CON, 14, BER_FLAGS_OPTIONAL, dissect_extensions },
1072   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1073   { 0, 0, 0, NULL }
1074 };
1075
1076 static int
1077 dissect_pres_T_normal_mode_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1078   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1079                                    T_normal_mode_parameters_sequence, hf_index, ett_pres_T_normal_mode_parameters);
1080
1081   return offset;
1082 }
1083 static int dissect_normal_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1084   return dissect_pres_T_normal_mode_parameters(TRUE, tvb, offset, pinfo, tree, hf_pres_normal_mode_parameters);
1085 }
1086
1087
1088 static const ber_sequence_t CP_type_set[] = {
1089   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_mode_selector_impl },
1090   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_x410_mode_parameters_impl },
1091   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_normal_mode_parameters_impl },
1092   { 0, 0, 0, NULL }
1093 };
1094
1095 static int
1096 dissect_pres_CP_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1097   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
1098                               CP_type_set, hf_index, ett_pres_CP_type);
1099
1100   return offset;
1101 }
1102
1103
1104
1105 static int
1106 dissect_pres_CPC_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1107   offset = dissect_pres_User_data(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1108
1109   return offset;
1110 }
1111
1112
1113
1114 static int
1115 dissect_pres_Responding_presentation_selector(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1116   offset = dissect_pres_Presentation_selector(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1117
1118   return offset;
1119 }
1120 static int dissect_responding_presentation_selector_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1121   return dissect_pres_Responding_presentation_selector(TRUE, tvb, offset, pinfo, tree, hf_pres_responding_presentation_selector);
1122 }
1123
1124
1125 static const value_string pres_Result_vals[] = {
1126   {   0, "acceptance" },
1127   {   1, "user-rejection" },
1128   {   2, "provider-rejection" },
1129   { 0, NULL }
1130 };
1131
1132
1133 static int
1134 dissect_pres_Result(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1135   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1136                                   NULL);
1137
1138   return offset;
1139 }
1140 static int dissect_result_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1141   return dissect_pres_Result(TRUE, tvb, offset, pinfo, tree, hf_pres_result);
1142 }
1143
1144
1145 static const value_string pres_T_provider_reason_vals[] = {
1146   {   0, "reason-not-specified" },
1147   {   1, "abstract-syntax-not-supported" },
1148   {   2, "proposed-transfer-syntaxes-not-supported" },
1149   {   3, "local-limit-on-DCS-exceeded" },
1150   { 0, NULL }
1151 };
1152
1153
1154 static int
1155 dissect_pres_T_provider_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1156   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1157                                   NULL);
1158
1159   return offset;
1160 }
1161 static int dissect_provider_reason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1162   return dissect_pres_T_provider_reason(TRUE, tvb, offset, pinfo, tree, hf_pres_provider_reason);
1163 }
1164
1165
1166 static const ber_sequence_t Result_list_item_sequence[] = {
1167   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_result_impl },
1168   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_transfer_syntax_name_impl },
1169   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_provider_reason_impl },
1170   { 0, 0, 0, NULL }
1171 };
1172
1173 static int
1174 dissect_pres_Result_list_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1175   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1176                                    Result_list_item_sequence, hf_index, ett_pres_Result_list_item);
1177
1178   return offset;
1179 }
1180 static int dissect_Result_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1181   return dissect_pres_Result_list_item(FALSE, tvb, offset, pinfo, tree, hf_pres_Result_list_item);
1182 }
1183
1184
1185 static const ber_sequence_t Result_list_sequence_of[1] = {
1186   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Result_list_item },
1187 };
1188
1189 static int
1190 dissect_pres_Result_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1191   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1192                                       Result_list_sequence_of, hf_index, ett_pres_Result_list);
1193
1194   return offset;
1195 }
1196
1197
1198
1199 static int
1200 dissect_pres_Presentation_context_definition_result_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1201   offset = dissect_pres_Result_list(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1202
1203   return offset;
1204 }
1205 static int dissect_presentation_context_definition_result_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1206   return dissect_pres_Presentation_context_definition_result_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_definition_result_list);
1207 }
1208
1209
1210 static const ber_sequence_t T_CPA_PPDU_normal_mode_parameters_sequence[] = {
1211   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_protocol_version_impl },
1212   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_responding_presentation_selector_impl },
1213   { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_definition_result_list_impl },
1214   { BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_requirements_impl },
1215   { BER_CLASS_CON, 9, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_session_requirements_impl },
1216   { BER_CLASS_CON, 11, BER_FLAGS_OPTIONAL, dissect_protocol_options },
1217   { BER_CLASS_CON, 13, BER_FLAGS_OPTIONAL, dissect_responders_nominated_context },
1218   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1219   { 0, 0, 0, NULL }
1220 };
1221
1222 static int
1223 dissect_pres_T_CPA_PPDU_normal_mode_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1224   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1225                                    T_CPA_PPDU_normal_mode_parameters_sequence, hf_index, ett_pres_T_CPA_PPDU_normal_mode_parameters);
1226
1227   return offset;
1228 }
1229 static int dissect_cPU_PPDU_normal_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1230   return dissect_pres_T_CPA_PPDU_normal_mode_parameters(TRUE, tvb, offset, pinfo, tree, hf_pres_cPU_PPDU_normal_mode_parameters);
1231 }
1232
1233
1234 static const ber_sequence_t CPA_PPDU_set[] = {
1235   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_mode_selector_impl },
1236   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cPR_PPDU_x400_mode_parameters_impl },
1237   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cPU_PPDU_normal_mode_parameters_impl },
1238   { 0, 0, 0, NULL }
1239 };
1240
1241 static int
1242 dissect_pres_CPA_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1243   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
1244                               CPA_PPDU_set, hf_index, ett_pres_CPA_PPDU);
1245
1246   return offset;
1247 }
1248
1249
1250
1251 static int
1252 dissect_pres_Default_context_result(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1253   offset = dissect_pres_Result(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1254
1255   return offset;
1256 }
1257 static int dissect_default_context_result_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1258   return dissect_pres_Default_context_result(TRUE, tvb, offset, pinfo, tree, hf_pres_default_context_result);
1259 }
1260
1261
1262 static const value_string pres_Provider_reason_vals[] = {
1263   {   0, "reason-not-specified" },
1264   {   1, "temporary-congestion" },
1265   {   2, "local-limit-exceeded" },
1266   {   3, "called-presentation-address-unknown" },
1267   {   4, "protocol-version-not-supported" },
1268   {   5, "default-context-not-supported" },
1269   {   6, "user-data-not-readable" },
1270   {   7, "no-PSAP-available" },
1271   { 0, NULL }
1272 };
1273
1274
1275 static int
1276 dissect_pres_Provider_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1277   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1278                                   NULL);
1279
1280   return offset;
1281 }
1282 static int dissect_cPR_PPDU__provider_reason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1283   return dissect_pres_Provider_reason(TRUE, tvb, offset, pinfo, tree, hf_pres_cPR_PPDU__provider_reason);
1284 }
1285
1286
1287 static const ber_sequence_t T_CPR_PPDU_normal_mode_parameters_sequence[] = {
1288   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_protocol_version_impl },
1289   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_responding_presentation_selector_impl },
1290   { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_definition_result_list_impl },
1291   { BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_default_context_result_impl },
1292   { BER_CLASS_CON, 10, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cPR_PPDU__provider_reason_impl },
1293   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1294   { 0, 0, 0, NULL }
1295 };
1296
1297 static int
1298 dissect_pres_T_CPR_PPDU_normal_mode_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1299   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1300                                    T_CPR_PPDU_normal_mode_parameters_sequence, hf_index, ett_pres_T_CPR_PPDU_normal_mode_parameters);
1301
1302   return offset;
1303 }
1304 static int dissect_cPR_PPDU_normal_mode_parameters(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1305   return dissect_pres_T_CPR_PPDU_normal_mode_parameters(FALSE, tvb, offset, pinfo, tree, hf_pres_cPR_PPDU_normal_mode_parameters);
1306 }
1307
1308
1309 static const value_string pres_CPR_PPDU_vals[] = {
1310   {   0, "x400-mode-parameters" },
1311   {   1, "normal-mode-parameters" },
1312   { 0, NULL }
1313 };
1314
1315 static const ber_choice_t CPR_PPDU_choice[] = {
1316   {   0, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cPU_PPDU_x400_mode_parameters },
1317   {   1, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cPR_PPDU_normal_mode_parameters },
1318   { 0, 0, 0, 0, NULL }
1319 };
1320
1321 static int
1322 dissect_pres_CPR_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1323   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1324                                  CPR_PPDU_choice, hf_index, ett_pres_CPR_PPDU,
1325                                  NULL);
1326
1327   return offset;
1328 }
1329
1330
1331 static const ber_sequence_t Presentation_context_identifier_list_item_sequence[] = {
1332   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_presentation_context_identifier },
1333   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_transfer_syntax_name },
1334   { 0, 0, 0, NULL }
1335 };
1336
1337 static int
1338 dissect_pres_Presentation_context_identifier_list_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1339   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1340                                    Presentation_context_identifier_list_item_sequence, hf_index, ett_pres_Presentation_context_identifier_list_item);
1341
1342   return offset;
1343 }
1344 static int dissect_Presentation_context_identifier_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1345   return dissect_pres_Presentation_context_identifier_list_item(FALSE, tvb, offset, pinfo, tree, hf_pres_Presentation_context_identifier_list_item);
1346 }
1347
1348
1349 static const ber_sequence_t Presentation_context_identifier_list_sequence_of[1] = {
1350   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Presentation_context_identifier_list_item },
1351 };
1352
1353 static int
1354 dissect_pres_Presentation_context_identifier_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1355   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1356                                       Presentation_context_identifier_list_sequence_of, hf_index, ett_pres_Presentation_context_identifier_list);
1357
1358   return offset;
1359 }
1360 static int dissect_presentation_context_identifier_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1361   return dissect_pres_Presentation_context_identifier_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_identifier_list);
1362 }
1363
1364
1365 static const ber_sequence_t T_ARU_PPDU_normal_mode_parameters_sequence[] = {
1366   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_identifier_list_impl },
1367   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1368   { 0, 0, 0, NULL }
1369 };
1370
1371 static int
1372 dissect_pres_T_ARU_PPDU_normal_mode_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1373   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1374                                    T_ARU_PPDU_normal_mode_parameters_sequence, hf_index, ett_pres_T_ARU_PPDU_normal_mode_parameters);
1375
1376   return offset;
1377 }
1378 static int dissect_aRU_PPDU_normal_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1379   return dissect_pres_T_ARU_PPDU_normal_mode_parameters(TRUE, tvb, offset, pinfo, tree, hf_pres_aRU_PPDU_normal_mode_parameters);
1380 }
1381
1382
1383 static const value_string pres_ARU_PPDU_vals[] = {
1384   {   0, "x400-mode-parameters" },
1385   {   1, "normal-mode-parameters" },
1386   { 0, NULL }
1387 };
1388
1389 static const ber_choice_t ARU_PPDU_choice[] = {
1390   {   0, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_aRU_PPDU_x400_mode_parameters },
1391   {   1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_aRU_PPDU_normal_mode_parameters_impl },
1392   { 0, 0, 0, 0, NULL }
1393 };
1394
1395 static int
1396 dissect_pres_ARU_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1397   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1398                                  ARU_PPDU_choice, hf_index, ett_pres_ARU_PPDU,
1399                                  NULL);
1400
1401   return offset;
1402 }
1403 static int dissect_aru_ppdu(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1404   return dissect_pres_ARU_PPDU(FALSE, tvb, offset, pinfo, tree, hf_pres_aru_ppdu);
1405 }
1406
1407
1408 static const value_string pres_Abort_reason_vals[] = {
1409   {   0, "reason-not-specified" },
1410   {   1, "unrecognized-ppdu" },
1411   {   2, "unexpected-ppdu" },
1412   {   3, "unexpected-session-service-primitive" },
1413   {   4, "unrecognized-ppdu-parameter" },
1414   {   5, "unexpected-ppdu-parameter" },
1415   {   6, "invalid-ppdu-parameter-value" },
1416   { 0, NULL }
1417 };
1418
1419
1420 static int
1421 dissect_pres_Abort_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1422   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1423                                   NULL);
1424
1425   return offset;
1426 }
1427 static int dissect_aRU_PPDU_provider_reason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1428   return dissect_pres_Abort_reason(TRUE, tvb, offset, pinfo, tree, hf_pres_aRU_PPDU_provider_reason);
1429 }
1430
1431
1432 static const value_string pres_Event_identifier_vals[] = {
1433   {   0, "cp-PPDU" },
1434   {   1, "cpa-PPDU" },
1435   {   2, "cpr-PPDU" },
1436   {   3, "aru-PPDU" },
1437   {   4, "arp-PPDU" },
1438   {   5, "ac-PPDU" },
1439   {   6, "aca-PPDU" },
1440   {   7, "td-PPDU" },
1441   {   8, "ttd-PPDU" },
1442   {   9, "te-PPDU" },
1443   {  10, "tc-PPDU" },
1444   {  11, "tcc-PPDU" },
1445   {  12, "rs-PPDU" },
1446   {  13, "rsa-PPDU" },
1447   {  14, "s-release-indication" },
1448   {  15, "s-release-confirm" },
1449   {  16, "s-token-give-indication" },
1450   {  17, "s-token-please-indication" },
1451   {  18, "s-control-give-indication" },
1452   {  19, "s-sync-minor-indication" },
1453   {  20, "s-sync-minor-confirm" },
1454   {  21, "s-sync-major-indication" },
1455   {  22, "s-sync-major-confirm" },
1456   {  23, "s-p-exception-report-indication" },
1457   {  24, "s-u-exception-report-indication" },
1458   {  25, "s-activity-start-indication" },
1459   {  26, "s-activity-resume-indication" },
1460   {  27, "s-activity-interrupt-indication" },
1461   {  28, "s-activity-interrupt-confirm" },
1462   {  29, "s-activity-discard-indication" },
1463   {  30, "s-activity-discard-confirm" },
1464   {  31, "s-activity-end-indication" },
1465   {  32, "s-activity-end-confirm" },
1466   { 0, NULL }
1467 };
1468
1469
1470 static int
1471 dissect_pres_Event_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1472   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1473                                   NULL);
1474
1475   return offset;
1476 }
1477 static int dissect_event_identifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1478   return dissect_pres_Event_identifier(TRUE, tvb, offset, pinfo, tree, hf_pres_event_identifier);
1479 }
1480
1481
1482 static const ber_sequence_t ARP_PPDU_sequence[] = {
1483   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aRU_PPDU_provider_reason_impl },
1484   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_event_identifier_impl },
1485   { 0, 0, 0, NULL }
1486 };
1487
1488 static int
1489 dissect_pres_ARP_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1490   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1491                                    ARP_PPDU_sequence, hf_index, ett_pres_ARP_PPDU);
1492
1493   return offset;
1494 }
1495 static int dissect_arp_ppdu(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1496   return dissect_pres_ARP_PPDU(FALSE, tvb, offset, pinfo, tree, hf_pres_arp_ppdu);
1497 }
1498
1499
1500 static const value_string pres_Abort_type_vals[] = {
1501   {   0, "aru-ppdu" },
1502   {   1, "arp-ppdu" },
1503   { 0, NULL }
1504 };
1505
1506 static const ber_choice_t Abort_type_choice[] = {
1507   {   0, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_aru_ppdu },
1508   {   1, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_arp_ppdu },
1509   { 0, 0, 0, 0, NULL }
1510 };
1511
1512 static int
1513 dissect_pres_Abort_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1514   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1515                                  Abort_type_choice, hf_index, ett_pres_Abort_type,
1516                                  NULL);
1517
1518   return offset;
1519 }
1520
1521
1522
1523 static int
1524 dissect_pres_Presentation_context_addition_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1525   offset = dissect_pres_Context_list(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1526
1527   return offset;
1528 }
1529 static int dissect_presentation_context_addition_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1530   return dissect_pres_Presentation_context_addition_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_addition_list);
1531 }
1532
1533
1534 static const ber_sequence_t Presentation_context_deletion_list_sequence_of[1] = {
1535   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_Presentation_context_deletion_list_item },
1536 };
1537
1538 static int
1539 dissect_pres_Presentation_context_deletion_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1540   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1541                                       Presentation_context_deletion_list_sequence_of, hf_index, ett_pres_Presentation_context_deletion_list);
1542
1543   return offset;
1544 }
1545 static int dissect_presentation_context_deletion_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1546   return dissect_pres_Presentation_context_deletion_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_deletion_list);
1547 }
1548
1549
1550 static const ber_sequence_t AC_PPDU_sequence[] = {
1551   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_addition_list_impl },
1552   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_deletion_list_impl },
1553   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1554   { 0, 0, 0, NULL }
1555 };
1556
1557 static int
1558 dissect_pres_AC_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1559   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1560                                    AC_PPDU_sequence, hf_index, ett_pres_AC_PPDU);
1561
1562   return offset;
1563 }
1564 static int dissect_acPPDU_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1565   return dissect_pres_AC_PPDU(TRUE, tvb, offset, pinfo, tree, hf_pres_acPPDU);
1566 }
1567
1568
1569
1570 static int
1571 dissect_pres_Presentation_context_addition_result_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1572   offset = dissect_pres_Result_list(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1573
1574   return offset;
1575 }
1576 static int dissect_presentation_context_addition_result_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1577   return dissect_pres_Presentation_context_addition_result_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_addition_result_list);
1578 }
1579
1580
1581 static const value_string pres_Presentation_context_deletion_result_list_item_vals[] = {
1582   {   0, "acceptance" },
1583   {   1, "user-rejection" },
1584   { 0, NULL }
1585 };
1586
1587
1588 static int
1589 dissect_pres_Presentation_context_deletion_result_list_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1590   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1591                                   NULL);
1592
1593   return offset;
1594 }
1595 static int dissect_Presentation_context_deletion_result_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1596   return dissect_pres_Presentation_context_deletion_result_list_item(FALSE, tvb, offset, pinfo, tree, hf_pres_Presentation_context_deletion_result_list_item);
1597 }
1598
1599
1600 static const ber_sequence_t Presentation_context_deletion_result_list_sequence_of[1] = {
1601   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_Presentation_context_deletion_result_list_item },
1602 };
1603
1604 static int
1605 dissect_pres_Presentation_context_deletion_result_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1606   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1607                                       Presentation_context_deletion_result_list_sequence_of, hf_index, ett_pres_Presentation_context_deletion_result_list);
1608
1609   return offset;
1610 }
1611 static int dissect_presentation_context_deletion_result_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1612   return dissect_pres_Presentation_context_deletion_result_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_deletion_result_list);
1613 }
1614
1615
1616 static const ber_sequence_t ACA_PPDU_sequence[] = {
1617   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_addition_result_list_impl },
1618   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_deletion_result_list_impl },
1619   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1620   { 0, 0, 0, NULL }
1621 };
1622
1623 static int
1624 dissect_pres_ACA_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1625   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1626                                    ACA_PPDU_sequence, hf_index, ett_pres_ACA_PPDU);
1627
1628   return offset;
1629 }
1630 static int dissect_acaPPDU_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1631   return dissect_pres_ACA_PPDU(TRUE, tvb, offset, pinfo, tree, hf_pres_acaPPDU);
1632 }
1633
1634
1635 static const value_string pres_Typed_data_type_vals[] = {
1636   {   0, "acPPDU" },
1637   {   1, "acaPPDU" },
1638   {   2, "ttdPPDU" },
1639   { 0, NULL }
1640 };
1641
1642 static const ber_choice_t Typed_data_type_choice[] = {
1643   {   0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_acPPDU_impl },
1644   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_acaPPDU_impl },
1645   {   2, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_ttdPPDU },
1646   { 0, 0, 0, 0, NULL }
1647 };
1648
1649 static int
1650 dissect_pres_Typed_data_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1651   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1652                                  Typed_data_type_choice, hf_index, ett_pres_Typed_data_type,
1653                                  NULL);
1654
1655   return offset;
1656 }
1657
1658
1659 static const ber_sequence_t RS_PPDU_sequence[] = {
1660   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_identifier_list_impl },
1661   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1662   { 0, 0, 0, NULL }
1663 };
1664
1665 static int
1666 dissect_pres_RS_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1667   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1668                                    RS_PPDU_sequence, hf_index, ett_pres_RS_PPDU);
1669
1670   return offset;
1671 }
1672
1673
1674 static const ber_sequence_t RSA_PPDU_sequence[] = {
1675   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_identifier_list_impl },
1676   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1677   { 0, 0, 0, NULL }
1678 };
1679
1680 static int
1681 dissect_pres_RSA_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1682   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1683                                    RSA_PPDU_sequence, hf_index, ett_pres_RSA_PPDU);
1684
1685   return offset;
1686 }
1687
1688
1689 /*--- End of included file: packet-pres-fn.c ---*/
1690
1691
1692
1693 /*
1694  * Dissect an PPDU.
1695  */
1696 static int
1697 dissect_ppdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1698 {
1699   proto_item *ti;
1700   proto_tree *pres_tree = NULL;
1701   guint s_type;
1702 /* do we have spdu type from the session dissector?  */
1703         if( !pinfo->private_data ){
1704                 if(tree){
1705                         proto_tree_add_text(tree, tvb, offset, -1,
1706                                 "Internal error:can't get spdu type from session dissector.");
1707                         return  FALSE;
1708                 }
1709         }else{
1710                 session  = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) );
1711                 if(session->spdu_type == 0 ){
1712                         if(tree){
1713                                 proto_tree_add_text(tree, tvb, offset, -1,
1714                                         "Internal error:wrong spdu type %x from session dissector.",session->spdu_type);
1715                                 return  FALSE;
1716                         }
1717                 }
1718         }
1719 /* get type of tag      */
1720         s_type = tvb_get_guint8(tvb, offset);
1721                 /*  set up type of Ppdu */
1722         if (check_col(pinfo->cinfo, COL_INFO))
1723                                         col_add_str(pinfo->cinfo, COL_INFO,
1724                                                 val_to_str(session->spdu_type, ses_vals, "Unknown Ppdu type (0x%02x)"));
1725   if (tree){
1726           ti = proto_tree_add_item(tree, proto_pres, tvb, offset, -1,
1727                     FALSE);
1728           pres_tree = proto_item_add_subtree(ti, ett_pres);
1729   }
1730
1731         switch(session->spdu_type){
1732                 case SES_REFUSE:
1733                         break;
1734                 case SES_CONNECTION_REQUEST:
1735                         offset = dissect_pres_CP_type(FALSE, tvb, offset, pinfo, pres_tree, -1);
1736                         break;
1737                 case SES_CONNECTION_ACCEPT:
1738                         offset = dissect_pres_CPA_PPDU(FALSE, tvb, offset, pinfo, pres_tree, -1);
1739                         break;
1740                 case SES_ABORT:
1741                         offset = dissect_pres_Abort_type(FALSE, tvb, offset, pinfo, pres_tree, -1);
1742                         break;
1743                 case SES_DATA_TRANSFER:
1744                         offset = dissect_pres_CPC_type(FALSE, tvb, offset, pinfo, pres_tree, -1);
1745                         break;
1746                 default:
1747                         break;
1748         }
1749
1750         return offset;
1751 }
1752
1753 void
1754 dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
1755 {
1756         int offset = 0, old_offset;
1757 /* first, try to check length   */
1758 /* do we have at least 4 bytes  */
1759         if (!tvb_bytes_exist(tvb, 0, 4)){
1760                 proto_tree_add_text(parent_tree, tvb, offset, 
1761                         tvb_reported_length_remaining(tvb,offset),"User data");
1762                 return;  /* no, it isn't a presentation PDU */
1763         }
1764
1765         /*  we can't make any additional checking here   */
1766         /*  postpone it before dissector will have more information */
1767
1768         if (check_col(pinfo->cinfo, COL_PROTOCOL))
1769                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PRES");
1770         if (check_col(pinfo->cinfo, COL_INFO))
1771                 col_clear(pinfo->cinfo, COL_INFO);
1772         /* save pointers for calling the acse dissector  */
1773         global_tree = parent_tree;
1774         global_pinfo = pinfo;
1775
1776         while (tvb_reported_length_remaining(tvb, offset) > 0){
1777                 old_offset = offset;
1778                 offset = dissect_ppdu(tvb, offset, pinfo, parent_tree);
1779                 if(offset <= old_offset){
1780                         proto_tree_add_text(parent_tree, tvb, offset, -1,"Invalid offset");
1781                         THROW(ReportedBoundsError);
1782                 }
1783         }
1784 }
1785
1786
1787 /*--- proto_register_pres -------------------------------------------*/
1788 void proto_register_pres(void) {
1789
1790   /* List of fields */
1791   static hf_register_info hf[] = {
1792
1793
1794 /*--- Included file: packet-pres-hfarr.c ---*/
1795
1796     { &hf_pres_checkpointSize,
1797       { "checkpointSize", "pres.checkpointSize",
1798         FT_INT32, BASE_DEC, NULL, 0,
1799         "", HFILL }},
1800     { &hf_pres_windowSize,
1801       { "windowSize", "pres.windowSize",
1802         FT_INT32, BASE_DEC, NULL, 0,
1803         "", HFILL }},
1804     { &hf_pres_dialogueMode,
1805       { "dialogueMode", "pres.dialogueMode",
1806         FT_INT32, BASE_DEC, VALS(pres_T_dialogueMode_vals), 0,
1807         "RTORQapdu/dialogueMode", HFILL }},
1808     { &hf_pres_connectionDataRQ,
1809       { "connectionDataRQ", "pres.connectionDataRQ",
1810         FT_UINT32, BASE_DEC, VALS(pres_ConnectionData_vals), 0,
1811         "RTORQapdu/connectionDataRQ", HFILL }},
1812     { &hf_pres_applicationProtocol,
1813       { "applicationProtocol", "pres.applicationProtocol",
1814         FT_INT32, BASE_DEC, NULL, 0,
1815         "RTORQapdu/applicationProtocol", HFILL }},
1816     { &hf_pres_connectionDataAC,
1817       { "connectionDataAC", "pres.connectionDataAC",
1818         FT_UINT32, BASE_DEC, VALS(pres_ConnectionData_vals), 0,
1819         "RTOACapdu/connectionDataAC", HFILL }},
1820     { &hf_pres_refuseReason,
1821       { "refuseReason", "pres.refuseReason",
1822         FT_INT32, BASE_DEC, VALS(pres_RefuseReason_vals), 0,
1823         "RTORJapdu/refuseReason", HFILL }},
1824     { &hf_pres_userDataRJ,
1825       { "userDataRJ", "pres.userDataRJ",
1826         FT_NONE, BASE_NONE, NULL, 0,
1827         "RTORJapdu/userDataRJ", HFILL }},
1828     { &hf_pres_abortReason,
1829       { "abortReason", "pres.abortReason",
1830         FT_INT32, BASE_DEC, VALS(pres_AbortReason_vals), 0,
1831         "RTABapdu/abortReason", HFILL }},
1832     { &hf_pres_reflectedParameter,
1833       { "reflectedParameter", "pres.reflectedParameter",
1834         FT_BYTES, BASE_HEX, NULL, 0,
1835         "RTABapdu/reflectedParameter", HFILL }},
1836     { &hf_pres_userdataAB,
1837       { "userdataAB", "pres.userdataAB",
1838         FT_NONE, BASE_NONE, NULL, 0,
1839         "RTABapdu/userdataAB", HFILL }},
1840     { &hf_pres_open,
1841       { "open", "pres.open",
1842         FT_NONE, BASE_NONE, NULL, 0,
1843         "ConnectionData/open", HFILL }},
1844     { &hf_pres_recover,
1845       { "recover", "pres.recover",
1846         FT_NONE, BASE_NONE, NULL, 0,
1847         "ConnectionData/recover", HFILL }},
1848     { &hf_pres_callingSSuserReference,
1849       { "callingSSuserReference", "pres.callingSSuserReference",
1850         FT_UINT32, BASE_DEC, VALS(pres_CallingSSuserReference_vals), 0,
1851         "SessionConnectionIdentifier/callingSSuserReference", HFILL }},
1852     { &hf_pres_commonReference,
1853       { "commonReference", "pres.commonReference",
1854         FT_STRING, BASE_NONE, NULL, 0,
1855         "SessionConnectionIdentifier/commonReference", HFILL }},
1856     { &hf_pres_additionalReferenceInformation,
1857       { "additionalReferenceInformation", "pres.additionalReferenceInformation",
1858         FT_STRING, BASE_NONE, NULL, 0,
1859         "SessionConnectionIdentifier/additionalReferenceInformation", HFILL }},
1860     { &hf_pres_t61String,
1861       { "t61String", "pres.t61String",
1862         FT_STRING, BASE_NONE, NULL, 0,
1863         "CallingSSuserReference/t61String", HFILL }},
1864     { &hf_pres_octetString,
1865       { "octetString", "pres.octetString",
1866         FT_BYTES, BASE_HEX, NULL, 0,
1867         "CallingSSuserReference/octetString", HFILL }},
1868     { &hf_pres_mode_selector,
1869       { "mode-selector", "pres.mode_selector",
1870         FT_NONE, BASE_NONE, NULL, 0,
1871         "", HFILL }},
1872     { &hf_pres_x410_mode_parameters,
1873       { "x410-mode-parameters", "pres.x410_mode_parameters",
1874         FT_NONE, BASE_NONE, NULL, 0,
1875         "CP-type/x410-mode-parameters", HFILL }},
1876     { &hf_pres_normal_mode_parameters,
1877       { "normal-mode-parameters", "pres.normal_mode_parameters",
1878         FT_NONE, BASE_NONE, NULL, 0,
1879         "CP-type/normal-mode-parameters", HFILL }},
1880     { &hf_pres_protocol_version,
1881       { "protocol-version", "pres.protocol_version",
1882         FT_BYTES, BASE_HEX, NULL, 0,
1883         "", HFILL }},
1884     { &hf_pres_calling_presentation_selector,
1885       { "calling-presentation-selector", "pres.calling_presentation_selector",
1886         FT_BYTES, BASE_HEX, NULL, 0,
1887         "CP-type/normal-mode-parameters/calling-presentation-selector", HFILL }},
1888     { &hf_pres_called_presentation_selector,
1889       { "called-presentation-selector", "pres.called_presentation_selector",
1890         FT_BYTES, BASE_HEX, NULL, 0,
1891         "CP-type/normal-mode-parameters/called-presentation-selector", HFILL }},
1892     { &hf_pres_presentation_context_definition_list,
1893       { "presentation-context-definition-list", "pres.presentation_context_definition_list",
1894         FT_UINT32, BASE_DEC, NULL, 0,
1895         "CP-type/normal-mode-parameters/presentation-context-definition-list", HFILL }},
1896     { &hf_pres_default_context_name,
1897       { "default-context-name", "pres.default_context_name",
1898         FT_NONE, BASE_NONE, NULL, 0,
1899         "CP-type/normal-mode-parameters/default-context-name", HFILL }},
1900     { &hf_pres_presentation_requirements,
1901       { "presentation-requirements", "pres.presentation_requirements",
1902         FT_BYTES, BASE_HEX, NULL, 0,
1903         "", HFILL }},
1904     { &hf_pres_user_session_requirements,
1905       { "user-session-requirements", "pres.user_session_requirements",
1906         FT_BYTES, BASE_HEX, NULL, 0,
1907         "", HFILL }},
1908     { &hf_pres_protocol_options,
1909       { "protocol-options", "pres.protocol_options",
1910         FT_BYTES, BASE_HEX, NULL, 0,
1911         "", HFILL }},
1912     { &hf_pres_initiators_nominated_context,
1913       { "initiators-nominated-context", "pres.initiators_nominated_context",
1914         FT_INT32, BASE_DEC, NULL, 0,
1915         "CP-type/normal-mode-parameters/initiators-nominated-context", HFILL }},
1916     { &hf_pres_extensions,
1917       { "extensions", "pres.extensions",
1918         FT_NONE, BASE_NONE, NULL, 0,
1919         "CP-type/normal-mode-parameters/extensions", HFILL }},
1920     { &hf_pres_user_data,
1921       { "user-data", "pres.user_data",
1922         FT_UINT32, BASE_DEC, VALS(pres_User_data_vals), 0,
1923         "", HFILL }},
1924     { &hf_pres_cPR_PPDU_x400_mode_parameters,
1925       { "x410-mode-parameters", "pres.x410_mode_parameters",
1926         FT_NONE, BASE_NONE, NULL, 0,
1927         "CPA-PPDU/x410-mode-parameters", HFILL }},
1928     { &hf_pres_cPU_PPDU_normal_mode_parameters,
1929       { "normal-mode-parameters", "pres.normal_mode_parameters",
1930         FT_NONE, BASE_NONE, NULL, 0,
1931         "CPA-PPDU/normal-mode-parameters", HFILL }},
1932     { &hf_pres_responding_presentation_selector,
1933       { "responding-presentation-selector", "pres.responding_presentation_selector",
1934         FT_BYTES, BASE_HEX, NULL, 0,
1935         "", HFILL }},
1936     { &hf_pres_presentation_context_definition_result_list,
1937       { "presentation-context-definition-result-list", "pres.presentation_context_definition_result_list",
1938         FT_UINT32, BASE_DEC, NULL, 0,
1939         "", HFILL }},
1940     { &hf_pres_responders_nominated_context,
1941       { "responders-nominated-context", "pres.responders_nominated_context",
1942         FT_INT32, BASE_DEC, NULL, 0,
1943         "CPA-PPDU/normal-mode-parameters/responders-nominated-context", HFILL }},
1944     { &hf_pres_cPU_PPDU_x400_mode_parameters,
1945       { "x400-mode-parameters", "pres.x400_mode_parameters",
1946         FT_NONE, BASE_NONE, NULL, 0,
1947         "CPR-PPDU/x400-mode-parameters", HFILL }},
1948     { &hf_pres_cPR_PPDU_normal_mode_parameters,
1949       { "normal-mode-parameters", "pres.normal_mode_parameters",
1950         FT_NONE, BASE_NONE, NULL, 0,
1951         "CPR-PPDU/normal-mode-parameters", HFILL }},
1952     { &hf_pres_default_context_result,
1953       { "default-context-result", "pres.default_context_result",
1954         FT_INT32, BASE_DEC, VALS(pres_Result_vals), 0,
1955         "CPR-PPDU/normal-mode-parameters/default-context-result", HFILL }},
1956     { &hf_pres_cPR_PPDU__provider_reason,
1957       { "provider-reason", "pres.provider_reason",
1958         FT_INT32, BASE_DEC, VALS(pres_Provider_reason_vals), 0,
1959         "CPR-PPDU/normal-mode-parameters/provider-reason", HFILL }},
1960     { &hf_pres_aru_ppdu,
1961       { "aru-ppdu", "pres.aru_ppdu",
1962         FT_UINT32, BASE_DEC, VALS(pres_ARU_PPDU_vals), 0,
1963         "Abort-type/aru-ppdu", HFILL }},
1964     { &hf_pres_arp_ppdu,
1965       { "arp-ppdu", "pres.arp_ppdu",
1966         FT_NONE, BASE_NONE, NULL, 0,
1967         "Abort-type/arp-ppdu", HFILL }},
1968     { &hf_pres_aRU_PPDU_x400_mode_parameters,
1969       { "x400-mode-parameters", "pres.x400_mode_parameters",
1970         FT_NONE, BASE_NONE, NULL, 0,
1971         "ARU-PPDU/x400-mode-parameters", HFILL }},
1972     { &hf_pres_aRU_PPDU_normal_mode_parameters,
1973       { "normal-mode-parameters", "pres.normal_mode_parameters",
1974         FT_NONE, BASE_NONE, NULL, 0,
1975         "ARU-PPDU/normal-mode-parameters", HFILL }},
1976     { &hf_pres_presentation_context_identifier_list,
1977       { "presentation-context-identifier-list", "pres.presentation_context_identifier_list",
1978         FT_UINT32, BASE_DEC, NULL, 0,
1979         "", HFILL }},
1980     { &hf_pres_aRU_PPDU_provider_reason,
1981       { "provider-reason", "pres.provider_reason",
1982         FT_INT32, BASE_DEC, VALS(pres_Abort_reason_vals), 0,
1983         "ARP-PPDU/provider-reason", HFILL }},
1984     { &hf_pres_event_identifier,
1985       { "event-identifier", "pres.event_identifier",
1986         FT_INT32, BASE_DEC, VALS(pres_Event_identifier_vals), 0,
1987         "ARP-PPDU/event-identifier", HFILL }},
1988     { &hf_pres_acPPDU,
1989       { "acPPDU", "pres.acPPDU",
1990         FT_NONE, BASE_NONE, NULL, 0,
1991         "Typed-data-type/acPPDU", HFILL }},
1992     { &hf_pres_acaPPDU,
1993       { "acaPPDU", "pres.acaPPDU",
1994         FT_NONE, BASE_NONE, NULL, 0,
1995         "Typed-data-type/acaPPDU", HFILL }},
1996     { &hf_pres_ttdPPDU,
1997       { "ttdPPDU", "pres.ttdPPDU",
1998         FT_UINT32, BASE_DEC, VALS(pres_User_data_vals), 0,
1999         "Typed-data-type/ttdPPDU", HFILL }},
2000     { &hf_pres_presentation_context_addition_list,
2001       { "presentation-context-addition-list", "pres.presentation_context_addition_list",
2002         FT_UINT32, BASE_DEC, NULL, 0,
2003         "AC-PPDU/presentation-context-addition-list", HFILL }},
2004     { &hf_pres_presentation_context_deletion_list,
2005       { "presentation-context-deletion-list", "pres.presentation_context_deletion_list",
2006         FT_UINT32, BASE_DEC, NULL, 0,
2007         "AC-PPDU/presentation-context-deletion-list", HFILL }},
2008     { &hf_pres_presentation_context_addition_result_list,
2009       { "presentation-context-addition-result-list", "pres.presentation_context_addition_result_list",
2010         FT_UINT32, BASE_DEC, NULL, 0,
2011         "ACA-PPDU/presentation-context-addition-result-list", HFILL }},
2012     { &hf_pres_presentation_context_deletion_result_list,
2013       { "presentation-context-deletion-result-list", "pres.presentation_context_deletion_result_list",
2014         FT_UINT32, BASE_DEC, NULL, 0,
2015         "ACA-PPDU/presentation-context-deletion-result-list", HFILL }},
2016     { &hf_pres_Context_list_item,
2017       { "Item", "pres.Context_list_item",
2018         FT_NONE, BASE_NONE, NULL, 0,
2019         "Context-list/_item", HFILL }},
2020     { &hf_pres_presentation_context_identifier,
2021       { "presentation-context-identifier", "pres.presentation_context_identifier",
2022         FT_INT32, BASE_DEC, NULL, 0,
2023         "", HFILL }},
2024     { &hf_pres_abstract_syntax_name,
2025       { "abstract-syntax-name", "pres.abstract_syntax_name",
2026         FT_STRING, BASE_NONE, NULL, 0,
2027         "", HFILL }},
2028     { &hf_pres_transfer_syntax_name_list,
2029       { "transfer-syntax-name-list", "pres.transfer_syntax_name_list",
2030         FT_UINT32, BASE_DEC, NULL, 0,
2031         "Context-list/_item/transfer-syntax-name-list", HFILL }},
2032     { &hf_pres_transfer_syntax_name_list_item,
2033       { "Item", "pres.transfer_syntax_name_list_item",
2034         FT_STRING, BASE_NONE, NULL, 0,
2035         "Context-list/_item/transfer-syntax-name-list/_item", HFILL }},
2036     { &hf_pres_transfer_syntax_name,
2037       { "transfer-syntax-name", "pres.transfer_syntax_name",
2038         FT_STRING, BASE_NONE, NULL, 0,
2039         "", HFILL }},
2040     { &hf_pres_mode_value,
2041       { "mode-value", "pres.mode_value",
2042         FT_INT32, BASE_DEC, VALS(pres_T_mode_value_vals), 0,
2043         "Mode-selector/mode-value", HFILL }},
2044     { &hf_pres_Presentation_context_deletion_list_item,
2045       { "Item", "pres.Presentation_context_deletion_list_item",
2046         FT_INT32, BASE_DEC, NULL, 0,
2047         "Presentation-context-deletion-list/_item", HFILL }},
2048     { &hf_pres_Presentation_context_deletion_result_list_item,
2049       { "Item", "pres.Presentation_context_deletion_result_list_item",
2050         FT_INT32, BASE_DEC, VALS(pres_Presentation_context_deletion_result_list_item_vals), 0,
2051         "Presentation-context-deletion-result-list/_item", HFILL }},
2052     { &hf_pres_Presentation_context_identifier_list_item,
2053       { "Item", "pres.Presentation_context_identifier_list_item",
2054         FT_NONE, BASE_NONE, NULL, 0,
2055         "Presentation-context-identifier-list/_item", HFILL }},
2056     { &hf_pres_Result_list_item,
2057       { "Item", "pres.Result_list_item",
2058         FT_NONE, BASE_NONE, NULL, 0,
2059         "Result-list/_item", HFILL }},
2060     { &hf_pres_result,
2061       { "result", "pres.result",
2062         FT_INT32, BASE_DEC, VALS(pres_Result_vals), 0,
2063         "Result-list/_item/result", HFILL }},
2064     { &hf_pres_provider_reason,
2065       { "provider-reason", "pres.provider_reason",
2066         FT_INT32, BASE_DEC, VALS(pres_T_provider_reason_vals), 0,
2067         "Result-list/_item/provider-reason", HFILL }},
2068     { &hf_pres_simply_encoded_data,
2069       { "simply-encoded-data", "pres.simply_encoded_data",
2070         FT_BYTES, BASE_HEX, NULL, 0,
2071         "User-data/simply-encoded-data", HFILL }},
2072     { &hf_pres_fully_encoded_data,
2073       { "fully-encoded-data", "pres.fully_encoded_data",
2074         FT_UINT32, BASE_DEC, NULL, 0,
2075         "User-data/fully-encoded-data", HFILL }},
2076     { &hf_pres_Fully_encoded_data_item,
2077       { "Item", "pres.Fully_encoded_data_item",
2078         FT_NONE, BASE_NONE, NULL, 0,
2079         "Fully-encoded-data/_item", HFILL }},
2080     { &hf_pres_presentation_data_values,
2081       { "presentation-data-values", "pres.presentation_data_values",
2082         FT_UINT32, BASE_DEC, VALS(pres_T_presentation_data_values_vals), 0,
2083         "PDV-list/presentation-data-values", HFILL }},
2084     { &hf_pres_single_ASN1_type,
2085       { "single-ASN1-type", "pres.single_ASN1_type",
2086         FT_BYTES, BASE_HEX, NULL, 0,
2087         "PDV-list/presentation-data-values/single-ASN1-type", HFILL }},
2088     { &hf_pres_octet_aligned,
2089       { "octet-aligned", "pres.octet_aligned",
2090         FT_BYTES, BASE_HEX, NULL, 0,
2091         "PDV-list/presentation-data-values/octet-aligned", HFILL }},
2092     { &hf_pres_arbitrary,
2093       { "arbitrary", "pres.arbitrary",
2094         FT_BYTES, BASE_HEX, NULL, 0,
2095         "PDV-list/presentation-data-values/arbitrary", HFILL }},
2096     { &hf_pres_Presentation_requirements_context_management,
2097       { "context-management", "pres.context-management",
2098         FT_BOOLEAN, 8, NULL, 0x80,
2099         "", HFILL }},
2100     { &hf_pres_Presentation_requirements_restoration,
2101       { "restoration", "pres.restoration",
2102         FT_BOOLEAN, 8, NULL, 0x40,
2103         "", HFILL }},
2104     { &hf_pres_Protocol_options_nominated_context,
2105       { "nominated-context", "pres.nominated-context",
2106         FT_BOOLEAN, 8, NULL, 0x80,
2107         "", HFILL }},
2108     { &hf_pres_Protocol_options_short_encoding,
2109       { "short-encoding", "pres.short-encoding",
2110         FT_BOOLEAN, 8, NULL, 0x40,
2111         "", HFILL }},
2112     { &hf_pres_Protocol_options_packed_encoding_rules,
2113       { "packed-encoding-rules", "pres.packed-encoding-rules",
2114         FT_BOOLEAN, 8, NULL, 0x20,
2115         "", HFILL }},
2116     { &hf_pres_Protocol_version_version_1,
2117       { "version-1", "pres.version-1",
2118         FT_BOOLEAN, 8, NULL, 0x80,
2119         "", HFILL }},
2120     { &hf_pres_User_session_requirements_half_duplex,
2121       { "half-duplex", "pres.half-duplex",
2122         FT_BOOLEAN, 8, NULL, 0x80,
2123         "", HFILL }},
2124     { &hf_pres_User_session_requirements_duplex,
2125       { "duplex", "pres.duplex",
2126         FT_BOOLEAN, 8, NULL, 0x40,
2127         "", HFILL }},
2128     { &hf_pres_User_session_requirements_expedited_data,
2129       { "expedited-data", "pres.expedited-data",
2130         FT_BOOLEAN, 8, NULL, 0x20,
2131         "", HFILL }},
2132     { &hf_pres_User_session_requirements_minor_synchronize,
2133       { "minor-synchronize", "pres.minor-synchronize",
2134         FT_BOOLEAN, 8, NULL, 0x10,
2135         "", HFILL }},
2136     { &hf_pres_User_session_requirements_major_synchronize,
2137       { "major-synchronize", "pres.major-synchronize",
2138         FT_BOOLEAN, 8, NULL, 0x08,
2139         "", HFILL }},
2140     { &hf_pres_User_session_requirements_resynchronize,
2141       { "resynchronize", "pres.resynchronize",
2142         FT_BOOLEAN, 8, NULL, 0x04,
2143         "", HFILL }},
2144     { &hf_pres_User_session_requirements_activity_management,
2145       { "activity-management", "pres.activity-management",
2146         FT_BOOLEAN, 8, NULL, 0x02,
2147         "", HFILL }},
2148     { &hf_pres_User_session_requirements_negotiated_release,
2149       { "negotiated-release", "pres.negotiated-release",
2150         FT_BOOLEAN, 8, NULL, 0x01,
2151         "", HFILL }},
2152     { &hf_pres_User_session_requirements_capability_data,
2153       { "capability-data", "pres.capability-data",
2154         FT_BOOLEAN, 8, NULL, 0x80,
2155         "", HFILL }},
2156     { &hf_pres_User_session_requirements_exceptions,
2157       { "exceptions", "pres.exceptions",
2158         FT_BOOLEAN, 8, NULL, 0x40,
2159         "", HFILL }},
2160     { &hf_pres_User_session_requirements_typed_data,
2161       { "typed-data", "pres.typed-data",
2162         FT_BOOLEAN, 8, NULL, 0x20,
2163         "", HFILL }},
2164     { &hf_pres_User_session_requirements_symmetric_synchronize,
2165       { "symmetric-synchronize", "pres.symmetric-synchronize",
2166         FT_BOOLEAN, 8, NULL, 0x10,
2167         "", HFILL }},
2168     { &hf_pres_User_session_requirements_data_separation,
2169       { "data-separation", "pres.data-separation",
2170         FT_BOOLEAN, 8, NULL, 0x08,
2171         "", HFILL }},
2172
2173 /*--- End of included file: packet-pres-hfarr.c ---*/
2174
2175   };
2176
2177   /* List of subtrees */
2178   static gint *ett[] = {
2179                 &ett_pres,
2180
2181 /*--- Included file: packet-pres-ettarr.c ---*/
2182
2183     &ett_pres_RTORQapdu,
2184     &ett_pres_RTOACapdu,
2185     &ett_pres_RTORJapdu,
2186     &ett_pres_RTABapdu,
2187     &ett_pres_ConnectionData,
2188     &ett_pres_SessionConnectionIdentifier,
2189     &ett_pres_CallingSSuserReference,
2190     &ett_pres_CP_type,
2191     &ett_pres_T_normal_mode_parameters,
2192     &ett_pres_T_extensions,
2193     &ett_pres_CPA_PPDU,
2194     &ett_pres_T_CPA_PPDU_normal_mode_parameters,
2195     &ett_pres_CPR_PPDU,
2196     &ett_pres_T_CPR_PPDU_normal_mode_parameters,
2197     &ett_pres_Abort_type,
2198     &ett_pres_ARU_PPDU,
2199     &ett_pres_T_ARU_PPDU_normal_mode_parameters,
2200     &ett_pres_ARP_PPDU,
2201     &ett_pres_Typed_data_type,
2202     &ett_pres_AC_PPDU,
2203     &ett_pres_ACA_PPDU,
2204     &ett_pres_RS_PPDU,
2205     &ett_pres_RSA_PPDU,
2206     &ett_pres_Context_list,
2207     &ett_pres_Context_list_item,
2208     &ett_pres_SEQUENCE_OF_Transfer_syntax_name,
2209     &ett_pres_Default_context_name,
2210     &ett_pres_Mode_selector,
2211     &ett_pres_Presentation_context_deletion_list,
2212     &ett_pres_Presentation_context_deletion_result_list,
2213     &ett_pres_Presentation_context_identifier_list,
2214     &ett_pres_Presentation_context_identifier_list_item,
2215     &ett_pres_Presentation_requirements,
2216     &ett_pres_Protocol_options,
2217     &ett_pres_Protocol_version,
2218     &ett_pres_Result_list,
2219     &ett_pres_Result_list_item,
2220     &ett_pres_User_data,
2221     &ett_pres_Fully_encoded_data,
2222     &ett_pres_PDV_list,
2223     &ett_pres_T_presentation_data_values,
2224     &ett_pres_User_session_requirements,
2225
2226 /*--- End of included file: packet-pres-ettarr.c ---*/
2227
2228   };
2229
2230   /* Register protocol */
2231   proto_pres = proto_register_protocol(PNAME, PSNAME, PFNAME);
2232   register_dissector("pres", dissect_pres, proto_pres);
2233   /* Register fields and subtrees */
2234   proto_register_field_array(proto_pres, hf, array_length(hf));
2235   proto_register_subtree_array(ett, array_length(ett));
2236   register_init_routine(pres_init);
2237
2238 }
2239
2240
2241 /*--- proto_reg_handoff_pres ---------------------------------------*/
2242 void proto_reg_handoff_pres(void) {
2243
2244 /*      register_ber_oid_dissector("0.4.0.0.1.1.1.1", dissect_pres, proto_pres, 
2245           "itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) abstractSyntax(1) pres(1) version1(1)"); */
2246
2247         data_handle = find_dissector("data");
2248         acse_handle = find_dissector("acse");
2249 }