18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci *   fs/cifs/smb2proto.h
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *   Copyright (c) International Business Machines  Corp., 2002, 2011
58c2ecf20Sopenharmony_ci *                 Etersoft, 2012
68c2ecf20Sopenharmony_ci *   Author(s): Steve French (sfrench@us.ibm.com)
78c2ecf20Sopenharmony_ci *              Pavel Shilovsky (pshilovsky@samba.org) 2012
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci *   This library is free software; you can redistribute it and/or modify
108c2ecf20Sopenharmony_ci *   it under the terms of the GNU Lesser General Public License as published
118c2ecf20Sopenharmony_ci *   by the Free Software Foundation; either version 2.1 of the License, or
128c2ecf20Sopenharmony_ci *   (at your option) any later version.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci *   This library is distributed in the hope that it will be useful,
158c2ecf20Sopenharmony_ci *   but WITHOUT ANY WARRANTY; without even the implied warranty of
168c2ecf20Sopenharmony_ci *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
178c2ecf20Sopenharmony_ci *   the GNU Lesser General Public License for more details.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci *   You should have received a copy of the GNU Lesser General Public License
208c2ecf20Sopenharmony_ci *   along with this library; if not, write to the Free Software
218c2ecf20Sopenharmony_ci *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_ci#ifndef _SMB2PROTO_H
248c2ecf20Sopenharmony_ci#define _SMB2PROTO_H
258c2ecf20Sopenharmony_ci#include <linux/nls.h>
268c2ecf20Sopenharmony_ci#include <linux/key-type.h>
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_cistruct statfs;
298c2ecf20Sopenharmony_cistruct smb_rqst;
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci/*
328c2ecf20Sopenharmony_ci *****************************************************************
338c2ecf20Sopenharmony_ci * All Prototypes
348c2ecf20Sopenharmony_ci *****************************************************************
358c2ecf20Sopenharmony_ci */
368c2ecf20Sopenharmony_ciextern int map_smb2_to_linux_error(char *buf, bool log_err);
378c2ecf20Sopenharmony_ciextern int smb2_check_message(char *buf, unsigned int length,
388c2ecf20Sopenharmony_ci			      struct TCP_Server_Info *server);
398c2ecf20Sopenharmony_ciextern unsigned int smb2_calc_size(void *buf, struct TCP_Server_Info *server);
408c2ecf20Sopenharmony_ciextern char *smb2_get_data_area_len(int *off, int *len,
418c2ecf20Sopenharmony_ci				    struct smb2_sync_hdr *shdr);
428c2ecf20Sopenharmony_ciextern __le16 *cifs_convert_path_to_utf16(const char *from,
438c2ecf20Sopenharmony_ci					  struct cifs_sb_info *cifs_sb);
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciextern int smb2_verify_signature(struct smb_rqst *, struct TCP_Server_Info *);
468c2ecf20Sopenharmony_ciextern int smb2_check_receive(struct mid_q_entry *mid,
478c2ecf20Sopenharmony_ci			      struct TCP_Server_Info *server, bool log_error);
488c2ecf20Sopenharmony_ciextern struct mid_q_entry *smb2_setup_request(struct cifs_ses *ses,
498c2ecf20Sopenharmony_ci					      struct TCP_Server_Info *,
508c2ecf20Sopenharmony_ci					      struct smb_rqst *rqst);
518c2ecf20Sopenharmony_ciextern struct mid_q_entry *smb2_setup_async_request(
528c2ecf20Sopenharmony_ci			struct TCP_Server_Info *server, struct smb_rqst *rqst);
538c2ecf20Sopenharmony_ciextern struct cifs_ses *smb2_find_smb_ses(struct TCP_Server_Info *server,
548c2ecf20Sopenharmony_ci					   __u64 ses_id);
558c2ecf20Sopenharmony_ciextern struct cifs_tcon *smb2_find_smb_tcon(struct TCP_Server_Info *server,
568c2ecf20Sopenharmony_ci						__u64 ses_id, __u32  tid);
578c2ecf20Sopenharmony_ciextern int smb2_calc_signature(struct smb_rqst *rqst,
588c2ecf20Sopenharmony_ci				struct TCP_Server_Info *server,
598c2ecf20Sopenharmony_ci				bool allocate_crypto);
608c2ecf20Sopenharmony_ciextern int smb3_calc_signature(struct smb_rqst *rqst,
618c2ecf20Sopenharmony_ci				struct TCP_Server_Info *server,
628c2ecf20Sopenharmony_ci				bool allocate_crypto);
638c2ecf20Sopenharmony_ciextern void smb2_echo_request(struct work_struct *work);
648c2ecf20Sopenharmony_ciextern __le32 smb2_get_lease_state(struct cifsInodeInfo *cinode);
658c2ecf20Sopenharmony_ciextern bool smb2_is_valid_oplock_break(char *buffer,
668c2ecf20Sopenharmony_ci				       struct TCP_Server_Info *srv);
678c2ecf20Sopenharmony_ciextern struct cifs_ses *smb2_find_smb_ses(struct TCP_Server_Info *server,
688c2ecf20Sopenharmony_ci					  __u64 ses_id);
698c2ecf20Sopenharmony_ciextern int smb3_handle_read_data(struct TCP_Server_Info *server,
708c2ecf20Sopenharmony_ci				 struct mid_q_entry *mid);
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ciextern int open_shroot(unsigned int xid, struct cifs_tcon *tcon,
738c2ecf20Sopenharmony_ci		       struct cifs_sb_info *cifs_sb,
748c2ecf20Sopenharmony_ci		       struct cached_fid **cfid);
758c2ecf20Sopenharmony_ciextern void close_shroot(struct cached_fid *cfid);
768c2ecf20Sopenharmony_ciextern void close_shroot_lease(struct cached_fid *cfid);
778c2ecf20Sopenharmony_ciextern void close_shroot_lease_locked(struct cached_fid *cfid);
788c2ecf20Sopenharmony_ciextern void move_smb2_info_to_cifs(FILE_ALL_INFO *dst,
798c2ecf20Sopenharmony_ci				   struct smb2_file_all_info *src);
808c2ecf20Sopenharmony_ciextern int smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon,
818c2ecf20Sopenharmony_ci				struct cifs_sb_info *cifs_sb, const char *path,
828c2ecf20Sopenharmony_ci				__u32 *reparse_tag);
838c2ecf20Sopenharmony_ciextern int smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
848c2ecf20Sopenharmony_ci				struct cifs_sb_info *cifs_sb,
858c2ecf20Sopenharmony_ci				const char *full_path, FILE_ALL_INFO *data,
868c2ecf20Sopenharmony_ci				bool *adjust_tz, bool *symlink);
878c2ecf20Sopenharmony_ciextern int smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon,
888c2ecf20Sopenharmony_ci			      const char *full_path, __u64 size,
898c2ecf20Sopenharmony_ci			      struct cifs_sb_info *cifs_sb, bool set_alloc);
908c2ecf20Sopenharmony_ciextern int smb2_set_file_info(struct inode *inode, const char *full_path,
918c2ecf20Sopenharmony_ci			      FILE_BASIC_INFO *buf, const unsigned int xid);
928c2ecf20Sopenharmony_ciextern int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
938c2ecf20Sopenharmony_ci			       umode_t mode, struct cifs_tcon *tcon,
948c2ecf20Sopenharmony_ci			       const char *full_path,
958c2ecf20Sopenharmony_ci			       struct cifs_sb_info *cifs_sb);
968c2ecf20Sopenharmony_ciextern int smb2_mkdir(const unsigned int xid, struct inode *inode,
978c2ecf20Sopenharmony_ci		      umode_t mode, struct cifs_tcon *tcon,
988c2ecf20Sopenharmony_ci		      const char *name, struct cifs_sb_info *cifs_sb);
998c2ecf20Sopenharmony_ciextern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path,
1008c2ecf20Sopenharmony_ci			       struct cifs_sb_info *cifs_sb,
1018c2ecf20Sopenharmony_ci			       struct cifs_tcon *tcon, const unsigned int xid);
1028c2ecf20Sopenharmony_ciextern int smb2_rmdir(const unsigned int xid, struct cifs_tcon *tcon,
1038c2ecf20Sopenharmony_ci		      const char *name, struct cifs_sb_info *cifs_sb);
1048c2ecf20Sopenharmony_ciextern int smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon,
1058c2ecf20Sopenharmony_ci		       const char *name, struct cifs_sb_info *cifs_sb);
1068c2ecf20Sopenharmony_ciextern int smb2_rename_path(const unsigned int xid, struct cifs_tcon *tcon,
1078c2ecf20Sopenharmony_ci			    const char *from_name, const char *to_name,
1088c2ecf20Sopenharmony_ci			    struct cifs_sb_info *cifs_sb);
1098c2ecf20Sopenharmony_ciextern int smb2_create_hardlink(const unsigned int xid, struct cifs_tcon *tcon,
1108c2ecf20Sopenharmony_ci				const char *from_name, const char *to_name,
1118c2ecf20Sopenharmony_ci				struct cifs_sb_info *cifs_sb);
1128c2ecf20Sopenharmony_ciextern int smb3_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
1138c2ecf20Sopenharmony_ci			struct cifs_sb_info *cifs_sb, const unsigned char *path,
1148c2ecf20Sopenharmony_ci			char *pbuf, unsigned int *pbytes_written);
1158c2ecf20Sopenharmony_ciextern int smb3_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
1168c2ecf20Sopenharmony_ci			  struct cifs_sb_info *cifs_sb,
1178c2ecf20Sopenharmony_ci			  const unsigned char *path, char *pbuf,
1188c2ecf20Sopenharmony_ci			  unsigned int *pbytes_read);
1198c2ecf20Sopenharmony_ciextern int smb2_open_file(const unsigned int xid,
1208c2ecf20Sopenharmony_ci			  struct cifs_open_parms *oparms,
1218c2ecf20Sopenharmony_ci			  __u32 *oplock, FILE_ALL_INFO *buf);
1228c2ecf20Sopenharmony_ciextern int smb2_unlock_range(struct cifsFileInfo *cfile,
1238c2ecf20Sopenharmony_ci			     struct file_lock *flock, const unsigned int xid);
1248c2ecf20Sopenharmony_ciextern int smb2_push_mandatory_locks(struct cifsFileInfo *cfile);
1258c2ecf20Sopenharmony_ciextern void smb2_reconnect_server(struct work_struct *work);
1268c2ecf20Sopenharmony_ciextern int smb3_crypto_aead_allocate(struct TCP_Server_Info *server);
1278c2ecf20Sopenharmony_ciextern unsigned long smb_rqst_len(struct TCP_Server_Info *server,
1288c2ecf20Sopenharmony_ci				  struct smb_rqst *rqst);
1298c2ecf20Sopenharmony_ciextern void smb2_set_next_command(struct cifs_tcon *tcon,
1308c2ecf20Sopenharmony_ci				  struct smb_rqst *rqst);
1318c2ecf20Sopenharmony_ciextern void smb2_set_related(struct smb_rqst *rqst);
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci/*
1348c2ecf20Sopenharmony_ci * SMB2 Worker functions - most of protocol specific implementation details
1358c2ecf20Sopenharmony_ci * are contained within these calls.
1368c2ecf20Sopenharmony_ci */
1378c2ecf20Sopenharmony_ciextern int SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses);
1388c2ecf20Sopenharmony_ciextern int SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
1398c2ecf20Sopenharmony_ci			   const struct nls_table *nls_cp);
1408c2ecf20Sopenharmony_ciextern int SMB2_logoff(const unsigned int xid, struct cifs_ses *ses);
1418c2ecf20Sopenharmony_ciextern int SMB2_tcon(const unsigned int xid, struct cifs_ses *ses,
1428c2ecf20Sopenharmony_ci		     const char *tree, struct cifs_tcon *tcon,
1438c2ecf20Sopenharmony_ci		     const struct nls_table *);
1448c2ecf20Sopenharmony_ciextern int SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon);
1458c2ecf20Sopenharmony_ciextern int SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms,
1468c2ecf20Sopenharmony_ci		     __le16 *path, __u8 *oplock,
1478c2ecf20Sopenharmony_ci		     struct smb2_file_all_info *buf,
1488c2ecf20Sopenharmony_ci		     struct create_posix_rsp *posix,
1498c2ecf20Sopenharmony_ci		     struct kvec *err_iov, int *resp_buftype);
1508c2ecf20Sopenharmony_ciextern int SMB2_open_init(struct cifs_tcon *tcon,
1518c2ecf20Sopenharmony_ci			  struct TCP_Server_Info *server,
1528c2ecf20Sopenharmony_ci			  struct smb_rqst *rqst,
1538c2ecf20Sopenharmony_ci			  __u8 *oplock, struct cifs_open_parms *oparms,
1548c2ecf20Sopenharmony_ci			  __le16 *path);
1558c2ecf20Sopenharmony_ciextern void SMB2_open_free(struct smb_rqst *rqst);
1568c2ecf20Sopenharmony_ciextern int SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon,
1578c2ecf20Sopenharmony_ci		     u64 persistent_fid, u64 volatile_fid, u32 opcode,
1588c2ecf20Sopenharmony_ci		     char *in_data, u32 indatalen, u32 maxoutlen,
1598c2ecf20Sopenharmony_ci		     char **out_data, u32 *plen /* returned data len */);
1608c2ecf20Sopenharmony_ciextern int SMB2_ioctl_init(struct cifs_tcon *tcon,
1618c2ecf20Sopenharmony_ci			   struct TCP_Server_Info *server,
1628c2ecf20Sopenharmony_ci			   struct smb_rqst *rqst,
1638c2ecf20Sopenharmony_ci			   u64 persistent_fid, u64 volatile_fid, u32 opcode,
1648c2ecf20Sopenharmony_ci			   char *in_data, u32 indatalen,
1658c2ecf20Sopenharmony_ci			   __u32 max_response_size);
1668c2ecf20Sopenharmony_ciextern void SMB2_ioctl_free(struct smb_rqst *rqst);
1678c2ecf20Sopenharmony_ciextern int SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon,
1688c2ecf20Sopenharmony_ci			u64 persistent_fid, u64 volatile_fid, bool watch_tree,
1698c2ecf20Sopenharmony_ci			u32 completion_filter);
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ciextern int __SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
1728c2ecf20Sopenharmony_ci			u64 persistent_fid, u64 volatile_fid,
1738c2ecf20Sopenharmony_ci			struct smb2_file_network_open_info *pbuf);
1748c2ecf20Sopenharmony_ciextern int SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
1758c2ecf20Sopenharmony_ci		      u64 persistent_file_id, u64 volatile_file_id);
1768c2ecf20Sopenharmony_ciextern int SMB2_close_init(struct cifs_tcon *tcon,
1778c2ecf20Sopenharmony_ci			   struct TCP_Server_Info *server,
1788c2ecf20Sopenharmony_ci			   struct smb_rqst *rqst,
1798c2ecf20Sopenharmony_ci			   u64 persistent_fid, u64 volatile_fid,
1808c2ecf20Sopenharmony_ci			   bool query_attrs);
1818c2ecf20Sopenharmony_ciextern void SMB2_close_free(struct smb_rqst *rqst);
1828c2ecf20Sopenharmony_ciextern int SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon,
1838c2ecf20Sopenharmony_ci		      u64 persistent_file_id, u64 volatile_file_id);
1848c2ecf20Sopenharmony_ciextern int SMB2_flush_init(const unsigned int xid, struct smb_rqst *rqst,
1858c2ecf20Sopenharmony_ci			   struct cifs_tcon *tcon,
1868c2ecf20Sopenharmony_ci			   struct TCP_Server_Info *server,
1878c2ecf20Sopenharmony_ci			   u64 persistent_file_id, u64 volatile_file_id);
1888c2ecf20Sopenharmony_ciextern void SMB2_flush_free(struct smb_rqst *rqst);
1898c2ecf20Sopenharmony_ciextern int SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon,
1908c2ecf20Sopenharmony_ci		u64 persistent_fid, u64 volatile_fid, struct smb311_posix_qinfo *data, u32 *plen);
1918c2ecf20Sopenharmony_ciextern int SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon,
1928c2ecf20Sopenharmony_ci			   u64 persistent_file_id, u64 volatile_file_id,
1938c2ecf20Sopenharmony_ci			   struct smb2_file_all_info *data);
1948c2ecf20Sopenharmony_ciextern int SMB2_query_info_init(struct cifs_tcon *tcon,
1958c2ecf20Sopenharmony_ci				struct TCP_Server_Info *server,
1968c2ecf20Sopenharmony_ci				struct smb_rqst *rqst,
1978c2ecf20Sopenharmony_ci				u64 persistent_fid, u64 volatile_fid,
1988c2ecf20Sopenharmony_ci				u8 info_class, u8 info_type,
1998c2ecf20Sopenharmony_ci				u32 additional_info, size_t output_len,
2008c2ecf20Sopenharmony_ci				size_t input_len, void *input);
2018c2ecf20Sopenharmony_ciextern void SMB2_query_info_free(struct smb_rqst *rqst);
2028c2ecf20Sopenharmony_ciextern int SMB2_query_acl(const unsigned int xid, struct cifs_tcon *tcon,
2038c2ecf20Sopenharmony_ci			   u64 persistent_file_id, u64 volatile_file_id,
2048c2ecf20Sopenharmony_ci			   void **data, unsigned int *plen);
2058c2ecf20Sopenharmony_ciextern int SMB2_get_srv_num(const unsigned int xid, struct cifs_tcon *tcon,
2068c2ecf20Sopenharmony_ci			    u64 persistent_fid, u64 volatile_fid,
2078c2ecf20Sopenharmony_ci			    __le64 *uniqueid);
2088c2ecf20Sopenharmony_ciextern int smb2_async_readv(struct cifs_readdata *rdata);
2098c2ecf20Sopenharmony_ciextern int SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
2108c2ecf20Sopenharmony_ci		     unsigned int *nbytes, char **buf, int *buf_type);
2118c2ecf20Sopenharmony_ciextern int smb2_async_writev(struct cifs_writedata *wdata,
2128c2ecf20Sopenharmony_ci			     void (*release)(struct kref *kref));
2138c2ecf20Sopenharmony_ciextern int SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,
2148c2ecf20Sopenharmony_ci		      unsigned int *nbytes, struct kvec *iov, int n_vec);
2158c2ecf20Sopenharmony_ciextern int SMB2_echo(struct TCP_Server_Info *server);
2168c2ecf20Sopenharmony_ciextern int SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
2178c2ecf20Sopenharmony_ci				u64 persistent_fid, u64 volatile_fid, int index,
2188c2ecf20Sopenharmony_ci				struct cifs_search_info *srch_inf);
2198c2ecf20Sopenharmony_ciextern int SMB2_query_directory_init(unsigned int xid, struct cifs_tcon *tcon,
2208c2ecf20Sopenharmony_ci				     struct TCP_Server_Info *server,
2218c2ecf20Sopenharmony_ci				     struct smb_rqst *rqst,
2228c2ecf20Sopenharmony_ci				     u64 persistent_fid, u64 volatile_fid,
2238c2ecf20Sopenharmony_ci				     int index, int info_level);
2248c2ecf20Sopenharmony_ciextern void SMB2_query_directory_free(struct smb_rqst *rqst);
2258c2ecf20Sopenharmony_ciextern int SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon,
2268c2ecf20Sopenharmony_ci			u64 persistent_fid, u64 volatile_fid, u32 pid,
2278c2ecf20Sopenharmony_ci			__le64 *eof);
2288c2ecf20Sopenharmony_ciextern int SMB2_set_info_init(struct cifs_tcon *tcon,
2298c2ecf20Sopenharmony_ci			      struct TCP_Server_Info *server,
2308c2ecf20Sopenharmony_ci			      struct smb_rqst *rqst,
2318c2ecf20Sopenharmony_ci			      u64 persistent_fid, u64 volatile_fid, u32 pid,
2328c2ecf20Sopenharmony_ci			      u8 info_class, u8 info_type, u32 additional_info,
2338c2ecf20Sopenharmony_ci			      void **data, unsigned int *size);
2348c2ecf20Sopenharmony_ciextern void SMB2_set_info_free(struct smb_rqst *rqst);
2358c2ecf20Sopenharmony_ciextern int SMB2_set_acl(const unsigned int xid, struct cifs_tcon *tcon,
2368c2ecf20Sopenharmony_ci			u64 persistent_fid, u64 volatile_fid,
2378c2ecf20Sopenharmony_ci			struct cifs_ntsd *pnntsd, int pacllen, int aclflag);
2388c2ecf20Sopenharmony_ciextern int SMB2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
2398c2ecf20Sopenharmony_ci		       u64 persistent_fid, u64 volatile_fid,
2408c2ecf20Sopenharmony_ci		       struct smb2_file_full_ea_info *buf, int len);
2418c2ecf20Sopenharmony_ciextern int SMB2_set_compression(const unsigned int xid, struct cifs_tcon *tcon,
2428c2ecf20Sopenharmony_ci				u64 persistent_fid, u64 volatile_fid);
2438c2ecf20Sopenharmony_ciextern int SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon,
2448c2ecf20Sopenharmony_ci			     const u64 persistent_fid, const u64 volatile_fid,
2458c2ecf20Sopenharmony_ci			     const __u8 oplock_level);
2468c2ecf20Sopenharmony_ciextern int smb2_handle_cancelled_close(struct cifs_tcon *tcon,
2478c2ecf20Sopenharmony_ci				       __u64 persistent_fid,
2488c2ecf20Sopenharmony_ci				       __u64 volatile_fid);
2498c2ecf20Sopenharmony_ciextern int smb2_handle_cancelled_mid(struct mid_q_entry *mid, struct TCP_Server_Info *server);
2508c2ecf20Sopenharmony_civoid smb2_cancelled_close_fid(struct work_struct *work);
2518c2ecf20Sopenharmony_ciextern int SMB2_QFS_info(const unsigned int xid, struct cifs_tcon *tcon,
2528c2ecf20Sopenharmony_ci			 u64 persistent_file_id, u64 volatile_file_id,
2538c2ecf20Sopenharmony_ci			 struct kstatfs *FSData);
2548c2ecf20Sopenharmony_ciextern int SMB311_posix_qfs_info(const unsigned int xid, struct cifs_tcon *tcon,
2558c2ecf20Sopenharmony_ci			 u64 persistent_file_id, u64 volatile_file_id,
2568c2ecf20Sopenharmony_ci			 struct kstatfs *FSData);
2578c2ecf20Sopenharmony_ciextern int SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon,
2588c2ecf20Sopenharmony_ci			 u64 persistent_file_id, u64 volatile_file_id, int lvl);
2598c2ecf20Sopenharmony_ciextern int SMB2_lock(const unsigned int xid, struct cifs_tcon *tcon,
2608c2ecf20Sopenharmony_ci		     const __u64 persist_fid, const __u64 volatile_fid,
2618c2ecf20Sopenharmony_ci		     const __u32 pid, const __u64 length, const __u64 offset,
2628c2ecf20Sopenharmony_ci		     const __u32 lockFlags, const bool wait);
2638c2ecf20Sopenharmony_ciextern int smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2648c2ecf20Sopenharmony_ci		      const __u64 persist_fid, const __u64 volatile_fid,
2658c2ecf20Sopenharmony_ci		      const __u32 pid, const __u32 num_lock,
2668c2ecf20Sopenharmony_ci		      struct smb2_lock_element *buf);
2678c2ecf20Sopenharmony_ciextern int SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon,
2688c2ecf20Sopenharmony_ci			    __u8 *lease_key, const __le32 lease_state);
2698c2ecf20Sopenharmony_ciextern int smb3_validate_negotiate(const unsigned int, struct cifs_tcon *);
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ciextern enum securityEnum smb2_select_sectype(struct TCP_Server_Info *,
2728c2ecf20Sopenharmony_ci					enum securityEnum);
2738c2ecf20Sopenharmony_ciextern void smb2_parse_contexts(struct TCP_Server_Info *server,
2748c2ecf20Sopenharmony_ci				struct smb2_create_rsp *rsp,
2758c2ecf20Sopenharmony_ci				unsigned int *epoch, char *lease_key,
2768c2ecf20Sopenharmony_ci				__u8 *oplock, struct smb2_file_all_info *buf,
2778c2ecf20Sopenharmony_ci				struct create_posix_rsp *posix);
2788c2ecf20Sopenharmony_ciextern int smb3_encryption_required(const struct cifs_tcon *tcon);
2798c2ecf20Sopenharmony_ciextern int smb2_validate_iov(unsigned int offset, unsigned int buffer_length,
2808c2ecf20Sopenharmony_ci			     struct kvec *iov, unsigned int min_buf_size);
2818c2ecf20Sopenharmony_ciextern int smb2_validate_and_copy_iov(unsigned int offset,
2828c2ecf20Sopenharmony_ci				      unsigned int buffer_length,
2838c2ecf20Sopenharmony_ci				      struct kvec *iov,
2848c2ecf20Sopenharmony_ci				      unsigned int minbufsize, char *data);
2858c2ecf20Sopenharmony_ciextern void smb2_copy_fs_info_to_kstatfs(
2868c2ecf20Sopenharmony_ci	 struct smb2_fs_full_size_info *pfs_inf,
2878c2ecf20Sopenharmony_ci	 struct kstatfs *kst);
2888c2ecf20Sopenharmony_ciextern int smb311_crypto_shash_allocate(struct TCP_Server_Info *server);
2898c2ecf20Sopenharmony_ciextern int smb311_update_preauth_hash(struct cifs_ses *ses,
2908c2ecf20Sopenharmony_ci				      struct kvec *iov, int nvec);
2918c2ecf20Sopenharmony_ciextern int smb2_query_info_compound(const unsigned int xid,
2928c2ecf20Sopenharmony_ci				    struct cifs_tcon *tcon,
2938c2ecf20Sopenharmony_ci				    __le16 *utf16_path, u32 desired_access,
2948c2ecf20Sopenharmony_ci				    u32 class, u32 type, u32 output_len,
2958c2ecf20Sopenharmony_ci				    struct kvec *rsp, int *buftype,
2968c2ecf20Sopenharmony_ci				    struct cifs_sb_info *cifs_sb);
2978c2ecf20Sopenharmony_ci/* query path info from the server using SMB311 POSIX extensions*/
2988c2ecf20Sopenharmony_ciextern int smb311_posix_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
2998c2ecf20Sopenharmony_ci			struct cifs_sb_info *sb, const char *path, struct smb311_posix_qinfo *qinf,
3008c2ecf20Sopenharmony_ci			bool *adjust_tx, bool *symlink);
3018c2ecf20Sopenharmony_ciint posix_info_parse(const void *beg, const void *end,
3028c2ecf20Sopenharmony_ci		     struct smb2_posix_info_parsed *out);
3038c2ecf20Sopenharmony_ciint posix_info_sid_size(const void *beg, const void *end);
3048c2ecf20Sopenharmony_ci#endif			/* _SMB2PROTO_H */
305