2 Unix SMB/CIFS implementation.
3 smb2 wrapper client routines
4 Copyright (C) Jeremy Allison 2013
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __SMB2CLI_FNUM_H__
21 #define __SMB2CLI_FNUM_H__
24 struct smbXcli_session;
28 struct tevent_req *cli_smb2_create_fnum_send(TALLOC_CTX *mem_ctx,
29 struct tevent_context *ev,
30 struct cli_state *cli,
32 uint32_t create_flags,
33 uint32_t desired_access,
34 uint32_t file_attributes,
35 uint32_t share_access,
36 uint32_t create_disposition,
37 uint32_t create_options);
38 NTSTATUS cli_smb2_create_fnum_recv(struct tevent_req *req, uint16_t *pfnum,
39 struct smb_create_returns *cr);
40 NTSTATUS cli_smb2_create_fnum(struct cli_state *cli,
42 uint32_t create_flags,
43 uint32_t desired_access,
44 uint32_t file_attributes,
45 uint32_t share_access,
46 uint32_t create_disposition,
47 uint32_t create_options,
49 struct smb_create_returns *cr);
51 struct tevent_req *cli_smb2_close_fnum_send(TALLOC_CTX *mem_ctx,
52 struct tevent_context *ev,
53 struct cli_state *cli,
55 NTSTATUS cli_smb2_close_fnum_recv(struct tevent_req *req);
56 NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum);
57 struct tevent_req *cli_smb2_delete_on_close_send(TALLOC_CTX *mem_ctx,
58 struct tevent_context *ev,
59 struct cli_state *cli,
62 NTSTATUS cli_smb2_delete_on_close_recv(struct tevent_req *req);
63 NTSTATUS cli_smb2_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
64 NTSTATUS cli_smb2_mkdir(struct cli_state *cli, const char *dirname);
65 NTSTATUS cli_smb2_rmdir(struct cli_state *cli, const char *dirname);
66 NTSTATUS cli_smb2_unlink(struct cli_state *cli,const char *fname);
67 NTSTATUS cli_smb2_list(struct cli_state *cli,
70 NTSTATUS (*fn)(const char *,
75 NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
77 SMB_STRUCT_STAT *sbuf,
78 uint32_t *attributes);
79 NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli,
82 NTSTATUS cli_smb2_chkpath(struct cli_state *cli,
84 NTSTATUS cli_smb2_qfileinfo_basic(struct cli_state *cli,
88 struct timespec *create_time,
89 struct timespec *access_time,
90 struct timespec *write_time,
91 struct timespec *change_time,
93 NTSTATUS cli_smb2_getattrE(struct cli_state *cli,
100 NTSTATUS cli_smb2_getatr(struct cli_state *cli,
105 NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
107 struct timespec *create_time,
108 struct timespec *access_time,
109 struct timespec *write_time,
110 struct timespec *change_time,
114 NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
117 unsigned int *pnum_streams,
118 struct stream_struct **pstreams);
119 NTSTATUS cli_smb2_setpathinfo(struct cli_state *cli,
121 uint8_t in_info_type,
122 uint8_t in_file_info_class,
123 const DATA_BLOB *p_in_data);
124 NTSTATUS cli_smb2_setatr(struct cli_state *cli,
128 NTSTATUS cli_smb2_setattrE(struct cli_state *cli,
133 NTSTATUS cli_smb2_dskattr(struct cli_state *cli,
138 NTSTATUS cli_smb2_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
139 NTSTATUS cli_smb2_query_security_descriptor(struct cli_state *cli,
143 struct security_descriptor **ppsd);
144 NTSTATUS cli_smb2_set_security_descriptor(struct cli_state *cli,
147 const struct security_descriptor *sd);
148 NTSTATUS cli_smb2_rename(struct cli_state *cli,
149 const char *fname_src,
150 const char *fname_dst,
152 NTSTATUS cli_smb2_set_ea_fnum(struct cli_state *cli,
157 NTSTATUS cli_smb2_get_ea_list_path(struct cli_state *cli,
161 struct ea_struct **pea_list);
162 NTSTATUS cli_smb2_set_ea_path(struct cli_state *cli,
167 NTSTATUS cli_smb2_get_user_quota(struct cli_state *cli,
169 SMB_NTQUOTA_STRUCT *pqt);
170 NTSTATUS cli_smb2_list_user_quota_step(struct cli_state *cli,
173 SMB_NTQUOTA_LIST **pqt_list,
175 NTSTATUS cli_smb2_get_fs_quota_info(struct cli_state *cli,
177 SMB_NTQUOTA_STRUCT *pqt);
178 NTSTATUS cli_smb2_set_user_quota(struct cli_state *cli,
180 SMB_NTQUOTA_LIST *qtl);
181 NTSTATUS cli_smb2_set_fs_quota_info(struct cli_state *cli,
183 SMB_NTQUOTA_STRUCT *pqt);
184 struct tevent_req *cli_smb2_read_send(TALLOC_CTX *mem_ctx,
185 struct tevent_context *ev,
186 struct cli_state *cli,
190 NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
193 struct tevent_req *cli_smb2_write_send(TALLOC_CTX *mem_ctx,
194 struct tevent_context *ev,
195 struct cli_state *cli,
201 NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
203 struct tevent_req *cli_smb2_writeall_send(TALLOC_CTX *mem_ctx,
204 struct tevent_context *ev,
205 struct cli_state *cli,
211 NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
213 struct tevent_req *cli_smb2_splice_send(TALLOC_CTX *mem_ctx,
214 struct tevent_context *ev,
215 struct cli_state *cli,
216 uint16_t src_fnum, uint16_t dst_fnum,
217 off_t size, off_t src_offset, off_t dst_offset,
218 int (*splice_cb)(off_t n, void *priv), void *priv);
219 NTSTATUS cli_smb2_splice_recv(struct tevent_req *req, off_t *written);
220 NTSTATUS cli_smb2_shadow_copy_data(TALLOC_CTX *mem_ctx,
221 struct cli_state *cli,
226 NTSTATUS cli_smb2_ftruncate(struct cli_state *cli,
229 NTSTATUS cli_smb2_notify(struct cli_state *cli, uint16_t fnum,
230 uint32_t buffer_size, uint32_t completion_filter,
231 bool recursive, TALLOC_CTX *mem_ctx,
232 struct notify_change **pchanges,
233 uint32_t *pnum_changes);
234 #endif /* __SMB2CLI_FNUM_H__ */