aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifspdu.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifspdu.h')
-rw-r--r--fs/cifs/cifspdu.h84
1 files changed, 61 insertions, 23 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 068ef51edbf7..7d9505491b16 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 */
@@ -795,6 +796,8 @@ typedef struct smb_com_openx_rsp {
795 __u16 ByteCount; 796 __u16 ByteCount;
796} __attribute__((packed)) OPENX_RSP; 797} __attribute__((packed)) OPENX_RSP;
797 798
799/* For encoding of POSIX Open Request - see trans2 function 0x209 data struct */
800
798/* Legacy write request for older servers */ 801/* Legacy write request for older servers */
799typedef struct smb_com_writex_req { 802typedef struct smb_com_writex_req {
800 struct smb_hdr hdr; /* wct = 12 */ 803 struct smb_hdr hdr; /* wct = 12 */
@@ -1352,11 +1355,13 @@ struct smb_t2_rsp {
1352#define SMB_QUERY_FILE_UNIX_BASIC 0x200 1355#define SMB_QUERY_FILE_UNIX_BASIC 0x200
1353#define SMB_QUERY_FILE_UNIX_LINK 0x201 1356#define SMB_QUERY_FILE_UNIX_LINK 0x201
1354#define SMB_QUERY_POSIX_ACL 0x204 1357#define SMB_QUERY_POSIX_ACL 0x204
1355#define SMB_QUERY_XATTR 0x205 1358#define SMB_QUERY_XATTR 0x205 /* e.g. system EA name space */
1356#define SMB_QUERY_ATTR_FLAGS 0x206 /* append,immutable etc. */ 1359#define SMB_QUERY_ATTR_FLAGS 0x206 /* append,immutable etc. */
1357#define SMB_QUERY_POSIX_PERMISSION 0x207 1360#define SMB_QUERY_POSIX_PERMISSION 0x207
1358#define SMB_QUERY_POSIX_LOCK 0x208 1361#define SMB_QUERY_POSIX_LOCK 0x208
1359/* #define SMB_POSIX_OPEN 0x209 */ 1362/* #define SMB_POSIX_OPEN 0x209 */
1363/* #define SMB_POSIX_UNLINK 0x20a */
1364#define SMB_QUERY_FILE__UNIX_INFO2 0x20b
1360#define SMB_QUERY_FILE_INTERNAL_INFO 0x3ee 1365#define SMB_QUERY_FILE_INTERNAL_INFO 0x3ee
1361#define SMB_QUERY_FILE_ACCESS_INFO 0x3f0 1366#define SMB_QUERY_FILE_ACCESS_INFO 0x3f0
1362#define SMB_QUERY_FILE_NAME_INFO2 0x3f1 /* 0x30 bytes */ 1367#define SMB_QUERY_FILE_NAME_INFO2 0x3f1 /* 0x30 bytes */
@@ -1377,8 +1382,10 @@ struct smb_t2_rsp {
1377#define SMB_SET_ATTR_FLAGS 0x206 /* append, immutable etc. */ 1382#define SMB_SET_ATTR_FLAGS 0x206 /* append, immutable etc. */
1378#define SMB_SET_POSIX_LOCK 0x208 1383#define SMB_SET_POSIX_LOCK 0x208
1379#define SMB_POSIX_OPEN 0x209 1384#define SMB_POSIX_OPEN 0x209
1385#define SMB_POSIX_UNLINK 0x20a
1386#define SMB_SET_FILE_UNIX_INFO2
1380#define SMB_SET_FILE_BASIC_INFO2 0x3ec 1387#define SMB_SET_FILE_BASIC_INFO2 0x3ec
1381#define SMB_SET_FILE_RENAME_INFORMATION 0x3f2 /* BB check if qpathinfo level too */ 1388#define SMB_SET_FILE_RENAME_INFORMATION 0x3f2 /* BB check if qpathinfo too */
1382#define SMB_FILE_ALL_INFO2 0x3fa 1389#define SMB_FILE_ALL_INFO2 0x3fa
1383#define SMB_SET_FILE_ALLOCATION_INFO2 0x3fb 1390#define SMB_SET_FILE_ALLOCATION_INFO2 0x3fb
1384#define SMB_SET_FILE_END_OF_FILE_INFO2 0x3fc 1391#define SMB_SET_FILE_END_OF_FILE_INFO2 0x3fc
@@ -1428,7 +1435,7 @@ typedef struct smb_com_transaction2_qpi_rsp {
1428 struct smb_hdr hdr; /* wct = 10 + SetupCount */ 1435 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1429 struct trans2_resp t2; 1436 struct trans2_resp t2;
1430 __u16 ByteCount; 1437 __u16 ByteCount;
1431 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */ 1438 __u16 Reserved2; /* parameter word is present for infolevels > 100 */
1432} __attribute__((packed)) TRANSACTION2_QPI_RSP; 1439} __attribute__((packed)) TRANSACTION2_QPI_RSP;
1433 1440
1434typedef struct smb_com_transaction2_spi_req { 1441typedef struct smb_com_transaction2_spi_req {
@@ -1461,7 +1468,7 @@ typedef struct smb_com_transaction2_spi_rsp {
1461 struct smb_hdr hdr; /* wct = 10 + SetupCount */ 1468 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1462 struct trans2_resp t2; 1469 struct trans2_resp t2;
1463 __u16 ByteCount; 1470 __u16 ByteCount;
1464 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */ 1471 __u16 Reserved2; /* parameter word is present for infolevels > 100 */
1465} __attribute__((packed)) TRANSACTION2_SPI_RSP; 1472} __attribute__((packed)) TRANSACTION2_SPI_RSP;
1466 1473
1467struct set_file_rename { 1474struct set_file_rename {
@@ -1627,6 +1634,7 @@ typedef struct smb_com_transaction2_fnext_rsp_parms {
1627#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105 1634#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
1628#define SMB_QUERY_CIFS_UNIX_INFO 0x200 1635#define SMB_QUERY_CIFS_UNIX_INFO 0x200
1629#define SMB_QUERY_POSIX_FS_INFO 0x201 1636#define SMB_QUERY_POSIX_FS_INFO 0x201
1637#define SMB_QUERY_POSIX_WHO_AM_I 0x202
1630#define SMB_QUERY_LABEL_INFO 0x3ea 1638#define SMB_QUERY_LABEL_INFO 0x3ea
1631#define SMB_QUERY_FS_QUOTA_INFO 0x3ee 1639#define SMB_QUERY_FS_QUOTA_INFO 0x3ee
1632#define SMB_QUERY_FS_FULL_SIZE_INFO 0x3ef 1640#define SMB_QUERY_FS_FULL_SIZE_INFO 0x3ef
@@ -1659,9 +1667,21 @@ typedef struct smb_com_transaction_qfsi_rsp {
1659 struct smb_hdr hdr; /* wct = 10 + SetupCount */ 1667 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1660 struct trans2_resp t2; 1668 struct trans2_resp t2;
1661 __u16 ByteCount; 1669 __u16 ByteCount;
1662 __u8 Pad; /* may be three bytes *//* followed by data area */ 1670 __u8 Pad; /* may be three bytes? *//* followed by data area */
1663} __attribute__((packed)) TRANSACTION2_QFSI_RSP; 1671} __attribute__((packed)) TRANSACTION2_QFSI_RSP;
1664 1672
1673typedef struct whoami_rsp_data { /* Query level 0x202 */
1674 __u32 flags; /* 0 = Authenticated user 1 = GUEST */
1675 __u32 mask; /* which flags bits server understands ie 0x0001 */
1676 __u64 unix_user_id;
1677 __u64 unix_user_gid;
1678 __u32 number_of_supplementary_gids; /* may be zero */
1679 __u32 number_of_sids; /* may be zero */
1680 __u32 length_of_sid_array; /* in bytes - may be zero */
1681 __u32 pad; /* reserved - MBZ */
1682 /* __u64 gid_array[0]; */ /* may be empty */
1683 /* __u8 * psid_list */ /* may be empty */
1684} __attribute__((packed)) WHOAMI_RSP_DATA;
1665 1685
1666/* SETFSInfo Levels */ 1686/* SETFSInfo Levels */
1667#define SMB_SET_CIFS_UNIX_INFO 0x200 1687#define SMB_SET_CIFS_UNIX_INFO 0x200
@@ -1858,8 +1878,11 @@ typedef struct {
1858#define CIFS_UNIX_XATTR_CAP 0x00000004 /* support new namespace */ 1878#define CIFS_UNIX_XATTR_CAP 0x00000004 /* support new namespace */
1859#define CIFS_UNIX_EXTATTR_CAP 0x00000008 /* support chattr/chflag */ 1879#define CIFS_UNIX_EXTATTR_CAP 0x00000008 /* support chattr/chflag */
1860#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x00000010 /* Allow POSIX path chars */ 1880#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x00000010 /* Allow POSIX path chars */
1881#define CIFS_UNIX_POSIX_PATH_OPS_CAP 0x00000020 /* Allow new POSIX path based
1882 calls including posix open
1883 and posix unlink */
1861#ifdef CONFIG_CIFS_POSIX 1884#ifdef CONFIG_CIFS_POSIX
1862#define CIFS_UNIX_CAP_MASK 0x0000001b 1885#define CIFS_UNIX_CAP_MASK 0x0000003b
1863#else 1886#else
1864#define CIFS_UNIX_CAP_MASK 0x00000013 1887#define CIFS_UNIX_CAP_MASK 0x00000013
1865#endif /* CONFIG_CIFS_POSIX */ 1888#endif /* CONFIG_CIFS_POSIX */
@@ -1946,7 +1969,7 @@ typedef struct { /* data block encoding of response to level 263 QPathInfo */
1946 __le32 AlignmentRequirement; 1969 __le32 AlignmentRequirement;
1947 __le32 FileNameLength; 1970 __le32 FileNameLength;
1948 char FileName[1]; 1971 char FileName[1];
1949} __attribute__((packed)) FILE_ALL_INFO; /* level 0x107 QPathInfo */ 1972} __attribute__((packed)) FILE_ALL_INFO; /* level 0x107 QPathInfo */
1950 1973
1951/* defines for enumerating possible values of the Unix type field below */ 1974/* defines for enumerating possible values of the Unix type field below */
1952#define UNIX_FILE 0 1975#define UNIX_FILE 0
@@ -1970,11 +1993,11 @@ typedef struct {
1970 __u64 UniqueId; 1993 __u64 UniqueId;
1971 __le64 Permissions; 1994 __le64 Permissions;
1972 __le64 Nlinks; 1995 __le64 Nlinks;
1973} __attribute__((packed)) FILE_UNIX_BASIC_INFO; /* level 0x200 QPathInfo */ 1996} __attribute__((packed)) FILE_UNIX_BASIC_INFO; /* level 0x200 QPathInfo */
1974 1997
1975typedef struct { 1998typedef struct {
1976 char LinkDest[1]; 1999 char LinkDest[1];
1977} __attribute__((packed)) FILE_UNIX_LINK_INFO; /* level 0x201 QPathInfo */ 2000} __attribute__((packed)) FILE_UNIX_LINK_INFO; /* level 0x201 QPathInfo */
1978 2001
1979/* The following three structures are needed only for 2002/* The following three structures are needed only for
1980 setting time to NT4 and some older servers via 2003 setting time to NT4 and some older servers via
@@ -2011,7 +2034,7 @@ typedef struct {
2011 __le64 ChangeTime; 2034 __le64 ChangeTime;
2012 __le32 Attributes; 2035 __le32 Attributes;
2013 __u32 Pad; 2036 __u32 Pad;
2014} __attribute__((packed)) FILE_BASIC_INFO; /* size info, level 0x101 */ 2037} __attribute__((packed)) FILE_BASIC_INFO; /* size info, level 0x101 */
2015 2038
2016struct file_allocation_info { 2039struct file_allocation_info {
2017 __le64 AllocationSize; /* Note old Samba srvr rounds this up too much */ 2040 __le64 AllocationSize; /* Note old Samba srvr rounds this up too much */
@@ -2020,7 +2043,7 @@ struct file_allocation_info {
2020 2043
2021struct file_end_of_file_info { 2044struct file_end_of_file_info {
2022 __le64 FileSize; /* offset to end of file */ 2045 __le64 FileSize; /* offset to end of file */
2023} __attribute__((packed)); /* size info, level 0x104 for set, 0x106 for query */ 2046} __attribute__((packed)); /* size info, level 0x104 for set, 0x106 for query */
2024 2047
2025struct file_alt_name_info { 2048struct file_alt_name_info {
2026 __u8 alt_name[1]; 2049 __u8 alt_name[1];
@@ -2075,6 +2098,19 @@ struct cifs_posix_acl { /* access conrol list (ACL) */
2075 2098
2076/* end of POSIX ACL definitions */ 2099/* end of POSIX ACL definitions */
2077 2100
2101typedef struct {
2102 __u32 OpenFlags; /* same as NT CreateX */
2103 __u32 PosixOpenFlags;
2104 __u32 Mode;
2105 __u16 Level; /* reply level requested (see QPathInfo levels) */
2106 __u16 Pad; /* reserved - MBZ */
2107} __attribute__((packed)) OPEN_PSX_REQ; /* level 0x209 SetPathInfo data */
2108
2109typedef struct {
2110 /* reply varies based on requested level */
2111} __attribute__((packed)) OPEN_PSX_RSP; /* level 0x209 SetPathInfo data */
2112
2113
2078struct file_internal_info { 2114struct file_internal_info {
2079 __u64 UniqueId; /* inode number */ 2115 __u64 UniqueId; /* inode number */
2080} __attribute__((packed)); /* level 0x3ee */ 2116} __attribute__((packed)); /* level 0x3ee */
@@ -2238,7 +2274,8 @@ struct data_blob {
2238 1) PosixCreateX - to set and return the mode, inode#, device info and 2274 1) PosixCreateX - to set and return the mode, inode#, device info and
2239 perhaps add a CreateDevice - to create Pipes and other special .inodes 2275 perhaps add a CreateDevice - to create Pipes and other special .inodes
2240 Also note POSIX open flags 2276 Also note POSIX open flags
2241 2) Close - to return the last write time to do cache across close more safely 2277 2) Close - to return the last write time to do cache across close
2278 more safely
2242 3) FindFirst return unique inode number - what about resume key, two 2279 3) FindFirst return unique inode number - what about resume key, two
2243 forms short (matches readdir) and full (enough info to cache inodes) 2280 forms short (matches readdir) and full (enough info to cache inodes)
2244 4) Mkdir - set mode 2281 4) Mkdir - set mode
@@ -2273,7 +2310,8 @@ struct data_blob {
2273 TRANSACTION2 (18 cases) 2310 TRANSACTION2 (18 cases)
2274 SMB_SET_FILE_END_OF_FILE_INFO2 SMB_SET_PATH_END_OF_FILE_INFO2 2311 SMB_SET_FILE_END_OF_FILE_INFO2 SMB_SET_PATH_END_OF_FILE_INFO2
2275 (BB verify that never need to set allocation size) 2312 (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?) 2313 SMB_SET_FILE_BASIC_INFO2 (setting times - BB can it be done via
2314 Unix ext?)
2277 2315
2278 COPY (note support for copy across directories) - FUTURE, OPTIONAL 2316 COPY (note support for copy across directories) - FUTURE, OPTIONAL
2279 setting/getting OS/2 EAs - FUTURE (BB can this handle 2317 setting/getting OS/2 EAs - FUTURE (BB can this handle
@@ -2293,13 +2331,13 @@ struct data_blob {
2293 T2 QUERY_PATH_INFO (SMB_QUERY_FILE_UNIX_BASIC) - BB check for missing inode fields 2331 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 2332 Actually need QUERY_FILE_UNIX_INFO since has inode num
2295 BB what about a) blksize/blkbits/blocks 2333 BB what about a) blksize/blkbits/blocks
2296 b) i_version 2334 b) i_version
2297 c) i_rdev 2335 c) i_rdev
2298 d) notify mask? 2336 d) notify mask?
2299 e) generation 2337 e) generation
2300 f) size_seqcount 2338 f) size_seqcount
2301 T2 FIND_FIRST/FIND_NEXT FIND_FILE_UNIX 2339 T2 FIND_FIRST/FIND_NEXT FIND_FILE_UNIX
2302 TRANS2_GET_DFS_REFERRAL - OPTIONAL but recommended 2340 TRANS2_GET_DFS_REFERRAL - OPTIONAL but recommended
2303 T2_QFS_INFO QueryDevice/AttributeInfo - OPTIONAL 2341 T2_QFS_INFO QueryDevice/AttributeInfo - OPTIONAL
2304 2342
2305 2343
@@ -2338,7 +2376,7 @@ typedef struct file_xattr_info {
2338 __u32 xattr_value_len; 2376 __u32 xattr_value_len;
2339 char xattr_name[0]; 2377 char xattr_name[0];
2340 /* followed by xattr_value[xattr_value_len], no pad */ 2378 /* followed by xattr_value[xattr_value_len], no pad */
2341} __attribute__((packed)) FILE_XATTR_INFO; /* extended attribute, info level 0x205 */ 2379} __attribute__((packed)) FILE_XATTR_INFO; /* extended attribute, info level 0x205 */
2342 2380
2343 2381
2344/* flags for chattr command */ 2382/* flags for chattr command */