From Graeme Lunt
[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 #include "packet-rtse.h"
50
51
52 #define PNAME  "ISO 8823 OSI Presentation Protocol"
53 #define PSNAME "PRES"
54 #define PFNAME "pres"
55
56 /* Initialize the protocol and registered fields */
57 int proto_pres = -1;
58 /*   type of session envelop */
59 static struct SESSION_DATA_STRUCTURE* session = NULL;
60
61 /*      pointers for acse dissector  */
62 proto_tree *global_tree  = NULL;
63 packet_info *global_pinfo = NULL;
64
65 /* dissector for data */
66 static dissector_handle_t data_handle;
67
68 static char abstract_syntax_name_oid[BER_MAX_OID_STR_LEN];
69 static guint32 presentation_context_identifier;
70
71 /* to keep track of presentation context identifiers and protocol-oids */
72 typedef struct _pres_ctx_oid_t {
73         /* XXX here we should keep track of ADDRESS/PORT as well */
74         guint32 ctx_id;
75         char *oid;
76 } pres_ctx_oid_t;
77 static GHashTable *pres_ctx_oid_table = NULL;
78
79
80 /*--- Included file: packet-pres-hf.c ---*/
81
82 static int hf_pres_mode_selector = -1;            /* Mode_selector */
83 static int hf_pres_x410_mode_parameters = -1;     /* RTORQapdu */
84 static int hf_pres_normal_mode_parameters = -1;   /* T_normal_mode_parameters */
85 static int hf_pres_protocol_version = -1;         /* Protocol_version */
86 static int hf_pres_calling_presentation_selector = -1;  /* Calling_presentation_selector */
87 static int hf_pres_called_presentation_selector = -1;  /* Called_presentation_selector */
88 static int hf_pres_presentation_context_definition_list = -1;  /* Presentation_context_definition_list */
89 static int hf_pres_default_context_name = -1;     /* Default_context_name */
90 static int hf_pres_presentation_requirements = -1;  /* Presentation_requirements */
91 static int hf_pres_user_session_requirements = -1;  /* User_session_requirements */
92 static int hf_pres_protocol_options = -1;         /* Protocol_options */
93 static int hf_pres_initiators_nominated_context = -1;  /* Presentation_context_identifier */
94 static int hf_pres_extensions = -1;               /* T_extensions */
95 static int hf_pres_user_data = -1;                /* User_data */
96 static int hf_pres_cPR_PPDU_x400_mode_parameters = -1;  /* RTOACapdu */
97 static int hf_pres_cPU_PPDU_normal_mode_parameters = -1;  /* T_CPA_PPDU_normal_mode_parameters */
98 static int hf_pres_responding_presentation_selector = -1;  /* Responding_presentation_selector */
99 static int hf_pres_presentation_context_definition_result_list = -1;  /* Presentation_context_definition_result_list */
100 static int hf_pres_responders_nominated_context = -1;  /* Presentation_context_identifier */
101 static int hf_pres_cPU_PPDU_x400_mode_parameters = -1;  /* RTORJapdu */
102 static int hf_pres_cPR_PPDU_normal_mode_parameters = -1;  /* T_CPR_PPDU_normal_mode_parameters */
103 static int hf_pres_default_context_result = -1;   /* Default_context_result */
104 static int hf_pres_cPR_PPDU__provider_reason = -1;  /* Provider_reason */
105 static int hf_pres_aru_ppdu = -1;                 /* ARU_PPDU */
106 static int hf_pres_arp_ppdu = -1;                 /* ARP_PPDU */
107 static int hf_pres_aRU_PPDU_x400_mode_parameters = -1;  /* RTABapdu */
108 static int hf_pres_aRU_PPDU_normal_mode_parameters = -1;  /* T_ARU_PPDU_normal_mode_parameters */
109 static int hf_pres_presentation_context_identifier_list = -1;  /* Presentation_context_identifier_list */
110 static int hf_pres_aRU_PPDU_provider_reason = -1;  /* Abort_reason */
111 static int hf_pres_event_identifier = -1;         /* Event_identifier */
112 static int hf_pres_acPPDU = -1;                   /* AC_PPDU */
113 static int hf_pres_acaPPDU = -1;                  /* ACA_PPDU */
114 static int hf_pres_ttdPPDU = -1;                  /* User_data */
115 static int hf_pres_presentation_context_addition_list = -1;  /* Presentation_context_addition_list */
116 static int hf_pres_presentation_context_deletion_list = -1;  /* Presentation_context_deletion_list */
117 static int hf_pres_presentation_context_addition_result_list = -1;  /* Presentation_context_addition_result_list */
118 static int hf_pres_presentation_context_deletion_result_list = -1;  /* Presentation_context_deletion_result_list */
119 static int hf_pres_Context_list_item = -1;        /* Context_list_item */
120 static int hf_pres_presentation_context_identifier = -1;  /* Presentation_context_identifier */
121 static int hf_pres_abstract_syntax_name = -1;     /* Abstract_syntax_name */
122 static int hf_pres_transfer_syntax_name_list = -1;  /* SEQUENCE_OF_Transfer_syntax_name */
123 static int hf_pres_transfer_syntax_name_list_item = -1;  /* Transfer_syntax_name */
124 static int hf_pres_transfer_syntax_name = -1;     /* Transfer_syntax_name */
125 static int hf_pres_mode_value = -1;               /* T_mode_value */
126 static int hf_pres_Presentation_context_deletion_list_item = -1;  /* Presentation_context_identifier */
127 static int hf_pres_Presentation_context_deletion_result_list_item = -1;  /* Presentation_context_deletion_result_list_item */
128 static int hf_pres_Presentation_context_identifier_list_item = -1;  /* Presentation_context_identifier_list_item */
129 static int hf_pres_Result_list_item = -1;         /* Result_list_item */
130 static int hf_pres_result = -1;                   /* Result */
131 static int hf_pres_provider_reason = -1;          /* T_provider_reason */
132 static int hf_pres_simply_encoded_data = -1;      /* Simply_encoded_data */
133 static int hf_pres_fully_encoded_data = -1;       /* Fully_encoded_data */
134 static int hf_pres_Fully_encoded_data_item = -1;  /* PDV_list */
135 static int hf_pres_presentation_data_values = -1;  /* T_presentation_data_values */
136 static int hf_pres_single_ASN1_type = -1;         /* T_single_ASN1_type */
137 static int hf_pres_octet_aligned = -1;            /* OCTET_STRING */
138 static int hf_pres_arbitrary = -1;                /* BIT_STRING */
139 /* named bits */
140 static int hf_pres_Presentation_requirements_context_management = -1;
141 static int hf_pres_Presentation_requirements_restoration = -1;
142 static int hf_pres_Protocol_options_nominated_context = -1;
143 static int hf_pres_Protocol_options_short_encoding = -1;
144 static int hf_pres_Protocol_options_packed_encoding_rules = -1;
145 static int hf_pres_Protocol_version_version_1 = -1;
146 static int hf_pres_User_session_requirements_half_duplex = -1;
147 static int hf_pres_User_session_requirements_duplex = -1;
148 static int hf_pres_User_session_requirements_expedited_data = -1;
149 static int hf_pres_User_session_requirements_minor_synchronize = -1;
150 static int hf_pres_User_session_requirements_major_synchronize = -1;
151 static int hf_pres_User_session_requirements_resynchronize = -1;
152 static int hf_pres_User_session_requirements_activity_management = -1;
153 static int hf_pres_User_session_requirements_negotiated_release = -1;
154 static int hf_pres_User_session_requirements_capability_data = -1;
155 static int hf_pres_User_session_requirements_exceptions = -1;
156 static int hf_pres_User_session_requirements_typed_data = -1;
157 static int hf_pres_User_session_requirements_symmetric_synchronize = -1;
158 static int hf_pres_User_session_requirements_data_separation = -1;
159
160 /*--- End of included file: packet-pres-hf.c ---*/
161
162
163 /* Initialize the subtree pointers */
164 static gint ett_pres           = -1;
165
166
167 /*--- Included file: packet-pres-ett.c ---*/
168
169 static gint ett_pres_CP_type = -1;
170 static gint ett_pres_T_normal_mode_parameters = -1;
171 static gint ett_pres_T_extensions = -1;
172 static gint ett_pres_CPA_PPDU = -1;
173 static gint ett_pres_T_CPA_PPDU_normal_mode_parameters = -1;
174 static gint ett_pres_CPR_PPDU = -1;
175 static gint ett_pres_T_CPR_PPDU_normal_mode_parameters = -1;
176 static gint ett_pres_Abort_type = -1;
177 static gint ett_pres_ARU_PPDU = -1;
178 static gint ett_pres_T_ARU_PPDU_normal_mode_parameters = -1;
179 static gint ett_pres_ARP_PPDU = -1;
180 static gint ett_pres_Typed_data_type = -1;
181 static gint ett_pres_AC_PPDU = -1;
182 static gint ett_pres_ACA_PPDU = -1;
183 static gint ett_pres_RS_PPDU = -1;
184 static gint ett_pres_RSA_PPDU = -1;
185 static gint ett_pres_Context_list = -1;
186 static gint ett_pres_Context_list_item = -1;
187 static gint ett_pres_SEQUENCE_OF_Transfer_syntax_name = -1;
188 static gint ett_pres_Default_context_name = -1;
189 static gint ett_pres_Mode_selector = -1;
190 static gint ett_pres_Presentation_context_deletion_list = -1;
191 static gint ett_pres_Presentation_context_deletion_result_list = -1;
192 static gint ett_pres_Presentation_context_identifier_list = -1;
193 static gint ett_pres_Presentation_context_identifier_list_item = -1;
194 static gint ett_pres_Presentation_requirements = -1;
195 static gint ett_pres_Protocol_options = -1;
196 static gint ett_pres_Protocol_version = -1;
197 static gint ett_pres_Result_list = -1;
198 static gint ett_pres_Result_list_item = -1;
199 static gint ett_pres_User_data = -1;
200 static gint ett_pres_Fully_encoded_data = -1;
201 static gint ett_pres_PDV_list = -1;
202 static gint ett_pres_T_presentation_data_values = -1;
203 static gint ett_pres_User_session_requirements = -1;
204
205 /*--- End of included file: packet-pres-ett.c ---*/
206
207
208
209 static guint
210 pres_ctx_oid_hash(gconstpointer k)
211 {
212         pres_ctx_oid_t *pco=(pres_ctx_oid_t *)k;
213         return pco->ctx_id;
214 }
215 /* XXX this one should be made ADDRESS/PORT aware */
216 static gint
217 pres_ctx_oid_equal(gconstpointer k1, gconstpointer k2)
218 {
219         pres_ctx_oid_t *pco1=(pres_ctx_oid_t *)k1;
220         pres_ctx_oid_t *pco2=(pres_ctx_oid_t *)k2;
221         return pco1->ctx_id==pco2->ctx_id;
222 }
223
224 static void
225 pres_init(void)
226 {
227         if( pres_ctx_oid_table ){
228                 g_hash_table_destroy(pres_ctx_oid_table);
229                 pres_ctx_oid_table = NULL;
230         }
231         pres_ctx_oid_table = g_hash_table_new(pres_ctx_oid_hash,
232                         pres_ctx_oid_equal);
233
234 }
235
236 static void
237 register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, char *oid)
238 {
239         pres_ctx_oid_t *pco, *tmppco;
240         pco=se_alloc(sizeof(pres_ctx_oid_t));
241         pco->ctx_id=idx;
242         pco->oid=se_strdup(oid);
243
244         /* if this ctx already exists, remove the old one first */
245         tmppco=(pres_ctx_oid_t *)g_hash_table_lookup(pres_ctx_oid_table, pco);
246         if(tmppco){
247                 g_hash_table_remove(pres_ctx_oid_table, tmppco);
248
249         }
250         g_hash_table_insert(pres_ctx_oid_table, pco, pco);
251 }
252 char *
253 find_oid_by_pres_ctx_id(packet_info *pinfo _U_, guint32 idx)
254 {
255         pres_ctx_oid_t pco, *tmppco;
256         pco.ctx_id=idx;
257         tmppco=(pres_ctx_oid_t *)g_hash_table_lookup(pres_ctx_oid_table, &pco);
258         if(tmppco){
259                 return tmppco->oid;
260         }
261         return NULL;
262 }
263
264
265
266 /*--- Included file: packet-pres-fn.c ---*/
267
268 /*--- Fields for imported types ---*/
269
270 static int dissect_x410_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
271   return dissect_rtse_RTORQapdu(TRUE, tvb, offset, pinfo, tree, hf_pres_x410_mode_parameters);
272 }
273 static int dissect_cPR_PPDU_x400_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
274   return dissect_rtse_RTOACapdu(TRUE, tvb, offset, pinfo, tree, hf_pres_cPR_PPDU_x400_mode_parameters);
275 }
276 static int dissect_cPU_PPDU_x400_mode_parameters(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
277   return dissect_rtse_RTORJapdu(FALSE, tvb, offset, pinfo, tree, hf_pres_cPU_PPDU_x400_mode_parameters);
278 }
279 static int dissect_aRU_PPDU_x400_mode_parameters(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
280   return dissect_rtse_RTABapdu(FALSE, tvb, offset, pinfo, tree, hf_pres_aRU_PPDU_x400_mode_parameters);
281 }
282
283
284 static const value_string pres_T_mode_value_vals[] = {
285   {   0, "x410-1984-mode" },
286   {   1, "normal-mode" },
287   { 0, NULL }
288 };
289
290
291 static int
292 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_) {
293   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
294                                   NULL);
295
296   return offset;
297 }
298 static int dissect_mode_value_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
299   return dissect_pres_T_mode_value(TRUE, tvb, offset, pinfo, tree, hf_pres_mode_value);
300 }
301
302
303 static const ber_sequence_t Mode_selector_set[] = {
304   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_mode_value_impl },
305   { 0, 0, 0, NULL }
306 };
307
308 static int
309 dissect_pres_Mode_selector(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
310   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
311                               Mode_selector_set, hf_index, ett_pres_Mode_selector);
312
313   return offset;
314 }
315 static int dissect_mode_selector_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
316   return dissect_pres_Mode_selector(TRUE, tvb, offset, pinfo, tree, hf_pres_mode_selector);
317 }
318
319
320 static const asn_namedbit Protocol_version_bits[] = {
321   {  0, &hf_pres_Protocol_version_version_1, -1, -1, "version-1", NULL },
322   { 0, NULL, 0, 0, NULL, NULL }
323 };
324
325 static int
326 dissect_pres_Protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
327   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
328                                     Protocol_version_bits, hf_index, ett_pres_Protocol_version,
329                                     NULL);
330
331   return offset;
332 }
333 static int dissect_protocol_version_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
334   return dissect_pres_Protocol_version(TRUE, tvb, offset, pinfo, tree, hf_pres_protocol_version);
335 }
336
337
338
339 static int
340 dissect_pres_Presentation_selector(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
341   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
342                                        NULL);
343
344   return offset;
345 }
346
347
348
349 static int
350 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_) {
351   offset = dissect_pres_Presentation_selector(implicit_tag, tvb, offset, pinfo, tree, hf_index);
352
353   return offset;
354 }
355 static int dissect_calling_presentation_selector_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
356   return dissect_pres_Calling_presentation_selector(TRUE, tvb, offset, pinfo, tree, hf_pres_calling_presentation_selector);
357 }
358
359
360
361 static int
362 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_) {
363   offset = dissect_pres_Presentation_selector(implicit_tag, tvb, offset, pinfo, tree, hf_index);
364
365   return offset;
366 }
367 static int dissect_called_presentation_selector_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
368   return dissect_pres_Called_presentation_selector(TRUE, tvb, offset, pinfo, tree, hf_pres_called_presentation_selector);
369 }
370
371
372
373 static int
374 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_) {
375   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
376                                   &presentation_context_identifier);
377
378   return offset;
379 }
380 static int dissect_initiators_nominated_context(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
381   return dissect_pres_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_pres_initiators_nominated_context);
382 }
383 static int dissect_responders_nominated_context(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
384   return dissect_pres_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_pres_responders_nominated_context);
385 }
386 static int dissect_presentation_context_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
387   return dissect_pres_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_pres_presentation_context_identifier);
388 }
389 static int dissect_Presentation_context_deletion_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
390   return dissect_pres_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_pres_Presentation_context_deletion_list_item);
391 }
392
393
394
395 static int
396 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_) {
397   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
398                                             abstract_syntax_name_oid);
399
400   return offset;
401 }
402 static int dissect_abstract_syntax_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
403   return dissect_pres_Abstract_syntax_name(FALSE, tvb, offset, pinfo, tree, hf_pres_abstract_syntax_name);
404 }
405 static int dissect_abstract_syntax_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
406   return dissect_pres_Abstract_syntax_name(TRUE, tvb, offset, pinfo, tree, hf_pres_abstract_syntax_name);
407 }
408
409
410
411 static int
412 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_) {
413   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
414                                             NULL);
415
416   return offset;
417 }
418 static int dissect_transfer_syntax_name_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
419   return dissect_pres_Transfer_syntax_name(FALSE, tvb, offset, pinfo, tree, hf_pres_transfer_syntax_name_list_item);
420 }
421 static int dissect_transfer_syntax_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
422   return dissect_pres_Transfer_syntax_name(FALSE, tvb, offset, pinfo, tree, hf_pres_transfer_syntax_name);
423 }
424 static int dissect_transfer_syntax_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
425   return dissect_pres_Transfer_syntax_name(TRUE, tvb, offset, pinfo, tree, hf_pres_transfer_syntax_name);
426 }
427
428
429 static const ber_sequence_t SEQUENCE_OF_Transfer_syntax_name_sequence_of[1] = {
430   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_transfer_syntax_name_list_item },
431 };
432
433 static int
434 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_) {
435   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
436                                       SEQUENCE_OF_Transfer_syntax_name_sequence_of, hf_index, ett_pres_SEQUENCE_OF_Transfer_syntax_name);
437
438   return offset;
439 }
440 static int dissect_transfer_syntax_name_list(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
441   return dissect_pres_SEQUENCE_OF_Transfer_syntax_name(FALSE, tvb, offset, pinfo, tree, hf_pres_transfer_syntax_name_list);
442 }
443
444
445 static const ber_sequence_t Context_list_item_sequence[] = {
446   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_presentation_context_identifier },
447   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_abstract_syntax_name },
448   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_transfer_syntax_name_list },
449   { 0, 0, 0, NULL }
450 };
451
452 static int
453 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_) {
454   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
455                                    Context_list_item_sequence, hf_index, ett_pres_Context_list_item);
456
457         register_ctx_id_and_oid(pinfo, presentation_context_identifier, abstract_syntax_name_oid);
458   return offset;
459 }
460 static int dissect_Context_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
461   return dissect_pres_Context_list_item(FALSE, tvb, offset, pinfo, tree, hf_pres_Context_list_item);
462 }
463
464
465 static const ber_sequence_t Context_list_sequence_of[1] = {
466   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Context_list_item },
467 };
468
469 static int
470 dissect_pres_Context_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
471   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
472                                       Context_list_sequence_of, hf_index, ett_pres_Context_list);
473
474   return offset;
475 }
476
477
478
479 static int
480 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_) {
481   offset = dissect_pres_Context_list(implicit_tag, tvb, offset, pinfo, tree, hf_index);
482
483   return offset;
484 }
485 static int dissect_presentation_context_definition_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
486   return dissect_pres_Presentation_context_definition_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_definition_list);
487 }
488
489
490 static const ber_sequence_t Default_context_name_sequence[] = {
491   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_abstract_syntax_name_impl },
492   { BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_transfer_syntax_name_impl },
493   { 0, 0, 0, NULL }
494 };
495
496 static int
497 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_) {
498   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
499                                    Default_context_name_sequence, hf_index, ett_pres_Default_context_name);
500
501   return offset;
502 }
503 static int dissect_default_context_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
504   return dissect_pres_Default_context_name(TRUE, tvb, offset, pinfo, tree, hf_pres_default_context_name);
505 }
506
507
508 static const asn_namedbit Presentation_requirements_bits[] = {
509   {  0, &hf_pres_Presentation_requirements_context_management, -1, -1, "context-management", NULL },
510   {  1, &hf_pres_Presentation_requirements_restoration, -1, -1, "restoration", NULL },
511   { 0, NULL, 0, 0, NULL, NULL }
512 };
513
514 static int
515 dissect_pres_Presentation_requirements(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
516   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
517                                     Presentation_requirements_bits, hf_index, ett_pres_Presentation_requirements,
518                                     NULL);
519
520   return offset;
521 }
522 static int dissect_presentation_requirements_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
523   return dissect_pres_Presentation_requirements(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_requirements);
524 }
525
526
527 static const asn_namedbit User_session_requirements_bits[] = {
528   {  0, &hf_pres_User_session_requirements_half_duplex, -1, -1, "half-duplex", NULL },
529   {  1, &hf_pres_User_session_requirements_duplex, -1, -1, "duplex", NULL },
530   {  2, &hf_pres_User_session_requirements_expedited_data, -1, -1, "expedited-data", NULL },
531   {  3, &hf_pres_User_session_requirements_minor_synchronize, -1, -1, "minor-synchronize", NULL },
532   {  4, &hf_pres_User_session_requirements_major_synchronize, -1, -1, "major-synchronize", NULL },
533   {  5, &hf_pres_User_session_requirements_resynchronize, -1, -1, "resynchronize", NULL },
534   {  6, &hf_pres_User_session_requirements_activity_management, -1, -1, "activity-management", NULL },
535   {  7, &hf_pres_User_session_requirements_negotiated_release, -1, -1, "negotiated-release", NULL },
536   {  8, &hf_pres_User_session_requirements_capability_data, -1, -1, "capability-data", NULL },
537   {  9, &hf_pres_User_session_requirements_exceptions, -1, -1, "exceptions", NULL },
538   { 10, &hf_pres_User_session_requirements_typed_data, -1, -1, "typed-data", NULL },
539   { 11, &hf_pres_User_session_requirements_symmetric_synchronize, -1, -1, "symmetric-synchronize", NULL },
540   { 12, &hf_pres_User_session_requirements_data_separation, -1, -1, "data-separation", NULL },
541   { 0, NULL, 0, 0, NULL, NULL }
542 };
543
544 static int
545 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_) {
546   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
547                                     User_session_requirements_bits, hf_index, ett_pres_User_session_requirements,
548                                     NULL);
549
550   return offset;
551 }
552 static int dissect_user_session_requirements_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
553   return dissect_pres_User_session_requirements(TRUE, tvb, offset, pinfo, tree, hf_pres_user_session_requirements);
554 }
555
556
557 static const asn_namedbit Protocol_options_bits[] = {
558   {  0, &hf_pres_Protocol_options_nominated_context, -1, -1, "nominated-context", NULL },
559   {  1, &hf_pres_Protocol_options_short_encoding, -1, -1, "short-encoding", NULL },
560   {  2, &hf_pres_Protocol_options_packed_encoding_rules, -1, -1, "packed-encoding-rules", NULL },
561   { 0, NULL, 0, 0, NULL, NULL }
562 };
563
564 static int
565 dissect_pres_Protocol_options(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
566   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
567                                     Protocol_options_bits, hf_index, ett_pres_Protocol_options,
568                                     NULL);
569
570   return offset;
571 }
572 static int dissect_protocol_options(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
573   return dissect_pres_Protocol_options(FALSE, tvb, offset, pinfo, tree, hf_pres_protocol_options);
574 }
575
576
577 static const ber_sequence_t T_extensions_sequence[] = {
578   { 0, 0, 0, NULL }
579 };
580
581 static int
582 dissect_pres_T_extensions(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
583   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
584                                    T_extensions_sequence, hf_index, ett_pres_T_extensions);
585
586   return offset;
587 }
588 static int dissect_extensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
589   return dissect_pres_T_extensions(FALSE, tvb, offset, pinfo, tree, hf_pres_extensions);
590 }
591
592
593
594 static int
595 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_) {
596   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
597                                        NULL);
598
599   return offset;
600 }
601 static int dissect_simply_encoded_data_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
602   return dissect_pres_Simply_encoded_data(TRUE, tvb, offset, pinfo, tree, hf_pres_simply_encoded_data);
603 }
604
605
606
607 static int
608 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_) {
609
610  tvbuff_t       *next_tvb;
611  char *oid; 
612
613         oid=find_oid_by_pres_ctx_id(pinfo, presentation_context_identifier);
614         if(oid){
615                 next_tvb = tvb_new_subset(tvb, offset, -1, -1);
616                 call_ber_oid_callback(oid, next_tvb, offset, pinfo, global_tree);
617         } else {
618                 proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available");
619                   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
620                                        NULL);
621         
622         }
623
624
625
626   return offset;
627 }
628 static int dissect_single_ASN1_type_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
629   return dissect_pres_T_single_ASN1_type(TRUE, tvb, offset, pinfo, tree, hf_pres_single_ASN1_type);
630 }
631
632
633
634 static int
635 dissect_pres_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
636   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
637                                        NULL);
638
639   return offset;
640 }
641 static int dissect_octet_aligned_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
642   return dissect_pres_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_pres_octet_aligned);
643 }
644
645
646
647 static int
648 dissect_pres_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
649   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
650                                     NULL, hf_index, -1,
651                                     NULL);
652
653   return offset;
654 }
655 static int dissect_arbitrary_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
656   return dissect_pres_BIT_STRING(TRUE, tvb, offset, pinfo, tree, hf_pres_arbitrary);
657 }
658
659
660 static const value_string pres_T_presentation_data_values_vals[] = {
661   {   0, "single-ASN1-type" },
662   {   1, "octet-aligned" },
663   {   2, "arbitrary" },
664   { 0, NULL }
665 };
666
667 static const ber_choice_t T_presentation_data_values_choice[] = {
668   {   0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_single_ASN1_type_impl },
669   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_octet_aligned_impl },
670   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_arbitrary_impl },
671   { 0, 0, 0, 0, NULL }
672 };
673
674 static int
675 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_) {
676   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
677                                  T_presentation_data_values_choice, hf_index, ett_pres_T_presentation_data_values,
678                                  NULL);
679
680   return offset;
681 }
682 static int dissect_presentation_data_values(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
683   return dissect_pres_T_presentation_data_values(FALSE, tvb, offset, pinfo, tree, hf_pres_presentation_data_values);
684 }
685
686
687 static const ber_sequence_t PDV_list_sequence[] = {
688   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_transfer_syntax_name },
689   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_presentation_context_identifier },
690   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_presentation_data_values },
691   { 0, 0, 0, NULL }
692 };
693
694 static int
695 dissect_pres_PDV_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
696   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
697                                    PDV_list_sequence, hf_index, ett_pres_PDV_list);
698
699   return offset;
700 }
701 static int dissect_Fully_encoded_data_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
702   return dissect_pres_PDV_list(FALSE, tvb, offset, pinfo, tree, hf_pres_Fully_encoded_data_item);
703 }
704
705
706 static const ber_sequence_t Fully_encoded_data_sequence_of[1] = {
707   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Fully_encoded_data_item },
708 };
709
710 static int
711 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_) {
712   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
713                                       Fully_encoded_data_sequence_of, hf_index, ett_pres_Fully_encoded_data);
714
715   return offset;
716 }
717 static int dissect_fully_encoded_data_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
718   return dissect_pres_Fully_encoded_data(TRUE, tvb, offset, pinfo, tree, hf_pres_fully_encoded_data);
719 }
720
721
722 static const value_string pres_User_data_vals[] = {
723   {   0, "simply-encoded-data" },
724   {   1, "fully-encoded-data" },
725   { 0, NULL }
726 };
727
728 static const ber_choice_t User_data_choice[] = {
729   {   0, BER_CLASS_APP, 0, BER_FLAGS_IMPLTAG, dissect_simply_encoded_data_impl },
730   {   1, BER_CLASS_APP, 1, BER_FLAGS_IMPLTAG, dissect_fully_encoded_data_impl },
731   { 0, 0, 0, 0, NULL }
732 };
733
734 static int
735 dissect_pres_User_data(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
736   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
737                                  User_data_choice, hf_index, ett_pres_User_data,
738                                  NULL);
739
740   return offset;
741 }
742 static int dissect_user_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
743   return dissect_pres_User_data(FALSE, tvb, offset, pinfo, tree, hf_pres_user_data);
744 }
745 static int dissect_ttdPPDU(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
746   return dissect_pres_User_data(FALSE, tvb, offset, pinfo, tree, hf_pres_ttdPPDU);
747 }
748
749
750 static const ber_sequence_t T_normal_mode_parameters_sequence[] = {
751   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_protocol_version_impl },
752   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_calling_presentation_selector_impl },
753   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_called_presentation_selector_impl },
754   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_definition_list_impl },
755   { BER_CLASS_CON, 6, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_default_context_name_impl },
756   { BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_requirements_impl },
757   { BER_CLASS_CON, 9, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_session_requirements_impl },
758   { BER_CLASS_CON, 11, BER_FLAGS_OPTIONAL, dissect_protocol_options },
759   { BER_CLASS_CON, 12, BER_FLAGS_OPTIONAL, dissect_initiators_nominated_context },
760   { BER_CLASS_CON, 14, BER_FLAGS_OPTIONAL, dissect_extensions },
761   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
762   { 0, 0, 0, NULL }
763 };
764
765 static int
766 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_) {
767   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
768                                    T_normal_mode_parameters_sequence, hf_index, ett_pres_T_normal_mode_parameters);
769
770   return offset;
771 }
772 static int dissect_normal_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
773   return dissect_pres_T_normal_mode_parameters(TRUE, tvb, offset, pinfo, tree, hf_pres_normal_mode_parameters);
774 }
775
776
777 static const ber_sequence_t CP_type_set[] = {
778   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_mode_selector_impl },
779   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_x410_mode_parameters_impl },
780   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_normal_mode_parameters_impl },
781   { 0, 0, 0, NULL }
782 };
783
784 static int
785 dissect_pres_CP_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
786   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
787                               CP_type_set, hf_index, ett_pres_CP_type);
788
789   return offset;
790 }
791
792
793
794 static int
795 dissect_pres_CPC_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
796   offset = dissect_pres_User_data(implicit_tag, tvb, offset, pinfo, tree, hf_index);
797
798   return offset;
799 }
800
801
802
803 static int
804 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_) {
805   offset = dissect_pres_Presentation_selector(implicit_tag, tvb, offset, pinfo, tree, hf_index);
806
807   return offset;
808 }
809 static int dissect_responding_presentation_selector_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
810   return dissect_pres_Responding_presentation_selector(TRUE, tvb, offset, pinfo, tree, hf_pres_responding_presentation_selector);
811 }
812
813
814 static const value_string pres_Result_vals[] = {
815   {   0, "acceptance" },
816   {   1, "user-rejection" },
817   {   2, "provider-rejection" },
818   { 0, NULL }
819 };
820
821
822 static int
823 dissect_pres_Result(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
824   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
825                                   NULL);
826
827   return offset;
828 }
829 static int dissect_result_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
830   return dissect_pres_Result(TRUE, tvb, offset, pinfo, tree, hf_pres_result);
831 }
832
833
834 static const value_string pres_T_provider_reason_vals[] = {
835   {   0, "reason-not-specified" },
836   {   1, "abstract-syntax-not-supported" },
837   {   2, "proposed-transfer-syntaxes-not-supported" },
838   {   3, "local-limit-on-DCS-exceeded" },
839   { 0, NULL }
840 };
841
842
843 static int
844 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_) {
845   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
846                                   NULL);
847
848   return offset;
849 }
850 static int dissect_provider_reason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
851   return dissect_pres_T_provider_reason(TRUE, tvb, offset, pinfo, tree, hf_pres_provider_reason);
852 }
853
854
855 static const ber_sequence_t Result_list_item_sequence[] = {
856   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_result_impl },
857   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_transfer_syntax_name_impl },
858   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_provider_reason_impl },
859   { 0, 0, 0, NULL }
860 };
861
862 static int
863 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_) {
864   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
865                                    Result_list_item_sequence, hf_index, ett_pres_Result_list_item);
866
867   return offset;
868 }
869 static int dissect_Result_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
870   return dissect_pres_Result_list_item(FALSE, tvb, offset, pinfo, tree, hf_pres_Result_list_item);
871 }
872
873
874 static const ber_sequence_t Result_list_sequence_of[1] = {
875   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Result_list_item },
876 };
877
878 static int
879 dissect_pres_Result_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
880   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
881                                       Result_list_sequence_of, hf_index, ett_pres_Result_list);
882
883   return offset;
884 }
885
886
887
888 static int
889 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_) {
890   offset = dissect_pres_Result_list(implicit_tag, tvb, offset, pinfo, tree, hf_index);
891
892   return offset;
893 }
894 static int dissect_presentation_context_definition_result_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
895   return dissect_pres_Presentation_context_definition_result_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_definition_result_list);
896 }
897
898
899 static const ber_sequence_t T_CPA_PPDU_normal_mode_parameters_sequence[] = {
900   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_protocol_version_impl },
901   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_responding_presentation_selector_impl },
902   { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_definition_result_list_impl },
903   { BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_requirements_impl },
904   { BER_CLASS_CON, 9, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_session_requirements_impl },
905   { BER_CLASS_CON, 11, BER_FLAGS_OPTIONAL, dissect_protocol_options },
906   { BER_CLASS_CON, 13, BER_FLAGS_OPTIONAL, dissect_responders_nominated_context },
907   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
908   { 0, 0, 0, NULL }
909 };
910
911 static int
912 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_) {
913   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
914                                    T_CPA_PPDU_normal_mode_parameters_sequence, hf_index, ett_pres_T_CPA_PPDU_normal_mode_parameters);
915
916   return offset;
917 }
918 static int dissect_cPU_PPDU_normal_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
919   return dissect_pres_T_CPA_PPDU_normal_mode_parameters(TRUE, tvb, offset, pinfo, tree, hf_pres_cPU_PPDU_normal_mode_parameters);
920 }
921
922
923 static const ber_sequence_t CPA_PPDU_set[] = {
924   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_mode_selector_impl },
925   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cPR_PPDU_x400_mode_parameters_impl },
926   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cPU_PPDU_normal_mode_parameters_impl },
927   { 0, 0, 0, NULL }
928 };
929
930 static int
931 dissect_pres_CPA_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
932   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
933                               CPA_PPDU_set, hf_index, ett_pres_CPA_PPDU);
934
935   return offset;
936 }
937
938
939
940 static int
941 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_) {
942   offset = dissect_pres_Result(implicit_tag, tvb, offset, pinfo, tree, hf_index);
943
944   return offset;
945 }
946 static int dissect_default_context_result_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
947   return dissect_pres_Default_context_result(TRUE, tvb, offset, pinfo, tree, hf_pres_default_context_result);
948 }
949
950
951 static const value_string pres_Provider_reason_vals[] = {
952   {   0, "reason-not-specified" },
953   {   1, "temporary-congestion" },
954   {   2, "local-limit-exceeded" },
955   {   3, "called-presentation-address-unknown" },
956   {   4, "protocol-version-not-supported" },
957   {   5, "default-context-not-supported" },
958   {   6, "user-data-not-readable" },
959   {   7, "no-PSAP-available" },
960   { 0, NULL }
961 };
962
963
964 static int
965 dissect_pres_Provider_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
966   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
967                                   NULL);
968
969   return offset;
970 }
971 static int dissect_cPR_PPDU__provider_reason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
972   return dissect_pres_Provider_reason(TRUE, tvb, offset, pinfo, tree, hf_pres_cPR_PPDU__provider_reason);
973 }
974
975
976 static const ber_sequence_t T_CPR_PPDU_normal_mode_parameters_sequence[] = {
977   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_protocol_version_impl },
978   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_responding_presentation_selector_impl },
979   { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_definition_result_list_impl },
980   { BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_default_context_result_impl },
981   { BER_CLASS_CON, 10, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cPR_PPDU__provider_reason_impl },
982   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
983   { 0, 0, 0, NULL }
984 };
985
986 static int
987 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_) {
988   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
989                                    T_CPR_PPDU_normal_mode_parameters_sequence, hf_index, ett_pres_T_CPR_PPDU_normal_mode_parameters);
990
991   return offset;
992 }
993 static int dissect_cPR_PPDU_normal_mode_parameters(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
994   return dissect_pres_T_CPR_PPDU_normal_mode_parameters(FALSE, tvb, offset, pinfo, tree, hf_pres_cPR_PPDU_normal_mode_parameters);
995 }
996
997
998 static const value_string pres_CPR_PPDU_vals[] = {
999   {   0, "x400-mode-parameters" },
1000   {   1, "normal-mode-parameters" },
1001   { 0, NULL }
1002 };
1003
1004 static const ber_choice_t CPR_PPDU_choice[] = {
1005   {   0, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cPU_PPDU_x400_mode_parameters },
1006   {   1, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cPR_PPDU_normal_mode_parameters },
1007   { 0, 0, 0, 0, NULL }
1008 };
1009
1010 static int
1011 dissect_pres_CPR_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1012   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1013                                  CPR_PPDU_choice, hf_index, ett_pres_CPR_PPDU,
1014                                  NULL);
1015
1016   return offset;
1017 }
1018
1019
1020 static const ber_sequence_t Presentation_context_identifier_list_item_sequence[] = {
1021   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_presentation_context_identifier },
1022   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_transfer_syntax_name },
1023   { 0, 0, 0, NULL }
1024 };
1025
1026 static int
1027 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_) {
1028   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1029                                    Presentation_context_identifier_list_item_sequence, hf_index, ett_pres_Presentation_context_identifier_list_item);
1030
1031   return offset;
1032 }
1033 static int dissect_Presentation_context_identifier_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1034   return dissect_pres_Presentation_context_identifier_list_item(FALSE, tvb, offset, pinfo, tree, hf_pres_Presentation_context_identifier_list_item);
1035 }
1036
1037
1038 static const ber_sequence_t Presentation_context_identifier_list_sequence_of[1] = {
1039   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Presentation_context_identifier_list_item },
1040 };
1041
1042 static int
1043 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_) {
1044   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1045                                       Presentation_context_identifier_list_sequence_of, hf_index, ett_pres_Presentation_context_identifier_list);
1046
1047   return offset;
1048 }
1049 static int dissect_presentation_context_identifier_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1050   return dissect_pres_Presentation_context_identifier_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_identifier_list);
1051 }
1052
1053
1054 static const ber_sequence_t T_ARU_PPDU_normal_mode_parameters_sequence[] = {
1055   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_identifier_list_impl },
1056   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1057   { 0, 0, 0, NULL }
1058 };
1059
1060 static int
1061 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_) {
1062   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1063                                    T_ARU_PPDU_normal_mode_parameters_sequence, hf_index, ett_pres_T_ARU_PPDU_normal_mode_parameters);
1064
1065   return offset;
1066 }
1067 static int dissect_aRU_PPDU_normal_mode_parameters_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1068   return dissect_pres_T_ARU_PPDU_normal_mode_parameters(TRUE, tvb, offset, pinfo, tree, hf_pres_aRU_PPDU_normal_mode_parameters);
1069 }
1070
1071
1072 static const value_string pres_ARU_PPDU_vals[] = {
1073   {   0, "x400-mode-parameters" },
1074   {   1, "normal-mode-parameters" },
1075   { 0, NULL }
1076 };
1077
1078 static const ber_choice_t ARU_PPDU_choice[] = {
1079   {   0, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_aRU_PPDU_x400_mode_parameters },
1080   {   1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_aRU_PPDU_normal_mode_parameters_impl },
1081   { 0, 0, 0, 0, NULL }
1082 };
1083
1084 static int
1085 dissect_pres_ARU_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1086   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1087                                  ARU_PPDU_choice, hf_index, ett_pres_ARU_PPDU,
1088                                  NULL);
1089
1090   return offset;
1091 }
1092 static int dissect_aru_ppdu(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1093   return dissect_pres_ARU_PPDU(FALSE, tvb, offset, pinfo, tree, hf_pres_aru_ppdu);
1094 }
1095
1096
1097 static const value_string pres_Abort_reason_vals[] = {
1098   {   0, "reason-not-specified" },
1099   {   1, "unrecognized-ppdu" },
1100   {   2, "unexpected-ppdu" },
1101   {   3, "unexpected-session-service-primitive" },
1102   {   4, "unrecognized-ppdu-parameter" },
1103   {   5, "unexpected-ppdu-parameter" },
1104   {   6, "invalid-ppdu-parameter-value" },
1105   { 0, NULL }
1106 };
1107
1108
1109 static int
1110 dissect_pres_Abort_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1111   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1112                                   NULL);
1113
1114   return offset;
1115 }
1116 static int dissect_aRU_PPDU_provider_reason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1117   return dissect_pres_Abort_reason(TRUE, tvb, offset, pinfo, tree, hf_pres_aRU_PPDU_provider_reason);
1118 }
1119
1120
1121 static const value_string pres_Event_identifier_vals[] = {
1122   {   0, "cp-PPDU" },
1123   {   1, "cpa-PPDU" },
1124   {   2, "cpr-PPDU" },
1125   {   3, "aru-PPDU" },
1126   {   4, "arp-PPDU" },
1127   {   5, "ac-PPDU" },
1128   {   6, "aca-PPDU" },
1129   {   7, "td-PPDU" },
1130   {   8, "ttd-PPDU" },
1131   {   9, "te-PPDU" },
1132   {  10, "tc-PPDU" },
1133   {  11, "tcc-PPDU" },
1134   {  12, "rs-PPDU" },
1135   {  13, "rsa-PPDU" },
1136   {  14, "s-release-indication" },
1137   {  15, "s-release-confirm" },
1138   {  16, "s-token-give-indication" },
1139   {  17, "s-token-please-indication" },
1140   {  18, "s-control-give-indication" },
1141   {  19, "s-sync-minor-indication" },
1142   {  20, "s-sync-minor-confirm" },
1143   {  21, "s-sync-major-indication" },
1144   {  22, "s-sync-major-confirm" },
1145   {  23, "s-p-exception-report-indication" },
1146   {  24, "s-u-exception-report-indication" },
1147   {  25, "s-activity-start-indication" },
1148   {  26, "s-activity-resume-indication" },
1149   {  27, "s-activity-interrupt-indication" },
1150   {  28, "s-activity-interrupt-confirm" },
1151   {  29, "s-activity-discard-indication" },
1152   {  30, "s-activity-discard-confirm" },
1153   {  31, "s-activity-end-indication" },
1154   {  32, "s-activity-end-confirm" },
1155   { 0, NULL }
1156 };
1157
1158
1159 static int
1160 dissect_pres_Event_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1161   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1162                                   NULL);
1163
1164   return offset;
1165 }
1166 static int dissect_event_identifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1167   return dissect_pres_Event_identifier(TRUE, tvb, offset, pinfo, tree, hf_pres_event_identifier);
1168 }
1169
1170
1171 static const ber_sequence_t ARP_PPDU_sequence[] = {
1172   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aRU_PPDU_provider_reason_impl },
1173   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_event_identifier_impl },
1174   { 0, 0, 0, NULL }
1175 };
1176
1177 static int
1178 dissect_pres_ARP_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1179   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1180                                    ARP_PPDU_sequence, hf_index, ett_pres_ARP_PPDU);
1181
1182   return offset;
1183 }
1184 static int dissect_arp_ppdu(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1185   return dissect_pres_ARP_PPDU(FALSE, tvb, offset, pinfo, tree, hf_pres_arp_ppdu);
1186 }
1187
1188
1189 static const value_string pres_Abort_type_vals[] = {
1190   {   0, "aru-ppdu" },
1191   {   1, "arp-ppdu" },
1192   { 0, NULL }
1193 };
1194
1195 static const ber_choice_t Abort_type_choice[] = {
1196   {   0, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_aru_ppdu },
1197   {   1, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_arp_ppdu },
1198   { 0, 0, 0, 0, NULL }
1199 };
1200
1201 static int
1202 dissect_pres_Abort_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1203   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1204                                  Abort_type_choice, hf_index, ett_pres_Abort_type,
1205                                  NULL);
1206
1207   return offset;
1208 }
1209
1210
1211
1212 static int
1213 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_) {
1214   offset = dissect_pres_Context_list(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1215
1216   return offset;
1217 }
1218 static int dissect_presentation_context_addition_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1219   return dissect_pres_Presentation_context_addition_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_addition_list);
1220 }
1221
1222
1223 static const ber_sequence_t Presentation_context_deletion_list_sequence_of[1] = {
1224   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_Presentation_context_deletion_list_item },
1225 };
1226
1227 static int
1228 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_) {
1229   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1230                                       Presentation_context_deletion_list_sequence_of, hf_index, ett_pres_Presentation_context_deletion_list);
1231
1232   return offset;
1233 }
1234 static int dissect_presentation_context_deletion_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1235   return dissect_pres_Presentation_context_deletion_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_deletion_list);
1236 }
1237
1238
1239 static const ber_sequence_t AC_PPDU_sequence[] = {
1240   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_addition_list_impl },
1241   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_deletion_list_impl },
1242   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1243   { 0, 0, 0, NULL }
1244 };
1245
1246 static int
1247 dissect_pres_AC_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1248   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1249                                    AC_PPDU_sequence, hf_index, ett_pres_AC_PPDU);
1250
1251   return offset;
1252 }
1253 static int dissect_acPPDU_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1254   return dissect_pres_AC_PPDU(TRUE, tvb, offset, pinfo, tree, hf_pres_acPPDU);
1255 }
1256
1257
1258
1259 static int
1260 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_) {
1261   offset = dissect_pres_Result_list(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1262
1263   return offset;
1264 }
1265 static int dissect_presentation_context_addition_result_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1266   return dissect_pres_Presentation_context_addition_result_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_addition_result_list);
1267 }
1268
1269
1270 static const value_string pres_Presentation_context_deletion_result_list_item_vals[] = {
1271   {   0, "acceptance" },
1272   {   1, "user-rejection" },
1273   { 0, NULL }
1274 };
1275
1276
1277 static int
1278 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_) {
1279   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1280                                   NULL);
1281
1282   return offset;
1283 }
1284 static int dissect_Presentation_context_deletion_result_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1285   return dissect_pres_Presentation_context_deletion_result_list_item(FALSE, tvb, offset, pinfo, tree, hf_pres_Presentation_context_deletion_result_list_item);
1286 }
1287
1288
1289 static const ber_sequence_t Presentation_context_deletion_result_list_sequence_of[1] = {
1290   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_Presentation_context_deletion_result_list_item },
1291 };
1292
1293 static int
1294 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_) {
1295   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1296                                       Presentation_context_deletion_result_list_sequence_of, hf_index, ett_pres_Presentation_context_deletion_result_list);
1297
1298   return offset;
1299 }
1300 static int dissect_presentation_context_deletion_result_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1301   return dissect_pres_Presentation_context_deletion_result_list(TRUE, tvb, offset, pinfo, tree, hf_pres_presentation_context_deletion_result_list);
1302 }
1303
1304
1305 static const ber_sequence_t ACA_PPDU_sequence[] = {
1306   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_addition_result_list_impl },
1307   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_deletion_result_list_impl },
1308   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1309   { 0, 0, 0, NULL }
1310 };
1311
1312 static int
1313 dissect_pres_ACA_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1314   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1315                                    ACA_PPDU_sequence, hf_index, ett_pres_ACA_PPDU);
1316
1317   return offset;
1318 }
1319 static int dissect_acaPPDU_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1320   return dissect_pres_ACA_PPDU(TRUE, tvb, offset, pinfo, tree, hf_pres_acaPPDU);
1321 }
1322
1323
1324 static const value_string pres_Typed_data_type_vals[] = {
1325   {   0, "acPPDU" },
1326   {   1, "acaPPDU" },
1327   {   2, "ttdPPDU" },
1328   { 0, NULL }
1329 };
1330
1331 static const ber_choice_t Typed_data_type_choice[] = {
1332   {   0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_acPPDU_impl },
1333   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_acaPPDU_impl },
1334   {   2, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_ttdPPDU },
1335   { 0, 0, 0, 0, NULL }
1336 };
1337
1338 static int
1339 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_) {
1340   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1341                                  Typed_data_type_choice, hf_index, ett_pres_Typed_data_type,
1342                                  NULL);
1343
1344   return offset;
1345 }
1346
1347
1348 static const ber_sequence_t RS_PPDU_sequence[] = {
1349   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_identifier_list_impl },
1350   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1351   { 0, 0, 0, NULL }
1352 };
1353
1354 static int
1355 dissect_pres_RS_PPDU(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(implicit_tag, pinfo, tree, tvb, offset,
1357                                    RS_PPDU_sequence, hf_index, ett_pres_RS_PPDU);
1358
1359   return offset;
1360 }
1361
1362
1363 static const ber_sequence_t RSA_PPDU_sequence[] = {
1364   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_presentation_context_identifier_list_impl },
1365   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_user_data },
1366   { 0, 0, 0, NULL }
1367 };
1368
1369 static int
1370 dissect_pres_RSA_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1371   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1372                                    RSA_PPDU_sequence, hf_index, ett_pres_RSA_PPDU);
1373
1374   return offset;
1375 }
1376
1377
1378 /*--- End of included file: packet-pres-fn.c ---*/
1379
1380
1381
1382 /*
1383  * Dissect an PPDU.
1384  */
1385 static int
1386 dissect_ppdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1387 {
1388   proto_item *ti;
1389   proto_tree *pres_tree = NULL;
1390   guint s_type;
1391 /* do we have spdu type from the session dissector?  */
1392         if( !pinfo->private_data ){
1393                 if(tree){
1394                         proto_tree_add_text(tree, tvb, offset, -1,
1395                                 "Internal error:can't get spdu type from session dissector.");
1396                         return  FALSE;
1397                 }
1398         }else{
1399                 session  = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) );
1400                 if(session->spdu_type == 0 ){
1401                         if(tree){
1402                                 proto_tree_add_text(tree, tvb, offset, -1,
1403                                         "Internal error:wrong spdu type %x from session dissector.",session->spdu_type);
1404                                 return  FALSE;
1405                         }
1406                 }
1407         }
1408 /* get type of tag      */
1409         s_type = tvb_get_guint8(tvb, offset);
1410                 /*  set up type of Ppdu */
1411         if (check_col(pinfo->cinfo, COL_INFO))
1412                                         col_add_str(pinfo->cinfo, COL_INFO,
1413                                                 val_to_str(session->spdu_type, ses_vals, "Unknown Ppdu type (0x%02x)"));
1414   if (tree){
1415           ti = proto_tree_add_item(tree, proto_pres, tvb, offset, -1,
1416                     FALSE);
1417           pres_tree = proto_item_add_subtree(ti, ett_pres);
1418   }
1419
1420         switch(session->spdu_type){
1421                 case SES_REFUSE:
1422                         break;
1423                 case SES_CONNECTION_REQUEST:
1424                         offset = dissect_pres_CP_type(FALSE, tvb, offset, pinfo, pres_tree, -1);
1425                         break;
1426                 case SES_CONNECTION_ACCEPT:
1427                         offset = dissect_pres_CPA_PPDU(FALSE, tvb, offset, pinfo, pres_tree, -1);
1428                         break;
1429                 case SES_ABORT:
1430                         offset = dissect_pres_Abort_type(FALSE, tvb, offset, pinfo, pres_tree, -1);
1431                         break;
1432                 case SES_DATA_TRANSFER:
1433                         offset = dissect_pres_CPC_type(FALSE, tvb, offset, pinfo, pres_tree, -1);
1434                         break;
1435                 default:
1436                         break;
1437         }
1438
1439         return offset;
1440 }
1441
1442 void
1443 dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
1444 {
1445         int offset = 0, old_offset;
1446 /* first, try to check length   */
1447 /* do we have at least 4 bytes  */
1448         if (!tvb_bytes_exist(tvb, 0, 4)){
1449                 proto_tree_add_text(parent_tree, tvb, offset, 
1450                         tvb_reported_length_remaining(tvb,offset),"User data");
1451                 return;  /* no, it isn't a presentation PDU */
1452         }
1453
1454         /*  we can't make any additional checking here   */
1455         /*  postpone it before dissector will have more information */
1456
1457         if (check_col(pinfo->cinfo, COL_PROTOCOL))
1458                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PRES");
1459         if (check_col(pinfo->cinfo, COL_INFO))
1460                 col_clear(pinfo->cinfo, COL_INFO);
1461         /* save pointers for calling the acse dissector  */
1462         global_tree = parent_tree;
1463         global_pinfo = pinfo;
1464
1465         while (tvb_reported_length_remaining(tvb, offset) > 0){
1466                 old_offset = offset;
1467                 offset = dissect_ppdu(tvb, offset, pinfo, parent_tree);
1468                 if(offset <= old_offset){
1469                         proto_tree_add_text(parent_tree, tvb, offset, -1,"Invalid offset");
1470                         THROW(ReportedBoundsError);
1471                 }
1472         }
1473 }
1474
1475
1476 /*--- proto_register_pres -------------------------------------------*/
1477 void proto_register_pres(void) {
1478
1479   /* List of fields */
1480   static hf_register_info hf[] = {
1481
1482
1483 /*--- Included file: packet-pres-hfarr.c ---*/
1484
1485     { &hf_pres_mode_selector,
1486       { "mode-selector", "pres.mode_selector",
1487         FT_NONE, BASE_NONE, NULL, 0,
1488         "", HFILL }},
1489     { &hf_pres_x410_mode_parameters,
1490       { "x410-mode-parameters", "pres.x410_mode_parameters",
1491         FT_NONE, BASE_NONE, NULL, 0,
1492         "CP-type/x410-mode-parameters", HFILL }},
1493     { &hf_pres_normal_mode_parameters,
1494       { "normal-mode-parameters", "pres.normal_mode_parameters",
1495         FT_NONE, BASE_NONE, NULL, 0,
1496         "CP-type/normal-mode-parameters", HFILL }},
1497     { &hf_pres_protocol_version,
1498       { "protocol-version", "pres.protocol_version",
1499         FT_BYTES, BASE_HEX, NULL, 0,
1500         "", HFILL }},
1501     { &hf_pres_calling_presentation_selector,
1502       { "calling-presentation-selector", "pres.calling_presentation_selector",
1503         FT_BYTES, BASE_HEX, NULL, 0,
1504         "CP-type/normal-mode-parameters/calling-presentation-selector", HFILL }},
1505     { &hf_pres_called_presentation_selector,
1506       { "called-presentation-selector", "pres.called_presentation_selector",
1507         FT_BYTES, BASE_HEX, NULL, 0,
1508         "CP-type/normal-mode-parameters/called-presentation-selector", HFILL }},
1509     { &hf_pres_presentation_context_definition_list,
1510       { "presentation-context-definition-list", "pres.presentation_context_definition_list",
1511         FT_UINT32, BASE_DEC, NULL, 0,
1512         "CP-type/normal-mode-parameters/presentation-context-definition-list", HFILL }},
1513     { &hf_pres_default_context_name,
1514       { "default-context-name", "pres.default_context_name",
1515         FT_NONE, BASE_NONE, NULL, 0,
1516         "CP-type/normal-mode-parameters/default-context-name", HFILL }},
1517     { &hf_pres_presentation_requirements,
1518       { "presentation-requirements", "pres.presentation_requirements",
1519         FT_BYTES, BASE_HEX, NULL, 0,
1520         "", HFILL }},
1521     { &hf_pres_user_session_requirements,
1522       { "user-session-requirements", "pres.user_session_requirements",
1523         FT_BYTES, BASE_HEX, NULL, 0,
1524         "", HFILL }},
1525     { &hf_pres_protocol_options,
1526       { "protocol-options", "pres.protocol_options",
1527         FT_BYTES, BASE_HEX, NULL, 0,
1528         "", HFILL }},
1529     { &hf_pres_initiators_nominated_context,
1530       { "initiators-nominated-context", "pres.initiators_nominated_context",
1531         FT_INT32, BASE_DEC, NULL, 0,
1532         "CP-type/normal-mode-parameters/initiators-nominated-context", HFILL }},
1533     { &hf_pres_extensions,
1534       { "extensions", "pres.extensions",
1535         FT_NONE, BASE_NONE, NULL, 0,
1536         "CP-type/normal-mode-parameters/extensions", HFILL }},
1537     { &hf_pres_user_data,
1538       { "user-data", "pres.user_data",
1539         FT_UINT32, BASE_DEC, VALS(pres_User_data_vals), 0,
1540         "", HFILL }},
1541     { &hf_pres_cPR_PPDU_x400_mode_parameters,
1542       { "x410-mode-parameters", "pres.x410_mode_parameters",
1543         FT_NONE, BASE_NONE, NULL, 0,
1544         "CPA-PPDU/x410-mode-parameters", HFILL }},
1545     { &hf_pres_cPU_PPDU_normal_mode_parameters,
1546       { "normal-mode-parameters", "pres.normal_mode_parameters",
1547         FT_NONE, BASE_NONE, NULL, 0,
1548         "CPA-PPDU/normal-mode-parameters", HFILL }},
1549     { &hf_pres_responding_presentation_selector,
1550       { "responding-presentation-selector", "pres.responding_presentation_selector",
1551         FT_BYTES, BASE_HEX, NULL, 0,
1552         "", HFILL }},
1553     { &hf_pres_presentation_context_definition_result_list,
1554       { "presentation-context-definition-result-list", "pres.presentation_context_definition_result_list",
1555         FT_UINT32, BASE_DEC, NULL, 0,
1556         "", HFILL }},
1557     { &hf_pres_responders_nominated_context,
1558       { "responders-nominated-context", "pres.responders_nominated_context",
1559         FT_INT32, BASE_DEC, NULL, 0,
1560         "CPA-PPDU/normal-mode-parameters/responders-nominated-context", HFILL }},
1561     { &hf_pres_cPU_PPDU_x400_mode_parameters,
1562       { "x400-mode-parameters", "pres.x400_mode_parameters",
1563         FT_NONE, BASE_NONE, NULL, 0,
1564         "CPR-PPDU/x400-mode-parameters", HFILL }},
1565     { &hf_pres_cPR_PPDU_normal_mode_parameters,
1566       { "normal-mode-parameters", "pres.normal_mode_parameters",
1567         FT_NONE, BASE_NONE, NULL, 0,
1568         "CPR-PPDU/normal-mode-parameters", HFILL }},
1569     { &hf_pres_default_context_result,
1570       { "default-context-result", "pres.default_context_result",
1571         FT_INT32, BASE_DEC, VALS(pres_Result_vals), 0,
1572         "CPR-PPDU/normal-mode-parameters/default-context-result", HFILL }},
1573     { &hf_pres_cPR_PPDU__provider_reason,
1574       { "provider-reason", "pres.provider_reason",
1575         FT_INT32, BASE_DEC, VALS(pres_Provider_reason_vals), 0,
1576         "CPR-PPDU/normal-mode-parameters/provider-reason", HFILL }},
1577     { &hf_pres_aru_ppdu,
1578       { "aru-ppdu", "pres.aru_ppdu",
1579         FT_UINT32, BASE_DEC, VALS(pres_ARU_PPDU_vals), 0,
1580         "Abort-type/aru-ppdu", HFILL }},
1581     { &hf_pres_arp_ppdu,
1582       { "arp-ppdu", "pres.arp_ppdu",
1583         FT_NONE, BASE_NONE, NULL, 0,
1584         "Abort-type/arp-ppdu", HFILL }},
1585     { &hf_pres_aRU_PPDU_x400_mode_parameters,
1586       { "x400-mode-parameters", "pres.x400_mode_parameters",
1587         FT_NONE, BASE_NONE, NULL, 0,
1588         "ARU-PPDU/x400-mode-parameters", HFILL }},
1589     { &hf_pres_aRU_PPDU_normal_mode_parameters,
1590       { "normal-mode-parameters", "pres.normal_mode_parameters",
1591         FT_NONE, BASE_NONE, NULL, 0,
1592         "ARU-PPDU/normal-mode-parameters", HFILL }},
1593     { &hf_pres_presentation_context_identifier_list,
1594       { "presentation-context-identifier-list", "pres.presentation_context_identifier_list",
1595         FT_UINT32, BASE_DEC, NULL, 0,
1596         "", HFILL }},
1597     { &hf_pres_aRU_PPDU_provider_reason,
1598       { "provider-reason", "pres.provider_reason",
1599         FT_INT32, BASE_DEC, VALS(pres_Abort_reason_vals), 0,
1600         "ARP-PPDU/provider-reason", HFILL }},
1601     { &hf_pres_event_identifier,
1602       { "event-identifier", "pres.event_identifier",
1603         FT_INT32, BASE_DEC, VALS(pres_Event_identifier_vals), 0,
1604         "ARP-PPDU/event-identifier", HFILL }},
1605     { &hf_pres_acPPDU,
1606       { "acPPDU", "pres.acPPDU",
1607         FT_NONE, BASE_NONE, NULL, 0,
1608         "Typed-data-type/acPPDU", HFILL }},
1609     { &hf_pres_acaPPDU,
1610       { "acaPPDU", "pres.acaPPDU",
1611         FT_NONE, BASE_NONE, NULL, 0,
1612         "Typed-data-type/acaPPDU", HFILL }},
1613     { &hf_pres_ttdPPDU,
1614       { "ttdPPDU", "pres.ttdPPDU",
1615         FT_UINT32, BASE_DEC, VALS(pres_User_data_vals), 0,
1616         "Typed-data-type/ttdPPDU", HFILL }},
1617     { &hf_pres_presentation_context_addition_list,
1618       { "presentation-context-addition-list", "pres.presentation_context_addition_list",
1619         FT_UINT32, BASE_DEC, NULL, 0,
1620         "AC-PPDU/presentation-context-addition-list", HFILL }},
1621     { &hf_pres_presentation_context_deletion_list,
1622       { "presentation-context-deletion-list", "pres.presentation_context_deletion_list",
1623         FT_UINT32, BASE_DEC, NULL, 0,
1624         "AC-PPDU/presentation-context-deletion-list", HFILL }},
1625     { &hf_pres_presentation_context_addition_result_list,
1626       { "presentation-context-addition-result-list", "pres.presentation_context_addition_result_list",
1627         FT_UINT32, BASE_DEC, NULL, 0,
1628         "ACA-PPDU/presentation-context-addition-result-list", HFILL }},
1629     { &hf_pres_presentation_context_deletion_result_list,
1630       { "presentation-context-deletion-result-list", "pres.presentation_context_deletion_result_list",
1631         FT_UINT32, BASE_DEC, NULL, 0,
1632         "ACA-PPDU/presentation-context-deletion-result-list", HFILL }},
1633     { &hf_pres_Context_list_item,
1634       { "Item", "pres.Context_list_item",
1635         FT_NONE, BASE_NONE, NULL, 0,
1636         "Context-list/_item", HFILL }},
1637     { &hf_pres_presentation_context_identifier,
1638       { "presentation-context-identifier", "pres.presentation_context_identifier",
1639         FT_INT32, BASE_DEC, NULL, 0,
1640         "", HFILL }},
1641     { &hf_pres_abstract_syntax_name,
1642       { "abstract-syntax-name", "pres.abstract_syntax_name",
1643         FT_STRING, BASE_NONE, NULL, 0,
1644         "", HFILL }},
1645     { &hf_pres_transfer_syntax_name_list,
1646       { "transfer-syntax-name-list", "pres.transfer_syntax_name_list",
1647         FT_UINT32, BASE_DEC, NULL, 0,
1648         "Context-list/_item/transfer-syntax-name-list", HFILL }},
1649     { &hf_pres_transfer_syntax_name_list_item,
1650       { "Item", "pres.transfer_syntax_name_list_item",
1651         FT_STRING, BASE_NONE, NULL, 0,
1652         "Context-list/_item/transfer-syntax-name-list/_item", HFILL }},
1653     { &hf_pres_transfer_syntax_name,
1654       { "transfer-syntax-name", "pres.transfer_syntax_name",
1655         FT_STRING, BASE_NONE, NULL, 0,
1656         "", HFILL }},
1657     { &hf_pres_mode_value,
1658       { "mode-value", "pres.mode_value",
1659         FT_INT32, BASE_DEC, VALS(pres_T_mode_value_vals), 0,
1660         "Mode-selector/mode-value", HFILL }},
1661     { &hf_pres_Presentation_context_deletion_list_item,
1662       { "Item", "pres.Presentation_context_deletion_list_item",
1663         FT_INT32, BASE_DEC, NULL, 0,
1664         "Presentation-context-deletion-list/_item", HFILL }},
1665     { &hf_pres_Presentation_context_deletion_result_list_item,
1666       { "Item", "pres.Presentation_context_deletion_result_list_item",
1667         FT_INT32, BASE_DEC, VALS(pres_Presentation_context_deletion_result_list_item_vals), 0,
1668         "Presentation-context-deletion-result-list/_item", HFILL }},
1669     { &hf_pres_Presentation_context_identifier_list_item,
1670       { "Item", "pres.Presentation_context_identifier_list_item",
1671         FT_NONE, BASE_NONE, NULL, 0,
1672         "Presentation-context-identifier-list/_item", HFILL }},
1673     { &hf_pres_Result_list_item,
1674       { "Item", "pres.Result_list_item",
1675         FT_NONE, BASE_NONE, NULL, 0,
1676         "Result-list/_item", HFILL }},
1677     { &hf_pres_result,
1678       { "result", "pres.result",
1679         FT_INT32, BASE_DEC, VALS(pres_Result_vals), 0,
1680         "Result-list/_item/result", HFILL }},
1681     { &hf_pres_provider_reason,
1682       { "provider-reason", "pres.provider_reason",
1683         FT_INT32, BASE_DEC, VALS(pres_T_provider_reason_vals), 0,
1684         "Result-list/_item/provider-reason", HFILL }},
1685     { &hf_pres_simply_encoded_data,
1686       { "simply-encoded-data", "pres.simply_encoded_data",
1687         FT_BYTES, BASE_HEX, NULL, 0,
1688         "User-data/simply-encoded-data", HFILL }},
1689     { &hf_pres_fully_encoded_data,
1690       { "fully-encoded-data", "pres.fully_encoded_data",
1691         FT_UINT32, BASE_DEC, NULL, 0,
1692         "User-data/fully-encoded-data", HFILL }},
1693     { &hf_pres_Fully_encoded_data_item,
1694       { "Item", "pres.Fully_encoded_data_item",
1695         FT_NONE, BASE_NONE, NULL, 0,
1696         "Fully-encoded-data/_item", HFILL }},
1697     { &hf_pres_presentation_data_values,
1698       { "presentation-data-values", "pres.presentation_data_values",
1699         FT_UINT32, BASE_DEC, VALS(pres_T_presentation_data_values_vals), 0,
1700         "PDV-list/presentation-data-values", HFILL }},
1701     { &hf_pres_single_ASN1_type,
1702       { "single-ASN1-type", "pres.single_ASN1_type",
1703         FT_BYTES, BASE_HEX, NULL, 0,
1704         "PDV-list/presentation-data-values/single-ASN1-type", HFILL }},
1705     { &hf_pres_octet_aligned,
1706       { "octet-aligned", "pres.octet_aligned",
1707         FT_BYTES, BASE_HEX, NULL, 0,
1708         "PDV-list/presentation-data-values/octet-aligned", HFILL }},
1709     { &hf_pres_arbitrary,
1710       { "arbitrary", "pres.arbitrary",
1711         FT_BYTES, BASE_HEX, NULL, 0,
1712         "PDV-list/presentation-data-values/arbitrary", HFILL }},
1713     { &hf_pres_Presentation_requirements_context_management,
1714       { "context-management", "pres.context-management",
1715         FT_BOOLEAN, 8, NULL, 0x80,
1716         "", HFILL }},
1717     { &hf_pres_Presentation_requirements_restoration,
1718       { "restoration", "pres.restoration",
1719         FT_BOOLEAN, 8, NULL, 0x40,
1720         "", HFILL }},
1721     { &hf_pres_Protocol_options_nominated_context,
1722       { "nominated-context", "pres.nominated-context",
1723         FT_BOOLEAN, 8, NULL, 0x80,
1724         "", HFILL }},
1725     { &hf_pres_Protocol_options_short_encoding,
1726       { "short-encoding", "pres.short-encoding",
1727         FT_BOOLEAN, 8, NULL, 0x40,
1728         "", HFILL }},
1729     { &hf_pres_Protocol_options_packed_encoding_rules,
1730       { "packed-encoding-rules", "pres.packed-encoding-rules",
1731         FT_BOOLEAN, 8, NULL, 0x20,
1732         "", HFILL }},
1733     { &hf_pres_Protocol_version_version_1,
1734       { "version-1", "pres.version-1",
1735         FT_BOOLEAN, 8, NULL, 0x80,
1736         "", HFILL }},
1737     { &hf_pres_User_session_requirements_half_duplex,
1738       { "half-duplex", "pres.half-duplex",
1739         FT_BOOLEAN, 8, NULL, 0x80,
1740         "", HFILL }},
1741     { &hf_pres_User_session_requirements_duplex,
1742       { "duplex", "pres.duplex",
1743         FT_BOOLEAN, 8, NULL, 0x40,
1744         "", HFILL }},
1745     { &hf_pres_User_session_requirements_expedited_data,
1746       { "expedited-data", "pres.expedited-data",
1747         FT_BOOLEAN, 8, NULL, 0x20,
1748         "", HFILL }},
1749     { &hf_pres_User_session_requirements_minor_synchronize,
1750       { "minor-synchronize", "pres.minor-synchronize",
1751         FT_BOOLEAN, 8, NULL, 0x10,
1752         "", HFILL }},
1753     { &hf_pres_User_session_requirements_major_synchronize,
1754       { "major-synchronize", "pres.major-synchronize",
1755         FT_BOOLEAN, 8, NULL, 0x08,
1756         "", HFILL }},
1757     { &hf_pres_User_session_requirements_resynchronize,
1758       { "resynchronize", "pres.resynchronize",
1759         FT_BOOLEAN, 8, NULL, 0x04,
1760         "", HFILL }},
1761     { &hf_pres_User_session_requirements_activity_management,
1762       { "activity-management", "pres.activity-management",
1763         FT_BOOLEAN, 8, NULL, 0x02,
1764         "", HFILL }},
1765     { &hf_pres_User_session_requirements_negotiated_release,
1766       { "negotiated-release", "pres.negotiated-release",
1767         FT_BOOLEAN, 8, NULL, 0x01,
1768         "", HFILL }},
1769     { &hf_pres_User_session_requirements_capability_data,
1770       { "capability-data", "pres.capability-data",
1771         FT_BOOLEAN, 8, NULL, 0x80,
1772         "", HFILL }},
1773     { &hf_pres_User_session_requirements_exceptions,
1774       { "exceptions", "pres.exceptions",
1775         FT_BOOLEAN, 8, NULL, 0x40,
1776         "", HFILL }},
1777     { &hf_pres_User_session_requirements_typed_data,
1778       { "typed-data", "pres.typed-data",
1779         FT_BOOLEAN, 8, NULL, 0x20,
1780         "", HFILL }},
1781     { &hf_pres_User_session_requirements_symmetric_synchronize,
1782       { "symmetric-synchronize", "pres.symmetric-synchronize",
1783         FT_BOOLEAN, 8, NULL, 0x10,
1784         "", HFILL }},
1785     { &hf_pres_User_session_requirements_data_separation,
1786       { "data-separation", "pres.data-separation",
1787         FT_BOOLEAN, 8, NULL, 0x08,
1788         "", HFILL }},
1789
1790 /*--- End of included file: packet-pres-hfarr.c ---*/
1791
1792   };
1793
1794   /* List of subtrees */
1795   static gint *ett[] = {
1796                 &ett_pres,
1797
1798 /*--- Included file: packet-pres-ettarr.c ---*/
1799
1800     &ett_pres_CP_type,
1801     &ett_pres_T_normal_mode_parameters,
1802     &ett_pres_T_extensions,
1803     &ett_pres_CPA_PPDU,
1804     &ett_pres_T_CPA_PPDU_normal_mode_parameters,
1805     &ett_pres_CPR_PPDU,
1806     &ett_pres_T_CPR_PPDU_normal_mode_parameters,
1807     &ett_pres_Abort_type,
1808     &ett_pres_ARU_PPDU,
1809     &ett_pres_T_ARU_PPDU_normal_mode_parameters,
1810     &ett_pres_ARP_PPDU,
1811     &ett_pres_Typed_data_type,
1812     &ett_pres_AC_PPDU,
1813     &ett_pres_ACA_PPDU,
1814     &ett_pres_RS_PPDU,
1815     &ett_pres_RSA_PPDU,
1816     &ett_pres_Context_list,
1817     &ett_pres_Context_list_item,
1818     &ett_pres_SEQUENCE_OF_Transfer_syntax_name,
1819     &ett_pres_Default_context_name,
1820     &ett_pres_Mode_selector,
1821     &ett_pres_Presentation_context_deletion_list,
1822     &ett_pres_Presentation_context_deletion_result_list,
1823     &ett_pres_Presentation_context_identifier_list,
1824     &ett_pres_Presentation_context_identifier_list_item,
1825     &ett_pres_Presentation_requirements,
1826     &ett_pres_Protocol_options,
1827     &ett_pres_Protocol_version,
1828     &ett_pres_Result_list,
1829     &ett_pres_Result_list_item,
1830     &ett_pres_User_data,
1831     &ett_pres_Fully_encoded_data,
1832     &ett_pres_PDV_list,
1833     &ett_pres_T_presentation_data_values,
1834     &ett_pres_User_session_requirements,
1835
1836 /*--- End of included file: packet-pres-ettarr.c ---*/
1837
1838   };
1839
1840   /* Register protocol */
1841   proto_pres = proto_register_protocol(PNAME, PSNAME, PFNAME);
1842   register_dissector("pres", dissect_pres, proto_pres);
1843   /* Register fields and subtrees */
1844   proto_register_field_array(proto_pres, hf, array_length(hf));
1845   proto_register_subtree_array(ett, array_length(ett));
1846   register_init_routine(pres_init);
1847
1848 }
1849
1850
1851 /*--- proto_reg_handoff_pres ---------------------------------------*/
1852 void proto_reg_handoff_pres(void) {
1853
1854 /*      register_ber_oid_dissector("0.4.0.0.1.1.1.1", dissect_pres, proto_pres, 
1855           "itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) abstractSyntax(1) pres(1) version1(1)"); */
1856
1857         data_handle = find_dissector("data");
1858
1859 }