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