3 * Routine to dissect ISO 8823 OSI Presentation Protocol packets
7 * Yuriy Sidelnikov <YSidelnikov@hotmail.com>
9 * Ethereal - Network traffic analyzer
10 * By Gerald Combs <gerald@ethereal.com>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #define PROTO_STRING_PRES "ISO 8823 OSI Presentation Protocol"
29 #define PROTO_STRING_PRES_INFO "ISO 8823 OSI Presentation Protocol."
33 #define PRES_CONNECTION_REQUEST_CONFIRM 0x31
34 #define PRES_CONNECTION_REFUSE 0x30
36 /* asn.1 definitions */
37 #define ASN1_CLASS_UNIVERSAL 0x00
38 #define ASN1_CLASS_APPLICATION 0x40
39 #define ASN1_CLASS_CONTEXT_SPECIFIC 0x80
40 #define ASN1_CLASS_Private 0xc0
41 #define ASN1_CLASS_PC 0x20
43 #define INTEGER_ITEM 0x01
44 #define BOOLEAN_ITEM 0x01
46 /* type of parameters */
47 #define MODE_SELECTOR 0
49 #define SEQUENCE_TOP 2
61 CALLING_PRESENTATION_SELECTOR,
62 CALLED_PRESENTATION_SELECTOR,
63 RESPONDING_PRESENTATION_SELECTOR,
64 PRESENTATION_CONTEXT_DEFINITION_LIST,
65 PRESENTATION_CONTEXT_DEFINITION_RESULT_LIST,
67 DEFAULT_CONTEXT_RESULT,
68 PRESENTATION_REQUIREMENTS,
69 USER_SESSION_REQUIREMENTS,
72 /* definition list **/
73 #define PRESENTATION_CONTEXT_IDENTIFIER 2
74 #define ABSTRACT_SYNTAX_NAME 6
75 #define TRANSFER_SYNTAX_NAMES 0x30
77 #define PRESENTATION_RESULT 0x80
78 #define PRESENTATION_RESULT_TRANSFER_SYNTAX_NAME 0x81
79 #define PRESENTATION_RESULT_INTEGER 0x82
82 #define PRESENTATION_RESULT_ACCEPTANCE 0
83 #define PRESENTATION_RESULT_USER_REJECTION 1
84 #define PRESENTATION_RESULT_PROVIDER_REJECTION 2
92 CALLED_PRESENTATION_ADDRESS_UNKNOWN,
93 PROTOCOL_VERSION_NOT_SUPPORTED,
94 DEFAULT_CONTEXT_NOT_SUPPORTED,
95 USER_DATA_NOT_READABLE,
99 #define SIMPLY_ENCODED_DATA 0x60
100 #define FULLY_ENCODED_DATA 0x61
103 #define SINGLE_ASN1_TYPE 0xa0
104 #define OCTET_ALIGNED 0xa1
105 #define ARBITRARY 0xa2
106 #define DATA_BLOCK 0x81
108 /* provider reasons */
111 PR_REASON_NOT_SPECIFIED,
114 UNEXPECTED_SESSION_SERVICE_PRIMITIVE,
115 UNRECOGNIZED_PPDU_PARAMETER,
116 UNEXPECTED_PPDU_PARAMETER,
117 INVALID_PPDU_PARAMETER_VALUE
119 /* event identifier */
136 S_RELEASE_INDICATION,
138 S_TOKEN_GIVE_INDICATION,
139 S_TOKEN_PLEASE_INDICATION,
140 S_CONTROL_GIVE_INDICATION,
141 S_SYNC_MINOR_INDICATION,
142 S_SYNC_MINOR_CONFIRM,
143 S_SYNC_MAJOR_INDICATION,
144 S_SYNC_MAJOR_CONFIRM,
145 S_P_EXCEPTION_REPORT_INDICATION,
146 S_U_EXCEPTION_REPORT_INDICATION,
147 S_ACTIVITY_START_INDICATION,
148 S_ACTIVITY_RESUME_INDICATION,
149 S_ACTIVITY_INTERRUPT_INDICATION,
150 S_ACTIVITY_INTERRUPT_CONFIRM,
151 S_ACTIVITY_DISCARD_INDICATION,
152 S_ACTIVITY_DISCARD_CONFIRM,
153 S_ACTIVITY_END_INDICATION,
154 S_ACTIVITY_END_CONFIRM
158 #define PRES_PROTOCOL_VERGION 0x0080
160 #define PRES_CONTEXT_MANAGEMENT 0x0080
161 #define PRES_RESTORATION 0x0040
163 #define ACSE_PRESENTATION_CONTEXT_IDENTIFIER 3
166 #define MAXSTRING 256
167 #define UNKNOWN_SES_PDU_TYPE -1
169 #define ABORT_REASON_LEN 3