libsmb: Remove unused sync version of cli_getattrE()
[bbaumbach/samba-autobuild/.git] / source3 / libsmb / cli_smb2_fnum.h
1 /*
2    Unix SMB/CIFS implementation.
3    smb2 wrapper client routines
4    Copyright (C) Jeremy Allison 2013
5
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.
10
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.
15
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/>.
18 */
19
20 #ifndef __SMB2CLI_FNUM_H__
21 #define __SMB2CLI_FNUM_H__
22
23 struct smbXcli_conn;
24 struct smbXcli_session;
25 struct cli_state;
26 struct file_info;
27
28 struct tevent_req *cli_smb2_create_fnum_send(
29         TALLOC_CTX *mem_ctx,
30         struct tevent_context *ev,
31         struct cli_state *cli,
32         const char *fname,
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,
43         uint16_t *pfnum,
44         struct smb_create_returns *cr,
45         TALLOC_CTX *mem_ctx,
46         struct smb2_create_blobs *out_cblobs);
47 NTSTATUS cli_smb2_create_fnum(
48         struct cli_state *cli,
49         const char *fname,
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,
58         uint16_t *pfid,
59         struct smb_create_returns *cr,
60         TALLOC_CTX *mem_ctx,
61         struct smb2_create_blobs *out_cblobs);
62
63 struct tevent_req *cli_smb2_close_fnum_send(TALLOC_CTX *mem_ctx,
64                                             struct tevent_context *ev,
65                                             struct cli_state *cli,
66                                             uint16_t fnum);
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,
72                                         uint16_t fnum,
73                                         bool flag);
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(
77         TALLOC_CTX *mem_ctx,
78         struct tevent_context *ev,
79         struct cli_state *cli,
80         const char *name);
81 NTSTATUS cli_smb2_mkdir_recv(struct tevent_req *req);
82 struct tevent_req *cli_smb2_rmdir_send(
83         TALLOC_CTX *mem_ctx,
84         struct tevent_context *ev,
85         struct cli_state *cli,
86         const char *dname,
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(
90         TALLOC_CTX *mem_ctx,
91         struct tevent_context *ev,
92         struct cli_state *cli,
93         const char *fname,
94         const struct smb2_create_blobs *in_cblobs);
95 NTSTATUS cli_smb2_unlink_recv(struct tevent_req *req);
96 NTSTATUS cli_smb2_list(struct cli_state *cli,
97                         const char *pathname,
98                         uint32_t attribute,
99                         NTSTATUS (*fn)(const char *,
100                                 struct file_info *,
101                                 const char *,
102                                 void *),
103                         void *state);
104 NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
105                         const char *name,
106                         SMB_STRUCT_STAT *sbuf,
107                         uint32_t *attributes);
108 NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli,
109                         const char *name,
110                         fstring alt_name);
111 struct tevent_req *cli_smb2_chkpath_send(
112         TALLOC_CTX *mem_ctx,
113         struct tevent_context *ev,
114         struct cli_state *cli,
115         const char *name);
116 NTSTATUS cli_smb2_chkpath_recv(struct tevent_req *req);
117 struct tevent_req *cli_smb2_query_info_fnum_send(
118         TALLOC_CTX *mem_ctx,
119         struct tevent_context *ev,
120         struct cli_state *cli,
121         uint16_t fnum,
122         uint8_t in_info_type,
123         uint8_t in_info_class,
124         uint32_t in_max_output_length,
125         const DATA_BLOB *in_input_buffer,
126         uint32_t in_additional_info,
127         uint32_t in_flags);
128 NTSTATUS cli_smb2_query_info_fnum_recv(
129         struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *outbuf);
130 struct tevent_req *cli_smb2_set_info_fnum_send(
131         TALLOC_CTX *mem_ctx,
132         struct tevent_context *ev,
133         struct cli_state *cli,
134         uint16_t fnum,
135         uint8_t in_info_type,
136         uint8_t in_info_class,
137         const DATA_BLOB *in_input_buffer,
138         uint32_t in_additional_info);
139 NTSTATUS cli_smb2_set_info_fnum_recv(struct tevent_req *req);
140 NTSTATUS cli_smb2_set_info_fnum(
141         struct cli_state *cli,
142         uint16_t fnum,
143         uint8_t in_info_type,
144         uint8_t in_info_class,
145         const DATA_BLOB *in_input_buffer,
146         uint32_t in_additional_info);
147 NTSTATUS cli_smb2_query_info_fnum(
148         struct cli_state *cli,
149         uint16_t fnum,
150         uint8_t in_info_type,
151         uint8_t in_info_class,
152         uint32_t in_max_output_length,
153         const DATA_BLOB *in_input_buffer,
154         uint32_t in_additional_info,
155         uint32_t in_flags,
156         TALLOC_CTX *mem_ctx,
157         DATA_BLOB *outbuf);
158 NTSTATUS cli_smb2_qfileinfo_basic(struct cli_state *cli,
159                         uint16_t fnum,
160                         uint32_t *pattr,
161                         off_t *size,
162                         struct timespec *create_time,
163                         struct timespec *access_time,
164                         struct timespec *write_time,
165                         struct timespec *change_time,
166                         SMB_INO_T *ino);
167 NTSTATUS cli_smb2_getattrE(struct cli_state *cli,
168                         uint16_t fnum,
169                         uint32_t *pattr,
170                         off_t *size,
171                         time_t *change_time,
172                         time_t *access_time,
173                         time_t *write_time);
174 NTSTATUS cli_smb2_getatr(struct cli_state *cli,
175                         const char *name,
176                         uint32_t *pattr,
177                         off_t *size,
178                         time_t *write_time);
179 NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
180                         const char *fname,
181                         struct timespec *create_time,
182                         struct timespec *access_time,
183                         struct timespec *write_time,
184                         struct timespec *change_time,
185                         off_t *size,
186                         uint32_t *pattr,
187                         SMB_INO_T *ino);
188 NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
189                         const char *name,
190                         TALLOC_CTX *mem_ctx,
191                         unsigned int *pnum_streams,
192                         struct stream_struct **pstreams);
193 NTSTATUS cli_smb2_setpathinfo(struct cli_state *cli,
194                         const char *name,
195                         uint8_t in_info_type,
196                         uint8_t in_file_info_class,
197                         const DATA_BLOB *p_in_data);
198 NTSTATUS cli_smb2_setatr(struct cli_state *cli,
199                         const char *fname,
200                         uint32_t attr,
201                         time_t mtime);
202 NTSTATUS cli_smb2_setattrE(struct cli_state *cli,
203                         uint16_t fnum,
204                         time_t change_time,
205                         time_t access_time,
206                         time_t write_time);
207 NTSTATUS cli_smb2_dskattr(struct cli_state *cli,
208                         const char *path,
209                         uint64_t *bsize,
210                         uint64_t *total,
211                         uint64_t *avail);
212 NTSTATUS cli_smb2_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
213 NTSTATUS cli_smb2_get_fs_full_size_info(struct cli_state *cli,
214                         uint64_t *total_allocation_units,
215                         uint64_t *caller_allocation_units,
216                         uint64_t *actual_allocation_units,
217                         uint64_t *sectors_per_allocation_unit,
218                         uint64_t *bytes_per_sector);
219 NTSTATUS cli_smb2_get_fs_volume_info(struct cli_state *cli,
220                         TALLOC_CTX *mem_ctx,
221                         char **_volume_name,
222                         uint32_t *pserial_number,
223                         time_t *pdate);
224 NTSTATUS cli_smb2_query_security_descriptor(struct cli_state *cli,
225                         uint16_t fnum,
226                         uint32_t sec_info,
227                         TALLOC_CTX *mem_ctx,
228                         struct security_descriptor **ppsd);
229 NTSTATUS cli_smb2_set_security_descriptor(struct cli_state *cli,
230                         uint16_t fnum,
231                         uint32_t sec_info,
232                         const struct security_descriptor *sd);
233 struct tevent_req *cli_smb2_query_mxac_send(TALLOC_CTX *mem_ctx,
234                                             struct tevent_context *ev,
235                                             struct cli_state *cli,
236                                             const char *fname);
237 NTSTATUS cli_smb2_query_mxac_recv(struct tevent_req *req,
238                                   uint32_t *mxac);
239 NTSTATUS cli_smb2_query_mxac(struct cli_state *cli,
240                              const char *fname,
241                              uint32_t *mxac);
242 NTSTATUS cli_smb2_rename(struct cli_state *cli,
243                          const char *fname_src,
244                          const char *fname_dst,
245                          bool replace);
246 NTSTATUS cli_smb2_set_ea_fnum(struct cli_state *cli,
247                         uint16_t fnum,
248                         const char *ea_name,
249                         const char *ea_val,
250                         size_t ea_len);
251 NTSTATUS cli_smb2_get_ea_list_path(struct cli_state *cli,
252                         const char *name,
253                         TALLOC_CTX *ctx,
254                         size_t *pnum_eas,
255                         struct ea_struct **pea_list);
256 NTSTATUS cli_smb2_set_ea_path(struct cli_state *cli,
257                         const char *name,
258                         const char *ea_name,
259                         const char *ea_val,
260                         size_t ea_len);
261 NTSTATUS cli_smb2_get_user_quota(struct cli_state *cli,
262                                  int quota_fnum,
263                                  SMB_NTQUOTA_STRUCT *pqt);
264 NTSTATUS cli_smb2_list_user_quota_step(struct cli_state *cli,
265                                        TALLOC_CTX *mem_ctx,
266                                        int quota_fnum,
267                                        SMB_NTQUOTA_LIST **pqt_list,
268                                        bool first);
269 NTSTATUS cli_smb2_get_fs_quota_info(struct cli_state *cli,
270                                     int quota_fnum,
271                                     SMB_NTQUOTA_STRUCT *pqt);
272 NTSTATUS cli_smb2_set_user_quota(struct cli_state *cli,
273                                  int quota_fnum,
274                                  SMB_NTQUOTA_LIST *qtl);
275 NTSTATUS cli_smb2_set_fs_quota_info(struct cli_state *cli,
276                                     int quota_fnum,
277                                     SMB_NTQUOTA_STRUCT *pqt);
278 struct tevent_req *cli_smb2_read_send(TALLOC_CTX *mem_ctx,
279                                 struct tevent_context *ev,
280                                 struct cli_state *cli,
281                                 uint16_t fnum,
282                                 off_t offset,
283                                 size_t size);
284 NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
285                                 ssize_t *received,
286                                 uint8_t **rcvbuf);
287 struct tevent_req *cli_smb2_write_send(TALLOC_CTX *mem_ctx,
288                                         struct tevent_context *ev,
289                                         struct cli_state *cli,
290                                         uint16_t fnum,
291                                         uint16_t mode,
292                                         const uint8_t *buf,
293                                         off_t offset,
294                                         size_t size);
295 NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
296                              size_t *pwritten);
297 struct tevent_req *cli_smb2_writeall_send(TALLOC_CTX *mem_ctx,
298                         struct tevent_context *ev,
299                         struct cli_state *cli,
300                         uint16_t fnum,
301                         uint16_t mode,
302                         const uint8_t *buf,
303                         off_t offset,
304                         size_t size);
305 NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
306                         size_t *pwritten);
307 struct tevent_req *cli_smb2_splice_send(TALLOC_CTX *mem_ctx,
308                         struct tevent_context *ev,
309                         struct cli_state *cli,
310                         uint16_t src_fnum, uint16_t dst_fnum,
311                         off_t size, off_t src_offset, off_t dst_offset,
312                         int (*splice_cb)(off_t n, void *priv), void *priv);
313 NTSTATUS cli_smb2_splice_recv(struct tevent_req *req, off_t *written);
314 NTSTATUS cli_smb2_shadow_copy_data(TALLOC_CTX *mem_ctx,
315                         struct cli_state *cli,
316                         uint16_t fnum,
317                         bool get_names,
318                         char ***pnames,
319                         int *pnum_names);
320 NTSTATUS cli_smb2_ftruncate(struct cli_state *cli,
321                         uint16_t fnum,
322                         uint64_t newsize);
323 struct tevent_req *cli_smb2_notify_send(
324         TALLOC_CTX *mem_ctx,
325         struct tevent_context *ev,
326         struct cli_state *cli,
327         uint16_t fnum,
328         uint32_t buffer_size,
329         uint32_t completion_filter,
330         bool recursive);
331 NTSTATUS cli_smb2_notify_recv(struct tevent_req *req,
332                               TALLOC_CTX *mem_ctx,
333                               struct notify_change **pchanges,
334                               uint32_t *pnum_changes);
335 NTSTATUS cli_smb2_notify(struct cli_state *cli, uint16_t fnum,
336                          uint32_t buffer_size, uint32_t completion_filter,
337                          bool recursive, TALLOC_CTX *mem_ctx,
338                          struct notify_change **pchanges,
339                          uint32_t *pnum_changes);
340 struct tevent_req *cli_smb2_set_reparse_point_fnum_send(
341                         TALLOC_CTX *mem_ctx,
342                         struct tevent_context *ev,
343                         struct cli_state *cli,
344                         uint16_t fnum,
345                         DATA_BLOB in_buf);
346 NTSTATUS cli_smb2_set_reparse_point_fnum_recv(struct tevent_req *req);
347
348 struct tevent_req *cli_smb2_get_reparse_point_fnum_send(
349                         TALLOC_CTX *mem_ctx,
350                         struct tevent_context *ev,
351                         struct cli_state *cli,
352                         uint16_t fnum);
353 NTSTATUS cli_smb2_get_reparse_point_fnum_recv(struct tevent_req *req,
354                         TALLOC_CTX *mem_ctx,
355                         DATA_BLOB *output);
356
357 #endif /* __SMB2CLI_FNUM_H__ */