blob: e0ff9b56cc4ca866d7722f02322fc30252529c77 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * fs/cifs/cifspdu.h
3 *
Steve Frenchbf820672005-12-01 22:32:42 -08004 * Copyright (c) International Business Machines Corp., 2002,2005
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 * Author(s): Steve French (sfrench@us.ibm.com)
6 *
7 * This library is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation; either version 2.1 of the License, or
10 * (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15 * the GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software
Steve French39798772006-05-31 22:40:51 +000019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 */
21
22#ifndef _CIFSPDU_H
23#define _CIFSPDU_H
24
25#include <net/sock.h>
26
Steve French39798772006-05-31 22:40:51 +000027#ifdef CONFIG_CIFS_WEAK_PW_HASH
28#define LANMAN_PROT 0
29#define CIFS_PROT 1
30#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#define CIFS_PROT 0
Steve French39798772006-05-31 22:40:51 +000032#endif
33#define POSIX_PROT CIFS_PROT+1
34#define BAD_PROT 0xFFFF
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
36/* SMB command codes */
37/* Some commands have minimal (wct=0,bcc=0), or uninteresting, responses
38 (ie which include no useful data other than the SMB error code itself).
39 Knowing this helps avoid response buffer allocations and copy in some cases */
40#define SMB_COM_CREATE_DIRECTORY 0x00 /* trivial response */
41#define SMB_COM_DELETE_DIRECTORY 0x01 /* trivial response */
42#define SMB_COM_CLOSE 0x04 /* triv req/rsp, timestamp ignored */
43#define SMB_COM_DELETE 0x06 /* trivial response */
44#define SMB_COM_RENAME 0x07 /* trivial response */
Steve French6b8edfe2005-08-23 20:26:03 -070045#define SMB_COM_QUERY_INFORMATION 0x08 /* aka getattr */
Linus Torvalds1da177e2005-04-16 15:20:36 -070046#define SMB_COM_SETATTR 0x09 /* trivial response */
47#define SMB_COM_LOCKING_ANDX 0x24 /* trivial response */
48#define SMB_COM_COPY 0x29 /* trivial rsp, fail filename ignrd*/
Steve Frencha9d02ad2005-08-24 23:06:05 -070049#define SMB_COM_OPEN_ANDX 0x2D /* Legacy open for old servers */
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#define SMB_COM_READ_ANDX 0x2E
51#define SMB_COM_WRITE_ANDX 0x2F
52#define SMB_COM_TRANSACTION2 0x32
53#define SMB_COM_TRANSACTION2_SECONDARY 0x33
54#define SMB_COM_FIND_CLOSE2 0x34 /* trivial response */
55#define SMB_COM_TREE_DISCONNECT 0x71 /* trivial response */
56#define SMB_COM_NEGOTIATE 0x72
57#define SMB_COM_SESSION_SETUP_ANDX 0x73
58#define SMB_COM_LOGOFF_ANDX 0x74 /* trivial response */
59#define SMB_COM_TREE_CONNECT_ANDX 0x75
60#define SMB_COM_NT_TRANSACT 0xA0
61#define SMB_COM_NT_TRANSACT_SECONDARY 0xA1
62#define SMB_COM_NT_CREATE_ANDX 0xA2
Steve Frenchff5dbd92005-08-24 17:10:36 -070063#define SMB_COM_NT_CANCEL 0xA4 /* no response */
Linus Torvalds1da177e2005-04-16 15:20:36 -070064#define SMB_COM_NT_RENAME 0xA5 /* trivial response */
65
66/* Transact2 subcommand codes */
67#define TRANS2_OPEN 0x00
68#define TRANS2_FIND_FIRST 0x01
69#define TRANS2_FIND_NEXT 0x02
70#define TRANS2_QUERY_FS_INFORMATION 0x03
Jeremy Allisonac670552005-06-22 17:26:35 -070071#define TRANS2_SET_FS_INFORMATION 0x04
Linus Torvalds1da177e2005-04-16 15:20:36 -070072#define TRANS2_QUERY_PATH_INFORMATION 0x05
73#define TRANS2_SET_PATH_INFORMATION 0x06
74#define TRANS2_QUERY_FILE_INFORMATION 0x07
75#define TRANS2_SET_FILE_INFORMATION 0x08
76#define TRANS2_GET_DFS_REFERRAL 0x10
77#define TRANS2_REPORT_DFS_INCOSISTENCY 0x11
78
79/* NT Transact subcommand codes */
80#define NT_TRANSACT_CREATE 0x01
81#define NT_TRANSACT_IOCTL 0x02
82#define NT_TRANSACT_SET_SECURITY_DESC 0x03
83#define NT_TRANSACT_NOTIFY_CHANGE 0x04
84#define NT_TRANSACT_RENAME 0x05
85#define NT_TRANSACT_QUERY_SECURITY_DESC 0x06
86#define NT_TRANSACT_GET_USER_QUOTA 0x07
87#define NT_TRANSACT_SET_USER_QUOTA 0x08
88
Steve Frenchec637e32005-12-12 20:53:18 -080089#define MAX_CIFS_SMALL_BUFFER_SIZE 448 /* big enough for most */
90/* future chained NTCreateXReadX bigger, but for time being NTCreateX biggest */
91/* among the requests (NTCreateX response is bigger with wct of 34) */
92#define MAX_CIFS_HDR_SIZE 0x58 /* 4 len + 32 hdr + (2*24 wct) + 2 bct + 2 pad */
93#define CIFS_SMALL_PATH 120 /* allows for (448-88)/3 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070094
95/* internal cifs vfs structures */
96/*****************************************************************
97 * All constants go here
98 *****************************************************************
99 */
100
101/*
102 * Starting value for maximum SMB size negotiation
103 */
104#define CIFS_MAX_MSGSIZE (4*4096)
105
106/*
107 * Size of encrypted user password in bytes
108 */
109#define CIFS_ENCPWD_SIZE (16)
110
111/*
112 * Size of the crypto key returned on the negotiate SMB in bytes
113 */
114#define CIFS_CRYPTO_KEY_SIZE (8)
115
116/*
117 * Size of the session key (crypto key encrypted with the password
118 */
119#define CIFS_SESSION_KEY_SIZE (24)
120
121/*
122 * Maximum user name length
123 */
124#define CIFS_UNLEN (20)
125
126/*
127 * Flags on SMB open
128 */
129#define SMBOPEN_WRITE_THROUGH 0x4000
130#define SMBOPEN_DENY_ALL 0x0010
131#define SMBOPEN_DENY_WRITE 0x0020
132#define SMBOPEN_DENY_READ 0x0030
133#define SMBOPEN_DENY_NONE 0x0040
134#define SMBOPEN_READ 0x0000
135#define SMBOPEN_WRITE 0x0001
136#define SMBOPEN_READWRITE 0x0002
137#define SMBOPEN_EXECUTE 0x0003
138
139#define SMBOPEN_OCREATE 0x0010
140#define SMBOPEN_OTRUNC 0x0002
141#define SMBOPEN_OAPPEND 0x0001
142
143/*
144 * SMB flag definitions
145 */
Steve French0753ca72005-10-27 13:55:12 -0700146#define SMBFLG_EXTD_LOCK 0x01 /* server supports lock-read write-unlock smb */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147#define SMBFLG_RCV_POSTED 0x02 /* obsolete */
148#define SMBFLG_RSVD 0x04
Steve French0753ca72005-10-27 13:55:12 -0700149#define SMBFLG_CASELESS 0x08 /* all pathnames treated as caseless (off
150 implies case sensitive file handling request) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151#define SMBFLG_CANONICAL_PATH_FORMAT 0x10 /* obsolete */
152#define SMBFLG_OLD_OPLOCK 0x20 /* obsolete */
153#define SMBFLG_OLD_OPLOCK_NOTIFY 0x40 /* obsolete */
154#define SMBFLG_RESPONSE 0x80 /* this PDU is a response from server */
155
156/*
157 * SMB flag2 definitions
158 */
Steve French0753ca72005-10-27 13:55:12 -0700159#define SMBFLG2_KNOWS_LONG_NAMES cpu_to_le16(1) /* can send long (non-8.3)
160 path names in response */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161#define SMBFLG2_KNOWS_EAS cpu_to_le16(2)
162#define SMBFLG2_SECURITY_SIGNATURE cpu_to_le16(4)
163#define SMBFLG2_IS_LONG_NAME cpu_to_le16(0x40)
164#define SMBFLG2_EXT_SEC cpu_to_le16(0x800)
165#define SMBFLG2_DFS cpu_to_le16(0x1000)
166#define SMBFLG2_PAGING_IO cpu_to_le16(0x2000)
167#define SMBFLG2_ERR_STATUS cpu_to_le16(0x4000)
168#define SMBFLG2_UNICODE cpu_to_le16(0x8000)
169
170/*
171 * These are the file access permission bits defined in CIFS for the
172 * NTCreateAndX as well as the level 0x107
173 * TRANS2_QUERY_PATH_INFORMATION API. The level 0x107, SMB_QUERY_FILE_ALL_INFO
174 * responds with the AccessFlags.
175 * The AccessFlags specifies the access permissions a caller has to the
176 * file and can have any suitable combination of the following values:
177 */
178
Steve French0753ca72005-10-27 13:55:12 -0700179#define FILE_READ_DATA 0x00000001 /* Data can be read from the file */
180#define FILE_WRITE_DATA 0x00000002 /* Data can be written to the file */
181#define FILE_APPEND_DATA 0x00000004 /* Data can be appended to the file */
182#define FILE_READ_EA 0x00000008 /* Extended attributes associated */
183 /* with the file can be read */
184#define FILE_WRITE_EA 0x00000010 /* Extended attributes associated */
185 /* with the file can be written */
186#define FILE_EXECUTE 0x00000020 /*Data can be read into memory from */
187 /* the file using system paging I/O */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188#define FILE_DELETE_CHILD 0x00000040
Steve French0753ca72005-10-27 13:55:12 -0700189#define FILE_READ_ATTRIBUTES 0x00000080 /* Attributes associated with the */
190 /* file can be read */
191#define FILE_WRITE_ATTRIBUTES 0x00000100 /* Attributes associated with the */
192 /* file can be written */
193#define DELETE 0x00010000 /* The file can be deleted */
194#define READ_CONTROL 0x00020000 /* The access control list and */
195 /* ownership associated with the */
196 /* file can be read */
197#define WRITE_DAC 0x00040000 /* The access control list and */
198 /* ownership associated with the */
199 /* file can be written. */
200#define WRITE_OWNER 0x00080000 /* Ownership information associated */
201 /* with the file can be written */
202#define SYNCHRONIZE 0x00100000 /* The file handle can waited on to */
203 /* synchronize with the completion */
204 /* of an input/output request */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205#define GENERIC_ALL 0x10000000
206#define GENERIC_EXECUTE 0x20000000
207#define GENERIC_WRITE 0x40000000
208#define GENERIC_READ 0x80000000
209 /* In summary - Relevant file */
210 /* access flags from CIFS are */
211 /* file_read_data, file_write_data */
Steve French0753ca72005-10-27 13:55:12 -0700212 /* file_execute, file_read_attributes*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213 /* write_dac, and delete. */
214
215/*
216 * Invalid readdir handle
217 */
218#define CIFS_NO_HANDLE 0xFFFF
219
220/* IPC$ in ASCII */
221#define CIFS_IPC_RESOURCE "\x49\x50\x43\x24"
222
223/* IPC$ in Unicode */
224#define CIFS_IPC_UNICODE_RESOURCE "\x00\x49\x00\x50\x00\x43\x00\x24\x00\x00"
225
226/* Unicode Null terminate 2 bytes of 0 */
227#define UNICODE_NULL "\x00\x00"
228#define ASCII_NULL 0x00
229
230/*
231 * Server type values (returned on EnumServer API
232 */
233#define CIFS_SV_TYPE_DC 0x00000008
234#define CIFS_SV_TYPE_BACKDC 0x00000010
235
236/*
237 * Alias type flags (From EnumAlias API call
238 */
239#define CIFS_ALIAS_TYPE_FILE 0x0001
240#define CIFS_SHARE_TYPE_FILE 0x0000
241
242/*
243 * File Attribute flags
244 */
245#define ATTR_READONLY 0x0001
246#define ATTR_HIDDEN 0x0002
247#define ATTR_SYSTEM 0x0004
248#define ATTR_VOLUME 0x0008
249#define ATTR_DIRECTORY 0x0010
250#define ATTR_ARCHIVE 0x0020
251#define ATTR_DEVICE 0x0040
252#define ATTR_NORMAL 0x0080
253#define ATTR_TEMPORARY 0x0100
254#define ATTR_SPARSE 0x0200
255#define ATTR_REPARSE 0x0400
256#define ATTR_COMPRESSED 0x0800
Steve French0753ca72005-10-27 13:55:12 -0700257#define ATTR_OFFLINE 0x1000 /* ie file not immediately available -
258 on offline storage */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259#define ATTR_NOT_CONTENT_INDEXED 0x2000
260#define ATTR_ENCRYPTED 0x4000
261#define ATTR_POSIX_SEMANTICS 0x01000000
262#define ATTR_BACKUP_SEMANTICS 0x02000000
263#define ATTR_DELETE_ON_CLOSE 0x04000000
264#define ATTR_SEQUENTIAL_SCAN 0x08000000
265#define ATTR_RANDOM_ACCESS 0x10000000
266#define ATTR_NO_BUFFERING 0x20000000
267#define ATTR_WRITE_THROUGH 0x80000000
268
269/* ShareAccess flags */
270#define FILE_NO_SHARE 0x00000000
271#define FILE_SHARE_READ 0x00000001
272#define FILE_SHARE_WRITE 0x00000002
273#define FILE_SHARE_DELETE 0x00000004
274#define FILE_SHARE_ALL 0x00000007
275
276/* CreateDisposition flags */
277#define FILE_SUPERSEDE 0x00000000
278#define FILE_OPEN 0x00000001
279#define FILE_CREATE 0x00000002
280#define FILE_OPEN_IF 0x00000003
281#define FILE_OVERWRITE 0x00000004
282#define FILE_OVERWRITE_IF 0x00000005
283
284/* CreateOptions */
285#define CREATE_NOT_FILE 0x00000001 /* if set must not be file */
286#define CREATE_WRITE_THROUGH 0x00000002
Steve Frencheda3c0292005-07-21 15:20:28 -0700287#define CREATE_SEQUENTIAL 0x00000004
288#define CREATE_SYNC_ALERT 0x00000010
289#define CREATE_ASYNC_ALERT 0x00000020
290#define CREATE_NOT_DIR 0x00000040 /* if set must not be directory */
291#define CREATE_NO_EA_KNOWLEDGE 0x00000200
292#define CREATE_EIGHT_DOT_THREE 0x00000400
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293#define CREATE_RANDOM_ACCESS 0x00000800
294#define CREATE_DELETE_ON_CLOSE 0x00001000
Steve Frencheda3c0292005-07-21 15:20:28 -0700295#define CREATE_OPEN_BY_ID 0x00002000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700296#define OPEN_REPARSE_POINT 0x00200000
Steve Frencheda3c0292005-07-21 15:20:28 -0700297#define CREATE_OPTIONS_MASK 0x007FFFFF
298#define CREATE_OPTION_SPECIAL 0x20000000 /* system. NB not sent over wire */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299
300/* ImpersonationLevel flags */
301#define SECURITY_ANONYMOUS 0
302#define SECURITY_IDENTIFICATION 1
303#define SECURITY_IMPERSONATION 2
304#define SECURITY_DELEGATION 3
305
306/* SecurityFlags */
307#define SECURITY_CONTEXT_TRACKING 0x01
308#define SECURITY_EFFECTIVE_ONLY 0x02
309
310/*
311 * Default PID value, used in all SMBs where the PID is not important
312 */
313#define CIFS_DFT_PID 0x1234
314
315/*
316 * We use the same routine for Copy and Move SMBs. This flag is used to
317 * distinguish
318 */
319#define CIFS_COPY_OP 1
320#define CIFS_RENAME_OP 2
321
322#define GETU16(var) (*((__u16 *)var)) /* BB check for endian issues */
323#define GETU32(var) (*((__u32 *)var)) /* BB check for endian issues */
324
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325struct smb_hdr {
Steve French0753ca72005-10-27 13:55:12 -0700326 __u32 smb_buf_length; /* big endian on wire *//* BB length is only two
327 or three bytes - with one or two byte type preceding it that are
328 zero - we could mask the type byte off just in case BB */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329 __u8 Protocol[4];
330 __u8 Command;
331 union {
332 struct {
333 __u8 ErrorClass;
334 __u8 Reserved;
335 __le16 Error;
Steve French0753ca72005-10-27 13:55:12 -0700336 } __attribute__((packed)) DosError;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337 __le32 CifsError;
Steve French0753ca72005-10-27 13:55:12 -0700338 } __attribute__((packed)) Status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339 __u8 Flags;
340 __le16 Flags2; /* note: le */
341 __le16 PidHigh;
342 union {
343 struct {
344 __le32 SequenceNumber; /* le */
345 __u32 Reserved; /* zero */
Steve French0753ca72005-10-27 13:55:12 -0700346 } __attribute__((packed)) Sequence;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347 __u8 SecuritySignature[8]; /* le */
Steve French0753ca72005-10-27 13:55:12 -0700348 } __attribute__((packed)) Signature;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700349 __u8 pad[2];
350 __u16 Tid;
351 __le16 Pid;
352 __u16 Uid;
353 __u16 Mid;
354 __u8 WordCount;
Steve French0753ca72005-10-27 13:55:12 -0700355} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700356/* given a pointer to an smb_hdr retrieve the value of byte count */
357#define BCC(smb_var) ( *(__u16 *)((char *)smb_var + sizeof(struct smb_hdr) + (2* smb_var->WordCount) ) )
Steve Frenche4eb2952005-04-28 22:41:09 -0700358#define BCC_LE(smb_var) ( *(__le16 *)((char *)smb_var + sizeof(struct smb_hdr) + (2* smb_var->WordCount) ) )
Linus Torvalds1da177e2005-04-16 15:20:36 -0700359/* given a pointer to an smb_hdr retrieve the pointer to the byte area */
360#define pByteArea(smb_var) ((unsigned char *)smb_var + sizeof(struct smb_hdr) + (2* smb_var->WordCount) + 2 )
361
362/*
363 * Computer Name Length
364 */
365#define CNLEN 15
366
367/*
368 * Share Name Length @S8A
369 * Note: This length is limited by the SMB used to get @S8A
370 * the Share info. NetShareEnum only returns 13 @S8A
371 * chars, including the null termination. @S8A
372 */
373#define SNLEN 12 /*@S8A */
374
375/*
376 * Comment Length
377 */
378#define MAXCOMMENTLEN 40
379
380/*
381 * The OS/2 maximum path name
382 */
383#define MAX_PATHCONF 256
384
385/*
386 * SMB frame definitions (following must be packed structs)
387 * See the SNIA CIFS Specification for details.
388 *
389 * The Naming convention is the lower case version of the
390 * smb command code name for the struct and this is typedef to the
391 * uppercase version of the same name with the prefix SMB_ removed
392 * for brevity. Although typedefs are not commonly used for
393 * structure definitions in the Linux kernel, their use in the
394 * CIFS standards document, which this code is based on, may
395 * make this one of the cases where typedefs for structures make
396 * sense to improve readability for readers of the standards doc.
397 * Typedefs can always be removed later if they are too distracting
398 * and they are only used for the CIFSs PDUs themselves, not
399 * internal cifs vfs structures
400 *
401 */
402
403typedef struct negotiate_req {
404 struct smb_hdr hdr; /* wct = 0 */
405 __le16 ByteCount;
406 unsigned char DialectsArray[1];
Steve French0753ca72005-10-27 13:55:12 -0700407} __attribute__((packed)) NEGOTIATE_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700408
Steve French39798772006-05-31 22:40:51 +0000409/* Dialect index is 13 for LANMAN */
410
411typedef struct lanman_neg_rsp {
412 struct smb_hdr hdr; /* wct = 13 */
413 __le16 DialectIndex;
414 __le16 SecurityMode;
415 __le16 MaxBufSize;
416 __le16 MaxMpxCount;
417 __le16 MaxNumberVcs;
418 __le16 RawMode;
419 __le32 SessionKey;
420 __le32 ServerTime;
421 __le16 ServerTimeZone;
422 __le16 EncryptionKeyLength;
423 __le16 Reserved;
424 __u16 ByteCount;
425 unsigned char EncryptionKey[1];
426} __attribute__((packed)) LANMAN_NEG_RSP;
427
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428typedef struct negotiate_rsp {
429 struct smb_hdr hdr; /* wct = 17 */
430 __le16 DialectIndex;
431 __u8 SecurityMode;
432 __le16 MaxMpxCount;
433 __le16 MaxNumberVcs;
434 __le32 MaxBufferSize;
435 __le32 MaxRawSize;
436 __le32 SessionKey;
437 __le32 Capabilities; /* see below */
438 __le32 SystemTimeLow;
439 __le32 SystemTimeHigh;
440 __le16 ServerTimeZone;
441 __u8 EncryptionKeyLength;
442 __u16 ByteCount;
443 union {
Steve French0753ca72005-10-27 13:55:12 -0700444 unsigned char EncryptionKey[1]; /* cap extended security off */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700445 /* followed by Domain name - if extended security is off */
446 /* followed by 16 bytes of server GUID */
Steve French0753ca72005-10-27 13:55:12 -0700447 /* then security blob if cap_extended_security negotiated */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 struct {
449 unsigned char GUID[16];
450 unsigned char SecurityBlob[1];
Steve French0753ca72005-10-27 13:55:12 -0700451 } __attribute__((packed)) extended_response;
452 } __attribute__((packed)) u;
453} __attribute__((packed)) NEGOTIATE_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700454
455/* SecurityMode bits */
456#define SECMODE_USER 0x01 /* off indicates share level security */
457#define SECMODE_PW_ENCRYPT 0x02
458#define SECMODE_SIGN_ENABLED 0x04 /* SMB security signatures enabled */
459#define SECMODE_SIGN_REQUIRED 0x08 /* SMB security signatures required */
460
461/* Negotiate response Capabilities */
462#define CAP_RAW_MODE 0x00000001
463#define CAP_MPX_MODE 0x00000002
464#define CAP_UNICODE 0x00000004
465#define CAP_LARGE_FILES 0x00000008
466#define CAP_NT_SMBS 0x00000010 /* implies CAP_NT_FIND */
467#define CAP_RPC_REMOTE_APIS 0x00000020
468#define CAP_STATUS32 0x00000040
469#define CAP_LEVEL_II_OPLOCKS 0x00000080
470#define CAP_LOCK_AND_READ 0x00000100
471#define CAP_NT_FIND 0x00000200
472#define CAP_DFS 0x00001000
473#define CAP_INFOLEVEL_PASSTHRU 0x00002000
474#define CAP_LARGE_READ_X 0x00004000
475#define CAP_LARGE_WRITE_X 0x00008000
476#define CAP_UNIX 0x00800000
477#define CAP_RESERVED 0x02000000
478#define CAP_BULK_TRANSFER 0x20000000
479#define CAP_COMPRESSED_DATA 0x40000000
480#define CAP_EXTENDED_SECURITY 0x80000000
481
482typedef union smb_com_session_setup_andx {
483 struct { /* request format */
484 struct smb_hdr hdr; /* wct = 12 */
485 __u8 AndXCommand;
486 __u8 AndXReserved;
487 __le16 AndXOffset;
488 __le16 MaxBufferSize;
489 __le16 MaxMpxCount;
490 __le16 VcNumber;
491 __u32 SessionKey;
492 __le16 SecurityBlobLength;
493 __u32 Reserved;
494 __le32 Capabilities; /* see below */
495 __le16 ByteCount;
496 unsigned char SecurityBlob[1]; /* followed by */
497 /* STRING NativeOS */
498 /* STRING NativeLanMan */
Steve French0753ca72005-10-27 13:55:12 -0700499 } __attribute__((packed)) req; /* NTLM request format (with
500 extended security */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700501
502 struct { /* request format */
503 struct smb_hdr hdr; /* wct = 13 */
504 __u8 AndXCommand;
505 __u8 AndXReserved;
506 __le16 AndXOffset;
507 __le16 MaxBufferSize;
508 __le16 MaxMpxCount;
509 __le16 VcNumber;
510 __u32 SessionKey;
Steve French0753ca72005-10-27 13:55:12 -0700511 __le16 CaseInsensitivePasswordLength; /* ASCII password len */
512 __le16 CaseSensitivePasswordLength; /* Unicode password length*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700513 __u32 Reserved; /* see below */
514 __le32 Capabilities;
515 __le16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -0700516 unsigned char CaseInsensitivePassword[1]; /* followed by: */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700517 /* unsigned char * CaseSensitivePassword; */
518 /* STRING AccountName */
519 /* STRING PrimaryDomain */
520 /* STRING NativeOS */
521 /* STRING NativeLanMan */
Steve French0753ca72005-10-27 13:55:12 -0700522 } __attribute__((packed)) req_no_secext; /* NTLM request format (without
523 extended security */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700524
525 struct { /* default (NTLM) response format */
526 struct smb_hdr hdr; /* wct = 4 */
527 __u8 AndXCommand;
528 __u8 AndXReserved;
529 __le16 AndXOffset;
530 __le16 Action; /* see below */
531 __le16 SecurityBlobLength;
532 __u16 ByteCount;
533 unsigned char SecurityBlob[1]; /* followed by */
534/* unsigned char * NativeOS; */
535/* unsigned char * NativeLanMan; */
536/* unsigned char * PrimaryDomain; */
Steve French0753ca72005-10-27 13:55:12 -0700537 } __attribute__((packed)) resp; /* NTLM response format (with or without extended security */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700538
539 struct { /* request format */
540 struct smb_hdr hdr; /* wct = 10 */
541 __u8 AndXCommand;
542 __u8 AndXReserved;
543 __le16 AndXOffset;
544 __le16 MaxBufferSize;
545 __le16 MaxMpxCount;
546 __le16 VcNumber;
547 __u32 SessionKey;
Steve French39798772006-05-31 22:40:51 +0000548 __le16 PasswordLength;
549 __u32 Reserved; /* encrypt key len and offset */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700550 __le16 ByteCount;
551 unsigned char AccountPassword[1]; /* followed by */
552 /* STRING AccountName */
553 /* STRING PrimaryDomain */
554 /* STRING NativeOS */
555 /* STRING NativeLanMan */
Steve French0a4b92c2006-01-12 15:44:21 -0800556 } __attribute__((packed)) old_req; /* pre-NTLM (LANMAN2.1) req format */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557
558 struct { /* default (NTLM) response format */
559 struct smb_hdr hdr; /* wct = 3 */
560 __u8 AndXCommand;
561 __u8 AndXReserved;
562 __le16 AndXOffset;
563 __le16 Action; /* see below */
564 __u16 ByteCount;
565 unsigned char NativeOS[1]; /* followed by */
566/* unsigned char * NativeLanMan; */
567/* unsigned char * PrimaryDomain; */
Steve French0a4b92c2006-01-12 15:44:21 -0800568 } __attribute__((packed)) old_resp; /* pre-NTLM (LANMAN2.1) response */
Steve French0753ca72005-10-27 13:55:12 -0700569} __attribute__((packed)) SESSION_SETUP_ANDX;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700570
571#define CIFS_NETWORK_OPSYS "CIFS VFS Client for Linux"
572
573/* Capabilities bits (for NTLM SessSetup request) */
574#define CAP_UNICODE 0x00000004
575#define CAP_LARGE_FILES 0x00000008
576#define CAP_NT_SMBS 0x00000010
577#define CAP_STATUS32 0x00000040
578#define CAP_LEVEL_II_OPLOCKS 0x00000080
Steve French0753ca72005-10-27 13:55:12 -0700579#define CAP_NT_FIND 0x00000200 /* reserved should be zero
580 (because NT_SMBs implies the same thing?) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700581#define CAP_BULK_TRANSFER 0x20000000
582#define CAP_EXTENDED_SECURITY 0x80000000
583
584/* Action bits */
585#define GUEST_LOGIN 1
586
587typedef struct smb_com_tconx_req {
588 struct smb_hdr hdr; /* wct = 4 */
589 __u8 AndXCommand;
590 __u8 AndXReserved;
591 __le16 AndXOffset;
592 __le16 Flags; /* see below */
593 __le16 PasswordLength;
594 __le16 ByteCount;
595 unsigned char Password[1]; /* followed by */
596/* STRING Path *//* \\server\share name */
597 /* STRING Service */
Steve French0753ca72005-10-27 13:55:12 -0700598} __attribute__((packed)) TCONX_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700599
600typedef struct smb_com_tconx_rsp {
601 struct smb_hdr hdr; /* wct = 3 *//* note that Win2000 has sent wct=7 in some cases on responses. Four unspecified words followed OptionalSupport */
602 __u8 AndXCommand;
603 __u8 AndXReserved;
604 __le16 AndXOffset;
605 __le16 OptionalSupport; /* see below */
606 __u16 ByteCount;
607 unsigned char Service[1]; /* always ASCII, not Unicode */
608 /* STRING NativeFileSystem */
Steve French0753ca72005-10-27 13:55:12 -0700609} __attribute__((packed)) TCONX_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700610
611/* tree connect Flags */
612#define DISCONNECT_TID 0x0001
613#define TCON_EXTENDED_SECINFO 0x0008
614/* OptionalSupport bits */
Steve French0753ca72005-10-27 13:55:12 -0700615#define SMB_SUPPORT_SEARCH_BITS 0x0001 /* "must have" directory search bits
616 (exclusive searches supported) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700617#define SMB_SHARE_IS_IN_DFS 0x0002
618
619typedef struct smb_com_logoff_andx_req {
620 struct smb_hdr hdr; /* wct = 2 */
621 __u8 AndXCommand;
622 __u8 AndXReserved;
623 __u16 AndXOffset;
624 __u16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -0700625} __attribute__((packed)) LOGOFF_ANDX_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626
627typedef struct smb_com_logoff_andx_rsp {
628 struct smb_hdr hdr; /* wct = 2 */
629 __u8 AndXCommand;
630 __u8 AndXReserved;
631 __u16 AndXOffset;
632 __u16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -0700633} __attribute__((packed)) LOGOFF_ANDX_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700634
Steve French86c96b42005-11-18 20:25:31 -0800635typedef union smb_com_tree_disconnect { /* as an altetnative can use flag on
636 tree_connect PDU to effect disconnect */
637 /* tdis is probably simplest SMB PDU */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 struct {
639 struct smb_hdr hdr; /* wct = 0 */
640 __u16 ByteCount; /* bcc = 0 */
Steve French0753ca72005-10-27 13:55:12 -0700641 } __attribute__((packed)) req;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642 struct {
643 struct smb_hdr hdr; /* wct = 0 */
644 __u16 ByteCount; /* bcc = 0 */
Steve French0753ca72005-10-27 13:55:12 -0700645 } __attribute__((packed)) resp;
646} __attribute__((packed)) TREE_DISCONNECT;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647
648typedef struct smb_com_close_req {
649 struct smb_hdr hdr; /* wct = 3 */
650 __u16 FileID;
651 __u32 LastWriteTime; /* should be zero */
652 __u16 ByteCount; /* 0 */
Steve French0753ca72005-10-27 13:55:12 -0700653} __attribute__((packed)) CLOSE_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700654
655typedef struct smb_com_close_rsp {
656 struct smb_hdr hdr; /* wct = 0 */
657 __u16 ByteCount; /* bct = 0 */
Steve French0753ca72005-10-27 13:55:12 -0700658} __attribute__((packed)) CLOSE_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700659
660typedef struct smb_com_findclose_req {
661 struct smb_hdr hdr; /* wct = 1 */
662 __u16 FileID;
663 __u16 ByteCount; /* 0 */
Steve French0753ca72005-10-27 13:55:12 -0700664} __attribute__((packed)) FINDCLOSE_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665
666/* OpenFlags */
Steve Frencha9d02ad2005-08-24 23:06:05 -0700667#define REQ_MORE_INFO 0x00000001 /* legacy (OPEN_AND_X) only */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700668#define REQ_OPLOCK 0x00000002
669#define REQ_BATCHOPLOCK 0x00000004
670#define REQ_OPENDIRONLY 0x00000008
671
672typedef struct smb_com_open_req { /* also handles create */
673 struct smb_hdr hdr; /* wct = 24 */
674 __u8 AndXCommand;
675 __u8 AndXReserved;
676 __le16 AndXOffset;
677 __u8 Reserved; /* Must Be Zero */
678 __le16 NameLength;
679 __le32 OpenFlags;
680 __le32 RootDirectoryFid;
681 __le32 DesiredAccess;
682 __le64 AllocationSize;
683 __le32 FileAttributes;
684 __le32 ShareAccess;
685 __le32 CreateDisposition;
686 __le32 CreateOptions;
687 __le32 ImpersonationLevel;
688 __u8 SecurityFlags;
689 __le16 ByteCount;
690 char fileName[1];
Steve French0753ca72005-10-27 13:55:12 -0700691} __attribute__((packed)) OPEN_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700692
693/* open response: oplock levels */
694#define OPLOCK_NONE 0
695#define OPLOCK_EXCLUSIVE 1
696#define OPLOCK_BATCH 2
697#define OPLOCK_READ 3 /* level 2 oplock */
698
699/* open response for CreateAction shifted left */
700#define CIFS_CREATE_ACTION 0x20000 /* file created */
701
702typedef struct smb_com_open_rsp {
703 struct smb_hdr hdr; /* wct = 34 BB */
704 __u8 AndXCommand;
705 __u8 AndXReserved;
706 __le16 AndXOffset;
707 __u8 OplockLevel;
708 __u16 Fid;
709 __le32 CreateAction;
710 __le64 CreationTime;
711 __le64 LastAccessTime;
712 __le64 LastWriteTime;
713 __le64 ChangeTime;
714 __le32 FileAttributes;
715 __le64 AllocationSize;
716 __le64 EndOfFile;
717 __le16 FileType;
718 __le16 DeviceState;
719 __u8 DirectoryFlag;
720 __u16 ByteCount; /* bct = 0 */
Steve French0753ca72005-10-27 13:55:12 -0700721} __attribute__((packed)) OPEN_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700722
Steve Frencha9d02ad2005-08-24 23:06:05 -0700723/* format of legacy open request */
724typedef struct smb_com_openx_req {
725 struct smb_hdr hdr; /* wct = 15 */
726 __u8 AndXCommand;
727 __u8 AndXReserved;
728 __le16 AndXOffset;
729 __le16 OpenFlags;
730 __le16 Mode;
731 __le16 Sattr; /* search attributes */
732 __le16 FileAttributes; /* dos attrs */
733 __le32 CreateTime; /* os2 format */
734 __le16 OpenFunction;
735 __le32 EndOfFile;
736 __le32 Timeout;
737 __le32 Reserved;
Steve French70ca7342005-09-22 16:32:06 -0700738 __le16 ByteCount; /* file name follows */
Steve Frencha9d02ad2005-08-24 23:06:05 -0700739 char fileName[1];
Steve French0753ca72005-10-27 13:55:12 -0700740} __attribute__((packed)) OPENX_REQ;
Steve Frencha9d02ad2005-08-24 23:06:05 -0700741
742typedef struct smb_com_openx_rsp {
743 struct smb_hdr hdr; /* wct = 15 */
744 __u8 AndXCommand;
745 __u8 AndXReserved;
746 __le16 AndXOffset;
747 __u16 Fid;
748 __le16 FileAttributes;
749 __le32 LastWriteTime; /* os2 format */
750 __le32 EndOfFile;
751 __le16 Access;
752 __le16 FileType;
753 __le16 IPCState;
754 __le16 Action;
755 __u32 FileId;
756 __u16 Reserved;
757 __u16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -0700758} __attribute__((packed)) OPENX_RSP;
Steve Frencha9d02ad2005-08-24 23:06:05 -0700759
760/* Legacy write request for older servers */
761typedef struct smb_com_writex_req {
762 struct smb_hdr hdr; /* wct = 12 */
763 __u8 AndXCommand;
764 __u8 AndXReserved;
765 __le16 AndXOffset;
766 __u16 Fid;
767 __le32 OffsetLow;
768 __u32 Reserved; /* Timeout */
769 __le16 WriteMode; /* 1 = write through */
770 __le16 Remaining;
771 __le16 Reserved2;
772 __le16 DataLengthLow;
773 __le16 DataOffset;
774 __le16 ByteCount;
775 __u8 Pad; /* BB check for whether padded to DWORD boundary and optimum performance here */
776 char Data[0];
Steve French0753ca72005-10-27 13:55:12 -0700777} __attribute__((packed)) WRITEX_REQ;
Steve Frencha9d02ad2005-08-24 23:06:05 -0700778
Linus Torvalds1da177e2005-04-16 15:20:36 -0700779typedef struct smb_com_write_req {
780 struct smb_hdr hdr; /* wct = 14 */
781 __u8 AndXCommand;
782 __u8 AndXReserved;
783 __le16 AndXOffset;
784 __u16 Fid;
785 __le32 OffsetLow;
786 __u32 Reserved;
787 __le16 WriteMode;
788 __le16 Remaining;
789 __le16 DataLengthHigh;
790 __le16 DataLengthLow;
791 __le16 DataOffset;
792 __le32 OffsetHigh;
793 __le16 ByteCount;
794 __u8 Pad; /* BB check for whether padded to DWORD boundary and optimum performance here */
795 char Data[0];
Steve French0753ca72005-10-27 13:55:12 -0700796} __attribute__((packed)) WRITE_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700797
798typedef struct smb_com_write_rsp {
799 struct smb_hdr hdr; /* wct = 6 */
800 __u8 AndXCommand;
801 __u8 AndXReserved;
802 __le16 AndXOffset;
803 __le16 Count;
804 __le16 Remaining;
805 __le16 CountHigh;
806 __u16 Reserved;
807 __u16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -0700808} __attribute__((packed)) WRITE_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700809
Steve Frencha9d02ad2005-08-24 23:06:05 -0700810/* legacy read request for older servers */
811typedef struct smb_com_readx_req {
812 struct smb_hdr hdr; /* wct = 10 */
813 __u8 AndXCommand;
814 __u8 AndXReserved;
815 __le16 AndXOffset;
816 __u16 Fid;
817 __le32 OffsetLow;
818 __le16 MaxCount;
819 __le16 MinCount; /* obsolete */
820 __le32 Reserved;
821 __le16 Remaining;
822 __le16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -0700823} __attribute__((packed)) READX_REQ;
Steve Frencha9d02ad2005-08-24 23:06:05 -0700824
Linus Torvalds1da177e2005-04-16 15:20:36 -0700825typedef struct smb_com_read_req {
826 struct smb_hdr hdr; /* wct = 12 */
827 __u8 AndXCommand;
828 __u8 AndXReserved;
829 __le16 AndXOffset;
830 __u16 Fid;
831 __le32 OffsetLow;
832 __le16 MaxCount;
833 __le16 MinCount; /* obsolete */
834 __le32 MaxCountHigh;
835 __le16 Remaining;
836 __le32 OffsetHigh;
837 __le16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -0700838} __attribute__((packed)) READ_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700839
840typedef struct smb_com_read_rsp {
841 struct smb_hdr hdr; /* wct = 12 */
842 __u8 AndXCommand;
843 __u8 AndXReserved;
844 __le16 AndXOffset;
845 __le16 Remaining;
846 __le16 DataCompactionMode;
847 __le16 Reserved;
848 __le16 DataLength;
849 __le16 DataOffset;
850 __le16 DataLengthHigh;
851 __u64 Reserved2;
852 __u16 ByteCount;
853 __u8 Pad; /* BB check for whether padded to DWORD boundary and optimum performance here */
854 char Data[1];
Steve French0753ca72005-10-27 13:55:12 -0700855} __attribute__((packed)) READ_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700856
857typedef struct locking_andx_range {
858 __le16 Pid;
859 __le16 Pad;
860 __le32 OffsetHigh;
861 __le32 OffsetLow;
862 __le32 LengthHigh;
863 __le32 LengthLow;
Steve French0753ca72005-10-27 13:55:12 -0700864} __attribute__((packed)) LOCKING_ANDX_RANGE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700865
866#define LOCKING_ANDX_SHARED_LOCK 0x01
867#define LOCKING_ANDX_OPLOCK_RELEASE 0x02
868#define LOCKING_ANDX_CHANGE_LOCKTYPE 0x04
869#define LOCKING_ANDX_CANCEL_LOCK 0x08
870#define LOCKING_ANDX_LARGE_FILES 0x10 /* always on for us */
871
872typedef struct smb_com_lock_req {
873 struct smb_hdr hdr; /* wct = 8 */
874 __u8 AndXCommand;
875 __u8 AndXReserved;
876 __le16 AndXOffset;
877 __u16 Fid;
878 __u8 LockType;
879 __u8 OplockLevel;
880 __le32 Timeout;
881 __le16 NumberOfUnlocks;
882 __le16 NumberOfLocks;
883 __le16 ByteCount;
884 LOCKING_ANDX_RANGE Locks[1];
Steve French0753ca72005-10-27 13:55:12 -0700885} __attribute__((packed)) LOCK_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700886
Steve French08547b02006-02-28 22:39:25 +0000887/* lock type */
888#define CIFS_RDLCK 0
889#define CIFS_WRLCK 1
890#define CIFS_UNLCK 2
Steve Frenchf654bac2005-04-28 22:41:04 -0700891typedef struct cifs_posix_lock {
892 __le16 lock_type; /* 0 = Read, 1 = Write, 2 = Unlock */
893 __le16 lock_flags; /* 1 = Wait (only valid for setlock) */
894 __le32 pid;
895 __le64 start;
896 __le64 length;
897 /* BB what about additional owner info to identify network client */
Steve French0753ca72005-10-27 13:55:12 -0700898} __attribute__((packed)) CIFS_POSIX_LOCK;
Steve Frenchf654bac2005-04-28 22:41:04 -0700899
Linus Torvalds1da177e2005-04-16 15:20:36 -0700900typedef struct smb_com_lock_rsp {
901 struct smb_hdr hdr; /* wct = 2 */
902 __u8 AndXCommand;
903 __u8 AndXReserved;
904 __le16 AndXOffset;
905 __u16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -0700906} __attribute__((packed)) LOCK_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700907
908typedef struct smb_com_rename_req {
909 struct smb_hdr hdr; /* wct = 1 */
910 __le16 SearchAttributes; /* target file attributes */
911 __le16 ByteCount;
912 __u8 BufferFormat; /* 4 = ASCII or Unicode */
913 unsigned char OldFileName[1];
914 /* followed by __u8 BufferFormat2 */
915 /* followed by NewFileName */
Steve French0753ca72005-10-27 13:55:12 -0700916} __attribute__((packed)) RENAME_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700917
918 /* copy request flags */
919#define COPY_MUST_BE_FILE 0x0001
920#define COPY_MUST_BE_DIR 0x0002
921#define COPY_TARGET_MODE_ASCII 0x0004 /* if not set, binary */
922#define COPY_SOURCE_MODE_ASCII 0x0008 /* if not set, binary */
923#define COPY_VERIFY_WRITES 0x0010
924#define COPY_TREE 0x0020
925
926typedef struct smb_com_copy_req {
927 struct smb_hdr hdr; /* wct = 3 */
928 __u16 Tid2;
929 __le16 OpenFunction;
930 __le16 Flags;
931 __le16 ByteCount;
932 __u8 BufferFormat; /* 4 = ASCII or Unicode */
933 unsigned char OldFileName[1];
934 /* followed by __u8 BufferFormat2 */
935 /* followed by NewFileName string */
Steve French0753ca72005-10-27 13:55:12 -0700936} __attribute__((packed)) COPY_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700937
938typedef struct smb_com_copy_rsp {
939 struct smb_hdr hdr; /* wct = 1 */
940 __le16 CopyCount; /* number of files copied */
941 __u16 ByteCount; /* may be zero */
942 __u8 BufferFormat; /* 0x04 - only present if errored file follows */
943 unsigned char ErrorFileName[1]; /* only present if error in copy */
Steve French0753ca72005-10-27 13:55:12 -0700944} __attribute__((packed)) COPY_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700945
946#define CREATE_HARD_LINK 0x103
947#define MOVEFILE_COPY_ALLOWED 0x0002
948#define MOVEFILE_REPLACE_EXISTING 0x0001
949
950typedef struct smb_com_nt_rename_req { /* A5 - also used for create hardlink */
951 struct smb_hdr hdr; /* wct = 4 */
952 __le16 SearchAttributes; /* target file attributes */
953 __le16 Flags; /* spec says Information Level */
954 __le32 ClusterCount;
955 __le16 ByteCount;
956 __u8 BufferFormat; /* 4 = ASCII or Unicode */
957 unsigned char OldFileName[1];
958 /* followed by __u8 BufferFormat2 */
959 /* followed by NewFileName */
Steve French0753ca72005-10-27 13:55:12 -0700960} __attribute__((packed)) NT_RENAME_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700961
962typedef struct smb_com_rename_rsp {
963 struct smb_hdr hdr; /* wct = 0 */
964 __u16 ByteCount; /* bct = 0 */
Steve French0753ca72005-10-27 13:55:12 -0700965} __attribute__((packed)) RENAME_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700966
967typedef struct smb_com_delete_file_req {
968 struct smb_hdr hdr; /* wct = 1 */
969 __le16 SearchAttributes;
970 __le16 ByteCount;
971 __u8 BufferFormat; /* 4 = ASCII */
972 unsigned char fileName[1];
Steve French0753ca72005-10-27 13:55:12 -0700973} __attribute__((packed)) DELETE_FILE_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700974
975typedef struct smb_com_delete_file_rsp {
976 struct smb_hdr hdr; /* wct = 0 */
977 __u16 ByteCount; /* bct = 0 */
Steve French0753ca72005-10-27 13:55:12 -0700978} __attribute__((packed)) DELETE_FILE_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700979
980typedef struct smb_com_delete_directory_req {
981 struct smb_hdr hdr; /* wct = 0 */
982 __le16 ByteCount;
983 __u8 BufferFormat; /* 4 = ASCII */
984 unsigned char DirName[1];
Steve French0753ca72005-10-27 13:55:12 -0700985} __attribute__((packed)) DELETE_DIRECTORY_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700986
987typedef struct smb_com_delete_directory_rsp {
988 struct smb_hdr hdr; /* wct = 0 */
989 __u16 ByteCount; /* bct = 0 */
Steve French0753ca72005-10-27 13:55:12 -0700990} __attribute__((packed)) DELETE_DIRECTORY_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700991
992typedef struct smb_com_create_directory_req {
993 struct smb_hdr hdr; /* wct = 0 */
994 __le16 ByteCount;
995 __u8 BufferFormat; /* 4 = ASCII */
996 unsigned char DirName[1];
Steve French0753ca72005-10-27 13:55:12 -0700997} __attribute__((packed)) CREATE_DIRECTORY_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700998
999typedef struct smb_com_create_directory_rsp {
1000 struct smb_hdr hdr; /* wct = 0 */
1001 __u16 ByteCount; /* bct = 0 */
Steve French0753ca72005-10-27 13:55:12 -07001002} __attribute__((packed)) CREATE_DIRECTORY_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001003
Steve French6b8edfe2005-08-23 20:26:03 -07001004typedef struct smb_com_query_information_req {
1005 struct smb_hdr hdr; /* wct = 0 */
1006 __le16 ByteCount; /* 1 + namelen + 1 */
1007 __u8 BufferFormat; /* 4 = ASCII */
1008 unsigned char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07001009} __attribute__((packed)) QUERY_INFORMATION_REQ;
Steve French6b8edfe2005-08-23 20:26:03 -07001010
1011typedef struct smb_com_query_information_rsp {
1012 struct smb_hdr hdr; /* wct = 10 */
1013 __le16 attr;
1014 __le32 last_write_time;
1015 __le32 size;
1016 __u16 reserved[5];
1017 __le16 ByteCount; /* bcc = 0 */
Steve French0753ca72005-10-27 13:55:12 -07001018} __attribute__((packed)) QUERY_INFORMATION_RSP;
Steve French6b8edfe2005-08-23 20:26:03 -07001019
Linus Torvalds1da177e2005-04-16 15:20:36 -07001020typedef struct smb_com_setattr_req {
1021 struct smb_hdr hdr; /* wct = 8 */
1022 __le16 attr;
1023 __le16 time_low;
1024 __le16 time_high;
1025 __le16 reserved[5]; /* must be zero */
1026 __u16 ByteCount;
1027 __u8 BufferFormat; /* 4 = ASCII */
1028 unsigned char fileName[1];
Steve French0753ca72005-10-27 13:55:12 -07001029} __attribute__((packed)) SETATTR_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001030
1031typedef struct smb_com_setattr_rsp {
1032 struct smb_hdr hdr; /* wct = 0 */
1033 __u16 ByteCount; /* bct = 0 */
Steve French0753ca72005-10-27 13:55:12 -07001034} __attribute__((packed)) SETATTR_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001035
1036/* empty wct response to setattr */
1037
Steve French0a4b92c2006-01-12 15:44:21 -08001038/*******************************************************/
1039/* NT Transact structure defintions follow */
1040/* Currently only ioctl, acl (get security descriptor) */
1041/* and notify are implemented */
1042/*******************************************************/
1043typedef struct smb_com_ntransact_req {
1044 struct smb_hdr hdr; /* wct >= 19 */
1045 __u8 MaxSetupCount;
1046 __u16 Reserved;
1047 __le32 TotalParameterCount;
1048 __le32 TotalDataCount;
1049 __le32 MaxParameterCount;
1050 __le32 MaxDataCount;
1051 __le32 ParameterCount;
1052 __le32 ParameterOffset;
1053 __le32 DataCount;
1054 __le32 DataOffset;
1055 __u8 SetupCount; /* four setup words follow subcommand */
1056 /* SNIA spec incorrectly included spurious pad here */
1057 __le16 SubCommand; /* 2 = IOCTL/FSCTL */
1058 /* SetupCount words follow then */
1059 __le16 ByteCount;
1060 __u8 Pad[3];
1061 __u8 Parms[0];
1062} __attribute__((packed)) NTRANSACT_REQ;
1063
1064typedef struct smb_com_ntransact_rsp {
1065 struct smb_hdr hdr; /* wct = 18 */
1066 __u8 Reserved[3];
1067 __le32 TotalParameterCount;
1068 __le32 TotalDataCount;
1069 __le32 ParameterCount;
1070 __le32 ParameterOffset;
1071 __le32 ParameterDisplacement;
1072 __le32 DataCount;
1073 __le32 DataOffset;
1074 __le32 DataDisplacement;
1075 __u8 SetupCount; /* 0 */
1076 __u16 ByteCount;
1077 /* __u8 Pad[3]; */
1078 /* parms and data follow */
1079} __attribute__((packed)) NTRANSACT_RSP;
1080
Linus Torvalds1da177e2005-04-16 15:20:36 -07001081typedef struct smb_com_transaction_ioctl_req {
1082 struct smb_hdr hdr; /* wct = 23 */
1083 __u8 MaxSetupCount;
1084 __u16 Reserved;
1085 __le32 TotalParameterCount;
1086 __le32 TotalDataCount;
1087 __le32 MaxParameterCount;
1088 __le32 MaxDataCount;
1089 __le32 ParameterCount;
1090 __le32 ParameterOffset;
1091 __le32 DataCount;
1092 __le32 DataOffset;
1093 __u8 SetupCount; /* four setup words follow subcommand */
1094 /* SNIA spec incorrectly included spurious pad here */
Steve French0a4b92c2006-01-12 15:44:21 -08001095 __le16 SubCommand; /* 2 = IOCTL/FSCTL */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001096 __le32 FunctionCode;
1097 __u16 Fid;
Steve French0a4b92c2006-01-12 15:44:21 -08001098 __u8 IsFsctl; /* 1 = File System Control 0 = device control (IOCTL) */
1099 __u8 IsRootFlag; /* 1 = apply command to root of share (must be DFS) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001100 __le16 ByteCount;
1101 __u8 Pad[3];
1102 __u8 Data[1];
Steve French0753ca72005-10-27 13:55:12 -07001103} __attribute__((packed)) TRANSACT_IOCTL_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001104
1105typedef struct smb_com_transaction_ioctl_rsp {
1106 struct smb_hdr hdr; /* wct = 19 */
1107 __u8 Reserved[3];
1108 __le32 TotalParameterCount;
1109 __le32 TotalDataCount;
1110 __le32 ParameterCount;
1111 __le32 ParameterOffset;
1112 __le32 ParameterDisplacement;
1113 __le32 DataCount;
1114 __le32 DataOffset;
1115 __le32 DataDisplacement;
1116 __u8 SetupCount; /* 1 */
1117 __le16 ReturnedDataLen;
1118 __u16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -07001119} __attribute__((packed)) TRANSACT_IOCTL_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001120
Steve French0a4b92c2006-01-12 15:44:21 -08001121#define CIFS_ACL_OWNER 1
1122#define CIFS_ACL_GROUP 2
1123#define CIFS_ACL_DACL 4
1124#define CIFS_ACL_SACL 8
1125
1126typedef struct smb_com_transaction_qsec_req {
1127 struct smb_hdr hdr; /* wct = 19 */
1128 __u8 MaxSetupCount;
1129 __u16 Reserved;
1130 __le32 TotalParameterCount;
1131 __le32 TotalDataCount;
1132 __le32 MaxParameterCount;
1133 __le32 MaxDataCount;
1134 __le32 ParameterCount;
1135 __le32 ParameterOffset;
1136 __le32 DataCount;
1137 __le32 DataOffset;
1138 __u8 SetupCount; /* no setup words follow subcommand */
1139 /* SNIA spec incorrectly included spurious pad here */
1140 __le16 SubCommand; /* 6 = QUERY_SECURITY_DESC */
1141 __le16 ByteCount; /* bcc = 3 + 8 */
1142 __u8 Pad[3];
1143 __u16 Fid;
1144 __u16 Reserved2;
1145 __le32 AclFlags;
1146} __attribute__((packed)) QUERY_SEC_DESC_REQ;
1147
Linus Torvalds1da177e2005-04-16 15:20:36 -07001148typedef struct smb_com_transaction_change_notify_req {
1149 struct smb_hdr hdr; /* wct = 23 */
1150 __u8 MaxSetupCount;
1151 __u16 Reserved;
1152 __le32 TotalParameterCount;
1153 __le32 TotalDataCount;
1154 __le32 MaxParameterCount;
1155 __le32 MaxDataCount;
1156 __le32 ParameterCount;
1157 __le32 ParameterOffset;
1158 __le32 DataCount;
1159 __le32 DataOffset;
1160 __u8 SetupCount; /* four setup words follow subcommand */
1161 /* SNIA spec incorrectly included spurious pad here */
1162 __le16 SubCommand;/* 4 = Change Notify */
1163 __le32 CompletionFilter; /* operation to monitor */
1164 __u16 Fid;
1165 __u8 WatchTree; /* 1 = Monitor subdirectories */
1166 __u8 Reserved2;
1167 __le16 ByteCount;
Steve French0a4b92c2006-01-12 15:44:21 -08001168/* __u8 Pad[3];*/
Linus Torvalds1da177e2005-04-16 15:20:36 -07001169/* __u8 Data[1];*/
Steve French0753ca72005-10-27 13:55:12 -07001170} __attribute__((packed)) TRANSACT_CHANGE_NOTIFY_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001171
Steve French0a4b92c2006-01-12 15:44:21 -08001172/* BB eventually change to use generic ntransact rsp struct
1173 and validation routine */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001174typedef struct smb_com_transaction_change_notify_rsp {
1175 struct smb_hdr hdr; /* wct = 18 */
1176 __u8 Reserved[3];
1177 __le32 TotalParameterCount;
1178 __le32 TotalDataCount;
1179 __le32 ParameterCount;
1180 __le32 ParameterOffset;
1181 __le32 ParameterDisplacement;
1182 __le32 DataCount;
1183 __le32 DataOffset;
1184 __le32 DataDisplacement;
1185 __u8 SetupCount; /* 0 */
1186 __u16 ByteCount;
1187 /* __u8 Pad[3]; */
Steve French0753ca72005-10-27 13:55:12 -07001188} __attribute__((packed)) TRANSACT_CHANGE_NOTIFY_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001189/* Completion Filter flags for Notify */
1190#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
1191#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
1192#define FILE_NOTIFY_CHANGE_NAME 0x00000003
1193#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
1194#define FILE_NOTIFY_CHANGE_SIZE 0x00000008
1195#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
1196#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
1197#define FILE_NOTIFY_CHANGE_CREATION 0x00000040
1198#define FILE_NOTIFY_CHANGE_EA 0x00000080
1199#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
1200#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
1201#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
1202#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
1203
1204#define FILE_ACTION_ADDED 0x00000001
1205#define FILE_ACTION_REMOVED 0x00000002
1206#define FILE_ACTION_MODIFIED 0x00000003
1207#define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
1208#define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
1209#define FILE_ACTION_ADDED_STREAM 0x00000006
1210#define FILE_ACTION_REMOVED_STREAM 0x00000007
1211#define FILE_ACTION_MODIFIED_STREAM 0x00000008
1212
1213/* response contains array of the following structures */
1214struct file_notify_information {
1215 __le32 NextEntryOffset;
1216 __le32 Action;
1217 __le32 FileNameLength;
1218 __u8 FileName[0];
Steve French0753ca72005-10-27 13:55:12 -07001219} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001220
1221struct reparse_data {
1222 __u32 ReparseTag;
1223 __u16 ReparseDataLength;
1224 __u16 Reserved;
1225 __u16 AltNameOffset;
1226 __u16 AltNameLen;
1227 __u16 TargetNameOffset;
1228 __u16 TargetNameLen;
1229 char LinkNamesBuf[1];
Steve French0753ca72005-10-27 13:55:12 -07001230} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001231
1232struct cifs_quota_data {
1233 __u32 rsrvd1; /* 0 */
1234 __u32 sid_size;
1235 __u64 rsrvd2; /* 0 */
1236 __u64 space_used;
1237 __u64 soft_limit;
1238 __u64 hard_limit;
1239 char sid[1]; /* variable size? */
Steve French0753ca72005-10-27 13:55:12 -07001240} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001241
1242/* quota sub commands */
1243#define QUOTA_LIST_CONTINUE 0
1244#define QUOTA_LIST_START 0x100
1245#define QUOTA_FOR_SID 0x101
1246
1247struct trans2_req {
1248 /* struct smb_hdr hdr precedes. Set wct = 14+ */
1249 __le16 TotalParameterCount;
1250 __le16 TotalDataCount;
1251 __le16 MaxParameterCount;
1252 __le16 MaxDataCount;
1253 __u8 MaxSetupCount;
1254 __u8 Reserved;
1255 __le16 Flags;
1256 __le32 Timeout;
1257 __u16 Reserved2;
1258 __le16 ParameterCount;
1259 __le16 ParameterOffset;
1260 __le16 DataCount;
1261 __le16 DataOffset;
1262 __u8 SetupCount;
1263 __u8 Reserved3;
1264 __le16 SubCommand; /* 1st setup word - SetupCount words follow */
1265 __le16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -07001266} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001267
1268struct smb_t2_req {
1269 struct smb_hdr hdr;
1270 struct trans2_req t2_req;
Steve French0753ca72005-10-27 13:55:12 -07001271} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001272
1273struct trans2_resp {
1274 /* struct smb_hdr hdr precedes. Note wct = 10 + setup count */
1275 __le16 TotalParameterCount;
1276 __le16 TotalDataCount;
1277 __u16 Reserved;
1278 __le16 ParameterCount;
1279 __le16 ParameterOffset;
1280 __le16 ParameterDisplacement;
1281 __le16 DataCount;
1282 __le16 DataOffset;
1283 __le16 DataDisplacement;
1284 __u8 SetupCount;
1285 __u8 Reserved1;
1286 /* SetupWords[SetupCount];
1287 __u16 ByteCount;
1288 __u16 Reserved2;*/
1289 /* data area follows */
Steve French0753ca72005-10-27 13:55:12 -07001290} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001291
1292struct smb_t2_rsp {
1293 struct smb_hdr hdr;
1294 struct trans2_resp t2_rsp;
Steve French0753ca72005-10-27 13:55:12 -07001295} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001296
1297/* PathInfo/FileInfo infolevels */
1298#define SMB_INFO_STANDARD 1
1299#define SMB_SET_FILE_EA 2
1300#define SMB_QUERY_FILE_EA_SIZE 2
1301#define SMB_INFO_QUERY_EAS_FROM_LIST 3
1302#define SMB_INFO_QUERY_ALL_EAS 4
1303#define SMB_INFO_IS_NAME_VALID 6
1304#define SMB_QUERY_FILE_BASIC_INFO 0x101
1305#define SMB_QUERY_FILE_STANDARD_INFO 0x102
1306#define SMB_QUERY_FILE_EA_INFO 0x103
1307#define SMB_QUERY_FILE_NAME_INFO 0x104
1308#define SMB_QUERY_FILE_ALLOCATION_INFO 0x105
1309#define SMB_QUERY_FILE_END_OF_FILEINFO 0x106
1310#define SMB_QUERY_FILE_ALL_INFO 0x107
1311#define SMB_QUERY_ALT_NAME_INFO 0x108
1312#define SMB_QUERY_FILE_STREAM_INFO 0x109
1313#define SMB_QUERY_FILE_COMPRESSION_INFO 0x10B
1314#define SMB_QUERY_FILE_UNIX_BASIC 0x200
1315#define SMB_QUERY_FILE_UNIX_LINK 0x201
1316#define SMB_QUERY_POSIX_ACL 0x204
1317#define SMB_QUERY_XATTR 0x205
1318#define SMB_QUERY_ATTR_FLAGS 0x206 /* append,immutable etc. */
Steve Frenchf654bac2005-04-28 22:41:04 -07001319#define SMB_QUERY_POSIX_PERMISSION 0x207
1320#define SMB_QUERY_POSIX_LOCK 0x208
Linus Torvalds1da177e2005-04-16 15:20:36 -07001321#define SMB_QUERY_FILE_INTERNAL_INFO 0x3ee
1322#define SMB_QUERY_FILE_ACCESS_INFO 0x3f0
1323#define SMB_QUERY_FILE_NAME_INFO2 0x3f1 /* 0x30 bytes */
1324#define SMB_QUERY_FILE_POSITION_INFO 0x3f6
1325#define SMB_QUERY_FILE_MODE_INFO 0x3f8
1326#define SMB_QUERY_FILE_ALGN_INFO 0x3f9
1327
1328
1329#define SMB_SET_FILE_BASIC_INFO 0x101
1330#define SMB_SET_FILE_DISPOSITION_INFO 0x102
1331#define SMB_SET_FILE_ALLOCATION_INFO 0x103
1332#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
1333#define SMB_SET_FILE_UNIX_BASIC 0x200
1334#define SMB_SET_FILE_UNIX_LINK 0x201
1335#define SMB_SET_FILE_UNIX_HLINK 0x203
1336#define SMB_SET_POSIX_ACL 0x204
1337#define SMB_SET_XATTR 0x205
1338#define SMB_SET_ATTR_FLAGS 0x206 /* append, immutable etc. */
Steve Frenchf654bac2005-04-28 22:41:04 -07001339#define SMB_SET_POSIX_LOCK 0x208
Linus Torvalds1da177e2005-04-16 15:20:36 -07001340#define SMB_SET_FILE_BASIC_INFO2 0x3ec
1341#define SMB_SET_FILE_RENAME_INFORMATION 0x3f2 /* BB check if qpathinfo level too */
1342#define SMB_FILE_ALL_INFO2 0x3fa
1343#define SMB_SET_FILE_ALLOCATION_INFO2 0x3fb
1344#define SMB_SET_FILE_END_OF_FILE_INFO2 0x3fc
1345#define SMB_FILE_MOVE_CLUSTER_INFO 0x407
1346#define SMB_FILE_QUOTA_INFO 0x408
1347#define SMB_FILE_REPARSEPOINT_INFO 0x409
1348#define SMB_FILE_MAXIMUM_INFO 0x40d
1349
1350/* Find File infolevels */
1351#define SMB_FIND_FILE_DIRECTORY_INFO 0x101
1352#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
1353#define SMB_FIND_FILE_NAMES_INFO 0x103
1354#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
1355#define SMB_FIND_FILE_ID_FULL_DIR_INFO 0x105
1356#define SMB_FIND_FILE_ID_BOTH_DIR_INFO 0x106
1357#define SMB_FIND_FILE_UNIX 0x202
1358
1359typedef struct smb_com_transaction2_qpi_req {
1360 struct smb_hdr hdr; /* wct = 14+ */
1361 __le16 TotalParameterCount;
1362 __le16 TotalDataCount;
1363 __le16 MaxParameterCount;
1364 __le16 MaxDataCount;
1365 __u8 MaxSetupCount;
1366 __u8 Reserved;
1367 __le16 Flags;
1368 __le32 Timeout;
1369 __u16 Reserved2;
1370 __le16 ParameterCount;
1371 __le16 ParameterOffset;
1372 __le16 DataCount;
1373 __le16 DataOffset;
1374 __u8 SetupCount;
1375 __u8 Reserved3;
1376 __le16 SubCommand; /* one setup word */
1377 __le16 ByteCount;
1378 __u8 Pad;
1379 __le16 InformationLevel;
1380 __u32 Reserved4;
1381 char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07001382} __attribute__((packed)) TRANSACTION2_QPI_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001383
1384typedef struct smb_com_transaction2_qpi_rsp {
1385 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1386 struct trans2_resp t2;
1387 __u16 ByteCount;
1388 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */
Steve French0753ca72005-10-27 13:55:12 -07001389} __attribute__((packed)) TRANSACTION2_QPI_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001390
1391typedef struct smb_com_transaction2_spi_req {
1392 struct smb_hdr hdr; /* wct = 15 */
1393 __le16 TotalParameterCount;
1394 __le16 TotalDataCount;
1395 __le16 MaxParameterCount;
1396 __le16 MaxDataCount;
1397 __u8 MaxSetupCount;
1398 __u8 Reserved;
1399 __le16 Flags;
1400 __le32 Timeout;
1401 __u16 Reserved2;
1402 __le16 ParameterCount;
1403 __le16 ParameterOffset;
1404 __le16 DataCount;
1405 __le16 DataOffset;
1406 __u8 SetupCount;
1407 __u8 Reserved3;
1408 __le16 SubCommand; /* one setup word */
1409 __le16 ByteCount;
1410 __u8 Pad;
1411 __u16 Pad1;
1412 __le16 InformationLevel;
1413 __u32 Reserved4;
1414 char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07001415} __attribute__((packed)) TRANSACTION2_SPI_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001416
1417typedef struct smb_com_transaction2_spi_rsp {
1418 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1419 struct trans2_resp t2;
1420 __u16 ByteCount;
1421 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */
Steve French0753ca72005-10-27 13:55:12 -07001422} __attribute__((packed)) TRANSACTION2_SPI_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001423
1424struct set_file_rename {
1425 __le32 overwrite; /* 1 = overwrite dest */
1426 __u32 root_fid; /* zero */
1427 __le32 target_name_len;
1428 char target_name[0]; /* Must be unicode */
Steve French0753ca72005-10-27 13:55:12 -07001429} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001430
1431struct smb_com_transaction2_sfi_req {
1432 struct smb_hdr hdr; /* wct = 15 */
1433 __le16 TotalParameterCount;
1434 __le16 TotalDataCount;
1435 __le16 MaxParameterCount;
1436 __le16 MaxDataCount;
1437 __u8 MaxSetupCount;
1438 __u8 Reserved;
1439 __le16 Flags;
1440 __le32 Timeout;
1441 __u16 Reserved2;
1442 __le16 ParameterCount;
1443 __le16 ParameterOffset;
1444 __le16 DataCount;
1445 __le16 DataOffset;
1446 __u8 SetupCount;
1447 __u8 Reserved3;
1448 __le16 SubCommand; /* one setup word */
1449 __le16 ByteCount;
1450 __u8 Pad;
1451 __u16 Pad1;
1452 __u16 Fid;
1453 __le16 InformationLevel;
1454 __u16 Reserved4;
Steve French0753ca72005-10-27 13:55:12 -07001455} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001456
1457struct smb_com_transaction2_sfi_rsp {
1458 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1459 struct trans2_resp t2;
1460 __u16 ByteCount;
Steve Frenchf654bac2005-04-28 22:41:04 -07001461 __u16 Reserved2; /* parameter word reserved -
1462 present for infolevels > 100 */
Steve French0753ca72005-10-27 13:55:12 -07001463} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001464
Steve Frenchf654bac2005-04-28 22:41:04 -07001465struct smb_t2_qfi_req {
1466 struct smb_hdr hdr;
1467 struct trans2_req t2;
1468 __u8 Pad;
Steve Frenchf654bac2005-04-28 22:41:04 -07001469 __u16 Fid;
1470 __le16 InformationLevel;
Steve French0753ca72005-10-27 13:55:12 -07001471} __attribute__((packed));
Steve Frenchf654bac2005-04-28 22:41:04 -07001472
1473struct smb_t2_qfi_rsp {
1474 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1475 struct trans2_resp t2;
1476 __u16 ByteCount;
1477 __u16 Reserved2; /* parameter word reserved -
1478 present for infolevels > 100 */
Steve French0753ca72005-10-27 13:55:12 -07001479} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001480
1481/*
1482 * Flags on T2 FINDFIRST and FINDNEXT
1483 */
1484#define CIFS_SEARCH_CLOSE_ALWAYS 0x0001
1485#define CIFS_SEARCH_CLOSE_AT_END 0x0002
1486#define CIFS_SEARCH_RETURN_RESUME 0x0004
1487#define CIFS_SEARCH_CONTINUE_FROM_LAST 0x0008
1488#define CIFS_SEARCH_BACKUP_SEARCH 0x0010
1489
1490/*
1491 * Size of the resume key on FINDFIRST and FINDNEXT calls
1492 */
1493#define CIFS_SMB_RESUME_KEY_SIZE 4
1494
1495typedef struct smb_com_transaction2_ffirst_req {
1496 struct smb_hdr hdr; /* wct = 15 */
1497 __le16 TotalParameterCount;
1498 __le16 TotalDataCount;
1499 __le16 MaxParameterCount;
1500 __le16 MaxDataCount;
1501 __u8 MaxSetupCount;
1502 __u8 Reserved;
1503 __le16 Flags;
1504 __le32 Timeout;
1505 __u16 Reserved2;
1506 __le16 ParameterCount;
1507 __le16 ParameterOffset;
1508 __le16 DataCount;
1509 __le16 DataOffset;
1510 __u8 SetupCount; /* one */
1511 __u8 Reserved3;
1512 __le16 SubCommand; /* TRANS2_FIND_FIRST */
1513 __le16 ByteCount;
1514 __u8 Pad;
1515 __le16 SearchAttributes;
1516 __le16 SearchCount;
1517 __le16 SearchFlags;
1518 __le16 InformationLevel;
1519 __le32 SearchStorageType;
1520 char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07001521} __attribute__((packed)) TRANSACTION2_FFIRST_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001522
1523typedef struct smb_com_transaction2_ffirst_rsp {
1524 struct smb_hdr hdr; /* wct = 10 */
1525 struct trans2_resp t2;
1526 __u16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -07001527} __attribute__((packed)) TRANSACTION2_FFIRST_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001528
1529typedef struct smb_com_transaction2_ffirst_rsp_parms {
1530 __u16 SearchHandle;
1531 __le16 SearchCount;
1532 __le16 EndofSearch;
1533 __le16 EAErrorOffset;
1534 __le16 LastNameOffset;
Steve French0753ca72005-10-27 13:55:12 -07001535} __attribute__((packed)) T2_FFIRST_RSP_PARMS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001536
1537typedef struct smb_com_transaction2_fnext_req {
1538 struct smb_hdr hdr; /* wct = 15 */
1539 __le16 TotalParameterCount;
1540 __le16 TotalDataCount;
1541 __le16 MaxParameterCount;
1542 __le16 MaxDataCount;
1543 __u8 MaxSetupCount;
1544 __u8 Reserved;
1545 __le16 Flags;
1546 __le32 Timeout;
1547 __u16 Reserved2;
1548 __le16 ParameterCount;
1549 __le16 ParameterOffset;
1550 __le16 DataCount;
1551 __le16 DataOffset;
1552 __u8 SetupCount; /* one */
1553 __u8 Reserved3;
1554 __le16 SubCommand; /* TRANS2_FIND_NEXT */
1555 __le16 ByteCount;
1556 __u8 Pad;
1557 __u16 SearchHandle;
1558 __le16 SearchCount;
1559 __le16 InformationLevel;
1560 __u32 ResumeKey;
1561 __le16 SearchFlags;
1562 char ResumeFileName[1];
Steve French0753ca72005-10-27 13:55:12 -07001563} __attribute__((packed)) TRANSACTION2_FNEXT_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001564
1565typedef struct smb_com_transaction2_fnext_rsp {
1566 struct smb_hdr hdr; /* wct = 10 */
1567 struct trans2_resp t2;
1568 __u16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -07001569} __attribute__((packed)) TRANSACTION2_FNEXT_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001570
1571typedef struct smb_com_transaction2_fnext_rsp_parms {
1572 __le16 SearchCount;
1573 __le16 EndofSearch;
1574 __le16 EAErrorOffset;
1575 __le16 LastNameOffset;
Steve French0753ca72005-10-27 13:55:12 -07001576} __attribute__((packed)) T2_FNEXT_RSP_PARMS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001577
1578/* QFSInfo Levels */
1579#define SMB_INFO_ALLOCATION 1
1580#define SMB_INFO_VOLUME 2
1581#define SMB_QUERY_FS_VOLUME_INFO 0x102
1582#define SMB_QUERY_FS_SIZE_INFO 0x103
1583#define SMB_QUERY_FS_DEVICE_INFO 0x104
1584#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
1585#define SMB_QUERY_CIFS_UNIX_INFO 0x200
1586#define SMB_QUERY_POSIX_FS_INFO 0x201
1587#define SMB_QUERY_LABEL_INFO 0x3ea
1588#define SMB_QUERY_FS_QUOTA_INFO 0x3ee
1589#define SMB_QUERY_FS_FULL_SIZE_INFO 0x3ef
1590#define SMB_QUERY_OBJECTID_INFO 0x3f0
1591
1592typedef struct smb_com_transaction2_qfsi_req {
1593 struct smb_hdr hdr; /* wct = 14+ */
1594 __le16 TotalParameterCount;
1595 __le16 TotalDataCount;
1596 __le16 MaxParameterCount;
1597 __le16 MaxDataCount;
1598 __u8 MaxSetupCount;
1599 __u8 Reserved;
1600 __le16 Flags;
1601 __le32 Timeout;
1602 __u16 Reserved2;
1603 __le16 ParameterCount;
1604 __le16 ParameterOffset;
1605 __le16 DataCount;
1606 __le16 DataOffset;
1607 __u8 SetupCount;
1608 __u8 Reserved3;
1609 __le16 SubCommand; /* one setup word */
1610 __le16 ByteCount;
1611 __u8 Pad;
1612 __le16 InformationLevel;
Steve French0753ca72005-10-27 13:55:12 -07001613} __attribute__((packed)) TRANSACTION2_QFSI_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001614
1615typedef struct smb_com_transaction_qfsi_rsp {
1616 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1617 struct trans2_resp t2;
1618 __u16 ByteCount;
1619 __u8 Pad; /* may be three bytes *//* followed by data area */
Steve French0753ca72005-10-27 13:55:12 -07001620} __attribute__((packed)) TRANSACTION2_QFSI_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001621
Jeremy Allisonac670552005-06-22 17:26:35 -07001622
1623/* SETFSInfo Levels */
1624#define SMB_SET_CIFS_UNIX_INFO 0x200
1625typedef struct smb_com_transaction2_setfsi_req {
1626 struct smb_hdr hdr; /* wct = 15 */
1627 __le16 TotalParameterCount;
1628 __le16 TotalDataCount;
1629 __le16 MaxParameterCount;
1630 __le16 MaxDataCount;
1631 __u8 MaxSetupCount;
1632 __u8 Reserved;
1633 __le16 Flags;
1634 __le32 Timeout;
1635 __u16 Reserved2;
1636 __le16 ParameterCount; /* 4 */
1637 __le16 ParameterOffset;
1638 __le16 DataCount; /* 12 */
1639 __le16 DataOffset;
1640 __u8 SetupCount; /* one */
1641 __u8 Reserved3;
1642 __le16 SubCommand; /* TRANS2_SET_FS_INFORMATION */
1643 __le16 ByteCount;
1644 __u8 Pad;
1645 __u16 FileNum; /* Parameters start. */
1646 __le16 InformationLevel;/* Parameters end. */
1647 __le16 ClientUnixMajor; /* Data start. */
1648 __le16 ClientUnixMinor;
1649 __le64 ClientUnixCap; /* Data end */
Steve French0753ca72005-10-27 13:55:12 -07001650} __attribute__((packed)) TRANSACTION2_SETFSI_REQ;
Jeremy Allisonac670552005-06-22 17:26:35 -07001651
1652typedef struct smb_com_transaction2_setfsi_rsp {
1653 struct smb_hdr hdr; /* wct = 10 */
1654 struct trans2_resp t2;
1655 __u16 ByteCount;
Steve French0753ca72005-10-27 13:55:12 -07001656} __attribute__((packed)) TRANSACTION2_SETFSI_RSP;
Jeremy Allisonac670552005-06-22 17:26:35 -07001657
1658
Linus Torvalds1da177e2005-04-16 15:20:36 -07001659typedef struct smb_com_transaction2_get_dfs_refer_req {
1660 struct smb_hdr hdr; /* wct = 15 */
1661 __le16 TotalParameterCount;
1662 __le16 TotalDataCount;
1663 __le16 MaxParameterCount;
1664 __le16 MaxDataCount;
1665 __u8 MaxSetupCount;
1666 __u8 Reserved;
1667 __le16 Flags;
1668 __le32 Timeout;
1669 __u16 Reserved2;
1670 __le16 ParameterCount;
1671 __le16 ParameterOffset;
1672 __le16 DataCount;
1673 __le16 DataOffset;
1674 __u8 SetupCount;
1675 __u8 Reserved3;
1676 __le16 SubCommand; /* one setup word */
1677 __le16 ByteCount;
1678 __u8 Pad[3]; /* Win2K has sent 0x0F01 (max resp length perhaps?) followed by one byte pad - doesn't seem to matter though */
1679 __le16 MaxReferralLevel;
1680 char RequestFileName[1];
Steve French0753ca72005-10-27 13:55:12 -07001681} __attribute__((packed)) TRANSACTION2_GET_DFS_REFER_REQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001682
1683typedef struct dfs_referral_level_3 {
1684 __le16 VersionNumber;
1685 __le16 ReferralSize;
1686 __le16 ServerType; /* 0x0001 = CIFS server */
1687 __le16 ReferralFlags; /* or proximity - not clear which since always set to zero - SNIA spec says 0x01 means strip off PathConsumed chars before submitting RequestFileName to remote node */
1688 __le16 TimeToLive;
1689 __le16 Proximity;
1690 __le16 DfsPathOffset;
1691 __le16 DfsAlternatePathOffset;
1692 __le16 NetworkAddressOffset;
Steve French0753ca72005-10-27 13:55:12 -07001693} __attribute__((packed)) REFERRAL3;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001694
1695typedef struct smb_com_transaction_get_dfs_refer_rsp {
1696 struct smb_hdr hdr; /* wct = 10 */
1697 struct trans2_resp t2;
1698 __u16 ByteCount;
1699 __u8 Pad;
1700 __le16 PathConsumed;
1701 __le16 NumberOfReferrals;
1702 __le16 DFSFlags;
1703 __u16 Pad2;
1704 REFERRAL3 referrals[1]; /* array of level 3 dfs_referral structures */
1705 /* followed by the strings pointed to by the referral structures */
Steve French0753ca72005-10-27 13:55:12 -07001706} __attribute__((packed)) TRANSACTION2_GET_DFS_REFER_RSP;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001707
1708/* DFS Flags */
1709#define DFSREF_REFERRAL_SERVER 0x0001
1710#define DFSREF_STORAGE_SERVER 0x0002
1711
1712/* IOCTL information */
1713/* List of ioctl function codes that look to be of interest to remote clients like this. */
1714/* Need to do some experimentation to make sure they all work remotely. */
1715/* Some of the following such as the encryption/compression ones would be */
1716/* invoked from tools via a specialized hook into the VFS rather than via the */
1717/* standard vfs entry points */
1718#define FSCTL_REQUEST_OPLOCK_LEVEL_1 0x00090000
1719#define FSCTL_REQUEST_OPLOCK_LEVEL_2 0x00090004
1720#define FSCTL_REQUEST_BATCH_OPLOCK 0x00090008
1721#define FSCTL_LOCK_VOLUME 0x00090018
1722#define FSCTL_UNLOCK_VOLUME 0x0009001C
1723#define FSCTL_GET_COMPRESSION 0x0009003C
1724#define FSCTL_SET_COMPRESSION 0x0009C040
1725#define FSCTL_REQUEST_FILTER_OPLOCK 0x0009008C
1726#define FSCTL_FILESYS_GET_STATISTICS 0x00090090
1727#define FSCTL_SET_REPARSE_POINT 0x000900A4
1728#define FSCTL_GET_REPARSE_POINT 0x000900A8
1729#define FSCTL_DELETE_REPARSE_POINT 0x000900AC
1730#define FSCTL_SET_SPARSE 0x000900C4
1731#define FSCTL_SET_ZERO_DATA 0x000900C8
1732#define FSCTL_SET_ENCRYPTION 0x000900D7
1733#define FSCTL_ENCRYPTION_FSCTL_IO 0x000900DB
1734#define FSCTL_WRITE_RAW_ENCRYPTED 0x000900DF
1735#define FSCTL_READ_RAW_ENCRYPTED 0x000900E3
1736#define FSCTL_SIS_COPYFILE 0x00090100
1737#define FSCTL_SIS_LINK_FILES 0x0009C104
1738
1739#define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
1740#define IO_REPARSE_TAG_HSM 0xC0000004
1741#define IO_REPARSE_TAG_SIS 0x80000007
1742
1743/*
1744 ************************************************************************
1745 * All structs for everything above the SMB PDUs themselves
1746 * (such as the T2 level specific data) go here
1747 ************************************************************************
1748 */
1749
1750/*
1751 * Information on a server
1752 */
1753
1754struct serverInfo {
1755 char name[16];
1756 unsigned char versionMajor;
1757 unsigned char versionMinor;
1758 unsigned long type;
1759 unsigned int commentOffset;
Steve French0753ca72005-10-27 13:55:12 -07001760} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001761
1762/*
1763 * The following structure is the format of the data returned on a NetShareEnum
1764 * with level "90" (x5A)
1765 */
1766
1767struct shareInfo {
1768 char shareName[13];
1769 char pad;
1770 unsigned short type;
1771 unsigned int commentOffset;
Steve French0753ca72005-10-27 13:55:12 -07001772} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001773
1774struct aliasInfo {
1775 char aliasName[9];
1776 char pad;
1777 unsigned int commentOffset;
1778 unsigned char type[2];
Steve French0753ca72005-10-27 13:55:12 -07001779} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001780
1781struct aliasInfo92 {
1782 int aliasNameOffset;
1783 int serverNameOffset;
1784 int shareNameOffset;
Steve French0753ca72005-10-27 13:55:12 -07001785} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001786
1787typedef struct {
1788 __le64 TotalAllocationUnits;
1789 __le64 FreeAllocationUnits;
1790 __le32 SectorsPerAllocationUnit;
1791 __le32 BytesPerSector;
Steve French0753ca72005-10-27 13:55:12 -07001792} __attribute__((packed)) FILE_SYSTEM_INFO; /* size info, level 0x103 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001793
1794typedef struct {
Steve French20962432005-09-21 22:05:57 -07001795 __le32 fsid;
1796 __le32 SectorsPerAllocationUnit;
1797 __le32 TotalAllocationUnits;
1798 __le32 FreeAllocationUnits;
1799 __le16 BytesPerSector;
Steve French0753ca72005-10-27 13:55:12 -07001800} __attribute__((packed)) FILE_SYSTEM_ALLOC_INFO;
Steve French20962432005-09-21 22:05:57 -07001801
1802typedef struct {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001803 __le16 MajorVersionNumber;
1804 __le16 MinorVersionNumber;
1805 __le64 Capability;
Steve French0753ca72005-10-27 13:55:12 -07001806} __attribute__((packed)) FILE_SYSTEM_UNIX_INFO; /* Unix extensions info, level 0x200 */
Jeremy Allisonac670552005-06-22 17:26:35 -07001807
1808/* Version numbers for CIFS UNIX major and minor. */
1809#define CIFS_UNIX_MAJOR_VERSION 1
1810#define CIFS_UNIX_MINOR_VERSION 0
1811
Linus Torvalds1da177e2005-04-16 15:20:36 -07001812/* Linux/Unix extensions capability flags */
1813#define CIFS_UNIX_FCNTL_CAP 0x00000001 /* support for fcntl locks */
Steve Frenchf654bac2005-04-28 22:41:04 -07001814#define CIFS_UNIX_POSIX_ACL_CAP 0x00000002 /* support getfacl/setfacl */
1815#define CIFS_UNIX_XATTR_CAP 0x00000004 /* support new namespace */
1816#define CIFS_UNIX_EXTATTR_CAP 0x00000008 /* support chattr/chflag */
Steve French82940a42006-03-02 03:24:57 +00001817#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x00000010 /* Allow POSIX path chars */
1818#ifdef CONFIG_CIFS_POSIX
1819#define CIFS_UNIX_CAP_MASK 0x0000001b
1820#else
1821#define CIFS_UNIX_CAP_MASK 0x00000013
1822#endif /* CONFIG_CIFS_POSIX */
1823
Jeremy Allisonac670552005-06-22 17:26:35 -07001824
Steve Frenchf28ac912005-04-28 22:41:07 -07001825#define CIFS_POSIX_EXTENSIONS 0x00000010 /* support for new QFSInfo */
Jeremy Allisonac670552005-06-22 17:26:35 -07001826
Linus Torvalds1da177e2005-04-16 15:20:36 -07001827typedef struct {
1828 /* For undefined recommended transfer size return -1 in that field */
1829 __le32 OptimalTransferSize; /* bsize on some os, iosize on other os */
1830 __le32 BlockSize;
1831 /* The next three fields are in terms of the block size.
1832 (above). If block size is unknown, 4096 would be a
1833 reasonable block size for a server to report.
1834 Note that returning the blocks/blocksavail removes need
1835 to make a second call (to QFSInfo level 0x103 to get this info.
1836 UserBlockAvail is typically less than or equal to BlocksAvail,
1837 if no distinction is made return the same value in each */
1838 __le64 TotalBlocks;
1839 __le64 BlocksAvail; /* bfree */
1840 __le64 UserBlocksAvail; /* bavail */
1841 /* For undefined Node fields or FSID return -1 */
1842 __le64 TotalFileNodes;
1843 __le64 FreeFileNodes;
1844 __le64 FileSysIdentifier; /* fsid */
1845 /* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */
1846 /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */
Steve French0753ca72005-10-27 13:55:12 -07001847} __attribute__((packed)) FILE_SYSTEM_POSIX_INFO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001848
1849/* DeviceType Flags */
1850#define FILE_DEVICE_CD_ROM 0x00000002
1851#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
1852#define FILE_DEVICE_DFS 0x00000006
1853#define FILE_DEVICE_DISK 0x00000007
1854#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
1855#define FILE_DEVICE_FILE_SYSTEM 0x00000009
1856#define FILE_DEVICE_NAMED_PIPE 0x00000011
1857#define FILE_DEVICE_NETWORK 0x00000012
1858#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
1859#define FILE_DEVICE_NULL 0x00000015
1860#define FILE_DEVICE_PARALLEL_PORT 0x00000016
1861#define FILE_DEVICE_PRINTER 0x00000018
1862#define FILE_DEVICE_SERIAL_PORT 0x0000001b
1863#define FILE_DEVICE_STREAMS 0x0000001e
1864#define FILE_DEVICE_TAPE 0x0000001f
1865#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
1866#define FILE_DEVICE_VIRTUAL_DISK 0x00000024
1867#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
1868
1869typedef struct {
1870 __le32 DeviceType;
1871 __le32 DeviceCharacteristics;
Steve French39798772006-05-31 22:40:51 +00001872} __attribute__((packed)) FILE_SYSTEM_DEVICE_INFO; /* device info level 0x104 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001873
1874typedef struct {
1875 __le32 Attributes;
1876 __le32 MaxPathNameComponentLength;
1877 __le32 FileSystemNameLen;
Steve French39798772006-05-31 22:40:51 +00001878 char FileSystemName[52]; /* do not have to save this - get subset? */
Steve French0753ca72005-10-27 13:55:12 -07001879} __attribute__((packed)) FILE_SYSTEM_ATTRIBUTE_INFO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001880
1881/******************************************************************************/
1882/* QueryFileInfo/QueryPathinfo (also for SetPath/SetFile) data buffer formats */
1883/******************************************************************************/
1884typedef struct { /* data block encoding of response to level 263 QPathInfo */
1885 __le64 CreationTime;
1886 __le64 LastAccessTime;
1887 __le64 LastWriteTime;
1888 __le64 ChangeTime;
1889 __le32 Attributes;
1890 __u32 Pad1;
1891 __le64 AllocationSize;
1892 __le64 EndOfFile; /* size ie offset to first free byte in file */
1893 __le32 NumberOfLinks; /* hard links */
1894 __u8 DeletePending;
1895 __u8 Directory;
1896 __u16 Pad2;
1897 __u64 IndexNumber;
1898 __le32 EASize;
1899 __le32 AccessFlags;
1900 __u64 IndexNumber1;
1901 __le64 CurrentByteOffset;
1902 __le32 Mode;
1903 __le32 AlignmentRequirement;
1904 __le32 FileNameLength;
1905 char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07001906} __attribute__((packed)) FILE_ALL_INFO; /* level 0x107 QPathInfo */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001907
1908/* defines for enumerating possible values of the Unix type field below */
1909#define UNIX_FILE 0
1910#define UNIX_DIR 1
1911#define UNIX_SYMLINK 2
1912#define UNIX_CHARDEV 3
1913#define UNIX_BLOCKDEV 4
1914#define UNIX_FIFO 5
1915#define UNIX_SOCKET 6
1916typedef struct {
1917 __le64 EndOfFile;
1918 __le64 NumOfBytes;
1919 __le64 LastStatusChange; /*SNIA specs DCE time for the 3 time fields */
1920 __le64 LastAccessTime;
1921 __le64 LastModificationTime;
1922 __le64 Uid;
1923 __le64 Gid;
1924 __le32 Type;
1925 __le64 DevMajor;
1926 __le64 DevMinor;
1927 __u64 UniqueId;
1928 __le64 Permissions;
1929 __le64 Nlinks;
Steve French0753ca72005-10-27 13:55:12 -07001930} __attribute__((packed)) FILE_UNIX_BASIC_INFO; /* level 0x200 QPathInfo */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001931
1932typedef struct {
1933 char LinkDest[1];
Steve French0753ca72005-10-27 13:55:12 -07001934} __attribute__((packed)) FILE_UNIX_LINK_INFO; /* level 0x201 QPathInfo */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001935
1936/* The following three structures are needed only for
1937 setting time to NT4 and some older servers via
1938 the primitive DOS time format */
1939typedef struct {
1940 __u16 Day:5;
1941 __u16 Month:4;
1942 __u16 Year:7;
Steve French0753ca72005-10-27 13:55:12 -07001943} __attribute__((packed)) SMB_DATE;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001944
1945typedef struct {
1946 __u16 TwoSeconds:5;
1947 __u16 Minutes:6;
1948 __u16 Hours:5;
Steve French0753ca72005-10-27 13:55:12 -07001949} __attribute__((packed)) SMB_TIME;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001950
1951typedef struct {
1952 __le16 CreationDate; /* SMB Date see above */
1953 __le16 CreationTime; /* SMB Time */
1954 __le16 LastAccessDate;
1955 __le16 LastAccessTime;
1956 __le16 LastWriteDate;
1957 __le16 LastWriteTime;
1958 __le32 DataSize; /* File Size (EOF) */
1959 __le32 AllocationSize;
1960 __le16 Attributes; /* verify not u32 */
1961 __le32 EASize;
Steve French0753ca72005-10-27 13:55:12 -07001962} __attribute__((packed)) FILE_INFO_STANDARD; /* level 1 SetPath/FileInfo */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001963
1964typedef struct {
1965 __le64 CreationTime;
1966 __le64 LastAccessTime;
1967 __le64 LastWriteTime;
1968 __le64 ChangeTime;
1969 __le32 Attributes;
1970 __u32 Pad;
Steve French0753ca72005-10-27 13:55:12 -07001971} __attribute__((packed)) FILE_BASIC_INFO; /* size info, level 0x101 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001972
1973struct file_allocation_info {
1974 __le64 AllocationSize; /* Note old Samba srvr rounds this up too much */
Steve French0753ca72005-10-27 13:55:12 -07001975} __attribute__((packed)); /* size used on disk, level 0x103 for set, 0x105 for query */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001976
1977struct file_end_of_file_info {
1978 __le64 FileSize; /* offset to end of file */
Steve French0753ca72005-10-27 13:55:12 -07001979} __attribute__((packed)); /* size info, level 0x104 for set, 0x106 for query */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001980
1981struct file_alt_name_info {
1982 __u8 alt_name[1];
Steve French0753ca72005-10-27 13:55:12 -07001983} __attribute__((packed)); /* level 0x0108 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001984
1985struct file_stream_info {
1986 __le32 number_of_streams; /* BB check sizes and verify location */
1987 /* followed by info on streams themselves
1988 u64 size;
1989 u64 allocation_size
1990 stream info */
1991}; /* level 0x109 */
1992
1993struct file_compression_info {
1994 __le64 compressed_size;
1995 __le16 format;
1996 __u8 unit_shift;
1997 __u8 ch_shift;
1998 __u8 cl_shift;
1999 __u8 pad[3];
Steve French0753ca72005-10-27 13:55:12 -07002000} __attribute__((packed)); /* level 0x10b */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002001
2002/* POSIX ACL set/query path info structures */
2003#define CIFS_ACL_VERSION 1
2004struct cifs_posix_ace { /* access control entry (ACE) */
2005 __u8 cifs_e_tag;
2006 __u8 cifs_e_perm;
2007 __le64 cifs_uid; /* or gid */
Steve French0753ca72005-10-27 13:55:12 -07002008} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002009
2010struct cifs_posix_acl { /* access conrol list (ACL) */
2011 __le16 version;
2012 __le16 access_entry_count; /* access ACL - count of entries */
2013 __le16 default_entry_count; /* default ACL - count of entries */
2014 struct cifs_posix_ace ace_array[0];
2015 /* followed by
2016 struct cifs_posix_ace default_ace_arraay[] */
Steve French0753ca72005-10-27 13:55:12 -07002017} __attribute__((packed)); /* level 0x204 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002018
2019/* types of access control entries already defined in posix_acl.h */
2020/* #define CIFS_POSIX_ACL_USER_OBJ 0x01
2021#define CIFS_POSIX_ACL_USER 0x02
2022#define CIFS_POSIX_ACL_GROUP_OBJ 0x04
2023#define CIFS_POSIX_ACL_GROUP 0x08
2024#define CIFS_POSIX_ACL_MASK 0x10
2025#define CIFS_POSIX_ACL_OTHER 0x20 */
2026
2027/* types of perms */
2028/* #define CIFS_POSIX_ACL_EXECUTE 0x01
2029#define CIFS_POSIX_ACL_WRITE 0x02
2030#define CIFS_POSIX_ACL_READ 0x04 */
2031
2032/* end of POSIX ACL definitions */
2033
2034struct file_internal_info {
2035 __u64 UniqueId; /* inode number */
Steve French0753ca72005-10-27 13:55:12 -07002036} __attribute__((packed)); /* level 0x3ee */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002037struct file_mode_info {
2038 __le32 Mode;
Steve French0753ca72005-10-27 13:55:12 -07002039} __attribute__((packed)); /* level 0x3f8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002040
2041struct file_attrib_tag {
2042 __le32 Attribute;
2043 __le32 ReparseTag;
Steve French0753ca72005-10-27 13:55:12 -07002044} __attribute__((packed)); /* level 0x40b */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002045
2046
2047/********************************************************/
2048/* FindFirst/FindNext transact2 data buffer formats */
2049/********************************************************/
2050
2051typedef struct {
2052 __le32 NextEntryOffset;
2053 __u32 ResumeKey; /* as with FileIndex - no need to convert */
2054 __le64 EndOfFile;
2055 __le64 NumOfBytes;
2056 __le64 LastStatusChange; /*SNIA specs DCE time for the 3 time fields */
2057 __le64 LastAccessTime;
2058 __le64 LastModificationTime;
2059 __le64 Uid;
2060 __le64 Gid;
2061 __le32 Type;
2062 __le64 DevMajor;
2063 __le64 DevMinor;
2064 __u64 UniqueId;
2065 __le64 Permissions;
2066 __le64 Nlinks;
2067 char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07002068} __attribute__((packed)) FILE_UNIX_INFO; /* level 0x202 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002069
2070typedef struct {
2071 __le32 NextEntryOffset;
2072 __u32 FileIndex;
2073 __le64 CreationTime;
2074 __le64 LastAccessTime;
2075 __le64 LastWriteTime;
2076 __le64 ChangeTime;
2077 __le64 EndOfFile;
2078 __le64 AllocationSize;
2079 __le32 ExtFileAttributes;
2080 __le32 FileNameLength;
2081 char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07002082} __attribute__((packed)) FILE_DIRECTORY_INFO; /* level 0x101 FF response data area */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002083
2084typedef struct {
2085 __le32 NextEntryOffset;
2086 __u32 FileIndex;
2087 __le64 CreationTime;
2088 __le64 LastAccessTime;
2089 __le64 LastWriteTime;
2090 __le64 ChangeTime;
2091 __le64 EndOfFile;
2092 __le64 AllocationSize;
2093 __le32 ExtFileAttributes;
2094 __le32 FileNameLength;
2095 __le32 EaSize; /* length of the xattrs */
2096 char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07002097} __attribute__((packed)) FILE_FULL_DIRECTORY_INFO; /* level 0x102 FF response data area */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002098
2099typedef struct {
2100 __le32 NextEntryOffset;
2101 __u32 FileIndex;
2102 __le64 CreationTime;
2103 __le64 LastAccessTime;
2104 __le64 LastWriteTime;
2105 __le64 ChangeTime;
2106 __le64 EndOfFile;
2107 __le64 AllocationSize;
2108 __le32 ExtFileAttributes;
2109 __le32 FileNameLength;
2110 __le32 EaSize; /* EA size */
2111 __le32 Reserved;
2112 __u64 UniqueId; /* inode num - le since Samba puts ino in low 32 bit*/
2113 char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07002114} __attribute__((packed)) SEARCH_ID_FULL_DIR_INFO; /* level 0x105 FF response data area */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002115
2116typedef struct {
2117 __le32 NextEntryOffset;
2118 __u32 FileIndex;
2119 __le64 CreationTime;
2120 __le64 LastAccessTime;
2121 __le64 LastWriteTime;
2122 __le64 ChangeTime;
2123 __le64 EndOfFile;
2124 __le64 AllocationSize;
2125 __le32 ExtFileAttributes;
2126 __le32 FileNameLength;
2127 __le32 EaSize; /* length of the xattrs */
2128 __u8 ShortNameLength;
2129 __u8 Reserved;
2130 __u8 ShortName[12];
2131 char FileName[1];
Steve French0753ca72005-10-27 13:55:12 -07002132} __attribute__((packed)) FILE_BOTH_DIRECTORY_INFO; /* level 0x104 FF response data area */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002133
2134
Steve French86c96b42005-11-18 20:25:31 -08002135struct win_dev {
2136 unsigned char type[8]; /* IntxCHR or IntxBLK */
2137 __le64 major;
2138 __le64 minor;
2139} __attribute__((packed));
2140
Linus Torvalds1da177e2005-04-16 15:20:36 -07002141struct gea {
2142 unsigned char name_len;
2143 char name[1];
Steve French0753ca72005-10-27 13:55:12 -07002144} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002145
2146struct gealist {
2147 unsigned long list_len;
2148 struct gea list[1];
Steve French0753ca72005-10-27 13:55:12 -07002149} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002150
2151struct fea {
2152 unsigned char EA_flags;
2153 __u8 name_len;
2154 __le16 value_len;
2155 char name[1];
2156 /* optionally followed by value */
Steve French0753ca72005-10-27 13:55:12 -07002157} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002158/* flags for _FEA.fEA */
2159#define FEA_NEEDEA 0x80 /* need EA bit */
2160
2161struct fealist {
2162 __le32 list_len;
2163 struct fea list[1];
Steve French0753ca72005-10-27 13:55:12 -07002164} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002165
2166/* used to hold an arbitrary blob of data */
2167struct data_blob {
2168 __u8 *data;
2169 size_t length;
2170 void (*free) (struct data_blob * data_blob);
Steve French0753ca72005-10-27 13:55:12 -07002171} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002172
2173
2174#ifdef CONFIG_CIFS_POSIX
2175/*
2176 For better POSIX semantics from Linux client, (even better
2177 than the existing CIFS Unix Extensions) we need updated PDUs for:
2178
2179 1) PosixCreateX - to set and return the mode, inode#, device info and
2180 perhaps add a CreateDevice - to create Pipes and other special .inodes
2181 Also note POSIX open flags
2182 2) Close - to return the last write time to do cache across close more safely
Steve French1982c342005-08-17 12:38:22 -07002183 3) FindFirst return unique inode number - what about resume key, two
2184 forms short (matches readdir) and full (enough info to cache inodes)
2185 4) Mkdir - set mode
Linus Torvalds1da177e2005-04-16 15:20:36 -07002186
2187 And under consideration:
Steve French1982c342005-08-17 12:38:22 -07002188 5) FindClose2 (return nanosecond timestamp ??)
2189 6) Use nanosecond timestamps throughout all time fields if
Linus Torvalds1da177e2005-04-16 15:20:36 -07002190 corresponding attribute flag is set
Steve French1982c342005-08-17 12:38:22 -07002191 7) sendfile - handle based copy
2192 8) Direct i/o
2193 9) Misc fcntls?
Linus Torvalds1da177e2005-04-16 15:20:36 -07002194
2195 what about fixing 64 bit alignment
2196
2197 There are also various legacy SMB/CIFS requests used as is
2198
2199 From existing Lanman and NTLM dialects:
2200 --------------------------------------
2201 NEGOTIATE
2202 SESSION_SETUP_ANDX (BB which?)
2203 TREE_CONNECT_ANDX (BB which wct?)
2204 TREE_DISCONNECT (BB add volume timestamp on response)
2205 LOGOFF_ANDX
2206 DELETE (note delete open file behavior)
2207 DELETE_DIRECTORY
2208 READ_AND_X
2209 WRITE_AND_X
2210 LOCKING_AND_X (note posix lock semantics)
2211 RENAME (note rename across dirs and open file rename posix behaviors)
2212 NT_RENAME (for hardlinks) Is this good enough for all features?
2213 FIND_CLOSE2
2214 TRANSACTION2 (18 cases)
2215 SMB_SET_FILE_END_OF_FILE_INFO2 SMB_SET_PATH_END_OF_FILE_INFO2
2216 (BB verify that never need to set allocation size)
2217 SMB_SET_FILE_BASIC_INFO2 (setting times - BB can it be done via Unix ext?)
2218
2219 COPY (note support for copy across directories) - FUTURE, OPTIONAL
2220 setting/getting OS/2 EAs - FUTURE (BB can this handle
2221 setting Linux xattrs perfectly) - OPTIONAL
2222 dnotify - FUTURE, OPTIONAL
2223 quota - FUTURE, OPTIONAL
2224
2225 Note that various requests implemented for NT interop such as
2226 NT_TRANSACT (IOCTL) QueryReparseInfo
2227 are unneeded to servers compliant with the CIFS POSIX extensions
2228
2229 From CIFS Unix Extensions:
2230 -------------------------
2231 T2 SET_PATH_INFO (SMB_SET_FILE_UNIX_LINK) for symlinks
2232 T2 SET_PATH_INFO (SMB_SET_FILE_BASIC_INFO2)
2233 T2 QUERY_PATH_INFO (SMB_QUERY_FILE_UNIX_LINK)
2234 T2 QUERY_PATH_INFO (SMB_QUERY_FILE_UNIX_BASIC) - BB check for missing inode fields
2235 Actually need QUERY_FILE_UNIX_INFO since has inode num
2236 BB what about a) blksize/blkbits/blocks
2237 b) i_version
2238 c) i_rdev
2239 d) notify mask?
2240 e) generation
2241 f) size_seqcount
2242 T2 FIND_FIRST/FIND_NEXT FIND_FILE_UNIX
2243 TRANS2_GET_DFS_REFERRAL - OPTIONAL but recommended
2244 T2_QFS_INFO QueryDevice/AttributeInfo - OPTIONAL
2245
2246
2247 */
2248
Steve French1982c342005-08-17 12:38:22 -07002249/* xsymlink is a symlink format (used by MacOS) that can be used
Linus Torvalds1da177e2005-04-16 15:20:36 -07002250 to save symlink info in a regular file when
2251 mounted to operating systems that do not
2252 support the cifs Unix extensions or EAs (for xattr
2253 based symlinks). For such a file to be recognized
2254 as containing symlink data:
2255
2256 1) file size must be 1067,
2257 2) signature must begin file data,
2258 3) length field must be set to ASCII representation
2259 of a number which is less than or equal to 1024,
2260 4) md5 must match that of the path data */
2261
2262struct xsymlink {
2263 /* 1067 bytes */
2264 char signature[4]; /* XSym */ /* not null terminated */
2265 char cr0; /* \n */
2266/* ASCII representation of length (4 bytes decimal) terminated by \n not null */
2267 char length[4];
2268 char cr1; /* \n */
2269/* md5 of valid subset of path ie path[0] through path[length-1] */
2270 __u8 md5[32];
2271 char cr2; /* \n */
2272/* if room left, then end with \n then 0x20s by convention but not required */
2273 char path[1024];
Steve French0753ca72005-10-27 13:55:12 -07002274} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002275
Steve Frenchf654bac2005-04-28 22:41:04 -07002276typedef struct file_xattr_info {
Linus Torvalds1da177e2005-04-16 15:20:36 -07002277 /* BB do we need another field for flags? BB */
2278 __u32 xattr_name_len;
2279 __u32 xattr_value_len;
2280 char xattr_name[0];
2281 /* followed by xattr_value[xattr_value_len], no pad */
Steve French0753ca72005-10-27 13:55:12 -07002282} __attribute__((packed)) FILE_XATTR_INFO; /* extended attribute, info level 0x205 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002283
2284
Steve Frenchf654bac2005-04-28 22:41:04 -07002285/* flags for chattr command */
2286#define EXT_SECURE_DELETE 0x00000001 /* EXT3_SECRM_FL */
2287#define EXT_ENABLE_UNDELETE 0x00000002 /* EXT3_UNRM_FL */
2288/* Reserved for compress file 0x4 */
2289#define EXT_SYNCHRONOUS 0x00000008 /* EXT3_SYNC_FL */
2290#define EXT_IMMUTABLE_FL 0x00000010 /* EXT3_IMMUTABLE_FL */
2291#define EXT_OPEN_APPEND_ONLY 0x00000020 /* EXT3_APPEND_FL */
2292#define EXT_DO_NOT_BACKUP 0x00000040 /* EXT3_NODUMP_FL */
2293#define EXT_NO_UPDATE_ATIME 0x00000080 /* EXT3_NOATIME_FL */
2294/* 0x100 through 0x800 reserved for compression flags and are GET-ONLY */
2295#define EXT_HASH_TREE_INDEXED_DIR 0x00001000 /* GET-ONLY EXT3_INDEX_FL */
2296/* 0x2000 reserved for IMAGIC_FL */
2297#define EXT_JOURNAL_THIS_FILE 0x00004000 /* GET-ONLY EXT3_JOURNAL_DATA_FL */
2298/* 0x8000 reserved for EXT3_NOTAIL_FL */
2299#define EXT_SYNCHRONOUS_DIR 0x00010000 /* EXT3_DIRSYNC_FL */
2300#define EXT_TOPDIR 0x00020000 /* EXT3_TOPDIR_FL */
2301
2302#define EXT_SET_MASK 0x000300FF
2303#define EXT_GET_MASK 0x0003DFFF
2304
2305typedef struct file_chattr_info {
2306 __le64 mask; /* list of all possible attribute bits */
2307 __le64 mode; /* list of actual attribute bits on this inode */
Steve French0753ca72005-10-27 13:55:12 -07002308} __attribute__((packed)) FILE_CHATTR_INFO; /* ext attributes (chattr, chflags) level 0x206 */
Steve Frenchf654bac2005-04-28 22:41:04 -07002309
Linus Torvalds1da177e2005-04-16 15:20:36 -07002310#endif
2311
Linus Torvalds1da177e2005-04-16 15:20:36 -07002312#endif /* _CIFSPDU_H */