As with "file_write_error_message()", so with
[obnox/wireshark/wip.git] / packet-pres.h
1 /* packet-pres.h
2 *
3 * Routine to dissect ISO 8823 OSI Presentation Protocol packets
4 *
5 * $Id: packet-pres.h,v 1.1 2004/01/13 02:10:25 guy Exp $
6 *
7 * Yuriy Sidelnikov <YSidelnikov@hotmail.com>
8 *
9 * Ethereal - Network traffic analyzer
10 * By Gerald Combs <gerald@ethereal.com>
11 * Copyright 1998 Gerald Combs
12 *
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.
17 *
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.
22 *
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.
26 */
27
28 #define PROTO_STRING_PRES "ISO 8823 OSI Presentation Protocol"
29 #define PROTO_STRING_PRES_INFO "ISO 8823 OSI Presentation Protocol."
30
31 /*     type of PPDU   */
32
33 #define PRES_CONNECTION_REQUEST_CONFIRM         0x31
34 #define PRES_CONNECTION_REFUSE                          0x30
35
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
42
43 #define INTEGER_ITEM                                            0x01
44 #define BOOLEAN_ITEM                                            0x01
45
46 /*       type of parameters */
47 #define MODE_SELECTOR                                           0
48 #define SET_TOP                                                         1
49 #define SEQUENCE_TOP                                            2
50
51
52 #define SEQUENCE                                                        0x30
53
54 /*    sequence top   */
55 #define TAG_00                                                                  0
56 #define TAG_01                                                                  1
57
58 enum
59 {
60 PROTOCOL_VERSION,
61 CALLING_PRESENTATION_SELECTOR,
62 CALLED_PRESENTATION_SELECTOR,
63 RESPONDING_PRESENTATION_SELECTOR,
64 PRESENTATION_CONTEXT_DEFINITION_LIST,
65 PRESENTATION_CONTEXT_DEFINITION_RESULT_LIST,
66 DEFAULT_CONTEXT_NAME,
67 DEFAULT_CONTEXT_RESULT,
68 PRESENTATION_REQUIREMENTS,
69 USER_SESSION_REQUIREMENTS,
70 PROVIDER_REASON
71 };
72 /*   definition list **/
73 #define   PRESENTATION_CONTEXT_IDENTIFIER                2
74 #define   ABSTRACT_SYNTAX_NAME                                   6
75 #define   TRANSFER_SYNTAX_NAMES                                  0x30
76 /*   result    list */
77 #define   PRESENTATION_RESULT                                                           0x80
78 #define   PRESENTATION_RESULT_TRANSFER_SYNTAX_NAME                      0x81
79 #define   PRESENTATION_RESULT_INTEGER                                           0x82
80
81 /*     result  values  */
82 #define   PRESENTATION_RESULT_ACCEPTANCE                 0
83 #define   PRESENTATION_RESULT_USER_REJECTION     1
84 #define   PRESENTATION_RESULT_PROVIDER_REJECTION 2
85
86 /* provider reason  */
87 enum
88 {
89 REASON_NOT_SPECIFIED,
90 TEMPORARY_CONGESTION,
91 LOCAL_LIMIT_EXCEEDED,
92 CALLED_PRESENTATION_ADDRESS_UNKNOWN,
93 PROTOCOL_VERSION_NOT_SUPPORTED,
94 DEFAULT_CONTEXT_NOT_SUPPORTED,
95 USER_DATA_NOT_READABLE,
96 NO_PSAP_AVAILABLE
97 };
98 /*  user data   */
99 #define   SIMPLY_ENCODED_DATA                                                                   0x60
100 #define   FULLY_ENCODED_DATA                                                                    0x61
101
102 /*  PDV    */
103 #define   SINGLE_ASN1_TYPE                                                                              0xa0
104 #define   OCTET_ALIGNED                                                                                 0xa1
105 #define   ARBITRARY                                                                                             0xa2
106
107 /* provider reasons */
108 enum
109 {
110 PR_REASON_NOT_SPECIFIED,
111 UNRECOGNIZED_PDU,
112 UNEXPECTED_PDU,
113 UNEXPECTED_SESSION_SERVICE_PRIMITIVE,
114 UNRECOGNIZED_PPDU_PARAMETER,
115 UNEXPECTED_PPDU_PARAMETER,
116 INVALID_PPDU_PARAMETER_VALUE
117 };
118 /*  event identifier    */
119 enum
120 {
121 REASON_CP_PPDU,
122 REASON_CPA_PPDU,
123 REASON_CPR_PPDU,
124 REASON_ARU_PPDU,
125 REASON_ARP_PPDU,
126 REASON_AC_PPDU,
127 REASON_ACA_PPDU,
128 REASON_TD_PPDU,
129 REASON_TTD_PPDU,
130 REASON_TE_PPDU,
131 REASON_TC_PPDU,
132 REASON_TCC_PPDU,
133 REASON_RS_PPDU,
134 REASON_RSA_PPDU,
135 S_RELEASE_INDICATION,
136 S_RELEASE_CONFIRM,
137 S_TOKEN_GIVE_INDICATION,
138 S_TOKEN_PLEASE_INDICATION,
139 S_CONTROL_GIVE_INDICATION,
140 S_SYNC_MINOR_INDICATION,
141 S_SYNC_MINOR_CONFIRM,
142 S_SYNC_MAJOR_INDICATION,
143 S_SYNC_MAJOR_CONFIRM,
144 S_P_EXCEPTION_REPORT_INDICATION,
145 S_U_EXCEPTION_REPORT_INDICATION,
146 S_ACTIVITY_START_INDICATION,
147 S_ACTIVITY_RESUME_INDICATION,
148 S_ACTIVITY_INTERRUPT_INDICATION,
149 S_ACTIVITY_INTERRUPT_CONFIRM,
150 S_ACTIVITY_DISCARD_INDICATION,
151 S_ACTIVITY_DISCARD_CONFIRM,
152 S_ACTIVITY_END_INDICATION,
153 S_ACTIVITY_END_CONFIRM
154 };
155
156 /*   flags   */
157 #define PRES_PROTOCOL_VERGION                                   0x0080
158
159 #define PRES_CONTEXT_MANAGEMENT                                 0x0080
160 #define PRES_RESTORATION                                                0x0040
161
162 #define ACSE_PRESENTATION_CONTEXT_IDENTIFIER                            3
163
164
165 #define                 MAXSTRING                                       256
166 #define                 UNKNOWN_SES_PDU_TYPE         -1
167
168 #define                 ABORT_REASON_LEN                        3
169
170
171