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 NTSTATUS cli_smb2_mkdir(struct cli_state *cli, const char *dirname);
77 struct tevent_req *cli_smb2_rmdir_send(
79 struct tevent_context *ev,
80 struct cli_state *cli,
82 const struct smb2_create_blobs *in_cblobs);
83 NTSTATUS cli_smb2_rmdir_recv(struct tevent_req *req);
84 NTSTATUS cli_smb2_rmdir(
85 struct cli_state *cli,
87 const struct smb2_create_blobs *in_cblobs);
88 struct tevent_req *cli_smb2_unlink_send(
90 struct tevent_context *ev,
91 struct cli_state *cli,
93 const struct smb2_create_blobs *in_cblobs);
94 NTSTATUS cli_smb2_unlink_recv(struct tevent_req *req);
95 NTSTATUS cli_smb2_unlink(
96 struct cli_state *cli,
98 const struct smb2_create_blobs *in_cblobs);
99 NTSTATUS cli_smb2_list(struct cli_state *cli,
100 const char *pathname,
102 NTSTATUS (*fn)(const char *,
107 NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
109 SMB_STRUCT_STAT *sbuf,
110 uint32_t *attributes);
111 NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli,
114 NTSTATUS cli_smb2_chkpath(struct cli_state *cli,
116 struct tevent_req *cli_smb2_query_info_fnum_send(
118 struct tevent_context *ev,
119 struct cli_state *cli,
121 uint8_t in_info_type,
122 uint8_t in_info_class,
123 uint32_t in_max_output_length,
124 const DATA_BLOB *in_input_buffer,
125 uint32_t in_additional_info,
127 NTSTATUS cli_smb2_query_info_fnum_recv(
128 struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *outbuf);
129 struct tevent_req *cli_smb2_set_info_fnum_send(
131 struct tevent_context *ev,
132 struct cli_state *cli,
134 uint8_t in_info_type,
135 uint8_t in_info_class,
136 const DATA_BLOB *in_input_buffer,
137 uint32_t in_additional_info);
138 NTSTATUS cli_smb2_set_info_fnum_recv(struct tevent_req *req);
139 NTSTATUS cli_smb2_set_info_fnum(
140 struct cli_state *cli,
142 uint8_t in_info_type,
143 uint8_t in_info_class,
144 const DATA_BLOB *in_input_buffer,
145 uint32_t in_additional_info);
146 NTSTATUS cli_smb2_query_info_fnum(
147 struct cli_state *cli,
149 uint8_t in_info_type,
150 uint8_t in_info_class,
151 uint32_t in_max_output_length,
152 const DATA_BLOB *in_input_buffer,
153 uint32_t in_additional_info,
157 NTSTATUS cli_smb2_qfileinfo_basic(struct cli_state *cli,
161 struct timespec *create_time,
162 struct timespec *access_time,
163 struct timespec *write_time,
164 struct timespec *change_time,
166 NTSTATUS cli_smb2_getattrE(struct cli_state *cli,
173 NTSTATUS cli_smb2_getatr(struct cli_state *cli,
178 NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
180 struct timespec *create_time,
181 struct timespec *access_time,
182 struct timespec *write_time,
183 struct timespec *change_time,
187 NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
190 unsigned int *pnum_streams,
191 struct stream_struct **pstreams);
192 NTSTATUS cli_smb2_setpathinfo(struct cli_state *cli,
194 uint8_t in_info_type,
195 uint8_t in_file_info_class,
196 const DATA_BLOB *p_in_data);
197 NTSTATUS cli_smb2_setatr(struct cli_state *cli,
201 NTSTATUS cli_smb2_setattrE(struct cli_state *cli,
206 NTSTATUS cli_smb2_dskattr(struct cli_state *cli,
211 NTSTATUS cli_smb2_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
212 NTSTATUS cli_smb2_get_fs_full_size_info(struct cli_state *cli,
213 uint64_t *total_allocation_units,
214 uint64_t *caller_allocation_units,
215 uint64_t *actual_allocation_units,
216 uint64_t *sectors_per_allocation_unit,
217 uint64_t *bytes_per_sector);
218 NTSTATUS cli_smb2_get_fs_volume_info(struct cli_state *cli,
221 uint32_t *pserial_number,
223 NTSTATUS cli_smb2_query_security_descriptor(struct cli_state *cli,
227 struct security_descriptor **ppsd);
228 NTSTATUS cli_smb2_set_security_descriptor(struct cli_state *cli,
231 const struct security_descriptor *sd);
232 struct tevent_req *cli_smb2_query_mxac_send(TALLOC_CTX *mem_ctx,
233 struct tevent_context *ev,
234 struct cli_state *cli,
236 NTSTATUS cli_smb2_query_mxac_recv(struct tevent_req *req,
238 NTSTATUS cli_smb2_query_mxac(struct cli_state *cli,
241 NTSTATUS cli_smb2_rename(struct cli_state *cli,
242 const char *fname_src,
243 const char *fname_dst,
245 NTSTATUS cli_smb2_set_ea_fnum(struct cli_state *cli,
250 NTSTATUS cli_smb2_get_ea_list_path(struct cli_state *cli,
254 struct ea_struct **pea_list);
255 NTSTATUS cli_smb2_set_ea_path(struct cli_state *cli,
260 NTSTATUS cli_smb2_get_user_quota(struct cli_state *cli,
262 SMB_NTQUOTA_STRUCT *pqt);
263 NTSTATUS cli_smb2_list_user_quota_step(struct cli_state *cli,
266 SMB_NTQUOTA_LIST **pqt_list,
268 NTSTATUS cli_smb2_get_fs_quota_info(struct cli_state *cli,
270 SMB_NTQUOTA_STRUCT *pqt);
271 NTSTATUS cli_smb2_set_user_quota(struct cli_state *cli,
273 SMB_NTQUOTA_LIST *qtl);
274 NTSTATUS cli_smb2_set_fs_quota_info(struct cli_state *cli,
276 SMB_NTQUOTA_STRUCT *pqt);
277 struct tevent_req *cli_smb2_read_send(TALLOC_CTX *mem_ctx,
278 struct tevent_context *ev,
279 struct cli_state *cli,
283 NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
286 struct tevent_req *cli_smb2_write_send(TALLOC_CTX *mem_ctx,
287 struct tevent_context *ev,
288 struct cli_state *cli,
294 NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
296 struct tevent_req *cli_smb2_writeall_send(TALLOC_CTX *mem_ctx,
297 struct tevent_context *ev,
298 struct cli_state *cli,
304 NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
306 struct tevent_req *cli_smb2_splice_send(TALLOC_CTX *mem_ctx,
307 struct tevent_context *ev,
308 struct cli_state *cli,
309 uint16_t src_fnum, uint16_t dst_fnum,
310 off_t size, off_t src_offset, off_t dst_offset,
311 int (*splice_cb)(off_t n, void *priv), void *priv);
312 NTSTATUS cli_smb2_splice_recv(struct tevent_req *req, off_t *written);
313 NTSTATUS cli_smb2_shadow_copy_data(TALLOC_CTX *mem_ctx,
314 struct cli_state *cli,
319 NTSTATUS cli_smb2_ftruncate(struct cli_state *cli,
322 struct tevent_req *cli_smb2_notify_send(
324 struct tevent_context *ev,
325 struct cli_state *cli,
327 uint32_t buffer_size,
328 uint32_t completion_filter,
330 NTSTATUS cli_smb2_notify_recv(struct tevent_req *req,
332 struct notify_change **pchanges,
333 uint32_t *pnum_changes);
334 NTSTATUS cli_smb2_notify(struct cli_state *cli, uint16_t fnum,
335 uint32_t buffer_size, uint32_t completion_filter,
336 bool recursive, TALLOC_CTX *mem_ctx,
337 struct notify_change **pchanges,
338 uint32_t *pnum_changes);
339 struct tevent_req *cli_smb2_set_reparse_point_fnum_send(
341 struct tevent_context *ev,
342 struct cli_state *cli,
345 NTSTATUS cli_smb2_set_reparse_point_fnum_recv(struct tevent_req *req);
347 struct tevent_req *cli_smb2_get_reparse_point_fnum_send(
349 struct tevent_context *ev,
350 struct cli_state *cli,
352 NTSTATUS cli_smb2_get_reparse_point_fnum_recv(struct tevent_req *req,
356 #endif /* __SMB2CLI_FNUM_H__ */