source: trunk/samba-3.0.25pre1/source/include/trans2.h@ 4

Last change on this file since 4 was 1, checked in by Paul Smedley, 18 years ago

Initial code import

File size: 22.3 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 SMB transaction2 handling
4 Copyright (C) Jeremy Allison 1994-2002.
5
6 Extensively modified by Andrew Tridgell, 1995
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#ifndef _TRANS2_H_
24#define _TRANS2_H_
25
26/* Define the structures needed for the trans2 calls. */
27
28/*******************************************************
29 For DosFindFirst/DosFindNext - level 1
30
31MAXFILENAMELEN = 255;
32FDATE == uint16
33FTIME == uint16
34ULONG == uint32
35USHORT == uint16
36
37typedef struct _FILEFINDBUF {
38Byte offset Type name description
39-------------+-------+-------------------+--------------
400 FDATE fdateCreation;
412 FTIME ftimeCreation;
424 FDATE fdateLastAccess;
436 FTIME ftimeLastAccess;
448 FDATE fdateLastWrite;
4510 FTIME ftimeLastWrite;
4612 ULONG cbFile file length in bytes
4716 ULONG cbFileAlloc size of file allocation unit
4820 USHORT attrFile
4922 UCHAR cchName length of name to follow (not including zero)
5023 UCHAR achName[MAXFILENAMELEN]; Null terminated name
51} FILEFINDBUF;
52*********************************************************/
53
54#define l1_fdateCreation 0
55#define l1_fdateLastAccess 4
56#define l1_fdateLastWrite 8
57#define l1_cbFile 12
58#define l1_cbFileAlloc 16
59#define l1_attrFile 20
60#define l1_cchName 22
61#define l1_achName 23
62
63/**********************************************************
64For DosFindFirst/DosFindNext - level 2
65
66typedef struct _FILEFINDBUF2 {
67Byte offset Type name description
68-------------+-------+-------------------+--------------
690 FDATE fdateCreation;
702 FTIME ftimeCreation;
714 FDATE fdateLastAccess;
726 FTIME ftimeLastAccess;
738 FDATE fdateLastWrite;
7410 FTIME ftimeLastWrite;
7512 ULONG cbFile file length in bytes
7616 ULONG cbFileAlloc size of file allocation unit
7720 USHORT attrFile
7822 ULONG cbList Extended attribute list (always 0)
7926 UCHAR cchName length of name to follow (not including zero)
8027 UCHAR achName[MAXFILENAMELEN]; Null terminated name
81} FILEFINDBUF2;
82*************************************************************/
83
84#define l2_fdateCreation 0
85#define l2_fdateLastAccess 4
86#define l2_fdateLastWrite 8
87#define l2_cbFile 12
88#define l2_cbFileAlloc 16
89#define l2_attrFile 20
90#define l2_cbList 22
91#define l2_cchName 26
92#define l2_achName 27
93
94
95/**********************************************************
96For DosFindFirst/DosFindNext - level 260
97
98typedef struct _FILEFINDBUF260 {
99Byte offset Type name description
100-------------+-------+-------------------+--------------
1010 ULONG NextEntryOffset;
1024 ULONG FileIndex;
1038 LARGE_INTEGER CreationTime;
10416 LARGE_INTEGER LastAccessTime;
10524 LARGE_INTEGER LastWriteTime;
10632 LARGE_INTEGER ChangeTime;
10740 LARGE_INTEGER EndOfFile;
10848 LARGE_INTEGER AllocationSize;
10956 ULONG FileAttributes;
11060 ULONG FileNameLength;
11164 ULONG EaSize;
11268 CHAR ShortNameLength;
11370 UNICODE ShortName[12];
11494 UNICODE FileName[];
115*************************************************************/
116
117#define l260_achName 94
118
119
120/**********************************************************
121For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/
122DosSetFileInfo - level 1
123
124typedef struct _FILESTATUS {
125Byte offset Type name description
126-------------+-------+-------------------+--------------
1270 FDATE fdateCreation;
1282 FTIME ftimeCreation;
1294 FDATE fdateLastAccess;
1306 FTIME ftimeLastAccess;
1318 FDATE fdateLastWrite;
13210 FTIME ftimeLastWrite;
13312 ULONG cbFile file length in bytes
13416 ULONG cbFileAlloc size of file allocation unit
13520 USHORT attrFile
136} FILESTATUS;
137*************************************************************/
138
139/* Use the l1_ defines from DosFindFirst */
140
141/**********************************************************
142For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/
143DosSetFileInfo - level 2
144
145typedef struct _FILESTATUS2 {
146Byte offset Type name description
147-------------+-------+-------------------+--------------
1480 FDATE fdateCreation;
1492 FTIME ftimeCreation;
1504 FDATE fdateLastAccess;
1516 FTIME ftimeLastAccess;
1528 FDATE fdateLastWrite;
15310 FTIME ftimeLastWrite;
15412 ULONG cbFile file length in bytes
15516 ULONG cbFileAlloc size of file allocation unit
15620 USHORT attrFile
15722 ULONG cbList Length of EA's (0)
158} FILESTATUS2;
159*************************************************************/
160
161/* Use the l2_ #defines from DosFindFirst */
162
163/**********************************************************
164For DosQFSInfo/DosSetFSInfo - level 1
165
166typedef struct _FSALLOCATE {
167Byte offset Type name description
168-------------+-------+-------------------+--------------
1690 ULONG idFileSystem id of file system
1704 ULONG cSectorUnit number of sectors per allocation unit
1718 ULONG cUnit number of allocation units
17212 ULONG cUnitAvail Available allocation units
17316 USHORT cbSector bytes per sector
174} FSALLOCATE;
175*************************************************************/
176
177#define l1_idFileSystem 0
178#define l1_cSectorUnit 4
179#define l1_cUnit 8
180#define l1_cUnitAvail 12
181#define l1_cbSector 16
182
183/**********************************************************
184For DosQFSInfo/DosSetFSInfo - level 2
185
186typedef struct _FSINFO {
187Byte offset Type name description
188-------------+-------+-------------------+--------------
1890 FDATE vol_fdateCreation
1902 FTIME vol_ftimeCreation
1914 UCHAR vol_cch length of volume name (excluding NULL)
1925 UCHAR vol_szVolLabel[12] volume name
193} FSINFO;
194*************************************************************/
195
196#define SMB_INFO_STANDARD 1 /* FILESTATUS3 struct */
197#define SMB_INFO_SET_EA 2 /* EAOP2 struct, only valid on set not query */
198#define SMB_INFO_QUERY_EA_SIZE 2 /* FILESTATUS4 struct, only valid on query not set */
199#define SMB_INFO_QUERY_EAS_FROM_LIST 3 /* only valid on query not set */
200#define SMB_INFO_QUERY_ALL_EAS 4 /* only valid on query not set */
201#define SMB_INFO_IS_NAME_VALID 6
202#define SMB_INFO_STANDARD_LONG 11 /* similar to level 1, ie struct FileStatus3 */
203#define SMB_QUERY_EA_SIZE_LONG 12 /* similar to level 2, ie struct FileStatus4 */
204#define SMB_QUERY_FS_LABEL_INFO 0x101
205#define SMB_QUERY_FS_VOLUME_INFO 0x102
206#define SMB_QUERY_FS_SIZE_INFO 0x103
207#define SMB_QUERY_FS_DEVICE_INFO 0x104
208#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
209#if 0
210#define SMB_QUERY_FS_QUOTA_INFO
211#endif
212
213#define l2_vol_fdateCreation 0
214#define l2_vol_cch 4
215#define l2_vol_szVolLabel 5
216
217
218#define SMB_QUERY_FILE_BASIC_INFO 0x101
219#define SMB_QUERY_FILE_STANDARD_INFO 0x102
220#define SMB_QUERY_FILE_EA_INFO 0x103
221#define SMB_QUERY_FILE_NAME_INFO 0x104
222#define SMB_QUERY_FILE_ALLOCATION_INFO 0x105
223#define SMB_QUERY_FILE_END_OF_FILEINFO 0x106
224#define SMB_QUERY_FILE_ALL_INFO 0x107
225#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
226#define SMB_QUERY_FILE_STREAM_INFO 0x109
227#define SMB_QUERY_COMPRESSION_INFO 0x10b
228
229#define SMB_FIND_INFO_STANDARD 1
230#define SMB_FIND_EA_SIZE 2
231#define SMB_FIND_EA_LIST 3
232#define SMB_FIND_FILE_DIRECTORY_INFO 0x101
233#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
234#define SMB_FIND_FILE_NAMES_INFO 0x103
235#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
236#define SMB_FIND_ID_FULL_DIRECTORY_INFO 0x105
237#define SMB_FIND_ID_BOTH_DIRECTORY_INFO 0x106
238
239#define SMB_SET_FILE_BASIC_INFO 0x101
240#define SMB_SET_FILE_DISPOSITION_INFO 0x102
241#define SMB_SET_FILE_ALLOCATION_INFO 0x103
242#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
243
244/* Query FS info. */
245#define SMB_INFO_ALLOCATION 1
246#define SMB_INFO_VOLUME 2
247
248/*
249 * Thursby MAC extensions....
250 */
251
252/*
253 * MAC CIFS Extensions have the range 0x300 - 0x2FF reserved.
254 * Supposedly Microsoft have agreed to this.
255 */
256
257#define MIN_MAC_INFO_LEVEL 0x300
258#define MAX_MAC_INFO_LEVEL 0x3FF
259
260#define SMB_MAC_QUERY_FS_INFO 0x301
261
262#define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName))
263
264/*
265 * DeviceType and Characteristics returned in a
266 * SMB_QUERY_FS_DEVICE_INFO call.
267 */
268
269#define DEVICETYPE_CD_ROM 0x2
270#define DEVICETYPE_CD_ROM_FILE_SYSTEM 0x3
271#define DEVICETYPE_DISK 0x7
272#define DEVICETYPE_DISK_FILE_SYSTEM 0x8
273#define DEVICETYPE_FILE_SYSTEM 0x9
274
275/* Characteristics. */
276#define TYPE_REMOVABLE_MEDIA 0x1
277#define TYPE_READ_ONLY_DEVICE 0x2
278#define TYPE_FLOPPY 0x4
279#define TYPE_WORM 0x8
280#define TYPE_REMOTE 0x10
281#define TYPE_MOUNTED 0x20
282#define TYPE_VIRTUAL 0x40
283
284/* NT passthrough levels... */
285
286#define SMB_FILE_DIRECTORY_INFORMATION 1001
287#define SMB_FILE_FULL_DIRECTORY_INFORMATION 1002
288#define SMB_FILE_BOTH_DIRECTORY_INFORMATION 1003
289#define SMB_FILE_BASIC_INFORMATION 1004
290#define SMB_FILE_STANDARD_INFORMATION 1005
291#define SMB_FILE_INTERNAL_INFORMATION 1006
292#define SMB_FILE_EA_INFORMATION 1007
293#define SMB_FILE_ACCESS_INFORMATION 1008
294#define SMB_FILE_NAME_INFORMATION 1009
295#define SMB_FILE_RENAME_INFORMATION 1010
296#define SMB_FILE_LINK_INFORMATION 1011
297#define SMB_FILE_NAMES_INFORMATION 1012
298#define SMB_FILE_DISPOSITION_INFORMATION 1013
299#define SMB_FILE_POSITION_INFORMATION 1014
300#define SMB_FILE_FULL_EA_INFORMATION 1015
301#define SMB_FILE_MODE_INFORMATION 1016
302#define SMB_FILE_ALIGNMENT_INFORMATION 1017
303#define SMB_FILE_ALL_INFORMATION 1018
304#define SMB_FILE_ALLOCATION_INFORMATION 1019
305#define SMB_FILE_END_OF_FILE_INFORMATION 1020
306#define SMB_FILE_ALTERNATE_NAME_INFORMATION 1021
307#define SMB_FILE_STREAM_INFORMATION 1022
308#define SMB_FILE_PIPE_INFORMATION 1023
309#define SMB_FILE_PIPE_LOCAL_INFORMATION 1024
310#define SMB_FILE_PIPE_REMOTE_INFORMATION 1025
311#define SMB_FILE_MAILSLOT_QUERY_INFORMATION 1026
312#define SMB_FILE_MAILSLOT_SET_INFORMATION 1027
313#define SMB_FILE_COMPRESSION_INFORMATION 1028
314#define SMB_FILE_OBJECTID_INFORMATION 1029
315#define SMB_FILE_COMPLETION_INFORMATION 1030
316#define SMB_FILE_MOVE_CLUSTER_INFORMATION 1031
317#define SMB_FILE_QUOTA_INFORMATION 1032
318#define SMB_FILE_REPARSEPOINT_INFORMATION 1033
319#define SMB_FILE_NETWORK_OPEN_INFORMATION 1034
320#define SMB_FILE_ATTRIBUTE_TAG_INFORMATION 1035
321#define SMB_FILE_TRACKING_INFORMATION 1036
322#define SMB_FILE_MAXIMUM_INFORMATION 1037
323
324/* NT passthough levels for qfsinfo. */
325
326#define SMB_FS_VOLUME_INFORMATION 1001
327#define SMB_FS_LABEL_INFORMATION 1002
328#define SMB_FS_SIZE_INFORMATION 1003
329#define SMB_FS_DEVICE_INFORMATION 1004
330#define SMB_FS_ATTRIBUTE_INFORMATION 1005
331#define SMB_FS_QUOTA_INFORMATION 1006
332#define SMB_FS_FULL_SIZE_INFORMATION 1007
333#define SMB_FS_OBJECTID_INFORMATION 1008
334
335/* flags on trans2 findfirst/findnext that control search */
336#define FLAG_TRANS2_FIND_CLOSE 0x1
337#define FLAG_TRANS2_FIND_CLOSE_IF_END 0x2
338#define FLAG_TRANS2_FIND_REQUIRE_RESUME 0x4
339#define FLAG_TRANS2_FIND_CONTINUE 0x8
340#define FLAG_TRANS2_FIND_BACKUP_INTENT 0x10
341
342/* UNIX CIFS Extensions - created by HP */
343/*
344 * UNIX CIFS Extensions have the range 0x200 - 0x2FF reserved.
345 * Supposedly Microsoft have agreed to this.
346 */
347
348#define MIN_UNIX_INFO_LEVEL 0x200
349#define MAX_UNIX_INFO_LEVEL 0x2FF
350
351#define INFO_LEVEL_IS_UNIX(level) (((level) >= MIN_UNIX_INFO_LEVEL) && ((level) <= MAX_UNIX_INFO_LEVEL))
352
353#define SMB_QUERY_FILE_UNIX_BASIC 0x200 /* UNIX File Info*/
354#define SMB_SET_FILE_UNIX_BASIC 0x200
355
356#define SMB_MODE_NO_CHANGE 0xFFFFFFFF /* file mode value which */
357 /* means "don't change it" */
358#define SMB_UID_NO_CHANGE 0xFFFFFFFF
359#define SMB_GID_NO_CHANGE 0xFFFFFFFF
360
361#define SMB_SIZE_NO_CHANGE_LO 0xFFFFFFFF
362#define SMB_SIZE_NO_CHANGE_HI 0xFFFFFFFF
363
364#define SMB_TIME_NO_CHANGE_LO 0xFFFFFFFF
365#define SMB_TIME_NO_CHANGE_HI 0xFFFFFFFF
366
367/*
368Offset Size Name
3690 LARGE_INTEGER EndOfFile File size
3708 LARGE_INTEGER Blocks Number of bytes used on disk (st_blocks).
37116 LARGE_INTEGER CreationTime Creation time
37224 LARGE_INTEGER LastAccessTime Last access time
37332 LARGE_INTEGER LastModificationTime Last modification time
37440 LARGE_INTEGER Uid Numeric user id for the owner
37548 LARGE_INTEGER Gid Numeric group id of owner
37656 ULONG Type Enumeration specifying the pathname type:
377 0 -- File
378 1 -- Directory
379 2 -- Symbolic link
380 3 -- Character device
381 4 -- Block device
382 5 -- FIFO (named pipe)
383 6 -- Unix domain socket
384
38560 LARGE_INTEGER devmajor Major device number if type is device
38668 LARGE_INTEGER devminor Minor device number if type is device
38776 LARGE_INTEGER uniqueid This is a server-assigned unique id for the file. The client
388 will typically map this onto an inode number. The scope of
389 uniqueness is the share.
39084 LARGE_INTEGER permissions Standard UNIX file permissions - see below.
39192 LARGE_INTEGER nlinks The number of directory entries that map to this entry
392 (number of hard links)
393
394100 - end.
395*/
396
397#define SMB_FILE_UNIX_BASIC_SIZE 100
398
399/* UNIX filetype mappings. */
400
401#define UNIX_TYPE_FILE 0
402#define UNIX_TYPE_DIR 1
403#define UNIX_TYPE_SYMLINK 2
404#define UNIX_TYPE_CHARDEV 3
405#define UNIX_TYPE_BLKDEV 4
406#define UNIX_TYPE_FIFO 5
407#define UNIX_TYPE_SOCKET 6
408#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
409
410/*
411 * Oh this is fun. "Standard UNIX permissions" has no
412 * meaning in POSIX. We need to define the mapping onto
413 * and off the wire as this was not done in the original HP
414 * spec. JRA.
415 */
416
417#define UNIX_X_OTH 0000001
418#define UNIX_W_OTH 0000002
419#define UNIX_R_OTH 0000004
420#define UNIX_X_GRP 0000010
421#define UNIX_W_GRP 0000020
422#define UNIX_R_GRP 0000040
423#define UNIX_X_USR 0000100
424#define UNIX_W_USR 0000200
425#define UNIX_R_USR 0000400
426#define UNIX_STICKY 0001000
427#define UNIX_SET_GID 0002000
428#define UNIX_SET_UID 0004000
429
430/* Masks for the above */
431#define UNIX_OTH_MASK 0000007
432#define UNIX_GRP_MASK 0000070
433#define UNIX_USR_MASK 0000700
434#define UNIX_PERM_MASK 0000777
435#define UNIX_EXTRA_MASK 0007000
436#define UNIX_ALL_MASK 0007777
437
438#define SMB_QUERY_FILE_UNIX_LINK 0x201
439#define SMB_SET_FILE_UNIX_LINK 0x201
440#define SMB_SET_FILE_UNIX_HLINK 0x203
441/* SMB_QUERY_POSIX_ACL 0x204 see below */
442#define SMB_QUERY_XATTR 0x205 /* need for non-user XATTRs */
443#define SMB_QUERY_ATTR_FLAGS 0x206 /* chflags, chattr */
444#define SMB_SET_ATTR_FLAGS 0x206
445#define SMB_QUERY_POSIX_PERMISSION 0x207
446/* Only valid for qfileinfo */
447#define SMB_QUERY_POSIX_LOCK 0x208
448/* Only valid for setfileinfo */
449#define SMB_SET_POSIX_LOCK 0x208
450
451/* The set info levels for POSIX path operations. */
452#define SMB_POSIX_PATH_OPEN 0x209
453#define SMB_POSIX_PATH_UNLINK 0x20A
454
455#define SMB_QUERY_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */
456#define SMB_SET_FILE_UNIX_INFO2 0x20B
457
458/* Transact 2 Find First levels */
459#define SMB_FIND_FILE_UNIX 0x202
460
461/*
462 Info level for TRANS2_QFSINFO - returns version of CIFS UNIX extensions, plus
463 64-bits worth of capability fun :-).
464 Use the same info level for TRANS2_SETFSINFO
465*/
466
467#define SMB_QUERY_CIFS_UNIX_INFO 0x200
468#define SMB_SET_CIFS_UNIX_INFO 0x200
469
470/* Returns or sets the following.
471
472 UINT16 major version number
473 UINT16 minor version number
474 LARGE_INTEGER capability bitfield
475
476*/
477
478#define CIFS_UNIX_MAJOR_VERSION 1
479#define CIFS_UNIX_MINOR_VERSION 0
480
481#define CIFS_UNIX_FCNTL_LOCKS_CAP 0x1
482#define CIFS_UNIX_POSIX_ACLS_CAP 0x2
483#define CIFS_UNIX_XATTTR_CAP 0x4 /* for support of other xattr
484 namespaces such as system,
485 security and trusted */
486#define CIFS_UNIX_EXTATTR_CAP 0x8 /* for support of chattr
487 (chflags) and lsattr */
488#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x10 /* Use POSIX pathnames on the wire. */
489#define CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP 0x20 /* We can cope with POSIX open/mkdir/unlink etc. */
490
491
492#define SMB_QUERY_POSIX_FS_INFO 0x201
493
494/* Returns FILE_SYSTEM_POSIX_INFO struct as follows
495 (NB For undefined values return -1 in that field)
496 le32 OptimalTransferSize; bsize on some os, iosize on other os, This
497 is a hint to the client about best size. Server
498 can return -1 if no preference, ie if SMB
499 negotiated size is adequate for optimal
500 read/write performance
501 le32 BlockSize; (often 512 bytes) NB: BlockSize * TotalBlocks = disk space
502 le64 TotalBlocks; redundant with other infolevels but easy to ret here
503 le64 BlocksAvail; although redundant, easy to return
504 le64 UserBlocksAvail; bavail
505 le64 TotalFileNodes;
506 le64 FreeFileNodes;
507 le64 FileSysIdentifier; fsid
508 (NB statfs field Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call)
509 (NB statfs field flags can come from FILE_SYSTEM_DEVICE_INFO call)
510*/
511
512/* ... more as we think of them :-). */
513
514/* SMB POSIX ACL definitions. */
515/* Wire format is (all little endian) :
516
517[2 bytes] - Version number.
518[2 bytes] - Number of ACE entries to follow.
519[2 bytes] - Number of default ACE entries to follow.
520-------------------------------------
521^
522|
523ACE entries
524|
525v
526-------------------------------------
527^
528|
529Default ACE entries
530|
531v
532-------------------------------------
533
534Where an ACE entry looks like :
535
536[1 byte] - Entry type.
537
538Entry types are :
539
540ACL_USER_OBJ 0x01
541ACL_USER 0x02
542ACL_GROUP_OBJ 0x04
543ACL_GROUP 0x08
544ACL_MASK 0x10
545ACL_OTHER 0x20
546
547[1 byte] - permissions (perm_t)
548
549perm_t types are :
550
551ACL_READ 0x04
552ACL_WRITE 0x02
553ACL_EXECUTE 0x01
554
555[8 bytes] - uid/gid to apply this permission to.
556
557In the same format as the uid/gid fields in the other
558UNIX extensions definitions. Use 0xFFFFFFFFFFFFFFFF for
559the MASK and OTHER entry types.
560
561If the Number of ACE entries for either file or default ACE's
562is set to 0xFFFF this means ignore this kind of ACE (and the
563number of entries sent will be zero.
564
565*/
566
567/* The query/set info levels for POSIX ACLs. */
568#define SMB_QUERY_POSIX_ACL 0x204
569#define SMB_SET_POSIX_ACL 0x204
570
571/* Current on the wire ACL version. */
572#define SMB_POSIX_ACL_VERSION 1
573
574/* ACE entry type. */
575#define SMB_POSIX_ACL_USER_OBJ 0x01
576#define SMB_POSIX_ACL_USER 0x02
577#define SMB_POSIX_ACL_GROUP_OBJ 0x04
578#define SMB_POSIX_ACL_GROUP 0x08
579#define SMB_POSIX_ACL_MASK 0x10
580#define SMB_POSIX_ACL_OTHER 0x20
581
582/* perm_t types. */
583#define SMB_POSIX_ACL_READ 0x04
584#define SMB_POSIX_ACL_WRITE 0x02
585#define SMB_POSIX_ACL_EXECUTE 0x01
586
587#define SMB_POSIX_ACL_HEADER_SIZE 6
588#define SMB_POSIX_ACL_ENTRY_SIZE 10
589
590#define SMB_POSIX_IGNORE_ACE_ENTRIES 0xFFFF
591
592/* Definition of parameter block of SMB_SET_POSIX_LOCK */
593/*
594 [2 bytes] lock_type - 0 = Read, 1 = Write, 2 = Unlock
595 [2 bytes] lock_flags - 1 = Wait (only valid for setlock)
596 [4 bytes] pid = locking context.
597 [8 bytes] start = unsigned 64 bits.
598 [8 bytes] length = unsigned 64 bits.
599*/
600
601#define POSIX_LOCK_TYPE_OFFSET 0
602#define POSIX_LOCK_FLAGS_OFFSET 2
603#define POSIX_LOCK_PID_OFFSET 4
604#define POSIX_LOCK_START_OFFSET 8
605#define POSIX_LOCK_LEN_OFFSET 16
606#define POSIX_LOCK_DATA_SIZE 24
607
608#define POSIX_LOCK_FLAG_NOWAIT 0
609#define POSIX_LOCK_FLAG_WAIT 1
610
611#define POSIX_LOCK_TYPE_READ 0
612#define POSIX_LOCK_TYPE_WRITE 1
613#define POSIX_LOCK_TYPE_UNLOCK 2
614
615/* SMB_POSIX_PATH_OPEN "open_mode" definitions. */
616#define SMB_O_RDONLY 0x1
617#define SMB_O_WRONLY 0x2
618#define SMB_O_RDWR 0x4
619
620#define SMB_ACCMODE 0x7
621
622#define SMB_O_CREAT 0x10
623#define SMB_O_EXCL 0x20
624#define SMB_O_TRUNC 0x40
625#define SMB_O_APPEND 0x80
626#define SMB_O_SYNC 0x100
627#define SMB_O_DIRECTORY 0x200
628#define SMB_O_NOFOLLOW 0x400
629#define SMB_O_DIRECT 0x800
630
631/* Definition of request parameter block for SMB_POSIX_PATH_OPEN */
632/*
633 [4 bytes] flags (as smb_ntcreate_Flags).
634 [4 bytes] open_mode
635 [4 bytes] mode_t - same encoding as "Standard UNIX permissions" above.
636 [2 bytes] ret_info_level - optimization. Info level to be returned.
637*/
638
639/* Definition of reply data block for SMB_POSIX_PATH_OPEN */
640
641#define SMB_NO_INFO_LEVEL_RETURNED 0xFFFF
642
643/*
644 [2 bytes] reply info level - as requested or 0xFFFF if not available.
645 [n bytes] - info level reply - if available.
646*/
647
648#endif
Note: See TracBrowser for help on using the repository browser.