2fb969ef56e318b55f90ed6450337ec7a55b2c51
[obnox/wireshark/wip.git] / epan / dissectors / packet-acse.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
3 /* .\packet-acse.c                                                            */
4 /* ../../tools/asn2eth.py -X -b -e -p acse -c acse.cnf -s packet-acse-template acse.asn */
5
6 /* Input file: packet-acse-template.c */
7
8 /*XXX
9   There is a bug in asn2eth that it can not yet handle tagged assignments such
10   as EXTERNAL  ::=  [UNIVERSAL 8] IMPLICIT SEQUENCE {
11
12   This bug is workedaround by some .cnf magic but this should be cleaned up
13   once asn2eth learns how to deal with tagged assignments
14 */
15
16 /* packet-acse.c
17  * Routines for ACSE packet dissection
18  *   Ronnie Sahlberg 2005
19  * dissect_acse() based original handwritten dissector by Sid
20  *   Yuriy Sidelnikov <YSidelnikov@hotmail.com>
21  *
22  *
23  * $Id$
24  *
25  * Ethereal - Network traffic analyzer
26  * By Gerald Combs <gerald@ethereal.com>
27  * Copyright 1998 Gerald Combs
28  *
29  * This program is free software; you can redistribute it and/or
30  * modify it under the terms of the GNU General Public License
31  * as published by the Free Software Foundation; either version 2
32  * of the License, or (at your option) any later version.
33  *
34  * This program is distributed in the hope that it will be useful,
35  * but WITHOUT ANY WARRANTY; without even the implied warranty of
36  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
37  * GNU General Public License for more details.
38  *
39  * You should have received a copy of the GNU General Public License
40  * along with this program; if not, write to the Free Software
41  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
42  */
43
44 #ifdef HAVE_CONFIG_H
45 # include "config.h"
46 #endif
47
48 #include <glib.h>
49 #include <epan/packet.h>
50 #include <epan/emem.h>
51 #include <epan/conversation.h>
52
53 #include <stdio.h>
54 #include <string.h>
55
56 #include "packet-ber.h"
57 #include "packet-acse.h"
58 #include "packet-ses.h"
59 #include "packet-pres.h"
60 #include "packet-x509if.h"
61
62 #define PNAME  "ACSE"
63 #define PSNAME "ACSE"
64 #define PFNAME "acse"
65
66 #define ACSE_APDU_OID "2.2.1.0.1"
67
68 /* Initialize the protocol and registered fields */
69 int proto_acse = -1;
70
71 /*--- Included file: packet-acse-hf.c ---*/
72
73 static int hf_acse_direct_reference = -1;         /* T_direct_reference */
74 static int hf_acse_indirect_reference = -1;       /* T_indirect_reference */
75 static int hf_acse_data_value_descriptor = -1;    /* ObjectDescriptor */
76 static int hf_acse_encoding = -1;                 /* T_encoding */
77 static int hf_acse_single_ASN1_type = -1;         /* T_single_ASN1_type */
78 static int hf_acse_octet_aligned = -1;            /* OCTET_STRING */
79 static int hf_acse_arbitrary = -1;                /* BIT_STRING */
80 static int hf_acse_aarq = -1;                     /* AARQ_apdu */
81 static int hf_acse_aare = -1;                     /* AARE_apdu */
82 static int hf_acse_rlrq = -1;                     /* RLRQ_apdu */
83 static int hf_acse_rlre = -1;                     /* RLRE_apdu */
84 static int hf_acse_abrt = -1;                     /* ABRT_apdu */
85 static int hf_acse_adt = -1;                      /* A_DT_apdu */
86 static int hf_acse_acrq = -1;                     /* ACRQ_apdu */
87 static int hf_acse_acrp = -1;                     /* ACRP_apdu */
88 static int hf_acse_aARQ_protocol_version = -1;    /* T_AARQ_protocol_version */
89 static int hf_acse_aARQ_aSO_context_name = -1;    /* T_AARQ_aSO_context_name */
90 static int hf_acse_called_AP_title = -1;          /* AP_title */
91 static int hf_acse_called_AE_qualifier = -1;      /* AE_qualifier */
92 static int hf_acse_called_AP_invocation_identifier = -1;  /* AP_invocation_identifier */
93 static int hf_acse_called_AE_invocation_identifier = -1;  /* AE_invocation_identifier */
94 static int hf_acse_calling_AP_title = -1;         /* AP_title */
95 static int hf_acse_calling_AE_qualifier = -1;     /* AE_qualifier */
96 static int hf_acse_calling_AP_invocation_identifier = -1;  /* AP_invocation_identifier */
97 static int hf_acse_calling_AE_invocation_identifier = -1;  /* AE_invocation_identifier */
98 static int hf_acse_sender_acse_requirements = -1;  /* ACSE_requirements */
99 static int hf_acse_mechanism_name = -1;           /* Mechanism_name */
100 static int hf_acse_calling_authentication_value = -1;  /* Authentication_value */
101 static int hf_acse_aSO_context_name_list = -1;    /* ASO_context_name_list */
102 static int hf_acse_implementation_information = -1;  /* Implementation_data */
103 static int hf_acse_p_context_definition_list = -1;  /* Syntactic_context_list */
104 static int hf_acse_called_asoi_tag = -1;          /* ASOI_tag */
105 static int hf_acse_calling_asoi_tag = -1;         /* ASOI_tag */
106 static int hf_acse_aARQ_user_information = -1;    /* Association_data */
107 static int hf_acse_aARE_protocol_version = -1;    /* T_AARE_protocol_version */
108 static int hf_acse_aARE_aSO_context_name = -1;    /* T_AARE_aSO_context_name */
109 static int hf_acse_aARE_result = -1;              /* Associate_result */
110 static int hf_acse_result_source_diagnostic = -1;  /* Associate_source_diagnostic */
111 static int hf_acse_responding_AP_title = -1;      /* AP_title */
112 static int hf_acse_responding_AE_qualifier = -1;  /* AE_qualifier */
113 static int hf_acse_responding_AP_invocation_identifier = -1;  /* AP_invocation_identifier */
114 static int hf_acse_responding_AE_invocation_identifier = -1;  /* AE_invocation_identifier */
115 static int hf_acse_responder_acse_requirements = -1;  /* ACSE_requirements */
116 static int hf_acse_responding_authentication_value = -1;  /* Authentication_value */
117 static int hf_acse_p_context_result_list = -1;    /* P_context_result_list */
118 static int hf_acse_aARE_user_information = -1;    /* Association_data */
119 static int hf_acse_rLRQ_reason = -1;              /* Release_request_reason */
120 static int hf_acse_aso_qualifier = -1;            /* ASO_qualifier */
121 static int hf_acse_asoi_identifier = -1;          /* ASOI_identifier */
122 static int hf_acse_rLRQ_user_information = -1;    /* Association_data */
123 static int hf_acse_rLRE_reason = -1;              /* Release_response_reason */
124 static int hf_acse_rLRE_user_information = -1;    /* Association_data */
125 static int hf_acse_abort_source = -1;             /* ABRT_source */
126 static int hf_acse_abort_diagnostic = -1;         /* ABRT_diagnostic */
127 static int hf_acse_aBRT_user_information = -1;    /* Association_data */
128 static int hf_acse_a_user_data = -1;              /* User_Data */
129 static int hf_acse_aCRQ_aSO_context_name = -1;    /* T_ACRQ_aSO_context_name */
130 static int hf_acse_user_information = -1;         /* User_information */
131 static int hf_acse_aSO_context_name = -1;         /* T_ACRP_aSO_context_name */
132 static int hf_acse_ap_title_form1 = -1;           /* AP_title_form1 */
133 static int hf_acse_ap_title_form2 = -1;           /* AP_title_form2 */
134 static int hf_acse_ap_title_form3 = -1;           /* AP_title_form3 */
135 static int hf_acse_aso_qualifier_form1 = -1;      /* ASO_qualifier_form1 */
136 static int hf_acse_aso_qualifier_form2 = -1;      /* ASO_qualifier_form2 */
137 static int hf_acse_aso_qualifier_form3 = -1;      /* ASO_qualifier_form3 */
138 static int hf_acse_ae_title_form1 = -1;           /* AE_title_form1 */
139 static int hf_acse_ae_title_form2 = -1;           /* AE_title_form2 */
140 static int hf_acse_ASOI_tag_item = -1;            /* ASOI_tag_item */
141 static int hf_acse_qualifier = -1;                /* ASO_qualifier */
142 static int hf_acse_identifier = -1;               /* ASOI_identifier */
143 static int hf_acse_ASO_context_name_list_item = -1;  /* ASO_context_name */
144 static int hf_acse_context_list = -1;             /* Context_list */
145 static int hf_acse_default_contact_list = -1;     /* Default_Context_List */
146 static int hf_acse_Context_list_item = -1;        /* Context_list_item */
147 static int hf_acse_pci = -1;                      /* Presentation_context_identifier */
148 static int hf_acse_abstract_syntax = -1;          /* Abstract_syntax_name */
149 static int hf_acse_transfer_syntaxes = -1;        /* SEQUENCE_OF_TransferSyntaxName */
150 static int hf_acse_transfer_syntaxes_item = -1;   /* TransferSyntaxName */
151 static int hf_acse_Default_Context_List_item = -1;  /* Default_Context_List_item */
152 static int hf_acse_abstract_syntax_name = -1;     /* Abstract_syntax_name */
153 static int hf_acse_transfer_syntax_name = -1;     /* TransferSyntaxName */
154 static int hf_acse_P_context_result_list_item = -1;  /* P_context_result_list_item */
155 static int hf_acse_pcontext_result = -1;          /* Result */
156 static int hf_acse_concrete_syntax_name = -1;     /* Concrete_syntax_name */
157 static int hf_acse_provider_reason = -1;          /* T_provider_reason */
158 static int hf_acse_acse_service_user = -1;        /* T_acse_service_user */
159 static int hf_acse_acse_service_provider = -1;    /* T_acse_service_provider */
160 static int hf_acse_Association_data_item = -1;    /* EXTERNAL */
161 static int hf_acse_simply_encoded_data = -1;      /* Simply_encoded_data */
162 static int hf_acse_fully_encoded_data = -1;       /* PDV_list */
163 static int hf_acse_presentation_context_identifier = -1;  /* Presentation_context_identifier */
164 static int hf_acse_presentation_data_values = -1;  /* T_presentation_data_values */
165 static int hf_acse_simple_ASN1_type = -1;         /* T_simple_ASN1_type */
166 static int hf_acse_other_mechanism_name = -1;     /* T_other_mechanism_name */
167 static int hf_acse_other_mechanism_value = -1;    /* T_other_mechanism_value */
168 static int hf_acse_charstring = -1;               /* GraphicString */
169 static int hf_acse_bitstring = -1;                /* BIT_STRING */
170 static int hf_acse_external = -1;                 /* EXTERNAL */
171 static int hf_acse_other = -1;                    /* Authentication_value_other */
172 /* named bits */
173 static int hf_acse_T_AARQ_protocol_version_version1 = -1;
174 static int hf_acse_T_AARE_protocol_version_version1 = -1;
175 static int hf_acse_ACSE_requirements_authentication = -1;
176 static int hf_acse_ACSE_requirements_aSO_context_negotiation = -1;
177 static int hf_acse_ACSE_requirements_higher_level_association = -1;
178 static int hf_acse_ACSE_requirements_nested_association = -1;
179
180 /*--- End of included file: packet-acse-hf.c ---*/
181
182
183 /* Initialize the subtree pointers */
184 static gint ett_acse = -1;
185
186 /*--- Included file: packet-acse-ett.c ---*/
187
188 static gint ett_acse_EXTERNAL = -1;
189 static gint ett_acse_T_encoding = -1;
190 static gint ett_acse_ACSE_apdu = -1;
191 static gint ett_acse_AARQ_apdu = -1;
192 static gint ett_acse_T_AARQ_protocol_version = -1;
193 static gint ett_acse_AARE_apdu = -1;
194 static gint ett_acse_T_AARE_protocol_version = -1;
195 static gint ett_acse_RLRQ_apdu = -1;
196 static gint ett_acse_RLRE_apdu = -1;
197 static gint ett_acse_ABRT_apdu = -1;
198 static gint ett_acse_A_DT_apdu = -1;
199 static gint ett_acse_ACRQ_apdu = -1;
200 static gint ett_acse_ACRP_apdu = -1;
201 static gint ett_acse_ACSE_requirements = -1;
202 static gint ett_acse_AP_title = -1;
203 static gint ett_acse_ASO_qualifier = -1;
204 static gint ett_acse_AE_title = -1;
205 static gint ett_acse_ASOI_tag = -1;
206 static gint ett_acse_ASOI_tag_item = -1;
207 static gint ett_acse_ASO_context_name_list = -1;
208 static gint ett_acse_Syntactic_context_list = -1;
209 static gint ett_acse_Context_list = -1;
210 static gint ett_acse_Context_list_item = -1;
211 static gint ett_acse_SEQUENCE_OF_TransferSyntaxName = -1;
212 static gint ett_acse_Default_Context_List = -1;
213 static gint ett_acse_Default_Context_List_item = -1;
214 static gint ett_acse_P_context_result_list = -1;
215 static gint ett_acse_P_context_result_list_item = -1;
216 static gint ett_acse_Associate_source_diagnostic = -1;
217 static gint ett_acse_Association_data = -1;
218 static gint ett_acse_User_Data = -1;
219 static gint ett_acse_PDV_list = -1;
220 static gint ett_acse_T_presentation_data_values = -1;
221 static gint ett_acse_Authentication_value_other = -1;
222 static gint ett_acse_Authentication_value = -1;
223
224 /*--- End of included file: packet-acse-ett.c ---*/
225
226
227 static struct SESSION_DATA_STRUCTURE* session = NULL;
228
229 static char object_identifier_id[MAX_OID_STR_LEN];
230 /* indirect_reference, used to pick up the signalling so we know what
231    kind of data is transferred in SES_DATA_TRANSFER_PDUs */
232 static guint32 indir_ref=0;
233
234 static proto_tree *top_tree=NULL;
235
236 #if NOT_NEEDED
237 /* to keep track of presentation context identifiers and protocol-oids */
238 typedef struct _acse_ctx_oid_t {
239         /* XXX here we should keep track of ADDRESS/PORT as well */
240         guint32 ctx_id;
241         char *oid;
242 } acse_ctx_oid_t;
243 static GHashTable *acse_ctx_oid_table = NULL;
244
245 static guint
246 acse_ctx_oid_hash(gconstpointer k)
247 {
248         acse_ctx_oid_t *aco=(acse_ctx_oid_t *)k;
249         return aco->ctx_id;
250 }
251 /* XXX this one should be made ADDRESS/PORT aware */
252 static gint
253 acse_ctx_oid_equal(gconstpointer k1, gconstpointer k2)
254 {
255         acse_ctx_oid_t *aco1=(acse_ctx_oid_t *)k1;
256         acse_ctx_oid_t *aco2=(acse_ctx_oid_t *)k2;
257         return aco1->ctx_id==aco2->ctx_id;
258 }
259
260 static void
261 acse_init(void)
262 {
263         if( acse_ctx_oid_table ){
264                 g_hash_table_destroy(acse_ctx_oid_table);
265                 acse_ctx_oid_table = NULL;
266         }
267         acse_ctx_oid_table = g_hash_table_new(acse_ctx_oid_hash,
268                         acse_ctx_oid_equal);
269
270 }
271
272 static void
273 register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, char *oid)
274 {
275         acse_ctx_oid_t *aco, *tmpaco;
276         aco=se_alloc(sizeof(acse_ctx_oid_t));
277         aco->ctx_id=idx;
278         aco->oid=se_strdup(oid);
279
280         /* if this ctx already exists, remove the old one first */
281         tmpaco=(acse_ctx_oid_t *)g_hash_table_lookup(acse_ctx_oid_table, aco);
282         if(tmpaco){
283                 g_hash_table_remove(acse_ctx_oid_table, tmpaco);
284         }
285         g_hash_table_insert(acse_ctx_oid_table, aco, aco);
286 }
287 static char *
288 find_oid_by_ctx_id(packet_info *pinfo _U_, guint32 idx)
289 {
290         acse_ctx_oid_t aco, *tmpaco;
291         aco.ctx_id=idx;
292         tmpaco=(acse_ctx_oid_t *)g_hash_table_lookup(acse_ctx_oid_table, &aco);
293         if(tmpaco){
294                 return tmpaco->oid;
295         }
296         return NULL;
297 }
298
299 # endif /* NOT_NEEDED */
300
301
302 /*--- Included file: packet-acse-fn.c ---*/
303
304 /*--- Fields for imported types ---*/
305
306
307
308
309 static int
310 dissect_acse_T_direct_reference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
311
312   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
313
314
315
316   return offset;
317 }
318 static int dissect_direct_reference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
319   return dissect_acse_T_direct_reference(FALSE, tvb, offset, pinfo, tree, hf_acse_direct_reference);
320 }
321
322
323
324 static int
325 dissect_acse_T_indirect_reference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
326   char *oid;
327   offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset,
328                 hf_acse_indirect_reference,
329                 &indir_ref);
330
331   /* look up the indirect reference */
332   if((oid = find_oid_by_pres_ctx_id(pinfo, indir_ref)) != NULL) {
333     g_snprintf(object_identifier_id, MAX_OID_STR_LEN, "%s", oid);
334   }
335
336   if(session)
337         session->pres_ctx_id = indir_ref;
338
339
340   return offset;
341 }
342 static int dissect_indirect_reference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
343   return dissect_acse_T_indirect_reference(FALSE, tvb, offset, pinfo, tree, hf_acse_indirect_reference);
344 }
345
346
347
348 static int
349 dissect_acse_ObjectDescriptor(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
350   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_ObjectDescriptor,
351                                             pinfo, tree, tvb, offset, hf_index,
352                                             NULL);
353
354   return offset;
355 }
356 static int dissect_data_value_descriptor(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
357   return dissect_acse_ObjectDescriptor(FALSE, tvb, offset, pinfo, tree, hf_acse_data_value_descriptor);
358 }
359
360
361
362 static int
363 dissect_acse_T_single_ASN1_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
364   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree ? top_tree : tree);
365
366
367   return offset;
368 }
369 static int dissect_single_ASN1_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
370   return dissect_acse_T_single_ASN1_type(FALSE, tvb, offset, pinfo, tree, hf_acse_single_ASN1_type);
371 }
372
373
374
375 static int
376 dissect_acse_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
377   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
378                                        NULL);
379
380   return offset;
381 }
382 static int dissect_octet_aligned_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
383   return dissect_acse_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_acse_octet_aligned);
384 }
385
386
387
388 static int
389 dissect_acse_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
390   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
391                                     NULL, hf_index, -1,
392                                     NULL);
393
394   return offset;
395 }
396 static int dissect_arbitrary_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
397   return dissect_acse_BIT_STRING(TRUE, tvb, offset, pinfo, tree, hf_acse_arbitrary);
398 }
399 static int dissect_bitstring_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
400   return dissect_acse_BIT_STRING(TRUE, tvb, offset, pinfo, tree, hf_acse_bitstring);
401 }
402
403
404 static const value_string acse_T_encoding_vals[] = {
405   {   0, "single-ASN1-type" },
406   {   1, "octet-aligned" },
407   {   2, "arbitrary" },
408   { 0, NULL }
409 };
410
411 static const ber_choice_t T_encoding_choice[] = {
412   {   0, BER_CLASS_CON, 0, 0, dissect_single_ASN1_type },
413   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_octet_aligned_impl },
414   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_arbitrary_impl },
415   { 0, 0, 0, 0, NULL }
416 };
417
418 static int
419 dissect_acse_T_encoding(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
420   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
421                                  T_encoding_choice, hf_index, ett_acse_T_encoding,
422                                  NULL);
423
424   return offset;
425 }
426 static int dissect_encoding(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
427   return dissect_acse_T_encoding(FALSE, tvb, offset, pinfo, tree, hf_acse_encoding);
428 }
429
430
431 static const ber_sequence_t EXTERNAL_sequence[] = {
432   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_direct_reference },
433   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_indirect_reference },
434   { BER_CLASS_UNI, BER_UNI_TAG_ObjectDescriptor, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_data_value_descriptor },
435   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_encoding },
436   { 0, 0, 0, NULL }
437 };
438
439 int
440 dissect_acse_EXTERNAL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
441   gint8 class;
442   gboolean pc, ind_field;
443   gint32 tag;
444   guint32 len1;
445
446   if(!implicit_tag) {
447     /* XXX  asn2eth can not yet handle tagged assignment so for the
448      * time being  just remove this tag manually inside the EXTERNAL
449      * dissector.
450      */
451      offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
452      offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
453    }
454    offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset,
455                                 EXTERNAL_sequence, hf_index, ett_acse_EXTERNAL);
456
457
458   return offset;
459 }
460 static int dissect_Association_data_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
461   return dissect_acse_EXTERNAL(FALSE, tvb, offset, pinfo, tree, hf_acse_Association_data_item);
462 }
463 static int dissect_external_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
464   return dissect_acse_EXTERNAL(TRUE, tvb, offset, pinfo, tree, hf_acse_external);
465 }
466
467
468 static const asn_namedbit T_AARQ_protocol_version_bits[] = {
469   {  0, &hf_acse_T_AARQ_protocol_version_version1, -1, -1, "version1", NULL },
470   { 0, NULL, 0, 0, NULL, NULL }
471 };
472
473 static int
474 dissect_acse_T_AARQ_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
475   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
476                                     T_AARQ_protocol_version_bits, hf_index, ett_acse_T_AARQ_protocol_version,
477                                     NULL);
478
479   return offset;
480 }
481 static int dissect_aARQ_protocol_version_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
482   return dissect_acse_T_AARQ_protocol_version(TRUE, tvb, offset, pinfo, tree, hf_acse_aARQ_protocol_version);
483 }
484
485
486
487 static int
488 dissect_acse_ASO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
489   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
490
491   return offset;
492 }
493 static int dissect_ASO_context_name_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
494   return dissect_acse_ASO_context_name(FALSE, tvb, offset, pinfo, tree, hf_acse_ASO_context_name_list_item);
495 }
496
497
498
499 static int
500 dissect_acse_T_AARQ_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
501   offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
502                                          hf_index, object_identifier_id);
503
504
505   return offset;
506 }
507 static int dissect_aARQ_aSO_context_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
508   return dissect_acse_T_AARQ_aSO_context_name(FALSE, tvb, offset, pinfo, tree, hf_acse_aARQ_aSO_context_name);
509 }
510
511
512
513 static int
514 dissect_acse_AP_title_form1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
515   offset = dissect_x509if_Name(implicit_tag, tvb, offset, pinfo, tree, hf_index);
516
517   return offset;
518 }
519 static int dissect_ap_title_form1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
520   return dissect_acse_AP_title_form1(FALSE, tvb, offset, pinfo, tree, hf_acse_ap_title_form1);
521 }
522
523
524
525 static int
526 dissect_acse_AP_title_form2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
527   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
528
529   return offset;
530 }
531 static int dissect_ap_title_form2(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
532   return dissect_acse_AP_title_form2(FALSE, tvb, offset, pinfo, tree, hf_acse_ap_title_form2);
533 }
534
535
536
537 static int
538 dissect_acse_AP_title_form3(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
539   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString,
540                                             pinfo, tree, tvb, offset, hf_index,
541                                             NULL);
542
543   return offset;
544 }
545 static int dissect_ap_title_form3(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
546   return dissect_acse_AP_title_form3(FALSE, tvb, offset, pinfo, tree, hf_acse_ap_title_form3);
547 }
548
549
550 const value_string acse_AP_title_vals[] = {
551   {   0, "ap-title-form1" },
552   {   1, "ap-title-form2" },
553   {   2, "ap-title-form3" },
554   {   3, "ap-title-form3" },
555   { 0, NULL }
556 };
557
558 static const ber_choice_t AP_title_choice[] = {
559   {   0, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_ap_title_form1 },
560   {   1, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ap_title_form2 },
561   {   2, BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_ap_title_form3 },
562   {   3, BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_ap_title_form3 },
563   {   4, BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_ap_title_form3 },
564   { 0, 0, 0, 0, NULL }
565 };
566
567 int
568 dissect_acse_AP_title(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
569   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
570                                  AP_title_choice, hf_index, ett_acse_AP_title,
571                                  NULL);
572
573   return offset;
574 }
575 static int dissect_called_AP_title(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
576   return dissect_acse_AP_title(FALSE, tvb, offset, pinfo, tree, hf_acse_called_AP_title);
577 }
578 static int dissect_calling_AP_title(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
579   return dissect_acse_AP_title(FALSE, tvb, offset, pinfo, tree, hf_acse_calling_AP_title);
580 }
581 static int dissect_responding_AP_title(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
582   return dissect_acse_AP_title(FALSE, tvb, offset, pinfo, tree, hf_acse_responding_AP_title);
583 }
584
585
586
587 static int
588 dissect_acse_ASO_qualifier_form1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
589   offset = dissect_x509if_RelativeDistinguishedName(implicit_tag, tvb, offset, pinfo, tree, hf_index);
590
591   return offset;
592 }
593 static int dissect_aso_qualifier_form1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
594   return dissect_acse_ASO_qualifier_form1(FALSE, tvb, offset, pinfo, tree, hf_acse_aso_qualifier_form1);
595 }
596
597
598
599 static int
600 dissect_acse_ASO_qualifier_form2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
601   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
602                                   NULL);
603
604   return offset;
605 }
606 static int dissect_aso_qualifier_form2(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
607   return dissect_acse_ASO_qualifier_form2(FALSE, tvb, offset, pinfo, tree, hf_acse_aso_qualifier_form2);
608 }
609
610
611
612 static int
613 dissect_acse_ASO_qualifier_form3(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
614   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString,
615                                             pinfo, tree, tvb, offset, hf_index,
616                                             NULL);
617
618   return offset;
619 }
620 static int dissect_aso_qualifier_form3(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
621   return dissect_acse_ASO_qualifier_form3(FALSE, tvb, offset, pinfo, tree, hf_acse_aso_qualifier_form3);
622 }
623
624
625 const value_string acse_ASO_qualifier_vals[] = {
626   {   0, "aso-qualifier-form1" },
627   {   1, "aso-qualifier-form2" },
628   {   2, "aso-qualifier-form3" },
629   {   3, "aso-qualifier-form3" },
630   { 0, NULL }
631 };
632
633 static const ber_choice_t ASO_qualifier_choice[] = {
634   {   0, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_aso_qualifier_form1 },
635   {   1, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_aso_qualifier_form2 },
636   {   2, BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_aso_qualifier_form3 },
637   {   3, BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_aso_qualifier_form3 },
638   {   4, BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_aso_qualifier_form3 },
639   { 0, 0, 0, 0, NULL }
640 };
641
642 int
643 dissect_acse_ASO_qualifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
644   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
645                                  ASO_qualifier_choice, hf_index, ett_acse_ASO_qualifier,
646                                  NULL);
647
648   return offset;
649 }
650 static int dissect_aso_qualifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
651   return dissect_acse_ASO_qualifier(FALSE, tvb, offset, pinfo, tree, hf_acse_aso_qualifier);
652 }
653 static int dissect_qualifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
654   return dissect_acse_ASO_qualifier(FALSE, tvb, offset, pinfo, tree, hf_acse_qualifier);
655 }
656
657
658
659 int
660 dissect_acse_AE_qualifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
661   offset = dissect_acse_ASO_qualifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
662
663   return offset;
664 }
665 static int dissect_called_AE_qualifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
666   return dissect_acse_AE_qualifier(FALSE, tvb, offset, pinfo, tree, hf_acse_called_AE_qualifier);
667 }
668 static int dissect_calling_AE_qualifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
669   return dissect_acse_AE_qualifier(FALSE, tvb, offset, pinfo, tree, hf_acse_calling_AE_qualifier);
670 }
671 static int dissect_responding_AE_qualifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
672   return dissect_acse_AE_qualifier(FALSE, tvb, offset, pinfo, tree, hf_acse_responding_AE_qualifier);
673 }
674
675
676
677 int
678 dissect_acse_AP_invocation_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
679   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
680                                   NULL);
681
682   return offset;
683 }
684 static int dissect_called_AP_invocation_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
685   return dissect_acse_AP_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_acse_called_AP_invocation_identifier);
686 }
687 static int dissect_calling_AP_invocation_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
688   return dissect_acse_AP_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_acse_calling_AP_invocation_identifier);
689 }
690 static int dissect_responding_AP_invocation_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
691   return dissect_acse_AP_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_acse_responding_AP_invocation_identifier);
692 }
693
694
695
696 int
697 dissect_acse_AE_invocation_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
698   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
699                                   NULL);
700
701   return offset;
702 }
703 static int dissect_called_AE_invocation_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
704   return dissect_acse_AE_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_acse_called_AE_invocation_identifier);
705 }
706 static int dissect_calling_AE_invocation_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
707   return dissect_acse_AE_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_acse_calling_AE_invocation_identifier);
708 }
709 static int dissect_responding_AE_invocation_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
710   return dissect_acse_AE_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_acse_responding_AE_invocation_identifier);
711 }
712
713
714 static const asn_namedbit ACSE_requirements_bits[] = {
715   {  0, &hf_acse_ACSE_requirements_authentication, -1, -1, "authentication", NULL },
716   {  1, &hf_acse_ACSE_requirements_aSO_context_negotiation, -1, -1, "aSO-context-negotiation", NULL },
717   {  2, &hf_acse_ACSE_requirements_higher_level_association, -1, -1, "higher-level-association", NULL },
718   {  3, &hf_acse_ACSE_requirements_nested_association, -1, -1, "nested-association", NULL },
719   { 0, NULL, 0, 0, NULL, NULL }
720 };
721
722 static int
723 dissect_acse_ACSE_requirements(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
724   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
725                                     ACSE_requirements_bits, hf_index, ett_acse_ACSE_requirements,
726                                     NULL);
727
728   return offset;
729 }
730 static int dissect_sender_acse_requirements_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
731   return dissect_acse_ACSE_requirements(TRUE, tvb, offset, pinfo, tree, hf_acse_sender_acse_requirements);
732 }
733 static int dissect_responder_acse_requirements_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
734   return dissect_acse_ACSE_requirements(TRUE, tvb, offset, pinfo, tree, hf_acse_responder_acse_requirements);
735 }
736
737
738
739 static int
740 dissect_acse_Mechanism_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
741   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
742
743   return offset;
744 }
745 static int dissect_mechanism_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
746   return dissect_acse_Mechanism_name(TRUE, tvb, offset, pinfo, tree, hf_acse_mechanism_name);
747 }
748
749
750
751 static int
752 dissect_acse_GraphicString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
753   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_GraphicString,
754                                             pinfo, tree, tvb, offset, hf_index,
755                                             NULL);
756
757   return offset;
758 }
759 static int dissect_charstring_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
760   return dissect_acse_GraphicString(TRUE, tvb, offset, pinfo, tree, hf_acse_charstring);
761 }
762
763
764
765 static int
766 dissect_acse_T_other_mechanism_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
767   offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
768                                          hf_index, object_identifier_id);
769
770
771   return offset;
772 }
773 static int dissect_other_mechanism_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
774   return dissect_acse_T_other_mechanism_name(FALSE, tvb, offset, pinfo, tree, hf_acse_other_mechanism_name);
775 }
776
777
778
779 static int
780 dissect_acse_T_other_mechanism_value(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
781   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree);
782
783
784   return offset;
785 }
786 static int dissect_other_mechanism_value(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
787   return dissect_acse_T_other_mechanism_value(FALSE, tvb, offset, pinfo, tree, hf_acse_other_mechanism_value);
788 }
789
790
791 static const ber_sequence_t Authentication_value_other_sequence[] = {
792   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_other_mechanism_name },
793   { BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_other_mechanism_value },
794   { 0, 0, 0, NULL }
795 };
796
797 static int
798 dissect_acse_Authentication_value_other(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
799   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
800                                    Authentication_value_other_sequence, hf_index, ett_acse_Authentication_value_other);
801
802   return offset;
803 }
804 static int dissect_other_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
805   return dissect_acse_Authentication_value_other(TRUE, tvb, offset, pinfo, tree, hf_acse_other);
806 }
807
808
809 static const value_string acse_Authentication_value_vals[] = {
810   {   0, "charstring" },
811   {   1, "bitstring" },
812   {   2, "external" },
813   {   3, "other" },
814   { 0, NULL }
815 };
816
817 static const ber_choice_t Authentication_value_choice[] = {
818   {   0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_charstring_impl },
819   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_bitstring_impl },
820   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_external_impl },
821   {   3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_other_impl },
822   { 0, 0, 0, 0, NULL }
823 };
824
825 static int
826 dissect_acse_Authentication_value(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
827   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
828                                  Authentication_value_choice, hf_index, ett_acse_Authentication_value,
829                                  NULL);
830
831   return offset;
832 }
833 static int dissect_calling_authentication_value(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
834   return dissect_acse_Authentication_value(FALSE, tvb, offset, pinfo, tree, hf_acse_calling_authentication_value);
835 }
836 static int dissect_responding_authentication_value(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
837   return dissect_acse_Authentication_value(FALSE, tvb, offset, pinfo, tree, hf_acse_responding_authentication_value);
838 }
839
840
841 static const ber_sequence_t ASO_context_name_list_sequence_of[1] = {
842   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ASO_context_name_list_item },
843 };
844
845 static int
846 dissect_acse_ASO_context_name_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
847   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
848                                       ASO_context_name_list_sequence_of, hf_index, ett_acse_ASO_context_name_list);
849
850   return offset;
851 }
852 static int dissect_aSO_context_name_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
853   return dissect_acse_ASO_context_name_list(TRUE, tvb, offset, pinfo, tree, hf_acse_aSO_context_name_list);
854 }
855
856
857
858 static int
859 dissect_acse_Implementation_data(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
860   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_GraphicString,
861                                             pinfo, tree, tvb, offset, hf_index,
862                                             NULL);
863
864   return offset;
865 }
866 static int dissect_implementation_information_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
867   return dissect_acse_Implementation_data(TRUE, tvb, offset, pinfo, tree, hf_acse_implementation_information);
868 }
869
870
871
872 static int
873 dissect_acse_Presentation_context_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
874   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
875                                   NULL);
876
877   return offset;
878 }
879 static int dissect_pci(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
880   return dissect_acse_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_acse_pci);
881 }
882 static int dissect_presentation_context_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
883   return dissect_acse_Presentation_context_identifier(FALSE, tvb, offset, pinfo, tree, hf_acse_presentation_context_identifier);
884 }
885
886
887
888 static int
889 dissect_acse_Abstract_syntax_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
890   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
891
892   return offset;
893 }
894 static int dissect_abstract_syntax(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
895   return dissect_acse_Abstract_syntax_name(FALSE, tvb, offset, pinfo, tree, hf_acse_abstract_syntax);
896 }
897 static int dissect_abstract_syntax_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
898   return dissect_acse_Abstract_syntax_name(TRUE, tvb, offset, pinfo, tree, hf_acse_abstract_syntax_name);
899 }
900
901
902
903 static int
904 dissect_acse_TransferSyntaxName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
905   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
906
907   return offset;
908 }
909 static int dissect_transfer_syntaxes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
910   return dissect_acse_TransferSyntaxName(FALSE, tvb, offset, pinfo, tree, hf_acse_transfer_syntaxes_item);
911 }
912 static int dissect_transfer_syntax_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
913   return dissect_acse_TransferSyntaxName(FALSE, tvb, offset, pinfo, tree, hf_acse_transfer_syntax_name);
914 }
915 static int dissect_transfer_syntax_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
916   return dissect_acse_TransferSyntaxName(TRUE, tvb, offset, pinfo, tree, hf_acse_transfer_syntax_name);
917 }
918
919
920 static const ber_sequence_t SEQUENCE_OF_TransferSyntaxName_sequence_of[1] = {
921   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_transfer_syntaxes_item },
922 };
923
924 static int
925 dissect_acse_SEQUENCE_OF_TransferSyntaxName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
926   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
927                                       SEQUENCE_OF_TransferSyntaxName_sequence_of, hf_index, ett_acse_SEQUENCE_OF_TransferSyntaxName);
928
929   return offset;
930 }
931 static int dissect_transfer_syntaxes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
932   return dissect_acse_SEQUENCE_OF_TransferSyntaxName(FALSE, tvb, offset, pinfo, tree, hf_acse_transfer_syntaxes);
933 }
934
935
936 static const ber_sequence_t Context_list_item_sequence[] = {
937   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pci },
938   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_abstract_syntax },
939   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_transfer_syntaxes },
940   { 0, 0, 0, NULL }
941 };
942
943 static int
944 dissect_acse_Context_list_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
945   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
946                                    Context_list_item_sequence, hf_index, ett_acse_Context_list_item);
947
948   return offset;
949 }
950 static int dissect_Context_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
951   return dissect_acse_Context_list_item(FALSE, tvb, offset, pinfo, tree, hf_acse_Context_list_item);
952 }
953
954
955 static const ber_sequence_t Context_list_sequence_of[1] = {
956   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Context_list_item },
957 };
958
959 static int
960 dissect_acse_Context_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
961   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
962                                       Context_list_sequence_of, hf_index, ett_acse_Context_list);
963
964   return offset;
965 }
966 static int dissect_context_list(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
967   return dissect_acse_Context_list(FALSE, tvb, offset, pinfo, tree, hf_acse_context_list);
968 }
969
970
971 static const ber_sequence_t Default_Context_List_item_sequence[] = {
972   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_abstract_syntax_name_impl },
973   { BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_transfer_syntax_name_impl },
974   { 0, 0, 0, NULL }
975 };
976
977 static int
978 dissect_acse_Default_Context_List_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
979   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
980                                    Default_Context_List_item_sequence, hf_index, ett_acse_Default_Context_List_item);
981
982   return offset;
983 }
984 static int dissect_Default_Context_List_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
985   return dissect_acse_Default_Context_List_item(FALSE, tvb, offset, pinfo, tree, hf_acse_Default_Context_List_item);
986 }
987
988
989 static const ber_sequence_t Default_Context_List_sequence_of[1] = {
990   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Default_Context_List_item },
991 };
992
993 static int
994 dissect_acse_Default_Context_List(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
995   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
996                                       Default_Context_List_sequence_of, hf_index, ett_acse_Default_Context_List);
997
998   return offset;
999 }
1000 static int dissect_default_contact_list(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1001   return dissect_acse_Default_Context_List(FALSE, tvb, offset, pinfo, tree, hf_acse_default_contact_list);
1002 }
1003
1004
1005 static const value_string acse_Syntactic_context_list_vals[] = {
1006   {   0, "context-list" },
1007   {   1, "default-contact-list" },
1008   { 0, NULL }
1009 };
1010
1011 static const ber_choice_t Syntactic_context_list_choice[] = {
1012   {   0, BER_CLASS_CON, 0, 0, dissect_context_list },
1013   {   1, BER_CLASS_CON, 1, 0, dissect_default_contact_list },
1014   { 0, 0, 0, 0, NULL }
1015 };
1016
1017 static int
1018 dissect_acse_Syntactic_context_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1019   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1020                                  Syntactic_context_list_choice, hf_index, ett_acse_Syntactic_context_list,
1021                                  NULL);
1022
1023   return offset;
1024 }
1025 static int dissect_p_context_definition_list(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1026   return dissect_acse_Syntactic_context_list(FALSE, tvb, offset, pinfo, tree, hf_acse_p_context_definition_list);
1027 }
1028
1029
1030
1031 static int
1032 dissect_acse_ASOI_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1033   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1034                                   NULL);
1035
1036   return offset;
1037 }
1038 static int dissect_asoi_identifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1039   return dissect_acse_ASOI_identifier(TRUE, tvb, offset, pinfo, tree, hf_acse_asoi_identifier);
1040 }
1041 static int dissect_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1042   return dissect_acse_ASOI_identifier(FALSE, tvb, offset, pinfo, tree, hf_acse_identifier);
1043 }
1044
1045
1046 static const ber_sequence_t ASOI_tag_item_sequence[] = {
1047   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_qualifier },
1048   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_identifier },
1049   { 0, 0, 0, NULL }
1050 };
1051
1052 static int
1053 dissect_acse_ASOI_tag_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1054   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1055                                    ASOI_tag_item_sequence, hf_index, ett_acse_ASOI_tag_item);
1056
1057   return offset;
1058 }
1059 static int dissect_ASOI_tag_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1060   return dissect_acse_ASOI_tag_item(FALSE, tvb, offset, pinfo, tree, hf_acse_ASOI_tag_item);
1061 }
1062
1063
1064 static const ber_sequence_t ASOI_tag_sequence_of[1] = {
1065   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ASOI_tag_item },
1066 };
1067
1068 static int
1069 dissect_acse_ASOI_tag(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1070   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1071                                       ASOI_tag_sequence_of, hf_index, ett_acse_ASOI_tag);
1072
1073   return offset;
1074 }
1075 static int dissect_called_asoi_tag_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1076   return dissect_acse_ASOI_tag(TRUE, tvb, offset, pinfo, tree, hf_acse_called_asoi_tag);
1077 }
1078 static int dissect_calling_asoi_tag_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1079   return dissect_acse_ASOI_tag(TRUE, tvb, offset, pinfo, tree, hf_acse_calling_asoi_tag);
1080 }
1081
1082
1083 static const ber_sequence_t Association_data_sequence_of[1] = {
1084   { BER_CLASS_UNI, 8, BER_FLAGS_NOOWNTAG, dissect_Association_data_item },
1085 };
1086
1087 static int
1088 dissect_acse_Association_data(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1089   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1090                                       Association_data_sequence_of, hf_index, ett_acse_Association_data);
1091
1092   return offset;
1093 }
1094 static int dissect_aARQ_user_information_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1095   return dissect_acse_Association_data(TRUE, tvb, offset, pinfo, tree, hf_acse_aARQ_user_information);
1096 }
1097 static int dissect_aARE_user_information_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1098   return dissect_acse_Association_data(TRUE, tvb, offset, pinfo, tree, hf_acse_aARE_user_information);
1099 }
1100 static int dissect_rLRQ_user_information_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1101   return dissect_acse_Association_data(TRUE, tvb, offset, pinfo, tree, hf_acse_rLRQ_user_information);
1102 }
1103 static int dissect_rLRE_user_information_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1104   return dissect_acse_Association_data(TRUE, tvb, offset, pinfo, tree, hf_acse_rLRE_user_information);
1105 }
1106 static int dissect_aBRT_user_information_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1107   return dissect_acse_Association_data(TRUE, tvb, offset, pinfo, tree, hf_acse_aBRT_user_information);
1108 }
1109
1110
1111 static const ber_sequence_t AARQ_apdu_sequence[] = {
1112   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aARQ_protocol_version_impl },
1113   { BER_CLASS_CON, 1, 0, dissect_aARQ_aSO_context_name },
1114   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_called_AP_title },
1115   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_called_AE_qualifier },
1116   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL, dissect_called_AP_invocation_identifier },
1117   { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL, dissect_called_AE_invocation_identifier },
1118   { BER_CLASS_CON, 6, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_calling_AP_title },
1119   { BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_calling_AE_qualifier },
1120   { BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL, dissect_calling_AP_invocation_identifier },
1121   { BER_CLASS_CON, 9, BER_FLAGS_OPTIONAL, dissect_calling_AE_invocation_identifier },
1122   { BER_CLASS_CON, 10, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_sender_acse_requirements_impl },
1123   { BER_CLASS_CON, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_mechanism_name_impl },
1124   { BER_CLASS_CON, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_calling_authentication_value },
1125   { BER_CLASS_CON, 13, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aSO_context_name_list_impl },
1126   { BER_CLASS_CON, 29, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_implementation_information_impl },
1127   { BER_CLASS_CON, 14, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_p_context_definition_list },
1128   { BER_CLASS_CON, 15, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_called_asoi_tag_impl },
1129   { BER_CLASS_CON, 16, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_calling_asoi_tag_impl },
1130   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aARQ_user_information_impl },
1131   { 0, 0, 0, NULL }
1132 };
1133
1134 static int
1135 dissect_acse_AARQ_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1136   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1137                                    AARQ_apdu_sequence, hf_index, ett_acse_AARQ_apdu);
1138
1139   return offset;
1140 }
1141 static int dissect_aarq_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1142   return dissect_acse_AARQ_apdu(TRUE, tvb, offset, pinfo, tree, hf_acse_aarq);
1143 }
1144
1145
1146 static const asn_namedbit T_AARE_protocol_version_bits[] = {
1147   {  0, &hf_acse_T_AARE_protocol_version_version1, -1, -1, "version1", NULL },
1148   { 0, NULL, 0, 0, NULL, NULL }
1149 };
1150
1151 static int
1152 dissect_acse_T_AARE_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1153   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
1154                                     T_AARE_protocol_version_bits, hf_index, ett_acse_T_AARE_protocol_version,
1155                                     NULL);
1156
1157   return offset;
1158 }
1159 static int dissect_aARE_protocol_version_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1160   return dissect_acse_T_AARE_protocol_version(TRUE, tvb, offset, pinfo, tree, hf_acse_aARE_protocol_version);
1161 }
1162
1163
1164
1165 static int
1166 dissect_acse_T_AARE_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1167   offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
1168                                          hf_index, object_identifier_id);
1169
1170
1171   return offset;
1172 }
1173 static int dissect_aARE_aSO_context_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1174   return dissect_acse_T_AARE_aSO_context_name(FALSE, tvb, offset, pinfo, tree, hf_acse_aARE_aSO_context_name);
1175 }
1176
1177
1178 static const value_string acse_Associate_result_vals[] = {
1179   {   0, "accepted" },
1180   {   1, "rejected-permanent" },
1181   {   2, "rejected-transient" },
1182   { 0, NULL }
1183 };
1184
1185
1186 static int
1187 dissect_acse_Associate_result(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1188   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1189                                   NULL);
1190
1191   return offset;
1192 }
1193 static int dissect_aARE_result(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1194   return dissect_acse_Associate_result(FALSE, tvb, offset, pinfo, tree, hf_acse_aARE_result);
1195 }
1196
1197
1198 static const value_string acse_T_acse_service_user_vals[] = {
1199   {   0, "null" },
1200   {   1, "no-reason-given" },
1201   {   2, "application-context-name-not-supported" },
1202   {   3, "calling-AP-title-not-recognized" },
1203   {   4, "calling-AP-invocation-identifier-not-recognized" },
1204   {   5, "calling-AE-qualifier-not-recognized" },
1205   {   6, "calling-AE-invocation-identifier-not-recognized" },
1206   {   7, "called-AP-title-not-recognized" },
1207   {   8, "called-AP-invocation-identifier-not-recognized" },
1208   {   9, "called-AE-qualifier-not-recognized" },
1209   {  10, "called-AE-invocation-identifier-not-recognized" },
1210   {  11, "authentication-mechanism-name-not-recognized" },
1211   {  12, "authentication-mechanism-name-required" },
1212   {  13, "authentication-failure" },
1213   {  14, "authentication-required" },
1214   { 0, NULL }
1215 };
1216
1217
1218 static int
1219 dissect_acse_T_acse_service_user(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1220   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1221                                   NULL);
1222
1223   return offset;
1224 }
1225 static int dissect_acse_service_user(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1226   return dissect_acse_T_acse_service_user(FALSE, tvb, offset, pinfo, tree, hf_acse_acse_service_user);
1227 }
1228
1229
1230 static const value_string acse_T_acse_service_provider_vals[] = {
1231   {   0, "null" },
1232   {   1, "no-reason-given" },
1233   {   2, "no-common-acse-version" },
1234   { 0, NULL }
1235 };
1236
1237
1238 static int
1239 dissect_acse_T_acse_service_provider(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1240   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1241                                   NULL);
1242
1243   return offset;
1244 }
1245 static int dissect_acse_service_provider(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1246   return dissect_acse_T_acse_service_provider(FALSE, tvb, offset, pinfo, tree, hf_acse_acse_service_provider);
1247 }
1248
1249
1250 static const value_string acse_Associate_source_diagnostic_vals[] = {
1251   {   1, "acse-service-user" },
1252   {   2, "acse-service-provider" },
1253   { 0, NULL }
1254 };
1255
1256 static const ber_choice_t Associate_source_diagnostic_choice[] = {
1257   {   1, BER_CLASS_CON, 1, 0, dissect_acse_service_user },
1258   {   2, BER_CLASS_CON, 2, 0, dissect_acse_service_provider },
1259   { 0, 0, 0, 0, NULL }
1260 };
1261
1262 static int
1263 dissect_acse_Associate_source_diagnostic(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1264   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1265                                  Associate_source_diagnostic_choice, hf_index, ett_acse_Associate_source_diagnostic,
1266                                  NULL);
1267
1268   return offset;
1269 }
1270 static int dissect_result_source_diagnostic(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1271   return dissect_acse_Associate_source_diagnostic(FALSE, tvb, offset, pinfo, tree, hf_acse_result_source_diagnostic);
1272 }
1273
1274
1275 static const value_string acse_Result_vals[] = {
1276   {   0, "acceptance" },
1277   {   1, "user-rejection" },
1278   {   2, "provider-rejection" },
1279   { 0, NULL }
1280 };
1281
1282
1283 static int
1284 dissect_acse_Result(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1285   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1286                                   NULL);
1287
1288   return offset;
1289 }
1290 static int dissect_pcontext_result_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1291   return dissect_acse_Result(TRUE, tvb, offset, pinfo, tree, hf_acse_pcontext_result);
1292 }
1293
1294
1295
1296 static int
1297 dissect_acse_Concrete_syntax_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1298   offset = dissect_acse_TransferSyntaxName(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1299
1300   return offset;
1301 }
1302 static int dissect_concrete_syntax_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1303   return dissect_acse_Concrete_syntax_name(TRUE, tvb, offset, pinfo, tree, hf_acse_concrete_syntax_name);
1304 }
1305
1306
1307 static const value_string acse_T_provider_reason_vals[] = {
1308   {   0, "reason-not-specified" },
1309   {   1, "abstract-syntax-not-supported" },
1310   {   2, "proposed-transfer-syntaxes-not-supported" },
1311   {   3, "local-limit-on-DCS-exceeded" },
1312   { 0, NULL }
1313 };
1314
1315
1316 static int
1317 dissect_acse_T_provider_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1318   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1319                                   NULL);
1320
1321   return offset;
1322 }
1323 static int dissect_provider_reason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1324   return dissect_acse_T_provider_reason(TRUE, tvb, offset, pinfo, tree, hf_acse_provider_reason);
1325 }
1326
1327
1328 static const ber_sequence_t P_context_result_list_item_sequence[] = {
1329   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_pcontext_result_impl },
1330   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_concrete_syntax_name_impl },
1331   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_provider_reason_impl },
1332   { 0, 0, 0, NULL }
1333 };
1334
1335 static int
1336 dissect_acse_P_context_result_list_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1337   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1338                                    P_context_result_list_item_sequence, hf_index, ett_acse_P_context_result_list_item);
1339
1340   return offset;
1341 }
1342 static int dissect_P_context_result_list_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1343   return dissect_acse_P_context_result_list_item(FALSE, tvb, offset, pinfo, tree, hf_acse_P_context_result_list_item);
1344 }
1345
1346
1347 static const ber_sequence_t P_context_result_list_sequence_of[1] = {
1348   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_P_context_result_list_item },
1349 };
1350
1351 static int
1352 dissect_acse_P_context_result_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1353   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1354                                       P_context_result_list_sequence_of, hf_index, ett_acse_P_context_result_list);
1355
1356   return offset;
1357 }
1358 static int dissect_p_context_result_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1359   return dissect_acse_P_context_result_list(TRUE, tvb, offset, pinfo, tree, hf_acse_p_context_result_list);
1360 }
1361
1362
1363 static const ber_sequence_t AARE_apdu_sequence[] = {
1364   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aARE_protocol_version_impl },
1365   { BER_CLASS_CON, 1, 0, dissect_aARE_aSO_context_name },
1366   { BER_CLASS_CON, 2, 0, dissect_aARE_result },
1367   { BER_CLASS_CON, 3, BER_FLAGS_NOTCHKTAG, dissect_result_source_diagnostic },
1368   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_responding_AP_title },
1369   { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_responding_AE_qualifier },
1370   { BER_CLASS_CON, 6, BER_FLAGS_OPTIONAL, dissect_responding_AP_invocation_identifier },
1371   { BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL, dissect_responding_AE_invocation_identifier },
1372   { BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_responder_acse_requirements_impl },
1373   { BER_CLASS_CON, 9, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_mechanism_name_impl },
1374   { BER_CLASS_CON, 10, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_responding_authentication_value },
1375   { BER_CLASS_CON, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aSO_context_name_list_impl },
1376   { BER_CLASS_CON, 29, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_implementation_information_impl },
1377   { BER_CLASS_CON, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_p_context_result_list_impl },
1378   { BER_CLASS_CON, 13, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_called_asoi_tag_impl },
1379   { BER_CLASS_CON, 14, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_calling_asoi_tag_impl },
1380   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aARE_user_information_impl },
1381   { 0, 0, 0, NULL }
1382 };
1383
1384 static int
1385 dissect_acse_AARE_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1386   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1387                                    AARE_apdu_sequence, hf_index, ett_acse_AARE_apdu);
1388
1389   return offset;
1390 }
1391 static int dissect_aare_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1392   return dissect_acse_AARE_apdu(TRUE, tvb, offset, pinfo, tree, hf_acse_aare);
1393 }
1394
1395
1396 static const value_string acse_Release_request_reason_vals[] = {
1397   {   0, "normal" },
1398   {   1, "urgent" },
1399   {  30, "user-defined" },
1400   { 0, NULL }
1401 };
1402
1403
1404 static int
1405 dissect_acse_Release_request_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1406   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1407                                   NULL);
1408
1409   return offset;
1410 }
1411 static int dissect_rLRQ_reason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1412   return dissect_acse_Release_request_reason(TRUE, tvb, offset, pinfo, tree, hf_acse_rLRQ_reason);
1413 }
1414
1415
1416 static const ber_sequence_t RLRQ_apdu_sequence[] = {
1417   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rLRQ_reason_impl },
1418   { BER_CLASS_CON, 13, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_aso_qualifier },
1419   { BER_CLASS_CON, 14, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_asoi_identifier_impl },
1420   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rLRQ_user_information_impl },
1421   { 0, 0, 0, NULL }
1422 };
1423
1424 static int
1425 dissect_acse_RLRQ_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1426   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1427                                    RLRQ_apdu_sequence, hf_index, ett_acse_RLRQ_apdu);
1428
1429   return offset;
1430 }
1431 static int dissect_rlrq_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1432   return dissect_acse_RLRQ_apdu(TRUE, tvb, offset, pinfo, tree, hf_acse_rlrq);
1433 }
1434
1435
1436 static const value_string acse_Release_response_reason_vals[] = {
1437   {   0, "normal" },
1438   {   1, "not-finished" },
1439   {  30, "user-defined" },
1440   { 0, NULL }
1441 };
1442
1443
1444 static int
1445 dissect_acse_Release_response_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1446   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1447                                   NULL);
1448
1449   return offset;
1450 }
1451 static int dissect_rLRE_reason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1452   return dissect_acse_Release_response_reason(TRUE, tvb, offset, pinfo, tree, hf_acse_rLRE_reason);
1453 }
1454
1455
1456 static const ber_sequence_t RLRE_apdu_sequence[] = {
1457   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rLRE_reason_impl },
1458   { BER_CLASS_CON, 13, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_aso_qualifier },
1459   { BER_CLASS_CON, 14, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_asoi_identifier_impl },
1460   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rLRE_user_information_impl },
1461   { 0, 0, 0, NULL }
1462 };
1463
1464 static int
1465 dissect_acse_RLRE_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1466   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1467                                    RLRE_apdu_sequence, hf_index, ett_acse_RLRE_apdu);
1468
1469   return offset;
1470 }
1471 static int dissect_rlre_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1472   return dissect_acse_RLRE_apdu(TRUE, tvb, offset, pinfo, tree, hf_acse_rlre);
1473 }
1474
1475
1476 static const value_string acse_ABRT_source_vals[] = {
1477   {   0, "acse-service-user" },
1478   {   1, "acse-service-provider" },
1479   { 0, NULL }
1480 };
1481
1482
1483 static int
1484 dissect_acse_ABRT_source(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1485   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1486                                   NULL);
1487
1488   return offset;
1489 }
1490 static int dissect_abort_source_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1491   return dissect_acse_ABRT_source(TRUE, tvb, offset, pinfo, tree, hf_acse_abort_source);
1492 }
1493
1494
1495 static const value_string acse_ABRT_diagnostic_vals[] = {
1496   {   1, "no-reason-given" },
1497   {   2, "protocol-error" },
1498   {   3, "authentication-mechanism-name-not-recognized" },
1499   {   4, "authentication-mechanism-name-required" },
1500   {   5, "authentication-failure" },
1501   {   6, "authentication-required" },
1502   { 0, NULL }
1503 };
1504
1505
1506 static int
1507 dissect_acse_ABRT_diagnostic(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1508   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1509                                   NULL);
1510
1511   return offset;
1512 }
1513 static int dissect_abort_diagnostic_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1514   return dissect_acse_ABRT_diagnostic(TRUE, tvb, offset, pinfo, tree, hf_acse_abort_diagnostic);
1515 }
1516
1517
1518 static const ber_sequence_t ABRT_apdu_sequence[] = {
1519   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_abort_source_impl },
1520   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_abort_diagnostic_impl },
1521   { BER_CLASS_CON, 13, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_aso_qualifier },
1522   { BER_CLASS_CON, 14, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_asoi_identifier_impl },
1523   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aBRT_user_information_impl },
1524   { 0, 0, 0, NULL }
1525 };
1526
1527 static int
1528 dissect_acse_ABRT_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1529   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1530                                    ABRT_apdu_sequence, hf_index, ett_acse_ABRT_apdu);
1531
1532   return offset;
1533 }
1534 static int dissect_abrt_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1535   return dissect_acse_ABRT_apdu(TRUE, tvb, offset, pinfo, tree, hf_acse_abrt);
1536 }
1537
1538
1539
1540 static int
1541 dissect_acse_User_information(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1542   offset = dissect_acse_Association_data(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1543
1544   return offset;
1545 }
1546 static int dissect_user_information(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1547   return dissect_acse_User_information(FALSE, tvb, offset, pinfo, tree, hf_acse_user_information);
1548 }
1549 static int dissect_user_information_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1550   return dissect_acse_User_information(TRUE, tvb, offset, pinfo, tree, hf_acse_user_information);
1551 }
1552
1553
1554
1555 static int
1556 dissect_acse_Simply_encoded_data(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1557   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1558                                        NULL);
1559
1560   return offset;
1561 }
1562 static int dissect_simply_encoded_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1563   return dissect_acse_Simply_encoded_data(FALSE, tvb, offset, pinfo, tree, hf_acse_simply_encoded_data);
1564 }
1565
1566
1567
1568 static int
1569 dissect_acse_T_simple_ASN1_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1570 /*XXX not implemented yet */
1571
1572
1573   return offset;
1574 }
1575 static int dissect_simple_ASN1_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1576   return dissect_acse_T_simple_ASN1_type(FALSE, tvb, offset, pinfo, tree, hf_acse_simple_ASN1_type);
1577 }
1578
1579
1580 static const value_string acse_T_presentation_data_values_vals[] = {
1581   {   0, "simple-ASN1-type" },
1582   {   1, "octet-aligned" },
1583   {   2, "arbitrary" },
1584   { 0, NULL }
1585 };
1586
1587 static const ber_choice_t T_presentation_data_values_choice[] = {
1588   {   0, BER_CLASS_CON, 0, 0, dissect_simple_ASN1_type },
1589   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_octet_aligned_impl },
1590   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_arbitrary_impl },
1591   { 0, 0, 0, 0, NULL }
1592 };
1593
1594 static int
1595 dissect_acse_T_presentation_data_values(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1596   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1597                                  T_presentation_data_values_choice, hf_index, ett_acse_T_presentation_data_values,
1598                                  NULL);
1599
1600   return offset;
1601 }
1602 static int dissect_presentation_data_values(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1603   return dissect_acse_T_presentation_data_values(FALSE, tvb, offset, pinfo, tree, hf_acse_presentation_data_values);
1604 }
1605
1606
1607 static const ber_sequence_t PDV_list_sequence[] = {
1608   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_transfer_syntax_name },
1609   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_presentation_context_identifier },
1610   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_presentation_data_values },
1611   { 0, 0, 0, NULL }
1612 };
1613
1614 static int
1615 dissect_acse_PDV_list(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1616   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1617                                    PDV_list_sequence, hf_index, ett_acse_PDV_list);
1618
1619   return offset;
1620 }
1621 static int dissect_fully_encoded_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1622   return dissect_acse_PDV_list(FALSE, tvb, offset, pinfo, tree, hf_acse_fully_encoded_data);
1623 }
1624
1625
1626 static const value_string acse_User_Data_vals[] = {
1627   {   0, "user-information" },
1628   {   1, "simply-encoded-data" },
1629   {   2, "fully-encoded-data" },
1630   { 0, NULL }
1631 };
1632
1633 static const ber_choice_t User_Data_choice[] = {
1634   {   0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_user_information },
1635   {   1, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_simply_encoded_data },
1636   {   2, BER_CLASS_CON, 0, 0, dissect_fully_encoded_data },
1637   { 0, 0, 0, 0, NULL }
1638 };
1639
1640 static int
1641 dissect_acse_User_Data(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1642   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1643                                  User_Data_choice, hf_index, ett_acse_User_Data,
1644                                  NULL);
1645
1646   return offset;
1647 }
1648 static int dissect_a_user_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1649   return dissect_acse_User_Data(FALSE, tvb, offset, pinfo, tree, hf_acse_a_user_data);
1650 }
1651
1652
1653 static const ber_sequence_t A_DT_apdu_sequence[] = {
1654   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_aso_qualifier },
1655   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_asoi_identifier_impl },
1656   { BER_CLASS_CON, 30, BER_FLAGS_NOTCHKTAG, dissect_a_user_data },
1657   { 0, 0, 0, NULL }
1658 };
1659
1660 static int
1661 dissect_acse_A_DT_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1662   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1663                                    A_DT_apdu_sequence, hf_index, ett_acse_A_DT_apdu);
1664
1665   return offset;
1666 }
1667 static int dissect_adt_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1668   return dissect_acse_A_DT_apdu(TRUE, tvb, offset, pinfo, tree, hf_acse_adt);
1669 }
1670
1671
1672
1673 static int
1674 dissect_acse_T_ACRQ_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1675   offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
1676                                          hf_index, object_identifier_id);
1677
1678
1679   return offset;
1680 }
1681 static int dissect_aCRQ_aSO_context_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1682   return dissect_acse_T_ACRQ_aSO_context_name(TRUE, tvb, offset, pinfo, tree, hf_acse_aCRQ_aSO_context_name);
1683 }
1684
1685
1686 static const ber_sequence_t ACRQ_apdu_sequence[] = {
1687   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_aso_qualifier },
1688   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_asoi_identifier_impl },
1689   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aCRQ_aSO_context_name_impl },
1690   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aSO_context_name_list_impl },
1691   { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_p_context_definition_list },
1692   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_information_impl },
1693   { 0, 0, 0, NULL }
1694 };
1695
1696 static int
1697 dissect_acse_ACRQ_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1698   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1699                                    ACRQ_apdu_sequence, hf_index, ett_acse_ACRQ_apdu);
1700
1701   return offset;
1702 }
1703 static int dissect_acrq_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1704   return dissect_acse_ACRQ_apdu(TRUE, tvb, offset, pinfo, tree, hf_acse_acrq);
1705 }
1706
1707
1708
1709 static int
1710 dissect_acse_T_ACRP_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1711   offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
1712                                          hf_index, object_identifier_id);
1713
1714
1715   return offset;
1716 }
1717 static int dissect_aSO_context_name_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1718   return dissect_acse_T_ACRP_aSO_context_name(TRUE, tvb, offset, pinfo, tree, hf_acse_aSO_context_name);
1719 }
1720
1721
1722 static const ber_sequence_t ACRP_apdu_sequence[] = {
1723   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_aso_qualifier },
1724   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_asoi_identifier_impl },
1725   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_aSO_context_name_impl },
1726   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_p_context_result_list_impl },
1727   { BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_information_impl },
1728   { 0, 0, 0, NULL }
1729 };
1730
1731 static int
1732 dissect_acse_ACRP_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1733   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1734                                    ACRP_apdu_sequence, hf_index, ett_acse_ACRP_apdu);
1735
1736   return offset;
1737 }
1738 static int dissect_acrp_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1739   return dissect_acse_ACRP_apdu(TRUE, tvb, offset, pinfo, tree, hf_acse_acrp);
1740 }
1741
1742
1743 static const value_string acse_ACSE_apdu_vals[] = {
1744   {   0, "aarq" },
1745   {   1, "aare" },
1746   {   2, "rlrq" },
1747   {   3, "rlre" },
1748   {   4, "abrt" },
1749   {   5, "adt" },
1750   {   6, "acrq" },
1751   {   7, "acrp" },
1752   {   5, "adt" },
1753   {   6, "acrq" },
1754   {   7, "acrp" },
1755   { 0, NULL }
1756 };
1757
1758 static const ber_choice_t ACSE_apdu_choice[] = {
1759   {   0, BER_CLASS_APP, 0, BER_FLAGS_IMPLTAG, dissect_aarq_impl },
1760   {   1, BER_CLASS_APP, 1, BER_FLAGS_IMPLTAG, dissect_aare_impl },
1761   {   2, BER_CLASS_APP, 2, BER_FLAGS_IMPLTAG, dissect_rlrq_impl },
1762   {   3, BER_CLASS_APP, 3, BER_FLAGS_IMPLTAG, dissect_rlre_impl },
1763   {   4, BER_CLASS_APP, 4, BER_FLAGS_IMPLTAG, dissect_abrt_impl },
1764   {   5, BER_CLASS_APP, 5, BER_FLAGS_IMPLTAG, dissect_adt_impl },
1765   {   6, BER_CLASS_APP, 6, BER_FLAGS_IMPLTAG, dissect_acrq_impl },
1766   {   7, BER_CLASS_APP, 7, BER_FLAGS_IMPLTAG, dissect_acrp_impl },
1767   {   5, BER_CLASS_APP, 5, BER_FLAGS_IMPLTAG, dissect_adt_impl },
1768   {   6, BER_CLASS_APP, 6, BER_FLAGS_IMPLTAG, dissect_acrq_impl },
1769   {   7, BER_CLASS_APP, 7, BER_FLAGS_IMPLTAG, dissect_acrp_impl },
1770   {   5, BER_CLASS_APP, 5, BER_FLAGS_IMPLTAG, dissect_adt_impl },
1771   {   6, BER_CLASS_APP, 6, BER_FLAGS_IMPLTAG, dissect_acrq_impl },
1772   {   7, BER_CLASS_APP, 7, BER_FLAGS_IMPLTAG, dissect_acrp_impl },
1773   { 0, 0, 0, 0, NULL }
1774 };
1775
1776 static int
1777 dissect_acse_ACSE_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1778   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1779                                  ACSE_apdu_choice, hf_index, ett_acse_ACSE_apdu,
1780                                  NULL);
1781
1782   return offset;
1783 }
1784
1785
1786
1787 static int
1788 dissect_acse_Application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1789   offset = dissect_acse_ASO_context_name(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1790
1791   return offset;
1792 }
1793
1794
1795
1796 static int
1797 dissect_acse_AE_title_form1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1798   offset = dissect_x509if_Name(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1799
1800   return offset;
1801 }
1802 static int dissect_ae_title_form1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1803   return dissect_acse_AE_title_form1(FALSE, tvb, offset, pinfo, tree, hf_acse_ae_title_form1);
1804 }
1805
1806
1807
1808 static int
1809 dissect_acse_AE_title_form2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1810   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
1811
1812   return offset;
1813 }
1814 static int dissect_ae_title_form2(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1815   return dissect_acse_AE_title_form2(FALSE, tvb, offset, pinfo, tree, hf_acse_ae_title_form2);
1816 }
1817
1818
1819 static const value_string acse_AE_title_vals[] = {
1820   {   0, "ae-title-form1" },
1821   {   1, "ae-title-form2" },
1822   { 0, NULL }
1823 };
1824
1825 static const ber_choice_t AE_title_choice[] = {
1826   {   0, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_ae_title_form1 },
1827   {   1, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ae_title_form2 },
1828   { 0, 0, 0, 0, NULL }
1829 };
1830
1831 static int
1832 dissect_acse_AE_title(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1833   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1834                                  AE_title_choice, hf_index, ett_acse_AE_title,
1835                                  NULL);
1836
1837   return offset;
1838 }
1839
1840
1841 /*--- End of included file: packet-acse-fn.c ---*/
1842
1843
1844
1845 /*
1846 * Dissect ACSE PDUs inside a PPDU.
1847 */
1848 static void
1849 dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
1850 {
1851         int offset = 0;
1852         proto_item    *item=NULL;
1853         proto_tree    *tree=NULL;
1854         char *oid;
1855
1856         /* save parent_tree so subdissectors can create new top nodes */
1857         top_tree=parent_tree;
1858
1859         /* first, try to check length   */
1860         /* do we have at least 2 bytes  */
1861         if (!tvb_bytes_exist(tvb, 0, 2)){
1862                 proto_tree_add_text(parent_tree, tvb, offset,
1863                         tvb_reported_length_remaining(tvb,offset),
1864                         "User data");
1865                 return;  /* no, it isn't a ACSE PDU */
1866         }
1867         /* do we have spdu type from the session dissector?  */
1868         if( !pinfo->private_data ){
1869                 if(parent_tree){
1870                         REPORT_DISSECTOR_BUG("Can't get SPDU type from session dissector.");
1871                 }
1872                 return  ;
1873         } else {
1874                 session  = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) );
1875                 if(session->spdu_type == 0 ) {
1876                         if(parent_tree){
1877                                 REPORT_DISSECTOR_BUG(
1878                                         ep_strdup_printf("Wrong spdu type %x from session dissector.",session->spdu_type));
1879                                 return  ;
1880                         }
1881                 }
1882         }
1883         /*  ACSE has only AARQ,AARE,RLRQ,RLRE,ABRT type of pdu */
1884         /*  reject everything else                              */
1885         /*  data pdu is not ACSE pdu and has to go directly to app dissector */
1886         switch(session->spdu_type){
1887         case SES_CONNECTION_REQUEST:            /*   AARQ   */
1888         case SES_CONNECTION_ACCEPT:             /*   AARE   */
1889         case SES_REFUSE:                        /*   RLRE   */
1890         case SES_DISCONNECT:                    /*   RLRQ   */
1891         case SES_FINISH:                        /*   RLRE   */
1892         case SES_ABORT:                         /*   ABRT   */
1893                 break;
1894         case SES_DATA_TRANSFER:
1895                 oid=find_oid_by_pres_ctx_id(pinfo, indir_ref);
1896                 if(oid){
1897                         if(strcmp(oid, ACSE_APDU_OID) == 0){
1898                                 proto_tree_add_text(parent_tree, tvb, offset, -1,
1899                                     "Invalid OID: %s", ACSE_APDU_OID);
1900                                 THROW(ReportedBoundsError);
1901                         }
1902                         call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree);
1903                 } else {
1904                         proto_tree_add_text(parent_tree, tvb, offset, -1,
1905                             "dissector is not available");
1906                 }
1907                 return;
1908         default:
1909                 return;
1910         }
1911
1912         /* create display subtree for the protocol */
1913         if(parent_tree){
1914                 item = proto_tree_add_item(parent_tree, proto_acse, tvb, 0, -1, FALSE);
1915                 tree = proto_item_add_subtree(item, ett_acse);
1916         }
1917         if (check_col(pinfo->cinfo, COL_PROTOCOL))
1918                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ACSE");
1919         if (check_col(pinfo->cinfo, COL_INFO))
1920                 col_clear(pinfo->cinfo, COL_INFO);
1921
1922
1923         /*  we can't make any additional checking here   */
1924         /*  postpone it before dissector will have more information */
1925         while (tvb_reported_length_remaining(tvb, offset) > 0){
1926                 int old_offset=offset;
1927                 offset = dissect_acse_ACSE_apdu(FALSE, tvb, offset, pinfo, tree, -1);
1928                 if(offset == old_offset ){
1929                         proto_tree_add_text(tree, tvb, offset, -1,"Malformed packet");
1930                         offset = tvb_length(tvb);
1931                         break;
1932                 }
1933         }
1934
1935 }
1936
1937 /*--- proto_register_acse ----------------------------------------------*/
1938 void proto_register_acse(void) {
1939
1940   /* List of fields */
1941   static hf_register_info hf[] = {
1942
1943 /*--- Included file: packet-acse-hfarr.c ---*/
1944
1945     { &hf_acse_direct_reference,
1946       { "direct-reference", "acse.direct_reference",
1947         FT_STRING, BASE_NONE, NULL, 0,
1948         "EXTERNAL/direct-reference", HFILL }},
1949     { &hf_acse_indirect_reference,
1950       { "indirect-reference", "acse.indirect_reference",
1951         FT_INT32, BASE_DEC, NULL, 0,
1952         "EXTERNAL/indirect-reference", HFILL }},
1953     { &hf_acse_data_value_descriptor,
1954       { "data-value-descriptor", "acse.data_value_descriptor",
1955         FT_STRING, BASE_NONE, NULL, 0,
1956         "EXTERNAL/data-value-descriptor", HFILL }},
1957     { &hf_acse_encoding,
1958       { "encoding", "acse.encoding",
1959         FT_UINT32, BASE_DEC, VALS(acse_T_encoding_vals), 0,
1960         "EXTERNAL/encoding", HFILL }},
1961     { &hf_acse_single_ASN1_type,
1962       { "single-ASN1-type", "acse.single_ASN1_type",
1963         FT_NONE, BASE_NONE, NULL, 0,
1964         "EXTERNAL/encoding/single-ASN1-type", HFILL }},
1965     { &hf_acse_octet_aligned,
1966       { "octet-aligned", "acse.octet_aligned",
1967         FT_BYTES, BASE_HEX, NULL, 0,
1968         "", HFILL }},
1969     { &hf_acse_arbitrary,
1970       { "arbitrary", "acse.arbitrary",
1971         FT_BYTES, BASE_HEX, NULL, 0,
1972         "", HFILL }},
1973     { &hf_acse_aarq,
1974       { "aarq", "acse.aarq",
1975         FT_NONE, BASE_NONE, NULL, 0,
1976         "ACSE-apdu/aarq", HFILL }},
1977     { &hf_acse_aare,
1978       { "aare", "acse.aare",
1979         FT_NONE, BASE_NONE, NULL, 0,
1980         "ACSE-apdu/aare", HFILL }},
1981     { &hf_acse_rlrq,
1982       { "rlrq", "acse.rlrq",
1983         FT_NONE, BASE_NONE, NULL, 0,
1984         "ACSE-apdu/rlrq", HFILL }},
1985     { &hf_acse_rlre,
1986       { "rlre", "acse.rlre",
1987         FT_NONE, BASE_NONE, NULL, 0,
1988         "ACSE-apdu/rlre", HFILL }},
1989     { &hf_acse_abrt,
1990       { "abrt", "acse.abrt",
1991         FT_NONE, BASE_NONE, NULL, 0,
1992         "ACSE-apdu/abrt", HFILL }},
1993     { &hf_acse_adt,
1994       { "adt", "acse.adt",
1995         FT_NONE, BASE_NONE, NULL, 0,
1996         "ACSE-apdu/adt", HFILL }},
1997     { &hf_acse_acrq,
1998       { "acrq", "acse.acrq",
1999         FT_NONE, BASE_NONE, NULL, 0,
2000         "ACSE-apdu/acrq", HFILL }},
2001     { &hf_acse_acrp,
2002       { "acrp", "acse.acrp",
2003         FT_NONE, BASE_NONE, NULL, 0,
2004         "ACSE-apdu/acrp", HFILL }},
2005     { &hf_acse_aARQ_protocol_version,
2006       { "protocol-version", "acse.protocol_version",
2007         FT_BYTES, BASE_HEX, NULL, 0,
2008         "AARQ-apdu/protocol-version", HFILL }},
2009     { &hf_acse_aARQ_aSO_context_name,
2010       { "aSO-context-name", "acse.aSO_context_name",
2011         FT_STRING, BASE_NONE, NULL, 0,
2012         "AARQ-apdu/aSO-context-name", HFILL }},
2013     { &hf_acse_called_AP_title,
2014       { "called-AP-title", "acse.called_AP_title",
2015         FT_UINT32, BASE_DEC, VALS(acse_AP_title_vals), 0,
2016         "AARQ-apdu/called-AP-title", HFILL }},
2017     { &hf_acse_called_AE_qualifier,
2018       { "called-AE-qualifier", "acse.called_AE_qualifier",
2019         FT_UINT32, BASE_DEC, VALS(acse_ASO_qualifier_vals), 0,
2020         "AARQ-apdu/called-AE-qualifier", HFILL }},
2021     { &hf_acse_called_AP_invocation_identifier,
2022       { "called-AP-invocation-identifier", "acse.called_AP_invocation_identifier",
2023         FT_INT32, BASE_DEC, NULL, 0,
2024         "AARQ-apdu/called-AP-invocation-identifier", HFILL }},
2025     { &hf_acse_called_AE_invocation_identifier,
2026       { "called-AE-invocation-identifier", "acse.called_AE_invocation_identifier",
2027         FT_INT32, BASE_DEC, NULL, 0,
2028         "AARQ-apdu/called-AE-invocation-identifier", HFILL }},
2029     { &hf_acse_calling_AP_title,
2030       { "calling-AP-title", "acse.calling_AP_title",
2031         FT_UINT32, BASE_DEC, VALS(acse_AP_title_vals), 0,
2032         "AARQ-apdu/calling-AP-title", HFILL }},
2033     { &hf_acse_calling_AE_qualifier,
2034       { "calling-AE-qualifier", "acse.calling_AE_qualifier",
2035         FT_UINT32, BASE_DEC, VALS(acse_ASO_qualifier_vals), 0,
2036         "AARQ-apdu/calling-AE-qualifier", HFILL }},
2037     { &hf_acse_calling_AP_invocation_identifier,
2038       { "calling-AP-invocation-identifier", "acse.calling_AP_invocation_identifier",
2039         FT_INT32, BASE_DEC, NULL, 0,
2040         "AARQ-apdu/calling-AP-invocation-identifier", HFILL }},
2041     { &hf_acse_calling_AE_invocation_identifier,
2042       { "calling-AE-invocation-identifier", "acse.calling_AE_invocation_identifier",
2043         FT_INT32, BASE_DEC, NULL, 0,
2044         "AARQ-apdu/calling-AE-invocation-identifier", HFILL }},
2045     { &hf_acse_sender_acse_requirements,
2046       { "sender-acse-requirements", "acse.sender_acse_requirements",
2047         FT_BYTES, BASE_HEX, NULL, 0,
2048         "AARQ-apdu/sender-acse-requirements", HFILL }},
2049     { &hf_acse_mechanism_name,
2050       { "mechanism-name", "acse.mechanism_name",
2051         FT_STRING, BASE_NONE, NULL, 0,
2052         "", HFILL }},
2053     { &hf_acse_calling_authentication_value,
2054       { "calling-authentication-value", "acse.calling_authentication_value",
2055         FT_UINT32, BASE_DEC, VALS(acse_Authentication_value_vals), 0,
2056         "AARQ-apdu/calling-authentication-value", HFILL }},
2057     { &hf_acse_aSO_context_name_list,
2058       { "aSO-context-name-list", "acse.aSO_context_name_list",
2059         FT_UINT32, BASE_DEC, NULL, 0,
2060         "", HFILL }},
2061     { &hf_acse_implementation_information,
2062       { "implementation-information", "acse.implementation_information",
2063         FT_STRING, BASE_NONE, NULL, 0,
2064         "", HFILL }},
2065     { &hf_acse_p_context_definition_list,
2066       { "p-context-definition-list", "acse.p_context_definition_list",
2067         FT_UINT32, BASE_DEC, VALS(acse_Syntactic_context_list_vals), 0,
2068         "", HFILL }},
2069     { &hf_acse_called_asoi_tag,
2070       { "called-asoi-tag", "acse.called_asoi_tag",
2071         FT_UINT32, BASE_DEC, NULL, 0,
2072         "", HFILL }},
2073     { &hf_acse_calling_asoi_tag,
2074       { "calling-asoi-tag", "acse.calling_asoi_tag",
2075         FT_UINT32, BASE_DEC, NULL, 0,
2076         "", HFILL }},
2077     { &hf_acse_aARQ_user_information,
2078       { "user-information", "acse.user_information",
2079         FT_UINT32, BASE_DEC, NULL, 0,
2080         "AARQ-apdu/user-information", HFILL }},
2081     { &hf_acse_aARE_protocol_version,
2082       { "protocol-version", "acse.protocol_version",
2083         FT_BYTES, BASE_HEX, NULL, 0,
2084         "AARE-apdu/protocol-version", HFILL }},
2085     { &hf_acse_aARE_aSO_context_name,
2086       { "aSO-context-name", "acse.aSO_context_name",
2087         FT_STRING, BASE_NONE, NULL, 0,
2088         "AARE-apdu/aSO-context-name", HFILL }},
2089     { &hf_acse_aARE_result,
2090       { "result", "acse.result",
2091         FT_UINT32, BASE_DEC, VALS(acse_Associate_result_vals), 0,
2092         "AARE-apdu/result", HFILL }},
2093     { &hf_acse_result_source_diagnostic,
2094       { "result-source-diagnostic", "acse.result_source_diagnostic",
2095         FT_UINT32, BASE_DEC, VALS(acse_Associate_source_diagnostic_vals), 0,
2096         "AARE-apdu/result-source-diagnostic", HFILL }},
2097     { &hf_acse_responding_AP_title,
2098       { "responding-AP-title", "acse.responding_AP_title",
2099         FT_UINT32, BASE_DEC, VALS(acse_AP_title_vals), 0,
2100         "AARE-apdu/responding-AP-title", HFILL }},
2101     { &hf_acse_responding_AE_qualifier,
2102       { "responding-AE-qualifier", "acse.responding_AE_qualifier",
2103         FT_UINT32, BASE_DEC, VALS(acse_ASO_qualifier_vals), 0,
2104         "AARE-apdu/responding-AE-qualifier", HFILL }},
2105     { &hf_acse_responding_AP_invocation_identifier,
2106       { "responding-AP-invocation-identifier", "acse.responding_AP_invocation_identifier",
2107         FT_INT32, BASE_DEC, NULL, 0,
2108         "AARE-apdu/responding-AP-invocation-identifier", HFILL }},
2109     { &hf_acse_responding_AE_invocation_identifier,
2110       { "responding-AE-invocation-identifier", "acse.responding_AE_invocation_identifier",
2111         FT_INT32, BASE_DEC, NULL, 0,
2112         "AARE-apdu/responding-AE-invocation-identifier", HFILL }},
2113     { &hf_acse_responder_acse_requirements,
2114       { "responder-acse-requirements", "acse.responder_acse_requirements",
2115         FT_BYTES, BASE_HEX, NULL, 0,
2116         "AARE-apdu/responder-acse-requirements", HFILL }},
2117     { &hf_acse_responding_authentication_value,
2118       { "responding-authentication-value", "acse.responding_authentication_value",
2119         FT_UINT32, BASE_DEC, VALS(acse_Authentication_value_vals), 0,
2120         "AARE-apdu/responding-authentication-value", HFILL }},
2121     { &hf_acse_p_context_result_list,
2122       { "p-context-result-list", "acse.p_context_result_list",
2123         FT_UINT32, BASE_DEC, NULL, 0,
2124         "", HFILL }},
2125     { &hf_acse_aARE_user_information,
2126       { "user-information", "acse.user_information",
2127         FT_UINT32, BASE_DEC, NULL, 0,
2128         "AARE-apdu/user-information", HFILL }},
2129     { &hf_acse_rLRQ_reason,
2130       { "reason", "acse.reason",
2131         FT_INT32, BASE_DEC, VALS(acse_Release_request_reason_vals), 0,
2132         "RLRQ-apdu/reason", HFILL }},
2133     { &hf_acse_aso_qualifier,
2134       { "aso-qualifier", "acse.aso_qualifier",
2135         FT_UINT32, BASE_DEC, VALS(acse_ASO_qualifier_vals), 0,
2136         "", HFILL }},
2137     { &hf_acse_asoi_identifier,
2138       { "asoi-identifier", "acse.asoi_identifier",
2139         FT_UINT32, BASE_DEC, NULL, 0,
2140         "", HFILL }},
2141     { &hf_acse_rLRQ_user_information,
2142       { "user-information", "acse.user_information",
2143         FT_UINT32, BASE_DEC, NULL, 0,
2144         "RLRQ-apdu/user-information", HFILL }},
2145     { &hf_acse_rLRE_reason,
2146       { "reason", "acse.reason",
2147         FT_INT32, BASE_DEC, VALS(acse_Release_response_reason_vals), 0,
2148         "RLRE-apdu/reason", HFILL }},
2149     { &hf_acse_rLRE_user_information,
2150       { "user-information", "acse.user_information",
2151         FT_UINT32, BASE_DEC, NULL, 0,
2152         "RLRE-apdu/user-information", HFILL }},
2153     { &hf_acse_abort_source,
2154       { "abort-source", "acse.abort_source",
2155         FT_UINT32, BASE_DEC, VALS(acse_ABRT_source_vals), 0,
2156         "ABRT-apdu/abort-source", HFILL }},
2157     { &hf_acse_abort_diagnostic,
2158       { "abort-diagnostic", "acse.abort_diagnostic",
2159         FT_UINT32, BASE_DEC, VALS(acse_ABRT_diagnostic_vals), 0,
2160         "ABRT-apdu/abort-diagnostic", HFILL }},
2161     { &hf_acse_aBRT_user_information,
2162       { "user-information", "acse.user_information",
2163         FT_UINT32, BASE_DEC, NULL, 0,
2164         "ABRT-apdu/user-information", HFILL }},
2165     { &hf_acse_a_user_data,
2166       { "a-user-data", "acse.a_user_data",
2167         FT_UINT32, BASE_DEC, VALS(acse_User_Data_vals), 0,
2168         "A-DT-apdu/a-user-data", HFILL }},
2169     { &hf_acse_aCRQ_aSO_context_name,
2170       { "aSO-context-name", "acse.aSO_context_name",
2171         FT_STRING, BASE_NONE, NULL, 0,
2172         "ACRQ-apdu/aSO-context-name", HFILL }},
2173     { &hf_acse_user_information,
2174       { "user-information", "acse.user_information",
2175         FT_UINT32, BASE_DEC, NULL, 0,
2176         "", HFILL }},
2177     { &hf_acse_aSO_context_name,
2178       { "aSO-context-name", "acse.aSO_context_name",
2179         FT_UINT32, BASE_DEC, NULL, 0,
2180         "ACRP-apdu/aSO-context-name", HFILL }},
2181     { &hf_acse_ap_title_form1,
2182       { "ap-title-form1", "acse.ap_title_form1",
2183         FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0,
2184         "AP-title/ap-title-form1", HFILL }},
2185     { &hf_acse_ap_title_form2,
2186       { "ap-title-form2", "acse.ap_title_form2",
2187         FT_STRING, BASE_NONE, NULL, 0,
2188         "AP-title/ap-title-form2", HFILL }},
2189     { &hf_acse_ap_title_form3,
2190       { "ap-title-form3", "acse.ap_title_form3",
2191         FT_STRING, BASE_NONE, NULL, 0,
2192         "AP-title/ap-title-form3", HFILL }},
2193     { &hf_acse_aso_qualifier_form1,
2194       { "aso-qualifier-form1", "acse.aso_qualifier_form1",
2195         FT_UINT32, BASE_DEC, NULL, 0,
2196         "ASO-qualifier/aso-qualifier-form1", HFILL }},
2197     { &hf_acse_aso_qualifier_form2,
2198       { "aso-qualifier-form2", "acse.aso_qualifier_form2",
2199         FT_INT32, BASE_DEC, NULL, 0,
2200         "ASO-qualifier/aso-qualifier-form2", HFILL }},
2201     { &hf_acse_aso_qualifier_form3,
2202       { "aso-qualifier-form3", "acse.aso_qualifier_form3",
2203         FT_STRING, BASE_NONE, NULL, 0,
2204         "ASO-qualifier/aso-qualifier-form3", HFILL }},
2205     { &hf_acse_ae_title_form1,
2206       { "ae-title-form1", "acse.ae_title_form1",
2207         FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0,
2208         "AE-title/ae-title-form1", HFILL }},
2209     { &hf_acse_ae_title_form2,
2210       { "ae-title-form2", "acse.ae_title_form2",
2211         FT_STRING, BASE_NONE, NULL, 0,
2212         "AE-title/ae-title-form2", HFILL }},
2213     { &hf_acse_ASOI_tag_item,
2214       { "Item", "acse.ASOI_tag_item",
2215         FT_NONE, BASE_NONE, NULL, 0,
2216         "ASOI-tag/_item", HFILL }},
2217     { &hf_acse_qualifier,
2218       { "qualifier", "acse.qualifier",
2219         FT_UINT32, BASE_DEC, VALS(acse_ASO_qualifier_vals), 0,
2220         "ASOI-tag/_item/qualifier", HFILL }},
2221     { &hf_acse_identifier,
2222       { "identifier", "acse.identifier",
2223         FT_UINT32, BASE_DEC, NULL, 0,
2224         "ASOI-tag/_item/identifier", HFILL }},
2225     { &hf_acse_ASO_context_name_list_item,
2226       { "Item", "acse.ASO_context_name_list_item",
2227         FT_STRING, BASE_NONE, NULL, 0,
2228         "ASO-context-name-list/_item", HFILL }},
2229     { &hf_acse_context_list,
2230       { "context-list", "acse.context_list",
2231         FT_UINT32, BASE_DEC, NULL, 0,
2232         "Syntactic-context-list/context-list", HFILL }},
2233     { &hf_acse_default_contact_list,
2234       { "default-contact-list", "acse.default_contact_list",
2235         FT_UINT32, BASE_DEC, NULL, 0,
2236         "Syntactic-context-list/default-contact-list", HFILL }},
2237     { &hf_acse_Context_list_item,
2238       { "Item", "acse.Context_list_item",
2239         FT_NONE, BASE_NONE, NULL, 0,
2240         "Context-list/_item", HFILL }},
2241     { &hf_acse_pci,
2242       { "pci", "acse.pci",
2243         FT_INT32, BASE_DEC, NULL, 0,
2244         "Context-list/_item/pci", HFILL }},
2245     { &hf_acse_abstract_syntax,
2246       { "abstract-syntax", "acse.abstract_syntax",
2247         FT_STRING, BASE_NONE, NULL, 0,
2248         "Context-list/_item/abstract-syntax", HFILL }},
2249     { &hf_acse_transfer_syntaxes,
2250       { "transfer-syntaxes", "acse.transfer_syntaxes",
2251         FT_UINT32, BASE_DEC, NULL, 0,
2252         "Context-list/_item/transfer-syntaxes", HFILL }},
2253     { &hf_acse_transfer_syntaxes_item,
2254       { "Item", "acse.transfer_syntaxes_item",
2255         FT_STRING, BASE_NONE, NULL, 0,
2256         "Context-list/_item/transfer-syntaxes/_item", HFILL }},
2257     { &hf_acse_Default_Context_List_item,
2258       { "Item", "acse.Default_Context_List_item",
2259         FT_NONE, BASE_NONE, NULL, 0,
2260         "Default-Context-List/_item", HFILL }},
2261     { &hf_acse_abstract_syntax_name,
2262       { "abstract-syntax-name", "acse.abstract_syntax_name",
2263         FT_STRING, BASE_NONE, NULL, 0,
2264         "Default-Context-List/_item/abstract-syntax-name", HFILL }},
2265     { &hf_acse_transfer_syntax_name,
2266       { "transfer-syntax-name", "acse.transfer_syntax_name",
2267         FT_STRING, BASE_NONE, NULL, 0,
2268         "", HFILL }},
2269     { &hf_acse_P_context_result_list_item,
2270       { "Item", "acse.P_context_result_list_item",
2271         FT_NONE, BASE_NONE, NULL, 0,
2272         "P-context-result-list/_item", HFILL }},
2273     { &hf_acse_pcontext_result,
2274       { "result", "acse.result",
2275         FT_INT32, BASE_DEC, VALS(acse_Result_vals), 0,
2276         "P-context-result-list/_item/result", HFILL }},
2277     { &hf_acse_concrete_syntax_name,
2278       { "concrete-syntax-name", "acse.concrete_syntax_name",
2279         FT_STRING, BASE_NONE, NULL, 0,
2280         "P-context-result-list/_item/concrete-syntax-name", HFILL }},
2281     { &hf_acse_provider_reason,
2282       { "provider-reason", "acse.provider_reason",
2283         FT_INT32, BASE_DEC, VALS(acse_T_provider_reason_vals), 0,
2284         "P-context-result-list/_item/provider-reason", HFILL }},
2285     { &hf_acse_acse_service_user,
2286       { "acse-service-user", "acse.acse_service_user",
2287         FT_UINT32, BASE_DEC, VALS(acse_T_acse_service_user_vals), 0,
2288         "Associate-source-diagnostic/acse-service-user", HFILL }},
2289     { &hf_acse_acse_service_provider,
2290       { "acse-service-provider", "acse.acse_service_provider",
2291         FT_UINT32, BASE_DEC, VALS(acse_T_acse_service_provider_vals), 0,
2292         "Associate-source-diagnostic/acse-service-provider", HFILL }},
2293     { &hf_acse_Association_data_item,
2294       { "Item", "acse.Association_data_item",
2295         FT_NONE, BASE_NONE, NULL, 0,
2296         "Association-data/_item", HFILL }},
2297     { &hf_acse_simply_encoded_data,
2298       { "simply-encoded-data", "acse.simply_encoded_data",
2299         FT_BYTES, BASE_HEX, NULL, 0,
2300         "User-Data/simply-encoded-data", HFILL }},
2301     { &hf_acse_fully_encoded_data,
2302       { "fully-encoded-data", "acse.fully_encoded_data",
2303         FT_NONE, BASE_NONE, NULL, 0,
2304         "User-Data/fully-encoded-data", HFILL }},
2305     { &hf_acse_presentation_context_identifier,
2306       { "presentation-context-identifier", "acse.presentation_context_identifier",
2307         FT_INT32, BASE_DEC, NULL, 0,
2308         "PDV-list/presentation-context-identifier", HFILL }},
2309     { &hf_acse_presentation_data_values,
2310       { "presentation-data-values", "acse.presentation_data_values",
2311         FT_UINT32, BASE_DEC, VALS(acse_T_presentation_data_values_vals), 0,
2312         "PDV-list/presentation-data-values", HFILL }},
2313     { &hf_acse_simple_ASN1_type,
2314       { "simple-ASN1-type", "acse.simple_ASN1_type",
2315         FT_NONE, BASE_NONE, NULL, 0,
2316         "PDV-list/presentation-data-values/simple-ASN1-type", HFILL }},
2317     { &hf_acse_other_mechanism_name,
2318       { "other-mechanism-name", "acse.other_mechanism_name",
2319         FT_STRING, BASE_NONE, NULL, 0,
2320         "Authentication-value-other/other-mechanism-name", HFILL }},
2321     { &hf_acse_other_mechanism_value,
2322       { "other-mechanism-value", "acse.other_mechanism_value",
2323         FT_NONE, BASE_NONE, NULL, 0,
2324         "Authentication-value-other/other-mechanism-value", HFILL }},
2325     { &hf_acse_charstring,
2326       { "charstring", "acse.charstring",
2327         FT_STRING, BASE_NONE, NULL, 0,
2328         "Authentication-value/charstring", HFILL }},
2329     { &hf_acse_bitstring,
2330       { "bitstring", "acse.bitstring",
2331         FT_BYTES, BASE_HEX, NULL, 0,
2332         "Authentication-value/bitstring", HFILL }},
2333     { &hf_acse_external,
2334       { "external", "acse.external",
2335         FT_NONE, BASE_NONE, NULL, 0,
2336         "Authentication-value/external", HFILL }},
2337     { &hf_acse_other,
2338       { "other", "acse.other",
2339         FT_NONE, BASE_NONE, NULL, 0,
2340         "Authentication-value/other", HFILL }},
2341     { &hf_acse_T_AARQ_protocol_version_version1,
2342       { "version1", "acse.version1",
2343         FT_BOOLEAN, 8, NULL, 0x80,
2344         "", HFILL }},
2345     { &hf_acse_T_AARE_protocol_version_version1,
2346       { "version1", "acse.version1",
2347         FT_BOOLEAN, 8, NULL, 0x80,
2348         "", HFILL }},
2349     { &hf_acse_ACSE_requirements_authentication,
2350       { "authentication", "acse.authentication",
2351         FT_BOOLEAN, 8, NULL, 0x80,
2352         "", HFILL }},
2353     { &hf_acse_ACSE_requirements_aSO_context_negotiation,
2354       { "aSO-context-negotiation", "acse.aSO-context-negotiation",
2355         FT_BOOLEAN, 8, NULL, 0x40,
2356         "", HFILL }},
2357     { &hf_acse_ACSE_requirements_higher_level_association,
2358       { "higher-level-association", "acse.higher-level-association",
2359         FT_BOOLEAN, 8, NULL, 0x20,
2360         "", HFILL }},
2361     { &hf_acse_ACSE_requirements_nested_association,
2362       { "nested-association", "acse.nested-association",
2363         FT_BOOLEAN, 8, NULL, 0x10,
2364         "", HFILL }},
2365
2366 /*--- End of included file: packet-acse-hfarr.c ---*/
2367
2368   };
2369
2370   /* List of subtrees */
2371   static gint *ett[] = {
2372     &ett_acse,
2373
2374 /*--- Included file: packet-acse-ettarr.c ---*/
2375
2376     &ett_acse_EXTERNAL,
2377     &ett_acse_T_encoding,
2378     &ett_acse_ACSE_apdu,
2379     &ett_acse_AARQ_apdu,
2380     &ett_acse_T_AARQ_protocol_version,
2381     &ett_acse_AARE_apdu,
2382     &ett_acse_T_AARE_protocol_version,
2383     &ett_acse_RLRQ_apdu,
2384     &ett_acse_RLRE_apdu,
2385     &ett_acse_ABRT_apdu,
2386     &ett_acse_A_DT_apdu,
2387     &ett_acse_ACRQ_apdu,
2388     &ett_acse_ACRP_apdu,
2389     &ett_acse_ACSE_requirements,
2390     &ett_acse_AP_title,
2391     &ett_acse_ASO_qualifier,
2392     &ett_acse_AE_title,
2393     &ett_acse_ASOI_tag,
2394     &ett_acse_ASOI_tag_item,
2395     &ett_acse_ASO_context_name_list,
2396     &ett_acse_Syntactic_context_list,
2397     &ett_acse_Context_list,
2398     &ett_acse_Context_list_item,
2399     &ett_acse_SEQUENCE_OF_TransferSyntaxName,
2400     &ett_acse_Default_Context_List,
2401     &ett_acse_Default_Context_List_item,
2402     &ett_acse_P_context_result_list,
2403     &ett_acse_P_context_result_list_item,
2404     &ett_acse_Associate_source_diagnostic,
2405     &ett_acse_Association_data,
2406     &ett_acse_User_Data,
2407     &ett_acse_PDV_list,
2408     &ett_acse_T_presentation_data_values,
2409     &ett_acse_Authentication_value_other,
2410     &ett_acse_Authentication_value,
2411
2412 /*--- End of included file: packet-acse-ettarr.c ---*/
2413
2414   };
2415
2416   /* Register protocol */
2417   proto_acse = proto_register_protocol(PNAME, PSNAME, PFNAME);
2418   register_dissector("acse", dissect_acse, proto_acse);
2419
2420   /* Register fields and subtrees */
2421   proto_register_field_array(proto_acse, hf, array_length(hf));
2422   proto_register_subtree_array(ett, array_length(ett));
2423
2424 }
2425
2426
2427 /*--- proto_reg_handoff_acse -------------------------------------------*/
2428 void proto_reg_handoff_acse(void) {
2429 /*#include "packet-acse-dis-tab.c"*/
2430
2431         register_ber_oid_name("2.2.3.1.1","aCSE-id");
2432         register_ber_oid_dissector(ACSE_APDU_OID, dissect_acse, proto_acse, "acse-as-id");
2433
2434
2435 }
2436