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