1
2
3
4
5
6
7
8 #ifndef _LINUX_NCP_H
9 #define _LINUX_NCP_H
10
11 #include <linux/types.h>
12 #include <linux/ipx.h>
13
14 #define NCP_PTYPE (0x11)
15 #define NCP_PORT (0x0451)
16
17 #define NCP_ALLOC_SLOT_REQUEST (0x1111)
18 #define NCP_REQUEST (0x2222)
19 #define NCP_DEALLOC_SLOT_REQUEST (0x5555)
20
21 struct ncp_request_header {
22 __u16 type __attribute__ ((packed));
23 __u8 sequence __attribute__ ((packed));
24 __u8 conn_low __attribute__ ((packed));
25 __u8 task __attribute__ ((packed));
26 __u8 conn_high __attribute__ ((packed));
27 __u8 function __attribute__ ((packed));
28 __u8 data[0] __attribute__ ((packed));
29 };
30
31 #define NCP_REPLY (0x3333)
32 #define NCP_POSITIVE_ACK (0x9999)
33
34 struct ncp_reply_header {
35 __u16 type __attribute__ ((packed));
36 __u8 sequence __attribute__ ((packed));
37 __u8 conn_low __attribute__ ((packed));
38 __u8 task __attribute__ ((packed));
39 __u8 conn_high __attribute__ ((packed));
40 __u8 completion_code __attribute__ ((packed));
41 __u8 connection_state __attribute__ ((packed));
42 __u8 data[0] __attribute__ ((packed));
43 };
44
45
46 #define NCP_BINDERY_USER (0x0001)
47 #define NCP_BINDERY_UGROUP (0x0002)
48 #define NCP_BINDERY_PQUEUE (0x0003)
49 #define NCP_BINDERY_FSERVER (0x0004)
50 #define NCP_BINDERY_NAME_LEN (48)
51 struct ncp_bindery_object {
52 __u32 object_id;
53 __u16 object_type;
54 __u8 object_name[NCP_BINDERY_NAME_LEN];
55 __u8 object_flags;
56 __u8 object_security;
57 __u8 object_has_prop;
58 };
59
60 struct nw_property {
61 __u8 value[128];
62 __u8 more_flag;
63 __u8 property_flag;
64 };
65
66 struct prop_net_address {
67 __u32 network __attribute__ ((packed));
68 __u8 node[IPX_NODE_LEN] __attribute__ ((packed));
69 __u16 port __attribute__ ((packed));
70 };
71
72 #define NCP_VOLNAME_LEN (16)
73 #define NCP_NUMBER_OF_VOLUMES (64)
74 struct ncp_volume_info {
75 __u32 total_blocks;
76 __u32 free_blocks;
77 __u32 purgeable_blocks;
78 __u32 not_yet_purgeable_blocks;
79 __u32 total_dir_entries;
80 __u32 available_dir_entries;
81 __u8 sectors_per_block;
82 char volume_name[NCP_VOLNAME_LEN+1];
83 };
84
85 struct ncp_filesearch_info {
86 __u8 volume_number;
87 __u16 directory_id;
88 __u16 sequence_no;
89 __u8 access_rights;
90 };
91
92 #define NCP_MAX_FILENAME 14
93
94
95 #define aRONLY (1L<<0)
96 #define aHIDDEN (1L<<1)
97 #define aSYSTEM (1L<<2)
98 #define aEXECUTE (1L<<3)
99 #define aDIR (1L<<4)
100 #define aARCH (1L<<5)
101
102 #define AR_READ (0x01)
103 #define AR_WRITE (0x02)
104 #define AR_EXCLUSIVE (0x20)
105
106 #define NCP_FILE_ID_LEN 6
107 struct ncp_file_info {
108 __u8 file_id[NCP_FILE_ID_LEN];
109 char file_name[NCP_MAX_FILENAME+1];
110 __u8 file_attributes;
111 __u8 file_mode;
112 __u32 file_length;
113 __u16 creation_date;
114 __u16 access_date;
115 __u16 update_date;
116 __u16 update_time;
117 };
118
119
120
121 #define RIM_NAME (0x0001L)
122 #define RIM_SPACE_ALLOCATED (0x0002L)
123 #define RIM_ATTRIBUTES (0x0004L)
124 #define RIM_DATA_SIZE (0x0008L)
125 #define RIM_TOTAL_SIZE (0x0010L)
126 #define RIM_EXT_ATTR_INFO (0x0020L)
127 #define RIM_ARCHIVE (0x0040L)
128 #define RIM_MODIFY (0x0080L)
129 #define RIM_CREATION (0x0100L)
130 #define RIM_OWNING_NAMESPACE (0x0200L)
131 #define RIM_DIRECTORY (0x0400L)
132 #define RIM_RIGHTS (0x0800L)
133 #define RIM_ALL (0x0FFFL)
134 #define RIM_COMPRESSED_INFO (0x80000000L)
135
136
137 #define OC_MODE_OPEN 0x01
138 #define OC_MODE_TRUNCATE 0x02
139 #define OC_MODE_REPLACE 0x02
140 #define OC_MODE_CREATE 0x08
141
142
143 #define OC_ACTION_NONE 0x00
144 #define OC_ACTION_OPEN 0x01
145 #define OC_ACTION_CREATE 0x02
146 #define OC_ACTION_TRUNCATE 0x04
147 #define OC_ACTION_REPLACE 0x04
148
149
150 #ifndef AR_READ_ONLY
151 #define AR_READ_ONLY 0x0001
152 #define AR_WRITE_ONLY 0x0002
153 #define AR_DENY_READ 0x0004
154 #define AR_DENY_WRITE 0x0008
155 #define AR_COMPATIBILITY 0x0010
156 #define AR_WRITE_THROUGH 0x0040
157 #define AR_OPEN_COMPRESSED 0x0100
158 #endif
159
160 struct nw_info_struct
161 {
162 __u32 spaceAlloc __attribute__ ((packed));
163 __u32 attributes __attribute__ ((packed));
164 __u16 flags __attribute__ ((packed));
165 __u32 dataStreamSize __attribute__ ((packed));
166 __u32 totalStreamSize __attribute__ ((packed));
167 __u16 numberOfStreams __attribute__ ((packed));
168 __u16 creationTime __attribute__ ((packed));
169 __u16 creationDate __attribute__ ((packed));
170 __u32 creatorID __attribute__ ((packed));
171 __u16 modifyTime __attribute__ ((packed));
172 __u16 modifyDate __attribute__ ((packed));
173 __u32 modifierID __attribute__ ((packed));
174 __u16 lastAccessDate __attribute__ ((packed));
175 __u16 archiveTime __attribute__ ((packed));
176 __u16 archiveDate __attribute__ ((packed));
177 __u32 archiverID __attribute__ ((packed));
178 __u16 inheritedRightsMask __attribute__ ((packed));
179 __u32 dirEntNum __attribute__ ((packed));
180 __u32 DosDirNum __attribute__ ((packed));
181 __u32 volNumber __attribute__ ((packed));
182 __u32 EADataSize __attribute__ ((packed));
183 __u32 EAKeyCount __attribute__ ((packed));
184 __u32 EAKeySize __attribute__ ((packed));
185 __u32 NSCreator __attribute__ ((packed));
186 __u8 nameLen __attribute__ ((packed));
187 __u8 entryName[256] __attribute__ ((packed));
188 };
189
190
191 #define DM_ATTRIBUTES (0x0002L)
192 #define DM_CREATE_DATE (0x0004L)
193 #define DM_CREATE_TIME (0x0008L)
194 #define DM_CREATOR_ID (0x0010L)
195 #define DM_ARCHIVE_DATE (0x0020L)
196 #define DM_ARCHIVE_TIME (0x0040L)
197 #define DM_ARCHIVER_ID (0x0080L)
198 #define DM_MODIFY_DATE (0x0100L)
199 #define DM_MODIFY_TIME (0x0200L)
200 #define DM_MODIFIER_ID (0x0400L)
201 #define DM_LAST_ACCESS_DATE (0x0800L)
202 #define DM_INHERITED_RIGHTS_MASK (0x1000L)
203 #define DM_MAXIMUM_SPACE (0x2000L)
204
205 struct nw_modify_dos_info
206 {
207 __u32 attributes __attribute__ ((packed));
208 __u16 creationDate __attribute__ ((packed));
209 __u16 creationTime __attribute__ ((packed));
210 __u32 creatorID __attribute__ ((packed));
211 __u16 modifyDate __attribute__ ((packed));
212 __u16 modifyTime __attribute__ ((packed));
213 __u32 modifierID __attribute__ ((packed));
214 __u16 archiveDate __attribute__ ((packed));
215 __u16 archiveTime __attribute__ ((packed));
216 __u32 archiverID __attribute__ ((packed));
217 __u16 lastAccessDate __attribute__ ((packed));
218 __u16 inheritanceGrantMask __attribute__ ((packed));
219 __u16 inheritanceRevokeMask __attribute__ ((packed));
220 __u32 maximumSpace __attribute__ ((packed));
221 };
222
223 struct nw_file_info {
224 struct nw_info_struct i;
225 int opened;
226 int access;
227 __u32 server_file_handle __attribute__ ((packed));
228 __u8 open_create_action __attribute__ ((packed));
229 __u8 file_handle[6] __attribute__ ((packed));
230 };
231
232 struct nw_search_sequence {
233 __u8 volNumber __attribute__ ((packed));
234 __u32 dirBase __attribute__ ((packed));
235 __u32 sequence __attribute__ ((packed));
236 };
237
238 struct nw_queue_job_entry {
239 __u16 InUse __attribute__ ((packed));
240 __u32 prev __attribute__ ((packed));
241 __u32 next __attribute__ ((packed));
242 __u32 ClientStation __attribute__ ((packed));
243 __u32 ClientTask __attribute__ ((packed));
244 __u32 ClientObjectID __attribute__ ((packed));
245 __u32 TargetServerID __attribute__ ((packed));
246 __u8 TargetExecTime[6] __attribute__ ((packed));
247 __u8 JobEntryTime[6] __attribute__ ((packed));
248 __u32 JobNumber __attribute__ ((packed));
249 __u16 JobType __attribute__ ((packed));
250 __u16 JobPosition __attribute__ ((packed));
251 __u16 JobControlFlags __attribute__ ((packed));
252 __u8 FileNameLen __attribute__ ((packed));
253 char JobFileName[13] __attribute__ ((packed));
254 __u32 JobFileHandle __attribute__ ((packed));
255 __u32 ServerStation __attribute__ ((packed));
256 __u32 ServerTaskNumber __attribute__ ((packed));
257 __u32 ServerObjectID __attribute__ ((packed));
258 char JobTextDescription[50] __attribute__ ((packed));
259 char ClientRecordArea[152] __attribute__ ((packed));
260 };
261
262 struct queue_job {
263 struct nw_queue_job_entry j;
264 __u8 file_handle[6];
265 };
266
267 #define QJE_OPER_HOLD 0x80
268 #define QJE_USER_HOLD 0x40
269 #define QJE_ENTRYOPEN 0x20
270 #define QJE_SERV_RESTART 0x10
271 #define QJE_SERV_AUTO 0x08
272
273
274
275 #define KEEP_ON 0x0400
276 #define NO_FORM_FEED 0x0800
277 #define NOTIFICATION 0x1000
278 #define DELETE_FILE 0x2000
279 #define EXPAND_TABS 0x4000
280 #define PRINT_BANNER 0x8000
281
282 struct print_job_record {
283 __u8 Version __attribute__ ((packed));
284 __u8 TabSize __attribute__ ((packed));
285 __u16 Copies __attribute__ ((packed));
286 __u16 CtrlFlags __attribute__ ((packed));
287 __u16 Lines __attribute__ ((packed));
288 __u16 Rows __attribute__ ((packed));
289 char FormName[16] __attribute__ ((packed));
290 __u8 Reserved[6] __attribute__ ((packed));
291 char BannerName[13] __attribute__ ((packed));
292 char FnameBanner[13] __attribute__ ((packed));
293 char FnameHeader[14] __attribute__ ((packed));
294 char Path[80] __attribute__ ((packed));
295 };
296
297
298 #endif