^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * fs/cifs/cifs_ioctl.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Structure definitions for io control for cifs/smb3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (c) 2015 Steve French <steve.french@primarydata.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * This library is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * it under the terms of the GNU Lesser General Public License as published
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * by the Free Software Foundation; either version 2.1 of the License, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * (at your option) any later version.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * This library is distributed in the hope that it will be useful,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * but WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * the GNU Lesser General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct smb_mnt_fs_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) __u32 version; /* 0001 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) __u16 protocol_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) __u16 tcon_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) __u32 vol_serial_number;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) __u32 vol_create_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) __u32 share_caps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) __u32 share_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) __u32 sector_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) __u32 optimal_sector_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) __u32 max_bytes_chunk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) __u32 fs_attributes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) __u32 max_path_component;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) __u32 device_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) __u32 device_characteristics;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) __u32 maximal_access;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) __u64 cifs_posix_caps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct smb_snapshot_array {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) __u32 number_of_snapshots;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) __u32 number_of_snapshots_returned;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) __u32 snapshot_array_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) /* snapshots[]; */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) /* query_info flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define PASSTHRU_QUERY_INFO 0x00000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define PASSTHRU_FSCTL 0x00000001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define PASSTHRU_SET_INFO 0x00000002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct smb_query_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) __u32 info_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) __u32 file_info_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) __u32 additional_information;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) __u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) __u32 input_buffer_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) __u32 output_buffer_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) /* char buffer[]; */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) struct smb3_key_debug_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) __u64 Suid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) __u16 cipher_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) __u8 auth_key[16]; /* SMB2_NTLMV2_SESSKEY_SIZE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) __u8 smb3encryptionkey[SMB3_SIGN_KEY_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) __u8 smb3decryptionkey[SMB3_SIGN_KEY_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) struct smb3_notify {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) __u32 completion_filter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) bool watch_tree;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #define CIFS_IOCTL_MAGIC 0xCF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #define CIFS_IOC_COPYCHUNK_FILE _IOW(CIFS_IOCTL_MAGIC, 3, int)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) #define CIFS_IOC_SET_INTEGRITY _IO(CIFS_IOCTL_MAGIC, 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #define CIFS_IOC_GET_MNT_INFO _IOR(CIFS_IOCTL_MAGIC, 5, struct smb_mnt_fs_info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) #define CIFS_ENUMERATE_SNAPSHOTS _IOR(CIFS_IOCTL_MAGIC, 6, struct smb_snapshot_array)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #define CIFS_QUERY_INFO _IOWR(CIFS_IOCTL_MAGIC, 7, struct smb_query_info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) #define CIFS_DUMP_KEY _IOWR(CIFS_IOCTL_MAGIC, 8, struct smb3_key_debug_info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #define CIFS_IOC_NOTIFY _IOW(CIFS_IOCTL_MAGIC, 9, struct smb3_notify)