Coverage Report

Created: 2026-09-28 06:52

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