aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifspdu.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-02-06 19:29:46 -0500
committerSteve French <sfrench@us.ibm.com>2007-02-06 19:29:46 -0500
commit87f440e70e07dace7db130f2f9fcea3f132aad8f (patch)
treee050e5e8eafc64d39ab653f43dfdce7fc92ce1cc /fs/cifs/cifspdu.h
parenta850790f6c903f1a89d0dbf953946d231df3fe6b (diff)
[CIFS] Additional POSIX CIFS Extensions infolevels
also includes cleanup of whitespace/80 columns Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifspdu.h')
-rw-r--r--fs/cifs/cifspdu.h69
1 files changed, 46 insertions, 23 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 068ef51edbf7..2920ea0527f5 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * fs/cifs/cifspdu.h 2 * fs/cifs/cifspdu.h
3 * 3 *
4 * Copyright (c) International Business Machines Corp., 2002,2005 4 * Copyright (c) International Business Machines Corp., 2002,2007
5 * Author(s): Steve French (sfrench@us.ibm.com) 5 * Author(s): Steve French (sfrench@us.ibm.com)
6 * 6 *
7 * This library is free software; you can redistribute it and/or modify 7 * This library is free software; you can redistribute it and/or modify
@@ -544,7 +544,8 @@ typedef union smb_com_session_setup_andx {
544/* unsigned char * NativeOS; */ 544/* unsigned char * NativeOS; */
545/* unsigned char * NativeLanMan; */ 545/* unsigned char * NativeLanMan; */
546/* unsigned char * PrimaryDomain; */ 546/* unsigned char * PrimaryDomain; */
547 } __attribute__((packed)) resp; /* NTLM response with or without extended sec*/ 547 } __attribute__((packed)) resp; /* NTLM response
548 (with or without extended sec) */
548 549
549 struct { /* request format */ 550 struct { /* request format */
550 struct smb_hdr hdr; /* wct = 10 */ 551 struct smb_hdr hdr; /* wct = 10 */
@@ -1352,11 +1353,13 @@ struct smb_t2_rsp {
1352#define SMB_QUERY_FILE_UNIX_BASIC 0x200 1353#define SMB_QUERY_FILE_UNIX_BASIC 0x200
1353#define SMB_QUERY_FILE_UNIX_LINK 0x201 1354#define SMB_QUERY_FILE_UNIX_LINK 0x201
1354#define SMB_QUERY_POSIX_ACL 0x204 1355#define SMB_QUERY_POSIX_ACL 0x204
1355#define SMB_QUERY_XATTR 0x205 1356#define SMB_QUERY_XATTR 0x205 /* e.g. system EA name space */
1356#define SMB_QUERY_ATTR_FLAGS 0x206 /* append,immutable etc. */ 1357#define SMB_QUERY_ATTR_FLAGS 0x206 /* append,immutable etc. */
1357#define SMB_QUERY_POSIX_PERMISSION 0x207 1358#define SMB_QUERY_POSIX_PERMISSION 0x207
1358#define SMB_QUERY_POSIX_LOCK 0x208 1359#define SMB_QUERY_POSIX_LOCK 0x208
1359/* #define SMB_POSIX_OPEN 0x209 */ 1360/* #define SMB_POSIX_OPEN 0x209 */
1361/* #define SMB_POSIX_UNLINK 0x20a */
1362#define SMB_QUERY_FILE__UNIX_INFO2 0x20b
1360#define SMB_QUERY_FILE_INTERNAL_INFO 0x3ee 1363#define SMB_QUERY_FILE_INTERNAL_INFO 0x3ee
1361#define SMB_QUERY_FILE_ACCESS_INFO 0x3f0 1364#define SMB_QUERY_FILE_ACCESS_INFO 0x3f0
1362#define SMB_QUERY_FILE_NAME_INFO2 0x3f1 /* 0x30 bytes */ 1365#define SMB_QUERY_FILE_NAME_INFO2 0x3f1 /* 0x30 bytes */
@@ -1377,8 +1380,10 @@ struct smb_t2_rsp {
1377#define SMB_SET_ATTR_FLAGS 0x206 /* append, immutable etc. */ 1380#define SMB_SET_ATTR_FLAGS 0x206 /* append, immutable etc. */
1378#define SMB_SET_POSIX_LOCK 0x208 1381#define SMB_SET_POSIX_LOCK 0x208
1379#define SMB_POSIX_OPEN 0x209 1382#define SMB_POSIX_OPEN 0x209
1383#define SMB_POSIX_UNLINK 0x20a
1384#define SMB_SET_FILE_UNIX_INFO2
1380#define SMB_SET_FILE_BASIC_INFO2 0x3ec 1385#define SMB_SET_FILE_BASIC_INFO2 0x3ec
1381#define SMB_SET_FILE_RENAME_INFORMATION 0x3f2 /* BB check if qpathinfo level too */ 1386#define SMB_SET_FILE_RENAME_INFORMATION 0x3f2 /* BB check if qpathinfo too */
1382#define SMB_FILE_ALL_INFO2 0x3fa 1387#define SMB_FILE_ALL_INFO2 0x3fa
1383#define SMB_SET_FILE_ALLOCATION_INFO2 0x3fb 1388#define SMB_SET_FILE_ALLOCATION_INFO2 0x3fb
1384#define SMB_SET_FILE_END_OF_FILE_INFO2 0x3fc 1389#define SMB_SET_FILE_END_OF_FILE_INFO2 0x3fc
@@ -1428,7 +1433,7 @@ typedef struct smb_com_transaction2_qpi_rsp {
1428 struct smb_hdr hdr; /* wct = 10 + SetupCount */ 1433 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1429 struct trans2_resp t2; 1434 struct trans2_resp t2;
1430 __u16 ByteCount; 1435 __u16 ByteCount;
1431 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */ 1436 __u16 Reserved2; /* parameter word is present for infolevels > 100 */
1432} __attribute__((packed)) TRANSACTION2_QPI_RSP; 1437} __attribute__((packed)) TRANSACTION2_QPI_RSP;
1433 1438
1434typedef struct smb_com_transaction2_spi_req { 1439typedef struct smb_com_transaction2_spi_req {
@@ -1461,7 +1466,7 @@ typedef struct smb_com_transaction2_spi_rsp {
1461 struct smb_hdr hdr; /* wct = 10 + SetupCount */ 1466 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1462 struct trans2_resp t2; 1467 struct trans2_resp t2;
1463 __u16 ByteCount; 1468 __u16 ByteCount;
1464 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */ 1469 __u16 Reserved2; /* parameter word is present for infolevels > 100 */
1465} __attribute__((packed)) TRANSACTION2_SPI_RSP; 1470} __attribute__((packed)) TRANSACTION2_SPI_RSP;
1466 1471
1467struct set_file_rename { 1472struct set_file_rename {
@@ -1627,6 +1632,7 @@ typedef struct smb_com_transaction2_fnext_rsp_parms {
1627#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105 1632#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
1628#define SMB_QUERY_CIFS_UNIX_INFO 0x200 1633#define SMB_QUERY_CIFS_UNIX_INFO 0x200
1629#define SMB_QUERY_POSIX_FS_INFO 0x201 1634#define SMB_QUERY_POSIX_FS_INFO 0x201
1635#define SMB_QUERY_POSIX_WHO_AM_I 0x202
1630#define SMB_QUERY_LABEL_INFO 0x3ea 1636#define SMB_QUERY_LABEL_INFO 0x3ea
1631#define SMB_QUERY_FS_QUOTA_INFO 0x3ee 1637#define SMB_QUERY_FS_QUOTA_INFO 0x3ee
1632#define SMB_QUERY_FS_FULL_SIZE_INFO 0x3ef 1638#define SMB_QUERY_FS_FULL_SIZE_INFO 0x3ef
@@ -1659,9 +1665,21 @@ typedef struct smb_com_transaction_qfsi_rsp {
1659 struct smb_hdr hdr; /* wct = 10 + SetupCount */ 1665 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1660 struct trans2_resp t2; 1666 struct trans2_resp t2;
1661 __u16 ByteCount; 1667 __u16 ByteCount;
1662 __u8 Pad; /* may be three bytes *//* followed by data area */ 1668 __u8 Pad; /* may be three bytes? *//* followed by data area */
1663} __attribute__((packed)) TRANSACTION2_QFSI_RSP; 1669} __attribute__((packed)) TRANSACTION2_QFSI_RSP;
1664 1670
1671typedef struct whoami_rsp_data { /* Query level 0x202 */
1672 __u32 flags; /* 0 = Authenticated user 1 = GUEST */
1673 __u32 mask; /* which flags bits server understands ie 0x0001 */
1674 __u64 unix_user_id;
1675 __u64 unix_user_gid;
1676 __u32 number_of_supplementary_gids; /* may be zero */
1677 __u32 number_of_sids; /* may be zero */
1678 __u32 length_of_sid_array; /* in bytes - may be zero */
1679 __u32 pad; /* reserved - MBZ */
1680 /* __u64 gid_array[0]; */ /* may be empty */
1681 /* __u8 * psid_list */ /* may be empty */
1682} __attribute__((packed)) WHOAMI_RSP_DATA;
1665 1683
1666/* SETFSInfo Levels */ 1684/* SETFSInfo Levels */
1667#define SMB_SET_CIFS_UNIX_INFO 0x200 1685#define SMB_SET_CIFS_UNIX_INFO 0x200
@@ -1858,8 +1876,11 @@ typedef struct {
1858#define CIFS_UNIX_XATTR_CAP 0x00000004 /* support new namespace */ 1876#define CIFS_UNIX_XATTR_CAP 0x00000004 /* support new namespace */
1859#define CIFS_UNIX_EXTATTR_CAP 0x00000008 /* support chattr/chflag */ 1877#define CIFS_UNIX_EXTATTR_CAP 0x00000008 /* support chattr/chflag */
1860#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x00000010 /* Allow POSIX path chars */ 1878#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x00000010 /* Allow POSIX path chars */
1879#define CIFS_UNIX_POSIX_PATH_OPS_CAP 0x00000020 /* Allow new POSIX path based
1880 calls including posix open
1881 and posix unlink */
1861#ifdef CONFIG_CIFS_POSIX 1882#ifdef CONFIG_CIFS_POSIX
1862#define CIFS_UNIX_CAP_MASK 0x0000001b 1883#define CIFS_UNIX_CAP_MASK 0x0000003b
1863#else 1884#else
1864#define CIFS_UNIX_CAP_MASK 0x00000013 1885#define CIFS_UNIX_CAP_MASK 0x00000013
1865#endif /* CONFIG_CIFS_POSIX */ 1886#endif /* CONFIG_CIFS_POSIX */
@@ -1946,7 +1967,7 @@ typedef struct { /* data block encoding of response to level 263 QPathInfo */
1946 __le32 AlignmentRequirement; 1967 __le32 AlignmentRequirement;
1947 __le32 FileNameLength; 1968 __le32 FileNameLength;
1948 char FileName[1]; 1969 char FileName[1];
1949} __attribute__((packed)) FILE_ALL_INFO; /* level 0x107 QPathInfo */ 1970} __attribute__((packed)) FILE_ALL_INFO; /* level 0x107 QPathInfo */
1950 1971
1951/* defines for enumerating possible values of the Unix type field below */ 1972/* defines for enumerating possible values of the Unix type field below */
1952#define UNIX_FILE 0 1973#define UNIX_FILE 0
@@ -1970,11 +1991,11 @@ typedef struct {
1970 __u64 UniqueId; 1991 __u64 UniqueId;
1971 __le64 Permissions; 1992 __le64 Permissions;
1972 __le64 Nlinks; 1993 __le64 Nlinks;
1973} __attribute__((packed)) FILE_UNIX_BASIC_INFO; /* level 0x200 QPathInfo */ 1994} __attribute__((packed)) FILE_UNIX_BASIC_INFO; /* level 0x200 QPathInfo */
1974 1995
1975typedef struct { 1996typedef struct {
1976 char LinkDest[1]; 1997 char LinkDest[1];
1977} __attribute__((packed)) FILE_UNIX_LINK_INFO; /* level 0x201 QPathInfo */ 1998} __attribute__((packed)) FILE_UNIX_LINK_INFO; /* level 0x201 QPathInfo */
1978 1999
1979/* The following three structures are needed only for 2000/* The following three structures are needed only for
1980 setting time to NT4 and some older servers via 2001 setting time to NT4 and some older servers via
@@ -2011,7 +2032,7 @@ typedef struct {
2011 __le64 ChangeTime; 2032 __le64 ChangeTime;
2012 __le32 Attributes; 2033 __le32 Attributes;
2013 __u32 Pad; 2034 __u32 Pad;
2014} __attribute__((packed)) FILE_BASIC_INFO; /* size info, level 0x101 */ 2035} __attribute__((packed)) FILE_BASIC_INFO; /* size info, level 0x101 */
2015 2036
2016struct file_allocation_info { 2037struct file_allocation_info {
2017 __le64 AllocationSize; /* Note old Samba srvr rounds this up too much */ 2038 __le64 AllocationSize; /* Note old Samba srvr rounds this up too much */
@@ -2020,7 +2041,7 @@ struct file_allocation_info {
2020 2041
2021struct file_end_of_file_info { 2042struct file_end_of_file_info {
2022 __le64 FileSize; /* offset to end of file */ 2043 __le64 FileSize; /* offset to end of file */
2023} __attribute__((packed)); /* size info, level 0x104 for set, 0x106 for query */ 2044} __attribute__((packed)); /* size info, level 0x104 for set, 0x106 for query */
2024 2045
2025struct file_alt_name_info { 2046struct file_alt_name_info {
2026 __u8 alt_name[1]; 2047 __u8 alt_name[1];
@@ -2238,7 +2259,8 @@ struct data_blob {
2238 1) PosixCreateX - to set and return the mode, inode#, device info and 2259 1) PosixCreateX - to set and return the mode, inode#, device info and
2239 perhaps add a CreateDevice - to create Pipes and other special .inodes 2260 perhaps add a CreateDevice - to create Pipes and other special .inodes
2240 Also note POSIX open flags 2261 Also note POSIX open flags
2241 2) Close - to return the last write time to do cache across close more safely 2262 2) Close - to return the last write time to do cache across close
2263 more safely
2242 3) FindFirst return unique inode number - what about resume key, two 2264 3) FindFirst return unique inode number - what about resume key, two
2243 forms short (matches readdir) and full (enough info to cache inodes) 2265 forms short (matches readdir) and full (enough info to cache inodes)
2244 4) Mkdir - set mode 2266 4) Mkdir - set mode
@@ -2273,7 +2295,8 @@ struct data_blob {
2273 TRANSACTION2 (18 cases) 2295 TRANSACTION2 (18 cases)
2274 SMB_SET_FILE_END_OF_FILE_INFO2 SMB_SET_PATH_END_OF_FILE_INFO2 2296 SMB_SET_FILE_END_OF_FILE_INFO2 SMB_SET_PATH_END_OF_FILE_INFO2
2275 (BB verify that never need to set allocation size) 2297 (BB verify that never need to set allocation size)
2276 SMB_SET_FILE_BASIC_INFO2 (setting times - BB can it be done via Unix ext?) 2298 SMB_SET_FILE_BASIC_INFO2 (setting times - BB can it be done via
2299 Unix ext?)
2277 2300
2278 COPY (note support for copy across directories) - FUTURE, OPTIONAL 2301 COPY (note support for copy across directories) - FUTURE, OPTIONAL
2279 setting/getting OS/2 EAs - FUTURE (BB can this handle 2302 setting/getting OS/2 EAs - FUTURE (BB can this handle
@@ -2293,13 +2316,13 @@ struct data_blob {
2293 T2 QUERY_PATH_INFO (SMB_QUERY_FILE_UNIX_BASIC) - BB check for missing inode fields 2316 T2 QUERY_PATH_INFO (SMB_QUERY_FILE_UNIX_BASIC) - BB check for missing inode fields
2294 Actually need QUERY_FILE_UNIX_INFO since has inode num 2317 Actually need QUERY_FILE_UNIX_INFO since has inode num
2295 BB what about a) blksize/blkbits/blocks 2318 BB what about a) blksize/blkbits/blocks
2296 b) i_version 2319 b) i_version
2297 c) i_rdev 2320 c) i_rdev
2298 d) notify mask? 2321 d) notify mask?
2299 e) generation 2322 e) generation
2300 f) size_seqcount 2323 f) size_seqcount
2301 T2 FIND_FIRST/FIND_NEXT FIND_FILE_UNIX 2324 T2 FIND_FIRST/FIND_NEXT FIND_FILE_UNIX
2302 TRANS2_GET_DFS_REFERRAL - OPTIONAL but recommended 2325 TRANS2_GET_DFS_REFERRAL - OPTIONAL but recommended
2303 T2_QFS_INFO QueryDevice/AttributeInfo - OPTIONAL 2326 T2_QFS_INFO QueryDevice/AttributeInfo - OPTIONAL
2304 2327
2305 2328
@@ -2338,7 +2361,7 @@ typedef struct file_xattr_info {
2338 __u32 xattr_value_len; 2361 __u32 xattr_value_len;
2339 char xattr_name[0]; 2362 char xattr_name[0];
2340 /* followed by xattr_value[xattr_value_len], no pad */ 2363 /* followed by xattr_value[xattr_value_len], no pad */
2341} __attribute__((packed)) FILE_XATTR_INFO; /* extended attribute, info level 0x205 */ 2364} __attribute__((packed)) FILE_XATTR_INFO; /* extended attribute, info level 0x205 */
2342 2365
2343 2366
2344/* flags for chattr command */ 2367/* flags for chattr command */