FreeBSD/Linux Kernel Cross Reference
sys/netncp/ncp.h
1 /*
2 * ncp.h
3 *
4 * Copyright (C) 1995 by Volker Lendecke
5 * New version derived from original ncp.h, 1998 Boris Popov
6 *
7 * $FreeBSD: releng/5.1/sys/netncp/ncp.h 111657 2003-02-28 04:31:29Z tjr $
8 */
9
10 #ifndef _NETNCP_NCP_H_
11 #define _NETNCP_NCP_H_
12
13 #define NCP_VERMAJ 1
14 #define NCP_VERMIN 3500
15 #define NCP_VERSION (NCP_VERMAJ*100000 + NCP_VERMIN)
16
17 typedef u_int32_t nwdirent;
18
19 typedef char nstr8;
20 typedef nstr8* pnstr8;
21 typedef u_int8_t nuint8;
22 typedef u_int8_t* pnuint8;
23 typedef u_int16_t nuint16;
24 typedef nuint16* pnuint16;
25 typedef u_int32_t nuint32;
26 typedef nuint32* pnuint32;
27
28
29 #define NCP_DEFAULT_BUFSIZE 1024
30 #define NCP_MAX_BUFSIZE 1024
31 #define NCP_MAX_PACKET_SIZE 4070
32 #define NCP_MAXUSERNAMELEN 255
33 #define NCP_MAXPASSWORDLEN 255
34 #define NCP_MAXPATHLEN 255
35 #define NCP_MAX_FILENAME 14
36 #define NCP_FILE_ID_LEN 6
37
38 #define NCP_BINDERY_USER 0x0001
39 #define NCP_BINDERY_UGROUP 0x0002
40 #define NCP_BINDERY_PQUEUE 0x0003
41 #define NCP_BINDERY_FSERVER 0x0004
42 #define NCP_BINDERY_PSERVER 0x0007
43 #define NCP_BINDERY_NAME_LEN 48
44
45 /* Handle Flags */
46 #define NCP_HF_DIRSHORT 0 /* short directory handle */
47 #define NCP_HF_DIRBASE 1 /* directory base */
48 #define NCP_HF_NONE 0xff /* no handle or dirbase */
49
50 /* Options to negotiate */
51 #define NCP_IPX_CHECKSUM 1
52 #define NCP_SECURITY_LEVEL_SIGN_HEADERS 2
53
54 #ifndef NWCONN_HANDLE
55 #define NWCONN_HANDLE unsigned int
56 #define pNWCONN_HANDLE (unsigned int*)
57 #define NWCONN_NUM u_int16_t
58 #define NWCCODE unsigned int
59 #define NWDIR_HANDLE u_int8_t
60 #define NWFILE_HANDLE int
61 #endif
62
63 struct ncp_fh_s {
64 u_int16_t val1;
65 union {
66 u_int32_t val32;
67 u_int16_t val16;
68 } val;
69 } __packed;
70
71 typedef struct ncp_fh_s ncp_fh;
72
73 typedef struct ncpfid_s {
74 nwdirent f_parent;
75 nwdirent f_id;
76 } ncpfid;
77
78 /* -- Bindery properties -- */
79 struct ncp_bindery_object {
80 u_int32_t object_id;
81 u_int16_t object_type;
82 u_int8_t object_name[NCP_BINDERY_NAME_LEN];
83 u_int8_t object_flags;
84 u_int8_t object_security;
85 u_int8_t object_has_prop;
86 };
87
88 struct nw_property {
89 u_int8_t value[128];
90 u_int8_t more_flag;
91 u_int8_t property_flag;
92 };
93
94 struct ncp_filesearch_info {
95 u_int8_t volume_number;
96 u_int16_t directory_id;
97 u_int16_t sequence_no;
98 u_int8_t access_rights;
99 };
100
101
102 struct ncp_file_info {
103 u_int8_t file_id[NCP_FILE_ID_LEN];
104 char file_name[NCP_MAX_FILENAME + 1];
105 u_int8_t file_attributes;
106 u_int8_t file_mode;
107 u_int32_t file_length;
108 u_int16_t creation_date;
109 u_int16_t access_date;
110 u_int16_t update_date;
111 u_int16_t update_time;
112 };
113
114 struct nw_queue_job_entry {
115 u_int16_t InUse;
116 u_int32_t prev;
117 u_int32_t next;
118 u_int32_t ClientStation;
119 u_int32_t ClientTask;
120 u_int32_t ClientObjectID;
121 u_int32_t TargetServerID;
122 u_int8_t TargetExecTime[6];
123 u_int8_t JobEntryTime[6];
124 u_int32_t JobNumber;
125 u_int16_t JobType;
126 u_int16_t JobPosition;
127 u_int16_t JobControlFlags;
128 u_int8_t FileNameLen;
129 char JobFileName[13];
130 u_int32_t JobFileHandle;
131 u_int32_t ServerStation;
132 u_int32_t ServerTaskNumber;
133 u_int32_t ServerObjectID;
134 char JobTextDescription[50];
135 char ClientRecordArea[152];
136 } __packed;
137
138 struct queue_job {
139 struct nw_queue_job_entry j;
140 ncp_fh file_handle;
141 };
142
143 #define QJE_OPER_HOLD 0x80
144 #define QJE_USER_HOLD 0x40
145 #define QJE_ENTRYOPEN 0x20
146 #define QJE_SERV_RESTART 0x10
147 #define QJE_SERV_AUTO 0x08
148
149 /* ClientRecordArea for print jobs */
150
151 #define KEEP_ON 0x0400
152 #define NO_FORM_FEED 0x0800
153 #define NOTIFICATION 0x1000
154 #define DELETE_FILE 0x2000
155 #define EXPAND_TABS 0x4000
156 #define PRINT_BANNER 0x8000
157
158 struct print_job_record {
159 u_int8_t Version;
160 u_int8_t TabSize;
161 u_int16_t Copies;
162 u_int16_t CtrlFlags;
163 u_int16_t Lines;
164 u_int16_t Rows;
165 char FormName[16];
166 u_int8_t Reserved[6];
167 char BannerName[13];
168 char FnameBanner[13];
169 char FnameHeader[14];
170 char Path[80];
171 } __packed;
172
173 struct ncp_station_addr {
174 u_int32_t NetWork;
175 u_int8_t Node[6];
176 u_int16_t Socket;
177 } __packed;
178
179 struct ncp_prop_login_control {
180 u_int8_t AccountExpireDate[3];
181 u_int8_t Disabled;
182 u_int8_t PasswordExpireDate[3];
183 u_int8_t GraceLogins;
184 u_int16_t PasswordExpireInterval;
185 u_int8_t MaxGraceLogins;
186 u_int8_t MinPasswordLength;
187 u_int16_t MaxConnections;
188 u_int8_t ConnectionTimeMask[42];
189 u_int8_t LastLogin[6];
190 u_int8_t RestrictionMask;
191 u_int8_t reserved;
192 u_int32_t MaxDiskUsage;
193 u_int16_t BadLoginCount;
194 u_int32_t BadLoginCountDown;
195 struct ncp_station_addr LastIntruder;
196 } __packed;
197
198 #define NCP_VOLNAME_LEN (16)
199 #define NCP_NUMBER_OF_VOLUMES (64)
200 struct ncp_volume_info {
201 u_int32_t total_blocks;
202 u_int32_t free_blocks;
203 u_int32_t purgeable_blocks;
204 u_int32_t not_yet_purgeable_blocks;
205 u_int32_t total_dir_entries;
206 u_int32_t available_dir_entries;
207 u_int8_t sectors_per_block;
208 char volume_name[NCP_VOLNAME_LEN + 1];
209 };
210 /*
211 * Name space constants, taken from NDK
212 */
213 #define aRONLY (ntohl(0x01000000))
214 #define aHIDDEN (ntohl(0x02000000))
215 #define aSYSTEM (ntohl(0x04000000))
216 #define aEXECUTE (ntohl(0x08000000))
217 #define aDIR (ntohl(0x10000000))
218 #define aARCH (ntohl(0x20000000))
219
220 /* Defines for Name Spaces */
221 #define NW_NS_DOS 0
222 #define NW_NS_MAC 1
223 #define NW_NS_NFS 2
224 #define NW_NS_FTAM 3
225 #define NW_NS_OS2 4
226
227 /* for _ScanNSEntryInfo */
228 #define IM_NAME 0x00000001
229 #define IM_SPACE_ALLOCATED 0x00000002
230 #define IM_ATTRIBUTES 0x00000004
231 #define IM_SIZE 0x00000008
232 #define IM_TOTAL_SIZE 0x00000010
233 #define IM_EA 0x00000020
234 #define IM_ARCHIVE 0x00000040
235 #define IM_MODIFY 0x00000080
236 #define IM_CREATION 0x00000100
237 #define IM_OWNING_NAMESPACE 0x00000200
238 #define IM_DIRECTORY 0x00000400
239 #define IM_RIGHTS 0x00000800
240 #define IM_ALMOST_ALL 0x00000FED
241 #define IM_ALL 0x00000FFF
242 #define IM_REFERENCE_ID 0x00001000
243 #define IM_NS_ATTRIBUTES 0x00002000
244 #define IM_COMPRESSED_INFO 0x80000000UL
245
246 /* open/create modes */
247 #define OC_MODE_OPEN 0x01
248 #define OC_MODE_TRUNCATE 0x02
249 #define OC_MODE_REPLACE 0x02
250 #define OC_MODE_CREATE 0x08
251
252 /* open/create results */
253 #define OC_ACTION_NONE 0x00
254 #define OC_ACTION_OPEN 0x01
255 #define OC_ACTION_CREATE 0x02
256 #define OC_ACTION_TRUNCATE 0x04
257 #define OC_ACTION_REPLACE 0x04
258
259 /* renameFlag in NSRename */
260 #define NW_TYPE_FILE 0x8000
261 #define NW_TYPE_SUBDIR 0x0010
262
263 #define NW_NAME_CONVERT 0x0003 /* don't report error and set comp mode */
264 #define NW_NO_NAME_CONVERT 0x0004 /* only in specified name space */
265
266 /* search attributes */
267 #ifndef SA_HIDDEN
268 #define SA_NORMAL 0x0000
269 #define SA_HIDDEN 0x0002
270 #define SA_SYSTEM 0x0004
271 #define SA_SUBDIR_ONLY 0x0010
272 #define SA_SUBDIR_FILES 0x8000
273 #define SA_ALL 0x8006
274 #endif
275
276 /* access rights attributes */
277 #ifndef AR_READ
278 #define AR_READ 0x0001
279 #define AR_WRITE 0x0002
280 #define AR_READ_ONLY 0x0001
281 #define AR_WRITE_ONLY 0x0002
282 #define AR_DENY_READ 0x0004
283 #define AR_DENY_WRITE 0x0008
284 #define AR_COMPATIBILITY 0x0010
285 #define AR_WRITE_THROUGH 0x0040
286 #define AR_OPEN_COMPRESSED 0x0100
287 #endif
288
289 struct nw_entry_info {
290 u_int32_t spaceAlloc;
291 u_int32_t attributes; /* LH */
292 u_int16_t flags; /* internal */
293 u_int32_t dataStreamSize;
294 u_int32_t totalStreamSize;
295 u_int16_t numberOfStreams;
296 u_int16_t creationTime; /* LH */
297 u_int16_t creationDate; /* LH */
298 u_int32_t creatorID; /* HL */
299 u_int16_t modifyTime; /* LH */
300 u_int16_t modifyDate; /* LH */
301 u_int32_t modifierID; /* HL */
302 u_int16_t lastAccessDate; /* LH */
303 u_int16_t archiveTime; /* LH */
304 u_int16_t archiveDate; /* LH */
305 u_int32_t archiverID; /* HL */
306 u_int16_t inheritedRightsMask; /* LH */
307 u_int32_t dirEntNum;
308 u_int32_t DosDirNum;
309 u_int32_t volNumber;
310 u_int32_t EADataSize;
311 u_int32_t EAKeyCount;
312 u_int32_t EAKeySize;
313 u_int32_t NSCreator;
314 u_int8_t nameLen;
315 u_int8_t entryName[256];
316 } __packed;
317
318 typedef struct nw_entry_info NW_ENTRY_INFO;
319
320 /* modify mask - use with MODIFY_DOS_INFO structure */
321 #define DM_ATTRIBUTES 0x0002L
322 #define DM_CREATE_DATE 0x0004L
323 #define DM_CREATE_TIME 0x0008L
324 #define DM_CREATOR_ID 0x0010L
325 #define DM_ARCHIVE_DATE 0x0020L
326 #define DM_ARCHIVE_TIME 0x0040L
327 #define DM_ARCHIVER_ID 0x0080L
328 #define DM_MODIFY_DATE 0x0100L
329 #define DM_MODIFY_TIME 0x0200L
330 #define DM_MODIFIER_ID 0x0400L
331 #define DM_LAST_ACCESS_DATE 0x0800L
332 #define DM_INHERITED_RIGHTS_MASK 0x1000L
333 #define DM_MAXIMUM_SPACE 0x2000L
334
335 struct nw_modify_dos_info {
336 u_int32_t attributes;
337 u_int16_t creationDate;
338 u_int16_t creationTime;
339 u_int32_t creatorID;
340 u_int16_t modifyDate;
341 u_int16_t modifyTime;
342 u_int32_t modifierID;
343 u_int16_t archiveDate;
344 u_int16_t archiveTime;
345 u_int32_t archiverID;
346 u_int16_t lastAccessDate;
347 u_int16_t inheritanceGrantMask;
348 u_int16_t inheritanceRevokeMask;
349 u_int32_t maximumSpace;
350 } __packed;
351
352 struct nw_search_seq {
353 u_int8_t volNumber;
354 u_int32_t dirNumber;
355 u_int32_t searchDirNumber;
356 } __packed;
357
358 typedef struct nw_search_seq SEARCH_SEQUENCE;
359
360 struct ncp_file_server_info {
361 u_int8_t ServerName[48];
362 u_int8_t FileServiceVersion;
363 u_int8_t FileServiceSubVersion;
364 u_int16_t MaximumServiceConnections;
365 u_int16_t ConnectionsInUse;
366 u_int16_t NumberMountedVolumes;
367 u_int8_t Revision;
368 u_int8_t SFTLevel;
369 u_int8_t TTSLevel;
370 u_int16_t MaxConnectionsEverUsed;
371 u_int8_t AccountVersion;
372 u_int8_t VAPVersion;
373 u_int8_t QueueVersion;
374 u_int8_t PrintVersion;
375 u_int8_t VirtualConsoleVersion;
376 u_int8_t RestrictionLevel;
377 u_int8_t InternetBridge;
378 u_int8_t Reserved[60];
379 } __packed;
380
381 struct nw_time_buffer {
382 u_int8_t year;
383 u_int8_t month;
384 u_int8_t day;
385 u_int8_t hour;
386 u_int8_t minute;
387 u_int8_t second;
388 u_int8_t wday;
389 } __packed;
390
391 #endif /*_NCP_H_ */
Cache object: 38db0f8618ca1234a2325e8e0cb68849
|