Move dissectors to epan/dissectors directory.
[obnox/wireshark/wip.git] / epan / dissectors / packet-ses.h
1 /* packet-ses.h
2 *
3 * Routine to dissect ISO 8327-1 OSI Session Protocol packets
4 *
5 * $Id$
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_SES "ISO 8327-1 OSI Session Protocol"
29 #define PROTO_STRING_SES_INFO "ISO 8327-1 OSI Session Protocol."
30 /*
31 * Dissect ses-encapsulated data in a TCP stream.
32 */
33
34 /* session parms */
35 #define  SES_EXT_CONT           0x01
36
37 /* protocol versions  */
38 #define  PROTOCOL_VERSION_1     0x01
39 #define  PROTOCOL_VERSION_2     0x02
40
41 /* enclosure item */
42 #define BEGINNING_SPDU          0x01
43 #define END_SPDU                0x02
44
45 #define DATA_TOKEN                              0x01
46 #define RELEASE_TOKEN                           0x40
47 #define SYNCHRONIZE_MINOR_TOKEN                 0x04
48 #define MAJOR_ACTIVITY_TOKEN                    0x10
49
50 /* session user req  flag   */
51 #define HALF_DUPLEX_FUNCTION_UNIT               0x0001
52 #define DUPLEX_FUNCTION_UNIT                    0x0002
53 #define EXPEDITED_DATA_FUNCTION_UNIT            0x0004
54 #define MINOR_SYNCHRONIZE_FUNCTION_UNIT         0x0008
55 #define MAJOR_SYNCHRONIZE_FUNCTION_UNIT         0x0010
56 #define RESYNCHRONIZE_FUNCTION_UNIT             0x0020
57 #define ACTIVITY_MANAGEMENT_FUNCTION_UNIT       0x0040
58 #define NEGOTIATED_RELEASE_FUNCTION_UNIT        0x0080
59 #define CAPABILITY_DATA_FUNCTION_UNIT           0x0100
60 #define EXCEPTION_FUNCTION_UNIT                 0x0200
61 #define TYPED_DATA_FUNCTION_UNIT                0x0400
62 #define SYMMETRIC_SYNCHRONIZE_FUNCTION_UNIT     0x0800
63 #define DATA_SEPARATION_FUNCTION_UNIT           0x1000
64
65 #define SES_EXCEPTION_REPORT                    0x2000
66 /*define SES_EXCEPTION_REPORT                   0    */
67 #define SES_DATA_TRANSFER                       1
68 #define SES_GIVE_TOKENS                         1
69 #define SES_PLEASE_TOKENS                       2
70 #define SES_EXPEDITED                           5
71 #define SES_PREPARE                             7
72 #define SES_NOT_FINISHED                        8
73 #define SES_FINISH                              9
74 #define SES_DISCONNECT                          10
75 #define SES_REFUSE                              12
76 #define SES_CONNECTION_REQUEST                  13
77 #define SES_CONNECTION_ACCEPT                   14
78 #define SES_CONNECTION_DATA_OVERFLOW            15
79 #define SES_OVERFLOW_ACCEPT                     16
80 #define SES_GIVE_TOKENS_CONFIRM                 21
81 #define SES_GIVE_TOKENS_ACK                     22
82 #define SES_ABORT                               25
83 #define SES_ABORT_ACCEPT                        26
84 /*#define SES_ACTIVITY_INTERRUPT                25
85 #define SES_ACTIVITY_INTERRUPT_ACK              26  */
86 #define SES_ACTIVITY_RESUME                     29
87 #define SES_TYPED_DATA                          33
88 #define SES_RESYNCHRONIZE_ACK                   34
89 #define SES_MAJOR_SYNC_POINT                    41
90 /*#define SES_MAJOR_SYNC_POINT                  41
91 #define SES_ACTIVITY_END                        41  */
92 #define SES_MAJOR_SYNC_ACK                      42
93 #define SES_ACTIVITY_START                      45
94 #define SES_EXCEPTION_DATA                      48
95 #define SES_MINOR_SYNC_POINT                    49
96 #define SES_MINOR_SYNC_ACK                      50
97 #define SES_RESYNCHRONIZE                       53
98 #define SES_ACTIVITY_DISCARD                    57
99 #define SES_ACTIVITY_DISCARD_ACK                58
100 #define SES_CAPABILITY                          61
101 #define SES_CAPABILITY_DATA_ACK                 62
102
103 /*
104 reason code
105         0:      Rejection by called SS-user; reason not specified.
106         1:      Rejection by called SS-user due to temporary congestion.
107         2:      Rejection by called SS-user. Subsequent octets may be used
108                 for user data up to a length of 512 octets if Protocol
109                 Version 1 has been selected, and up to a length such that
110                 the total length (including SI and LI)  of the SPDU does
111                 not exceed 65 539 octets if Protocol Version 2 has been
112                 selected.
113         128 + 1:        Session Selector unknown.
114         128 + 2:        SS-user not attached to SSAP.
115         128 + 3:        SPM congestion at connect time.
116         128 + 4:        Proposed protocol versions not supported.
117         128 + 5:        Rejection by the SPM; reason not specified.
118         128 + 6:        Rejection by the SPM; implementation restriction stated in the 
119                         PICS.
120 */
121 #define reason_not_specified            0
122 #define temporary_congestion            1
123 #define Subsequent                      2
124 #define Session_Selector_unknown        128+1
125 #define SS_user_not_attached_to_SSAP    128+2
126 #define SPM_congestion_at_connect_time  128+3
127 #define versions_not_supported          128+4
128 #define SPM_reason_not_specified        128+5
129 #define SPM_implementation_restriction  128+6
130
131 #define         NON_TOKENS_SPDU                 FALSE
132 #define         TOKENS_SPDU                     TRUE
133
134 #define         TWO_BYTE_LEN                    0xff
135
136 /* PGI's */
137
138 #define Connection_Identifier                   1
139 #define Connect_Accept_Item                     5
140 #define Linking_Information                     33
141 #define User_Data                               193
142 #define Extended_User_Data                      194
143
144 /* PI's */
145
146 #define Called_SS_user_Reference                9
147 #define Calling_SS_user_Reference               10
148 #define Common_Reference                        11
149 #define Additional_Reference_Information        12
150
151 #define Sync_Type_Item                          15
152 #define Token_Item                              16
153 #define Transport_Disconnect                    17
154
155 #define Protocol_Options                        19
156 #define Session_Requirement                     20
157 #define TSDU_Maximum_Size                       21
158 #define Version_Number                          22
159 #define Initial_Serial_Number                   23
160 #define Prepare_Type                            24
161 #define EnclosureItem                           25
162 #define Token_Setting_Item                      26
163 #define Resync_Type                             27
164
165 #define Serial_Number                           42
166
167 #define Reflect_Parameter                       49
168
169 #define Reason_Code                             50
170 #define Calling_Session_Selector                51
171 #define Called_Session_Selector                 52
172 #define Second_Resync_Type                      53
173 #define Second_Serial_Number                    54
174 #define Second_Initial_Serial_Number            55
175 #define Upper_Limit_Serial_Number               56
176 #define Large_Initial_Serial_Number             57
177 #define Large_Second_Initial_Serial_Number      58
178
179 #define Data_Overflow                           60
180
181 /* transport disconnect values */
182 #define         transport_connection_is_released        0x01
183 #define         user_abort                              0x02
184 #define         protocol_error                          0x04
185 #define         no_reason                               0x08
186
187
188 #define         SESSION_NO_ABORT                0
189 #define         SESSION_USER_ABORT              1
190 #define         SESSION_PROVIDER_ABORT          2
191
192 /* data for presentation selector      */
193 struct SESSION_DATA_STRUCTURE
194 {
195         guint8  spdu_type;
196         guint8  abort_type;
197 };
198 #define         implementation_restriction              0x10