cifs.h revision a0aa776e20803c84edd153d9cb584fd67163aef3
* Flags field of the SMB header. The names in parenthesis represent * alternative names for the flags. * SMB_FLAGS_LOCK_AND_READ_OK If the server supports LockAndRead and * (SMB_FLAGS_LOCKS_SUBDIALECT) WriteAndUnlock, it sets this bit in the * SMB_FLAGS_SEND_NO_ACK When on, the client guarantees that there * (SMB_FLAGS_RCV_BUF_POSTED) is a receive buffer posted such that a * "Send-No-Ack" can be used by the server * to respond to the client's request. * SMB_FLAGS_CASE_INSENSITIVE This is part of the Flags field of every * SMB header. If this bit is set, then all * pathnames in the SMB should be treated as * case-insensitive. Otherwise pathnames are * SMB_FLAGS_CANONICALIZED_PATHS When on in SessionSetupX, this indicates * that all paths sent to the server are * already in OS/2 canonicalized format. * OS/2 canonical format means that file/directory names are in upper case, * are valid characters, . and .. have been removed and single backslashes * are used as separators. * SMB_FLAGS_OPLOCK When set in an open file request SMBs * (Open, Create, OpenX, etc.) this bit * indicates a request for an oplock on the * file. When set in the response, this bit * indicates that the oplock was granted. * SMB_FLAGS_OPLOCK_NOTIFY_ANY When on, this bit indicates that the server * should notify the client on any request * that could cause the file to be changed. * If not set, the server only notifies the * client on other open requests on the file. * This bit is only relevant when * SMB_FLAGS_OPLOCK is set. * SMB_FLAGS_SERVER_TO_REDIR This bit indicates that the SMB is being * (SMB_FLAGS_REPLY) sent from server to (client) redirector. * Flags2 field of the SMB header. #
define PCLAN1_0 2 /* Some versions of the original MSNET */#
define LANMAN1_0 5 /* This is the first version of the full */#
define LM1_2X002 6 /* This is the first version of the full */#
define NT_LM_0_12 11 /* The SMB protocol designed for NT */ * SMB_TREE_CONNECT_ANDX OptionalSupport flags * SMB_SUPPORT_SEARCH_BITS The server supports SearchAttributes. * SMB_SHARE_IS_IN_DFS The share is managed by DFS. * SMB_CSC_MASK Offline-caching mask - see CSC values. * SMB_UNIQUE_FILE_NAME The server uses long names and does not support * short names. This indicates to clients that * they may perform directory name-space caching. * SMB_EXTENDED_SIGNATURES The server will use signing key protection. * SMB_CSC_CACHE_MANUAL_REINT Clients are allowed to cache files for offline * use as requested by users but automatic * file-by-file reintegration is not allowed. * SMB_CSC_CACHE_AUTO_REINT Clients are allowed to automatically cache * files for offline use and file-by-file * reintegration is allowed. * SMB_CSC_CACHE_VDO Clients are allowed to automatically cache files * for offline use, file-by-file reintegration is * allowed and clients are permitted to work from * their local cache even while offline. * SMB_CSC_CACHE_NONE Client-side caching is disabled for this share. * SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM * The server will filter directory entries based * on the access permissions of the client. * The subcommand codes, placed in SETUP[0], for named pipe operations are: * SubCommand Code Value Description * =================== ===== ========================================= #
define PeekNmPipe 0x23 /* read but don't remove data */#
define RawReadNmPipe 0x11 /* read pipe in "raw" (non message mode) */ * Setup[0] Transaction2 Value Description * ========================== ===== ============================= #
define TRANS2_OPEN2 0x00 /* Create file, extended attributes */#
define TRANS2_FSCTL 0x09 /* Not implemented by NT server */ * Access Mode Encoding (CIFS/1.0 1996 Section 3.8). * The desired access mode passed in SmbOpen and SmbOpenAndX has the following * W - Write through mode. No read ahead or write behind allowed on * this file or device. When protocol is returned, data is expected * to be on the disk or device. * 0 - Compatibility mode (as in core open) * 2 - Open for reading and writing * rSSSrAAA = 11111111 (hex FF) indicates FCB open (as in core protocol) * 1 - Do not cache this file * L - Locality of reference * 0 - Locality of reference is unknown * 1 - Mainly sequential access * 2 - Mainly random access * 3 - Random access with some locality * 4 to 7 - Currently undefined * Macros used for share reservation rule checking * The SMB open function determines what action should be taken depending * on the existence or lack thereof of files used in the operation. It * has the following mapping: * O - Open (action to be taken if the target file exists) * 1 - Open or Append file * C - Create (action to be taken if the target file does not exist) * The Action field of OpenAndX has the following format: * L - Opportunistic lock. 1 if lock granted, else 0. * 1 - The file existed and was opened * 2 - The file did not exist but was created * 3 - The file existed and was truncated * Flags for TRANS2_FIND_FIRST2 and TRANS2_FIND_NEXT2 * If SMB_FIND_RETURN_RESUME_KEYS was set in the request parameters, * each entry is preceded by a four-byte resume key. * TRANS2_QUERY_FS_INFORMATION * Define information levels to represent the following requests: /* TRANS2_QUERY_{PATH,FILE}_INFORMATION */ /* NT passthrough levels - see ntifs.h FILE_INFORMATION_CLASS */ * The following bits may be set in the SecurityMode field of the * SMB_COM_NEGOTIATE response. * NEGOTIATE_SECURITY_SHARE_LEVEL is a montana2 invention. * The NTDDK cifs.h definitions are: * #define NEGOTIATE_USER_SECURITY 0x01 * #define NEGOTIATE_ENCRYPT_PASSWORDS 0x02 * #define NEGOTIATE_SECURITY_SIGNATURES_ENABLED 0x04 * #define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED 0x08 * Negotiated Capabilities (CIFS/1.0 section 4.1.1) * Capabilities allow the server to tell the client what it supports. * Undefined bits MUST be set to zero by servers, and MUST be ignored * by clients. The bit definitions are: * Capability Name Encoding Meaning * ==================== ======== ================================== * CAP_RAW_MODE 0x0001 The server supports SMB_COM_READ_RAW and * SMB_COM_WRITE_RAW (obsolescent) * CAP_MPX_MODE 0x0002 The server supports SMB_COM_READ_MPX and * SMB_COM_WRITE_MPX (obsolescent) * CAP_UNICODE 0x0004 The server supports Unicode strings * CAP_LARGE_FILES 0x0008 The server supports large files with 64 * CAP_NT_SMBS 0x0010 The server supports the SMBs particular * to the NT LM 0.12 dialect. * CAP_RPC_REMOTE_APIS 0x0020 The server supports remote admin API * CAP_STATUS32 0x0040 The server can respond with 32 bit * status codes in Status.Status * CAP_LEVEL_II_OPLOCKS 0x0080 The server supports level 2 oplocks * CAP_LOCK_AND_READ 0x0100 The server supports the * SMB_COM_LOCK_AND_READ SMB * CAP_BULK_TRANSFER 0x0400 * CAP_COMPRESSED_BULK 0x0800 * CAP_DFS 0x1000 The server is DFS aware * CAP_LARGE_READX 0x4000 The server supports large * CAP_LARGE_WRITEX 0x8000 The server supports large * CAP_RESERVED 0x02000000 Reserved for future use. * CAP_EXTENDED_SECURITY 0x80000000 The server supports extended security * Extended security exchanges provides a means of supporting arbitrary * authentication protocols within CIFS. Security blobs are opaque to the * CIFS protocol; they are messages in some authentication protocol that * has been agreed upon by client and server by some out of band mechanism, * for which CIFS merely functions as a transport. When * CAP_EXTENDED_SECURITY is negotiated, the server includes a first * security blob in its response; subsequent security blobs are exchanged * in SMB_COM_SESSION_SETUP_ANDX requests and responses until the * authentication protocol terminates. * Different device types according to NT * Some of these device types are not currently accessible over the network * and may never be accessible over the network. Some may change to be * accessible over the network. The values for device types that may never * be accessible over the network may be redefined to be just reserved at * some date in the future. * Characteristics is the sum of any of the following: * CREATE_ANDX ShareAccess Flags * CREATE_ANDX CreateDisposition flags * FILE_SUPERSEDE If the file already exists it should be superseded * by the specified file. If the file does not already * exist then it should be created. * FILE_CREATE If the file already exists the operation should fail. * If the file does not already exist then it should be * created. (aka CREATE_NEW) * FILE_OPEN If the file already exists then it should be opened. * If the file does not already exist then the operation * should fail. (aka OPEN_EXISTING) * FILE_OPEN_IF If the file already exists then it should be opened. * If the file does not already exist then it should be * created. (aka OPEN_ALWAYS) * FILE_OVERWRITE If the file already exists, it should be opened and * overwritten. If the file does not already exist then * the operation should fail. (aka TRUNCATE_EXISTING) * FILE_OVERWRITE_IF If the file already exists, it should be opened and * overwritten. If the file does not already exist then * it should be created. (aka CREATE_ALWAYS) * CREATE_ANDX Impersonation levels * CREATE_ANDX SecurityFlags #
define SV_SERVER 0x00000002 /* All servers */#
define SV_SQLSERVER 0x00000004 /* running with SQL server */#
define SV_AFP 0x00000040 /* Apple File Protocol */#
define SV_NOVELL 0x00000080 /* Novell servers */#
define SV_NT 0x00001000 /* NT server */#
define SV_WFW 0x00002000 /* Server running Windows for */#
define SV_SERVER_NT 0x00008000 /* Windows NT non DC server */#
define SV_OSF 0x00100000 /* OSF operating system */#
define SV_VMS 0x00200000 /* VMS operating system */ * SMB_COM_NT_TRANSACTION sub-command codes (CIFS/1.0 section 5.3) * SubCommand Code Value Description * =============================== ===== ================================= * NT_TRANSACT_IOCTL 2 Device IOCTL * NT_TRANSACT_SET_SECURITY_DESC 3 Set security descriptor * NT_TRANSACT_NOTIFY_CHANGE 4 Start directory watch * NT_TRANSACT_RENAME 5 Reserved (handle-based rename) * NT_TRANSACT_QUERY_SECURITY_DESC 6 Retrieve security descriptor * NT_TRANSACT_QUERY_QUOTA 7 Retrieve quota information * NT_TRANSACT_SET_QUOTA 8 Set quota information #
define SMB_SEEK_SET 0
/* set file offset to specified offset */#
define SMB_SEEK_CUR 1 /* set file offset to current plus specified offset */#
define SMB_SEEK_END 2 /* set file offset to EOF plus specified offset */ * API Numbers for Transact based RAP (Remote Administration Protocol) calls #
endif /* _SMBSRV_CIFS_H */