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