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