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(
30 struct tevent_context *ev,
31 struct cli_state *cli,
33 uint32_t create_flags,
34 uint32_t impersonation_level,
35 uint32_t desired_access,
36 uint32_t file_attributes,
37 uint32_t share_access,
38 uint32_t create_disposition,
39 uint32_t create_options,
40 const struct smb2_create_blobs *in_cblobs);
41 NTSTATUS cli_smb2_create_fnum_recv(
42 struct tevent_req *req,
44 struct smb_create_returns *cr,
46 struct smb2_create_blobs *out_cblobs);
47 NTSTATUS cli_smb2_create_fnum(
48 struct cli_state *cli,
50 uint32_t create_flags,
51 uint32_t impersonation_level,
52 uint32_t desired_access,
53 uint32_t file_attributes,
54 uint32_t share_access,
55 uint32_t create_disposition,
56 uint32_t create_options,
57 const struct smb2_create_blobs *in_cblobs,
59 struct smb_create_returns *cr,
61 struct smb2_create_blobs *out_cblobs);
63 struct tevent_req *cli_smb2_close_fnum_send(TALLOC_CTX *mem_ctx,
64 struct tevent_context *ev,
65 struct cli_state *cli,
67 NTSTATUS cli_smb2_close_fnum_recv(struct tevent_req *req);
68 NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum);
69 struct tevent_req *cli_smb2_delete_on_close_send(TALLOC_CTX *mem_ctx,
70 struct tevent_context *ev,
71 struct cli_state *cli,
74 NTSTATUS cli_smb2_delete_on_close_recv(struct tevent_req *req);
75 NTSTATUS cli_smb2_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
76 struct tevent_req *cli_smb2_mkdir_send(
78 struct tevent_context *ev,
79 struct cli_state *cli,
81 NTSTATUS cli_smb2_mkdir_recv(struct tevent_req *req);
82 struct tevent_req *cli_smb2_rmdir_send(
84 struct tevent_context *ev,
85 struct cli_state *cli,
87 const struct smb2_create_blobs *in_cblobs);
88 NTSTATUS cli_smb2_rmdir_recv(struct tevent_req *req);
89 struct tevent_req *cli_smb2_unlink_send(
91 struct tevent_context *ev,
92 struct cli_state *cli,
94 const struct smb2_create_blobs *in_cblobs);
95 NTSTATUS cli_smb2_unlink_recv(struct tevent_req *req);
96 struct tevent_req *cli_smb2_list_send(
98 struct tevent_context *ev,
99 struct cli_state *cli,
100 const char *pathname);
101 NTSTATUS cli_smb2_list_recv(
102 struct tevent_req *req,
104 struct file_info **pfinfo);
105 NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
107 SMB_STRUCT_STAT *sbuf,
108 uint32_t *attributes);
109 NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli,
112 struct tevent_req *cli_smb2_query_info_fnum_send(
114 struct tevent_context *ev,
115 struct cli_state *cli,
117 uint8_t in_info_type,
118 uint8_t in_info_class,
119 uint32_t in_max_output_length,
120 const DATA_BLOB *in_input_buffer,
121 uint32_t in_additional_info,
123 NTSTATUS cli_smb2_query_info_fnum_recv(
124 struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *outbuf);
125 struct tevent_req *cli_smb2_set_info_fnum_send(
127 struct tevent_context *ev,
128 struct cli_state *cli,
130 uint8_t in_info_type,
131 uint8_t in_info_class,
132 const DATA_BLOB *in_input_buffer,
133 uint32_t in_additional_info);
134 NTSTATUS cli_smb2_set_info_fnum_recv(struct tevent_req *req);
135 NTSTATUS cli_smb2_set_info_fnum(
136 struct cli_state *cli,
138 uint8_t in_info_type,
139 uint8_t in_info_class,
140 const DATA_BLOB *in_input_buffer,
141 uint32_t in_additional_info);
142 NTSTATUS cli_smb2_query_info_fnum(
143 struct cli_state *cli,
145 uint8_t in_info_type,
146 uint8_t in_info_class,
147 uint32_t in_max_output_length,
148 const DATA_BLOB *in_input_buffer,
149 uint32_t in_additional_info,
153 NTSTATUS cli_smb2_getatr(struct cli_state *cli,
158 NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
160 struct timespec *create_time,
161 struct timespec *access_time,
162 struct timespec *write_time,
163 struct timespec *change_time,
167 NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
170 unsigned int *pnum_streams,
171 struct stream_struct **pstreams);
172 NTSTATUS cli_smb2_setpathinfo(struct cli_state *cli,
174 uint8_t in_info_type,
175 uint8_t in_file_info_class,
176 const DATA_BLOB *p_in_data);
177 NTSTATUS cli_smb2_setatr(struct cli_state *cli,
181 NTSTATUS cli_smb2_setattrE(struct cli_state *cli,
186 NTSTATUS cli_smb2_dskattr(struct cli_state *cli,
191 NTSTATUS cli_smb2_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
192 NTSTATUS cli_smb2_get_fs_full_size_info(struct cli_state *cli,
193 uint64_t *total_allocation_units,
194 uint64_t *caller_allocation_units,
195 uint64_t *actual_allocation_units,
196 uint64_t *sectors_per_allocation_unit,
197 uint64_t *bytes_per_sector);
198 NTSTATUS cli_smb2_get_fs_volume_info(struct cli_state *cli,
201 uint32_t *pserial_number,
203 struct tevent_req *cli_smb2_query_mxac_send(TALLOC_CTX *mem_ctx,
204 struct tevent_context *ev,
205 struct cli_state *cli,
207 NTSTATUS cli_smb2_query_mxac_recv(struct tevent_req *req,
209 NTSTATUS cli_smb2_query_mxac(struct cli_state *cli,
212 struct tevent_req *cli_smb2_rename_send(
214 struct tevent_context *ev,
215 struct cli_state *cli,
216 const char *fname_src,
217 const char *fname_dst,
219 NTSTATUS cli_smb2_rename_recv(struct tevent_req *req);
220 NTSTATUS cli_smb2_set_ea_fnum(struct cli_state *cli,
225 NTSTATUS cli_smb2_get_ea_list_path(struct cli_state *cli,
229 struct ea_struct **pea_list);
230 NTSTATUS cli_smb2_set_ea_path(struct cli_state *cli,
235 NTSTATUS cli_smb2_get_user_quota(struct cli_state *cli,
237 SMB_NTQUOTA_STRUCT *pqt);
238 NTSTATUS cli_smb2_list_user_quota_step(struct cli_state *cli,
241 SMB_NTQUOTA_LIST **pqt_list,
243 NTSTATUS cli_smb2_get_fs_quota_info(struct cli_state *cli,
245 SMB_NTQUOTA_STRUCT *pqt);
246 NTSTATUS cli_smb2_set_user_quota(struct cli_state *cli,
248 SMB_NTQUOTA_LIST *qtl);
249 NTSTATUS cli_smb2_set_fs_quota_info(struct cli_state *cli,
251 SMB_NTQUOTA_STRUCT *pqt);
252 struct tevent_req *cli_smb2_read_send(TALLOC_CTX *mem_ctx,
253 struct tevent_context *ev,
254 struct cli_state *cli,
258 NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
261 struct tevent_req *cli_smb2_write_send(TALLOC_CTX *mem_ctx,
262 struct tevent_context *ev,
263 struct cli_state *cli,
269 NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
271 struct tevent_req *cli_smb2_writeall_send(TALLOC_CTX *mem_ctx,
272 struct tevent_context *ev,
273 struct cli_state *cli,
279 NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
281 struct tevent_req *cli_smb2_splice_send(TALLOC_CTX *mem_ctx,
282 struct tevent_context *ev,
283 struct cli_state *cli,
284 uint16_t src_fnum, uint16_t dst_fnum,
285 off_t size, off_t src_offset, off_t dst_offset,
286 int (*splice_cb)(off_t n, void *priv), void *priv);
287 NTSTATUS cli_smb2_splice_recv(struct tevent_req *req, off_t *written);
288 NTSTATUS cli_smb2_shadow_copy_data(TALLOC_CTX *mem_ctx,
289 struct cli_state *cli,
294 NTSTATUS cli_smb2_ftruncate(struct cli_state *cli,
297 struct tevent_req *cli_smb2_notify_send(
299 struct tevent_context *ev,
300 struct cli_state *cli,
302 uint32_t buffer_size,
303 uint32_t completion_filter,
305 NTSTATUS cli_smb2_notify_recv(struct tevent_req *req,
307 struct notify_change **pchanges,
308 uint32_t *pnum_changes);
309 NTSTATUS cli_smb2_notify(struct cli_state *cli, uint16_t fnum,
310 uint32_t buffer_size, uint32_t completion_filter,
311 bool recursive, TALLOC_CTX *mem_ctx,
312 struct notify_change **pchanges,
313 uint32_t *pnum_changes);
315 struct tevent_req *cli_smb2_fsctl_send(
317 struct tevent_context *ev,
318 struct cli_state *cli,
323 NTSTATUS cli_smb2_fsctl_recv(
324 struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *out);
326 #endif /* __SMB2CLI_FNUM_H__ */