1*a90cf9f2SGordon Ross /* 2*a90cf9f2SGordon Ross * This file and its contents are supplied under the terms of the 3*a90cf9f2SGordon Ross * Common Development and Distribution License ("CDDL"), version 1.0. 4*a90cf9f2SGordon Ross * You may only use this file in accordance with the terms of version 5*a90cf9f2SGordon Ross * 1.0 of the CDDL. 6*a90cf9f2SGordon Ross * 7*a90cf9f2SGordon Ross * A full copy of the text of the CDDL should have accompanied this 8*a90cf9f2SGordon Ross * source. A copy of the CDDL is also available via the Internet at 9*a90cf9f2SGordon Ross * http://www.illumos.org/license/CDDL. 10*a90cf9f2SGordon Ross */ 11*a90cf9f2SGordon Ross 12*a90cf9f2SGordon Ross /* 13*a90cf9f2SGordon Ross * Copyright 2015 Nexenta Systems, Inc. All rights reserved. 14*a90cf9f2SGordon Ross */ 15*a90cf9f2SGordon Ross 16*a90cf9f2SGordon Ross #ifndef _SMB_SMB2_H 17*a90cf9f2SGordon Ross #define _SMB_SMB2_H 18*a90cf9f2SGordon Ross 19*a90cf9f2SGordon Ross #ifdef __cplusplus 20*a90cf9f2SGordon Ross extern "C" { 21*a90cf9f2SGordon Ross #endif 22*a90cf9f2SGordon Ross 23*a90cf9f2SGordon Ross #define SMB2_PROTOCOL_ID { 0xFE, 'S', 'M', 'B' } 24*a90cf9f2SGordon Ross #define SMB2_HDR_SIZE 64 25*a90cf9f2SGordon Ross 26*a90cf9f2SGordon Ross /* 27*a90cf9f2SGordon Ross * SMB2 header command codes. 28*a90cf9f2SGordon Ross * These are uint16_t on the wire. 29*a90cf9f2SGordon Ross */ 30*a90cf9f2SGordon Ross typedef enum { 31*a90cf9f2SGordon Ross SMB2_NEGOTIATE = 0, 32*a90cf9f2SGordon Ross SMB2_SESSION_SETUP, 33*a90cf9f2SGordon Ross SMB2_LOGOFF, 34*a90cf9f2SGordon Ross SMB2_TREE_CONNECT, 35*a90cf9f2SGordon Ross SMB2_TREE_DISCONNECT, 36*a90cf9f2SGordon Ross SMB2_CREATE, 37*a90cf9f2SGordon Ross SMB2_CLOSE, 38*a90cf9f2SGordon Ross SMB2_FLUSH, 39*a90cf9f2SGordon Ross SMB2_READ, 40*a90cf9f2SGordon Ross SMB2_WRITE, 41*a90cf9f2SGordon Ross SMB2_LOCK, 42*a90cf9f2SGordon Ross SMB2_IOCTL, 43*a90cf9f2SGordon Ross SMB2_CANCEL, 44*a90cf9f2SGordon Ross SMB2_ECHO, 45*a90cf9f2SGordon Ross SMB2_QUERY_DIRECTORY, 46*a90cf9f2SGordon Ross SMB2_CHANGE_NOTIFY, 47*a90cf9f2SGordon Ross SMB2_QUERY_INFO, 48*a90cf9f2SGordon Ross SMB2_SET_INFO, 49*a90cf9f2SGordon Ross SMB2_OPLOCK_BREAK, 50*a90cf9f2SGordon Ross /* 51*a90cf9f2SGordon Ross * The above (oplock break) is the last real SMB2 op-code. 52*a90cf9f2SGordon Ross * We use one more slot to represent invalid commands, and 53*a90cf9f2SGordon Ross * the final enum value is used for array sizes. Keep last! 54*a90cf9f2SGordon Ross */ 55*a90cf9f2SGordon Ross SMB2_INVALID_CMD, 56*a90cf9f2SGordon Ross SMB2__NCMDS 57*a90cf9f2SGordon Ross } SMB2_cmd_code; 58*a90cf9f2SGordon Ross 59*a90cf9f2SGordon Ross /* 60*a90cf9f2SGordon Ross * SMB2 header flags. 61*a90cf9f2SGordon Ross */ 62*a90cf9f2SGordon Ross 63*a90cf9f2SGordon Ross /* 64*a90cf9f2SGordon Ross * SERVER_TO_REDIR 65*a90cf9f2SGordon Ross * When set, indicates the message is a response rather than 66*a90cf9f2SGordon Ross * a request. This MUST be set on responses sent from the 67*a90cf9f2SGordon Ross * server to the client, and MUST NOT be set on requests 68*a90cf9f2SGordon Ross * sent from the client to the server. 69*a90cf9f2SGordon Ross */ 70*a90cf9f2SGordon Ross #define SMB2_FLAGS_SERVER_TO_REDIR 0x00000001 71*a90cf9f2SGordon Ross 72*a90cf9f2SGordon Ross /* 73*a90cf9f2SGordon Ross * ASYNC_COMMAND 74*a90cf9f2SGordon Ross * When set, indicates that this is an ASYNC SMB2 header. 75*a90cf9f2SGordon Ross * Always set for headers of the form described in this 76*a90cf9f2SGordon Ross * section. 77*a90cf9f2SGordon Ross */ 78*a90cf9f2SGordon Ross #define SMB2_FLAGS_ASYNC_COMMAND 0x00000002 79*a90cf9f2SGordon Ross 80*a90cf9f2SGordon Ross /* 81*a90cf9f2SGordon Ross * RELATED_OPERATIONS 82*a90cf9f2SGordon Ross * When set in an SMB2 request, indicates that this request 83*a90cf9f2SGordon Ross * is a related operation in a compounded request chain. 84*a90cf9f2SGordon Ross * [MS-SMB2 sec. 3.2.4.1.4] 85*a90cf9f2SGordon Ross * 86*a90cf9f2SGordon Ross * When set in an SMB2 compound response, indicates that 87*a90cf9f2SGordon Ross * the request corresponding to this response was part of a 88*a90cf9f2SGordon Ross * related operation in a compounded request chain. 89*a90cf9f2SGordon Ross * [MS-SMB2 sec. 3.3.5.2.7.2] 90*a90cf9f2SGordon Ross */ 91*a90cf9f2SGordon Ross #define SMB2_FLAGS_RELATED_OPERATIONS 0x00000004 92*a90cf9f2SGordon Ross 93*a90cf9f2SGordon Ross /* 94*a90cf9f2SGordon Ross * SIGNED 95*a90cf9f2SGordon Ross * When set, indicates that this packet has been signed. 96*a90cf9f2SGordon Ross * [MS-SMB2 3.1.5.1] 97*a90cf9f2SGordon Ross */ 98*a90cf9f2SGordon Ross #define SMB2_FLAGS_SIGNED 0x00000008 99*a90cf9f2SGordon Ross 100*a90cf9f2SGordon Ross /* 101*a90cf9f2SGordon Ross * [MS-SMB2] 3.2.5.3.1 The SessionKey MUST be set to the 102*a90cf9f2SGordon Ross * first 16 bytes of the cryptographic key from GSSAPI. 103*a90cf9f2SGordon Ross * (Padded with zeros if the GSSAPI key is shorter.) 104*a90cf9f2SGordon Ross */ 105*a90cf9f2SGordon Ross #define SMB2_SESSION_KEY_LEN 16 106*a90cf9f2SGordon Ross 107*a90cf9f2SGordon Ross /* 108*a90cf9f2SGordon Ross * DFS_OPERATIONS 109*a90cf9f2SGordon Ross * When set, indicates that this command is a Distributed 110*a90cf9f2SGordon Ross * File System (DFS) operation. [MS-SMB2 3.3.5.9] 111*a90cf9f2SGordon Ross */ 112*a90cf9f2SGordon Ross #define SMB2_FLAGS_DFS_OPERATIONS 0x10000000 113*a90cf9f2SGordon Ross 114*a90cf9f2SGordon Ross /* 115*a90cf9f2SGordon Ross * REPLAY_OPERATION 116*a90cf9f2SGordon Ross * This flag is only valid for the SMB 3.0 dialect. When set, 117*a90cf9f2SGordon Ross * it indicates that this command is a replay operation. 118*a90cf9f2SGordon Ross * The client MUST ignore this bit on receipt. 119*a90cf9f2SGordon Ross */ 120*a90cf9f2SGordon Ross #define SMB2_FLAGS_REPLAY_OPERATION 0x20000000 121*a90cf9f2SGordon Ross 122*a90cf9f2SGordon Ross /* 123*a90cf9f2SGordon Ross * SMB2 Netgotiate [MS-SMB2 2.2.3] 124*a90cf9f2SGordon Ross */ 125*a90cf9f2SGordon Ross 126*a90cf9f2SGordon Ross #define SMB2_NEGOTIATE_SIGNING_ENABLED 0x01 127*a90cf9f2SGordon Ross #define SMB2_NEGOTIATE_SIGNING_REQUIRED 0x02 128*a90cf9f2SGordon Ross 129*a90cf9f2SGordon Ross #define SMB2_CAP_DFS 0x00000001 130*a90cf9f2SGordon Ross 131*a90cf9f2SGordon Ross /* Added with SMB2.1 */ 132*a90cf9f2SGordon Ross #define SMB2_CAP_DFS 0x00000001 133*a90cf9f2SGordon Ross #define SMB2_CAP_LEASING 0x00000002 134*a90cf9f2SGordon Ross /* 135*a90cf9f2SGordon Ross * LARGE_MTU: 136*a90cf9f2SGordon Ross * When set, indicates that the client supports multi-credit operations. 137*a90cf9f2SGordon Ross */ 138*a90cf9f2SGordon Ross #define SMB2_CAP_LARGE_MTU 0x00000004 139*a90cf9f2SGordon Ross 140*a90cf9f2SGordon Ross /* Added with SMB3.0 */ 141*a90cf9f2SGordon Ross #define SMB2_CAP_MULTI_CHANNEL 0x00000008 142*a90cf9f2SGordon Ross #define SMB2_CAP_PERSISTENT_HANDLES 0x00000010 143*a90cf9f2SGordon Ross #define SMB2_CAP_DIRECTORY_LEASING 0x00000020 144*a90cf9f2SGordon Ross #define SMB2_CAP_ENCRYPTION 0x00000040 145*a90cf9f2SGordon Ross 146*a90cf9f2SGordon Ross /* SMB2 session flags */ 147*a90cf9f2SGordon Ross #define SMB2_SESSION_FLAG_IS_GUEST 0x0001 148*a90cf9f2SGordon Ross #define SMB2_SESSION_FLAG_IS_NULL 0x0002 149*a90cf9f2SGordon Ross #define SMB2_SESSION_FLAG_ENCRYPT_DATA 0x0004 150*a90cf9f2SGordon Ross 151*a90cf9f2SGordon Ross /* 152*a90cf9f2SGordon Ross * SMB2 Tree connect, disconnect 153*a90cf9f2SGordon Ross */ 154*a90cf9f2SGordon Ross 155*a90cf9f2SGordon Ross /* SMB2 sharetype flags */ 156*a90cf9f2SGordon Ross #define SMB2_SHARE_TYPE_DISK 0x1 157*a90cf9f2SGordon Ross #define SMB2_SHARE_TYPE_PIPE 0x2 158*a90cf9f2SGordon Ross #define SMB2_SHARE_TYPE_PRINT 0x3 159*a90cf9f2SGordon Ross 160*a90cf9f2SGordon Ross /* SMB2 share flags */ 161*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_MANUAL_CACHING 0x00000000 162*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_AUTO_CACHING 0x00000010 163*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_VDO_CACHING 0x00000020 164*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_NO_CACHING 0x00000030 165*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_DFS 0x00000001 166*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_DFS_ROOT 0x00000002 167*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_RESTRICT_EXCLUSIVE_OPENS 0x00000100 168*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_FORCE_SHARED_DELETE 0x00000200 169*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_ALLOW_NAMESPACE_CACHING 0x00000400 170*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM 0x00000800 171*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_FORCE_LEVELII_OPLOCK 0x00001000 172*a90cf9f2SGordon Ross /* SMB 3.0 */ 173*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_ENABLE_HASH_V1 0x00002000 174*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_ENABLE_HASH_V2 0x00004000 175*a90cf9f2SGordon Ross #define SMB2_SHAREFLAG_ENCRYPT_DATA 0x00008000 176*a90cf9f2SGordon Ross 177*a90cf9f2SGordon Ross /* SMB2 share capabilities */ 178*a90cf9f2SGordon Ross #define SMB2_SHARE_CAP_DFS 0x00000008 179*a90cf9f2SGordon Ross /* SMB 3.0 */ 180*a90cf9f2SGordon Ross #define SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY 0x00000010 181*a90cf9f2SGordon Ross #define SMB2_SHARE_CAP_SCALEOUT 0x00000020 182*a90cf9f2SGordon Ross #define SMB2_SHARE_CAP_CLUSTER 0x00000040 183*a90cf9f2SGordon Ross 184*a90cf9f2SGordon Ross /* 185*a90cf9f2SGordon Ross * SMB2 Create (open) 186*a90cf9f2SGordon Ross */ 187*a90cf9f2SGordon Ross 188*a90cf9f2SGordon Ross /* SMB2 requested oplock levels */ 189*a90cf9f2SGordon Ross #define SMB2_OPLOCK_LEVEL_NONE 0x00 190*a90cf9f2SGordon Ross #define SMB2_OPLOCK_LEVEL_II 0x01 191*a90cf9f2SGordon Ross #define SMB2_OPLOCK_LEVEL_EXCLUSIVE 0x08 192*a90cf9f2SGordon Ross #define SMB2_OPLOCK_LEVEL_BATCH 0x09 193*a90cf9f2SGordon Ross #define SMB2_OPLOCK_LEVEL_LEASE 0xFF 194*a90cf9f2SGordon Ross 195*a90cf9f2SGordon Ross /* SMB2 impersonation levels */ 196*a90cf9f2SGordon Ross #define SMB2_IMPERSONATION_ANONYMOUS 0x00 197*a90cf9f2SGordon Ross #define SMB2_IMPERSONATION_IDENTIFICATION 0x01 198*a90cf9f2SGordon Ross #define SMB2_IMPERSONATION_IMPERSONATION 0x02 199*a90cf9f2SGordon Ross #define SMB2_IMPERSONATION_DELEGATE 0x03 200*a90cf9f2SGordon Ross 201*a90cf9f2SGordon Ross /* 202*a90cf9f2SGordon Ross * Note: ShareAccess, CreateDispositon, CreateOptions, 203*a90cf9f2SGordon Ross * all use the same definitions as SMB1 (from MS-FSA). 204*a90cf9f2SGordon Ross * Ditto FileAccess flags (as with ACLs) 205*a90cf9f2SGordon Ross */ 206*a90cf9f2SGordon Ross 207*a90cf9f2SGordon Ross /* SMB2 Create Context tags */ 208*a90cf9f2SGordon Ross 209*a90cf9f2SGordon Ross #define SMB2_CREATE_EA_BUFFER 0x45787441 /* ("ExtA") */ 210*a90cf9f2SGordon Ross /* 211*a90cf9f2SGordon Ross * The data contains the extended attributes 212*a90cf9f2SGordon Ross * that MUST be stored on the created file. 213*a90cf9f2SGordon Ross * This value MUST NOT be set for named 214*a90cf9f2SGordon Ross * pipes and print files. 215*a90cf9f2SGordon Ross */ 216*a90cf9f2SGordon Ross 217*a90cf9f2SGordon Ross #define SMB2_CREATE_SD_BUFFER 0x53656344 /* ("SecD") */ 218*a90cf9f2SGordon Ross /* 219*a90cf9f2SGordon Ross * The data contains a security descriptor that 220*a90cf9f2SGordon Ross * MUST be stored on the created file. 221*a90cf9f2SGordon Ross * This value MUST NOT be set for named 222*a90cf9f2SGordon Ross * pipes and print files. 223*a90cf9f2SGordon Ross */ 224*a90cf9f2SGordon Ross 225*a90cf9f2SGordon Ross #define SMB2_CREATE_DURABLE_HANDLE_REQUEST 0x44486e51 /* ("DHnQ") */ 226*a90cf9f2SGordon Ross /* The client is requesting the open to be durable */ 227*a90cf9f2SGordon Ross 228*a90cf9f2SGordon Ross #define SMB2_CREATE_DURABLE_HANDLE_RECONNECT 0x44486e43 /* ("DHnC") */ 229*a90cf9f2SGordon Ross /* 230*a90cf9f2SGordon Ross * The client is requesting to reconnect to a 231*a90cf9f2SGordon Ross * durable open after being disconnected 232*a90cf9f2SGordon Ross */ 233*a90cf9f2SGordon Ross 234*a90cf9f2SGordon Ross #define SMB2_CREATE_ALLOCATION_SIZE 0x416c5369 /* ("AISi") */ 235*a90cf9f2SGordon Ross /* 236*a90cf9f2SGordon Ross * The data contains the required allocation 237*a90cf9f2SGordon Ross * size of the newly created file. 238*a90cf9f2SGordon Ross */ 239*a90cf9f2SGordon Ross 240*a90cf9f2SGordon Ross #define SMB2_CREATE_QUERY_MAXIMAL_ACCESS_REQ 0x4d784163 /* ("MxAc") */ 241*a90cf9f2SGordon Ross /* 242*a90cf9f2SGordon Ross * The client is requesting that the server 243*a90cf9f2SGordon Ross * return maximal access information. 244*a90cf9f2SGordon Ross */ 245*a90cf9f2SGordon Ross 246*a90cf9f2SGordon Ross #define SMB2_CREATE_TIMEWARP_TOKEN 0x54577270 /* ("TWrp") */ 247*a90cf9f2SGordon Ross /* 248*a90cf9f2SGordon Ross * The client is requesting that the server 249*a90cf9f2SGordon Ross * open an earlier version of the file identified 250*a90cf9f2SGordon Ross * by the provided time stamp. 251*a90cf9f2SGordon Ross */ 252*a90cf9f2SGordon Ross 253*a90cf9f2SGordon Ross #define SMB2_CREATE_QUERY_ON_DISK_ID 0x51466964 /* ("QFid") */ 254*a90cf9f2SGordon Ross /* 255*a90cf9f2SGordon Ross * The client is requesting that the server return a 32-byte 256*a90cf9f2SGordon Ross * opaque BLOB that uniquely identifies the file being opened 257*a90cf9f2SGordon Ross * on disk. No data is passed to the server by the client. 258*a90cf9f2SGordon Ross */ 259*a90cf9f2SGordon Ross 260*a90cf9f2SGordon Ross #define SMB2_CREATE_REQUEST_LEASE 0x52714c73 /* ("RqLs") */ 261*a90cf9f2SGordon Ross /* 262*a90cf9f2SGordon Ross * The client is requesting that the server return a lease. 263*a90cf9f2SGordon Ross * This value is only supported for the SMB 2.1 and 3.0 dialects. 264*a90cf9f2SGordon Ross */ 265*a90cf9f2SGordon Ross 266*a90cf9f2SGordon Ross /* SMB2 create request lease */ 267*a90cf9f2SGordon Ross #define SMB2_LEASE_NONE 0x00 268*a90cf9f2SGordon Ross #define SMB2_LEASE_READ_CACHING 0x01 269*a90cf9f2SGordon Ross #define SMB2_LEASE_HANDLE_CACHING 0x02 270*a90cf9f2SGordon Ross #define SMB2_LEASE_WRITE_CACHING 0x04 271*a90cf9f2SGordon Ross 272*a90cf9f2SGordon Ross /* SMB2 lease break notification flags */ 273*a90cf9f2SGordon Ross #define SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED 0x01 274*a90cf9f2SGordon Ross 275*a90cf9f2SGordon Ross /* 276*a90cf9f2SGordon Ross * SMB2 Close 277*a90cf9f2SGordon Ross */ 278*a90cf9f2SGordon Ross #define SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB 0x0001 279*a90cf9f2SGordon Ross 280*a90cf9f2SGordon Ross /* 281*a90cf9f2SGordon Ross * SMB2 Write 282*a90cf9f2SGordon Ross */ 283*a90cf9f2SGordon Ross #define SMB2_WRITEFLAG_WRITE_THROUGH 0x00000001 284*a90cf9f2SGordon Ross 285*a90cf9f2SGordon Ross /* 286*a90cf9f2SGordon Ross * SMB2 Lock Request 287*a90cf9f2SGordon Ross */ 288*a90cf9f2SGordon Ross 289*a90cf9f2SGordon Ross /* SMB2 lock flags */ 290*a90cf9f2SGordon Ross 291*a90cf9f2SGordon Ross /* 292*a90cf9f2SGordon Ross * SMB2_LOCKFLAG_SHARED_LOCK 293*a90cf9f2SGordon Ross * The range MUST be locked shared, allowing other opens 294*a90cf9f2SGordon Ross * to read from or take a shared lock on the range. All opens 295*a90cf9f2SGordon Ross * MUST NOT be allowed to write within the range. Other 296*a90cf9f2SGordon Ross * locks can be requested and taken on this range. 297*a90cf9f2SGordon Ross */ 298*a90cf9f2SGordon Ross #define SMB2_LOCKFLAG_SHARED_LOCK 0x00000001 299*a90cf9f2SGordon Ross 300*a90cf9f2SGordon Ross /* 301*a90cf9f2SGordon Ross * SMB2_LOCKFLAG_EXCLUSIVE_LOCK 302*a90cf9f2SGordon Ross * The range MUST be locked exclusive, not allowing other 303*a90cf9f2SGordon Ross * opens to read, write, or lock within the range. 304*a90cf9f2SGordon Ross */ 305*a90cf9f2SGordon Ross #define SMB2_LOCKFLAG_EXCLUSIVE_LOCK 0x00000002 306*a90cf9f2SGordon Ross 307*a90cf9f2SGordon Ross /* 308*a90cf9f2SGordon Ross * SMB2_LOCKFLAG_UNLOCK 309*a90cf9f2SGordon Ross * The range MUST be unlocked from a previous lock taken 310*a90cf9f2SGordon Ross * on this range. The unlock range MUST be identical to the 311*a90cf9f2SGordon Ross * lock range. Sub-ranges cannot be unlocked. 312*a90cf9f2SGordon Ross */ 313*a90cf9f2SGordon Ross #define SMB2_LOCKFLAG_UNLOCK 0x00000004 314*a90cf9f2SGordon Ross 315*a90cf9f2SGordon Ross /* 316*a90cf9f2SGordon Ross * SMB2_LOCKFLAG_FAIL_IMMEDIATELY 317*a90cf9f2SGordon Ross * The lock operation MUST fail immediately if it conflicts 318*a90cf9f2SGordon Ross * with an existing lock, instead of waiting for the range to 319*a90cf9f2SGordon Ross * become available. This can be OR'ed with either of 320*a90cf9f2SGordon Ross * shared_lock, exclusive_lock (nothing else). 321*a90cf9f2SGordon Ross */ 322*a90cf9f2SGordon Ross #define SMB2_LOCKFLAG_FAIL_IMMEDIATELY 0x00000010 323*a90cf9f2SGordon Ross 324*a90cf9f2SGordon Ross /* 325*a90cf9f2SGordon Ross * SMB2 Ioctl Request 326*a90cf9f2SGordon Ross */ 327*a90cf9f2SGordon Ross #define SMB2_0_IOCTL_IS_FSCTL 0x00000001 328*a90cf9f2SGordon Ross 329*a90cf9f2SGordon Ross 330*a90cf9f2SGordon Ross /* 331*a90cf9f2SGordon Ross * SMB2 Query Directory 332*a90cf9f2SGordon Ross */ 333*a90cf9f2SGordon Ross 334*a90cf9f2SGordon Ross /* 335*a90cf9f2SGordon Ross * SMB2 query directory info levels 336*a90cf9f2SGordon Ross * Same as SMB1 (see ntifs.h) 337*a90cf9f2SGordon Ross */ 338*a90cf9f2SGordon Ross 339*a90cf9f2SGordon Ross /* 340*a90cf9f2SGordon Ross * SMB2 Query Directory Flags 341*a90cf9f2SGordon Ross * (our own names for these - spec. used poor names) 342*a90cf9f2SGordon Ross */ 343*a90cf9f2SGordon Ross #define SMB2_QDIR_FLAG_RESTART 0x01 /* SMB2_RESTART_SCANS */ 344*a90cf9f2SGordon Ross #define SMB2_QDIR_FLAG_SINGLE 0x02 /* SMB2_RETURN_SINGLE_ENTRY */ 345*a90cf9f2SGordon Ross #define SMB2_QDIR_FLAG_INDEX 0x04 /* SMB2_INDEX_SPECIFIED */ 346*a90cf9f2SGordon Ross #define SMB2_QDIR_FLAG_REOPEN 0x10 /* SMB2_REOPEN */ 347*a90cf9f2SGordon Ross 348*a90cf9f2SGordon Ross /* 349*a90cf9f2SGordon Ross * SMB2 Query Info Request 350*a90cf9f2SGordon Ross */ 351*a90cf9f2SGordon Ross 352*a90cf9f2SGordon Ross /* info type */ 353*a90cf9f2SGordon Ross #define SMB2_0_INFO_FILE 0x01 354*a90cf9f2SGordon Ross /* The file information is requested. */ 355*a90cf9f2SGordon Ross #define SMB2_0_INFO_FILESYSTEM 0x02 356*a90cf9f2SGordon Ross /* The underlying object store information is requested. */ 357*a90cf9f2SGordon Ross #define SMB2_0_INFO_SECURITY 0x03 358*a90cf9f2SGordon Ross /* The security information is requested. */ 359*a90cf9f2SGordon Ross #define SMB2_0_INFO_QUOTA 0x04 360*a90cf9f2SGordon Ross /* The underlying object store quota information is requested. */ 361*a90cf9f2SGordon Ross 362*a90cf9f2SGordon Ross /* 363*a90cf9f2SGordon Ross * SMB2 Change Nofity Request 364*a90cf9f2SGordon Ross */ 365*a90cf9f2SGordon Ross #define SMB2_WATCH_TREE 0x00000001 366*a90cf9f2SGordon Ross 367*a90cf9f2SGordon Ross #ifdef __cplusplus 368*a90cf9f2SGordon Ross } 369*a90cf9f2SGordon Ross #endif 370*a90cf9f2SGordon Ross 371*a90cf9f2SGordon Ross #endif /* _SMB_SMB2_H */ 372