libcli:smb: add defines for SMB2.2 global capabilities
[ira/wip.git] / libcli / smb / smb2_constants.h
index 6d29d6e9ea175ab0e59a29794710e23d3230a561..2b1223c240d5038ac247e818847d6f8317e4b856 100644 (file)
@@ -25,7 +25,8 @@
 /* offsets into header elements for a sync SMB2 request */
 #define SMB2_HDR_PROTOCOL_ID    0x00
 #define SMB2_HDR_LENGTH                0x04
-#define SMB2_HDR_EPOCH         0x06
+#define SMB2_HDR_CREDIT_CHARGE 0x06
+#define SMB2_HDR_EPOCH         SMB2_HDR_CREDIT_CHARGE /* TODO: remove this */
 #define SMB2_HDR_STATUS                0x08
 #define SMB2_HDR_OPCODE                0x0c
 #define SMB2_HDR_CREDIT                0x0e
 #define SMB2_DIALECT_REVISION_000       0x0000 /* early beta dialect */
 #define SMB2_DIALECT_REVISION_202       0x0202
 #define SMB2_DIALECT_REVISION_210       0x0210
+#define SMB2_DIALECT_REVISION_222       0x0222
+#define SMB2_DIALECT_REVISION_224       0x0224
 #define SMB2_DIALECT_REVISION_2FF       0x02FF
 
 /* SMB2 negotiate security_mode */
 #define SMB2_NEGOTIATE_SIGNING_ENABLED   0x01
 #define SMB2_NEGOTIATE_SIGNING_REQUIRED  0x02
 
-/* SMB2 capabilities - only 1 so far. I'm sure more will be added */
-#define SMB2_CAP_DFS                     0x00000001
-#define SMB2_CAP_LEASING                 0x00000002 /* only in dialect 0x210 */
-#define SMB2_CAP_LARGE_MTU              0x00000004 /* only in dialect 0x210 */
+/* SMB2 global capabilities */
+#define SMB2_CAP_DFS                   0x00000001
+#define SMB2_CAP_LEASING               0x00000002 /* only in dialect >= 0x210 */
+#define SMB2_CAP_LARGE_MTU             0x00000004 /* only in dialect >= 0x210 */
+#define SMB2_CAP_MULTI_CHANNEL         0x00000008 /* only in dialect >= 0x222 */
+#define SMB2_CAP_PERSISTENT_HANDLES    0x00000010 /* only in dialect >= 0x222 */
+#define SMB2_CAP_DIRECTORY_LEASING     0x00000020 /* only in dialect >= 0x222 */
+#define SMB2_CAP_ENCRYPTION            0x00000040 /* only in dialect >= 0x222 */
+
 /* so we can spot new caps as added */
 #define SMB2_CAP_ALL                     SMB2_CAP_DFS
 
 #define SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM       0x0800
 #define SMB2_SHAREFLAG_ALL                               0x0F33
 
-/* SMB2 share capafilities */
+/* SMB2 share capabilities */
 #define SMB2_SHARE_CAP_DFS             0x8
 
 /* SMB2 create security flags */
 #define SMB2_CREATE_TAG_TWRP "TWrp"
 #define SMB2_CREATE_TAG_QFID "QFid"
 #define SMB2_CREATE_TAG_RQLS "RqLs"
+#define SMB2_CREATE_TAG_DH2Q "DH2Q"
+#define SMB2_CREATE_TAG_DH2C "DH2C"
+
+/* SMB2 notify flags */
+#define SMB2_WATCH_TREE 0x0001
 
 /* SMB2 Create ignore some more create_options */
 #define SMB2_CREATE_OPTIONS_NOT_SUPPORTED_MASK (NTCREATEX_OPTIONS_TREE_CONNECTION | \
 #define SMB2_GETINFO_SECURITY           0x03
 #define SMB2_GETINFO_QUOTA              0x04
 
+#define SMB2_CLOSE_FLAGS_FULL_INFORMATION (0x01)
+
+#define SMB2_WRITEFLAG_WRITE_THROUGH   0x00000001
+
 #endif