s3:utils: Fix 'Usage:' for 'net ads enctypes'
[samba4-gss.git] / source3 / libsmb / cli_smb2_fnum.h
blob4399cf319816a5f253bfaea7c79a3c3b493ec91f
1 /*
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__
23 struct smbXcli_conn;
24 struct smbXcli_session;
25 struct cli_state;
26 struct file_info;
27 struct symlink_reparse_struct;
29 struct cli_smb2_create_flags {
30 bool batch_oplock:1;
31 bool exclusive_oplock:1;
34 struct tevent_req *cli_smb2_create_fnum_send(
35 TALLOC_CTX *mem_ctx,
36 struct tevent_context *ev,
37 struct cli_state *cli,
38 const char *fname,
39 struct cli_smb2_create_flags create_flags,
40 uint32_t impersonation_level,
41 uint32_t desired_access,
42 uint32_t file_attributes,
43 uint32_t share_access,
44 uint32_t create_disposition,
45 uint32_t create_options,
46 const struct smb2_create_blobs *in_cblobs);
47 NTSTATUS cli_smb2_create_fnum_recv(
48 struct tevent_req *req,
49 uint16_t *pfnum,
50 struct smb_create_returns *cr,
51 TALLOC_CTX *mem_ctx,
52 struct smb2_create_blobs *out_cblobs,
53 struct symlink_reparse_struct **symlink);
54 NTSTATUS cli_smb2_create_fnum(
55 struct cli_state *cli,
56 const char *fname,
57 struct cli_smb2_create_flags create_flags,
58 uint32_t impersonation_level,
59 uint32_t desired_access,
60 uint32_t file_attributes,
61 uint32_t share_access,
62 uint32_t create_disposition,
63 uint32_t create_options,
64 const struct smb2_create_blobs *in_cblobs,
65 uint16_t *pfid,
66 struct smb_create_returns *cr,
67 TALLOC_CTX *mem_ctx,
68 struct smb2_create_blobs *out_cblobs);
70 bool cli_smb2_fnum_is_posix(struct cli_state *cli, uint16_t fnum);
72 struct tevent_req *cli_smb2_close_fnum_send(TALLOC_CTX *mem_ctx,
73 struct tevent_context *ev,
74 struct cli_state *cli,
75 uint16_t fnum,
76 uint16_t flags);
77 NTSTATUS cli_smb2_close_fnum_recv(struct tevent_req *req);
78 NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum);
79 struct tevent_req *cli_smb2_delete_on_close_send(TALLOC_CTX *mem_ctx,
80 struct tevent_context *ev,
81 struct cli_state *cli,
82 uint16_t fnum,
83 bool flag);
84 NTSTATUS cli_smb2_delete_on_close_recv(struct tevent_req *req);
85 NTSTATUS cli_smb2_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
86 struct tevent_req *cli_smb2_mkdir_send(
87 TALLOC_CTX *mem_ctx,
88 struct tevent_context *ev,
89 struct cli_state *cli,
90 const char *name);
91 NTSTATUS cli_smb2_mkdir_recv(struct tevent_req *req);
92 struct tevent_req *cli_smb2_rmdir_send(
93 TALLOC_CTX *mem_ctx,
94 struct tevent_context *ev,
95 struct cli_state *cli,
96 const char *dname,
97 const struct smb2_create_blobs *in_cblobs);
98 NTSTATUS cli_smb2_rmdir_recv(struct tevent_req *req);
99 struct tevent_req *cli_smb2_unlink_send(
100 TALLOC_CTX *mem_ctx,
101 struct tevent_context *ev,
102 struct cli_state *cli,
103 const char *fname,
104 const struct smb2_create_blobs *in_cblobs);
105 NTSTATUS cli_smb2_unlink_recv(struct tevent_req *req);
106 struct tevent_req *cli_smb2_list_send(
107 TALLOC_CTX *mem_ctx,
108 struct tevent_context *ev,
109 struct cli_state *cli,
110 const char *pathname,
111 unsigned int info_level);
112 NTSTATUS cli_smb2_list_recv(
113 struct tevent_req *req,
114 TALLOC_CTX *mem_ctx,
115 struct file_info **pfinfo);
116 NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
117 const char *name,
118 SMB_STRUCT_STAT *sbuf,
119 uint32_t *attributes);
120 struct tevent_req *cli_smb2_qpathinfo_send(TALLOC_CTX *mem_ctx,
121 struct tevent_context *ev,
122 struct cli_state *cli,
123 const char *fname,
124 uint16_t level,
125 uint32_t min_rdata,
126 uint32_t max_rdata);
127 NTSTATUS cli_smb2_qpathinfo_recv(struct tevent_req *req,
128 TALLOC_CTX *mem_ctx,
129 uint8_t **rdata,
130 uint32_t *num_rdata);
131 struct tevent_req *cli_smb2_query_info_fnum_send(
132 TALLOC_CTX *mem_ctx,
133 struct tevent_context *ev,
134 struct cli_state *cli,
135 uint16_t fnum,
136 uint8_t in_info_type,
137 uint8_t in_info_class,
138 uint32_t in_max_output_length,
139 const DATA_BLOB *in_input_buffer,
140 uint32_t in_additional_info,
141 uint32_t in_flags);
142 NTSTATUS cli_smb2_query_info_fnum_recv(
143 struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *outbuf);
144 struct tevent_req *cli_smb2_set_info_fnum_send(
145 TALLOC_CTX *mem_ctx,
146 struct tevent_context *ev,
147 struct cli_state *cli,
148 uint16_t fnum,
149 uint8_t in_info_type,
150 uint8_t in_info_class,
151 const DATA_BLOB *in_input_buffer,
152 uint32_t in_additional_info);
153 NTSTATUS cli_smb2_set_info_fnum_recv(struct tevent_req *req);
154 NTSTATUS cli_smb2_set_info_fnum(
155 struct cli_state *cli,
156 uint16_t fnum,
157 uint8_t in_info_type,
158 uint8_t in_info_class,
159 const DATA_BLOB *in_input_buffer,
160 uint32_t in_additional_info);
161 NTSTATUS cli_smb2_query_info_fnum(
162 struct cli_state *cli,
163 uint16_t fnum,
164 uint8_t in_info_type,
165 uint8_t in_info_class,
166 uint32_t in_max_output_length,
167 const DATA_BLOB *in_input_buffer,
168 uint32_t in_additional_info,
169 uint32_t in_flags,
170 TALLOC_CTX *mem_ctx,
171 DATA_BLOB *outbuf);
172 NTSTATUS cli_smb2_setpathinfo(struct cli_state *cli,
173 const char *name,
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,
178 const char *fname,
179 uint32_t attr,
180 time_t mtime);
181 NTSTATUS cli_smb2_setattrE(struct cli_state *cli,
182 uint16_t fnum,
183 time_t change_time,
184 time_t access_time,
185 time_t write_time);
186 NTSTATUS cli_smb2_dskattr(struct cli_state *cli,
187 const char *path,
188 uint64_t *bsize,
189 uint64_t *total,
190 uint64_t *avail);
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,
199 TALLOC_CTX *mem_ctx,
200 char **_volume_name,
201 uint32_t *pserial_number,
202 time_t *pdate);
203 struct tevent_req *cli_smb2_query_mxac_send(TALLOC_CTX *mem_ctx,
204 struct tevent_context *ev,
205 struct cli_state *cli,
206 const char *fname);
207 NTSTATUS cli_smb2_query_mxac_recv(struct tevent_req *req,
208 uint32_t *mxac);
209 NTSTATUS cli_smb2_query_mxac(struct cli_state *cli,
210 const char *fname,
211 uint32_t *mxac);
212 struct tevent_req *cli_smb2_rename_send(
213 TALLOC_CTX *mem_ctx,
214 struct tevent_context *ev,
215 struct cli_state *cli,
216 const char *fname_src,
217 const char *fname_dst,
218 bool replace);
219 NTSTATUS cli_smb2_rename_recv(struct tevent_req *req);
220 NTSTATUS cli_smb2_set_ea_fnum(struct cli_state *cli,
221 uint16_t fnum,
222 const char *ea_name,
223 const char *ea_val,
224 size_t ea_len);
225 NTSTATUS cli_smb2_get_ea_list_path(struct cli_state *cli,
226 const char *name,
227 TALLOC_CTX *ctx,
228 size_t *pnum_eas,
229 struct ea_struct **pea_list);
230 NTSTATUS cli_smb2_set_ea_path(struct cli_state *cli,
231 const char *name,
232 const char *ea_name,
233 const char *ea_val,
234 size_t ea_len);
235 NTSTATUS cli_smb2_get_user_quota(struct cli_state *cli,
236 int quota_fnum,
237 SMB_NTQUOTA_STRUCT *pqt);
238 NTSTATUS cli_smb2_list_user_quota_step(struct cli_state *cli,
239 TALLOC_CTX *mem_ctx,
240 int quota_fnum,
241 SMB_NTQUOTA_LIST **pqt_list,
242 bool first);
243 NTSTATUS cli_smb2_get_fs_quota_info(struct cli_state *cli,
244 int quota_fnum,
245 SMB_NTQUOTA_STRUCT *pqt);
246 NTSTATUS cli_smb2_set_user_quota(struct cli_state *cli,
247 int quota_fnum,
248 SMB_NTQUOTA_LIST *qtl);
249 NTSTATUS cli_smb2_set_fs_quota_info(struct cli_state *cli,
250 int quota_fnum,
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,
255 uint16_t fnum,
256 off_t offset,
257 size_t size);
258 NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
259 ssize_t *received,
260 uint8_t **rcvbuf);
261 struct tevent_req *cli_smb2_write_send(TALLOC_CTX *mem_ctx,
262 struct tevent_context *ev,
263 struct cli_state *cli,
264 uint16_t fnum,
265 uint16_t mode,
266 const uint8_t *buf,
267 off_t offset,
268 size_t size);
269 NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
270 size_t *pwritten);
271 struct tevent_req *cli_smb2_writeall_send(TALLOC_CTX *mem_ctx,
272 struct tevent_context *ev,
273 struct cli_state *cli,
274 uint16_t fnum,
275 uint16_t mode,
276 const uint8_t *buf,
277 off_t offset,
278 size_t size);
279 NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
280 size_t *pwritten);
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,
290 uint16_t fnum,
291 bool get_names,
292 char ***pnames,
293 int *pnum_names);
294 NTSTATUS cli_smb2_ftruncate(struct cli_state *cli,
295 uint16_t fnum,
296 uint64_t newsize);
297 struct tevent_req *cli_smb2_notify_send(
298 TALLOC_CTX *mem_ctx,
299 struct tevent_context *ev,
300 struct cli_state *cli,
301 uint16_t fnum,
302 uint32_t buffer_size,
303 uint32_t completion_filter,
304 bool recursive);
305 NTSTATUS cli_smb2_notify_recv(struct tevent_req *req,
306 TALLOC_CTX *mem_ctx,
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(
316 TALLOC_CTX *mem_ctx,
317 struct tevent_context *ev,
318 struct cli_state *cli,
319 uint16_t fnum,
320 uint32_t ctl_code,
321 const DATA_BLOB *in,
322 uint32_t max_out);
323 NTSTATUS cli_smb2_fsctl_recv(
324 struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *out);
326 struct tevent_req *cli_smb2_get_posix_fs_info_send(TALLOC_CTX *mem_ctx,
327 struct tevent_context *ev,
328 struct cli_state *cli);
329 NTSTATUS cli_smb2_get_posix_fs_info_recv(struct tevent_req *req,
330 uint32_t *optimal_transfer_size,
331 uint32_t *block_size,
332 uint64_t *total_blocks,
333 uint64_t *blocks_available,
334 uint64_t *user_blocks_available,
335 uint64_t *total_file_nodes,
336 uint64_t *free_file_nodes,
337 uint64_t *fs_identifier);
340 #endif /* __SMB2CLI_FNUM_H__ */