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