libsmb: Remove unused cli_smb2_qfileinfo_basic()
[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_getatr(struct cli_state *cli,
159                         const char *name,
160                         uint32_t *pattr,
161                         off_t *size,
162                         time_t *write_time);
163 NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
164                         const char *fname,
165                         struct timespec *create_time,
166                         struct timespec *access_time,
167                         struct timespec *write_time,
168                         struct timespec *change_time,
169                         off_t *size,
170                         uint32_t *pattr,
171                         SMB_INO_T *ino);
172 NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
173                         const char *name,
174                         TALLOC_CTX *mem_ctx,
175                         unsigned int *pnum_streams,
176                         struct stream_struct **pstreams);
177 NTSTATUS cli_smb2_setpathinfo(struct cli_state *cli,
178                         const char *name,
179                         uint8_t in_info_type,
180                         uint8_t in_file_info_class,
181                         const DATA_BLOB *p_in_data);
182 NTSTATUS cli_smb2_setatr(struct cli_state *cli,
183                         const char *fname,
184                         uint32_t attr,
185                         time_t mtime);
186 NTSTATUS cli_smb2_setattrE(struct cli_state *cli,
187                         uint16_t fnum,
188                         time_t change_time,
189                         time_t access_time,
190                         time_t write_time);
191 NTSTATUS cli_smb2_dskattr(struct cli_state *cli,
192                         const char *path,
193                         uint64_t *bsize,
194                         uint64_t *total,
195                         uint64_t *avail);
196 NTSTATUS cli_smb2_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
197 NTSTATUS cli_smb2_get_fs_full_size_info(struct cli_state *cli,
198                         uint64_t *total_allocation_units,
199                         uint64_t *caller_allocation_units,
200                         uint64_t *actual_allocation_units,
201                         uint64_t *sectors_per_allocation_unit,
202                         uint64_t *bytes_per_sector);
203 NTSTATUS cli_smb2_get_fs_volume_info(struct cli_state *cli,
204                         TALLOC_CTX *mem_ctx,
205                         char **_volume_name,
206                         uint32_t *pserial_number,
207                         time_t *pdate);
208 NTSTATUS cli_smb2_query_security_descriptor(struct cli_state *cli,
209                         uint16_t fnum,
210                         uint32_t sec_info,
211                         TALLOC_CTX *mem_ctx,
212                         struct security_descriptor **ppsd);
213 NTSTATUS cli_smb2_set_security_descriptor(struct cli_state *cli,
214                         uint16_t fnum,
215                         uint32_t sec_info,
216                         const struct security_descriptor *sd);
217 struct tevent_req *cli_smb2_query_mxac_send(TALLOC_CTX *mem_ctx,
218                                             struct tevent_context *ev,
219                                             struct cli_state *cli,
220                                             const char *fname);
221 NTSTATUS cli_smb2_query_mxac_recv(struct tevent_req *req,
222                                   uint32_t *mxac);
223 NTSTATUS cli_smb2_query_mxac(struct cli_state *cli,
224                              const char *fname,
225                              uint32_t *mxac);
226 NTSTATUS cli_smb2_rename(struct cli_state *cli,
227                          const char *fname_src,
228                          const char *fname_dst,
229                          bool replace);
230 NTSTATUS cli_smb2_set_ea_fnum(struct cli_state *cli,
231                         uint16_t fnum,
232                         const char *ea_name,
233                         const char *ea_val,
234                         size_t ea_len);
235 NTSTATUS cli_smb2_get_ea_list_path(struct cli_state *cli,
236                         const char *name,
237                         TALLOC_CTX *ctx,
238                         size_t *pnum_eas,
239                         struct ea_struct **pea_list);
240 NTSTATUS cli_smb2_set_ea_path(struct cli_state *cli,
241                         const char *name,
242                         const char *ea_name,
243                         const char *ea_val,
244                         size_t ea_len);
245 NTSTATUS cli_smb2_get_user_quota(struct cli_state *cli,
246                                  int quota_fnum,
247                                  SMB_NTQUOTA_STRUCT *pqt);
248 NTSTATUS cli_smb2_list_user_quota_step(struct cli_state *cli,
249                                        TALLOC_CTX *mem_ctx,
250                                        int quota_fnum,
251                                        SMB_NTQUOTA_LIST **pqt_list,
252                                        bool first);
253 NTSTATUS cli_smb2_get_fs_quota_info(struct cli_state *cli,
254                                     int quota_fnum,
255                                     SMB_NTQUOTA_STRUCT *pqt);
256 NTSTATUS cli_smb2_set_user_quota(struct cli_state *cli,
257                                  int quota_fnum,
258                                  SMB_NTQUOTA_LIST *qtl);
259 NTSTATUS cli_smb2_set_fs_quota_info(struct cli_state *cli,
260                                     int quota_fnum,
261                                     SMB_NTQUOTA_STRUCT *pqt);
262 struct tevent_req *cli_smb2_read_send(TALLOC_CTX *mem_ctx,
263                                 struct tevent_context *ev,
264                                 struct cli_state *cli,
265                                 uint16_t fnum,
266                                 off_t offset,
267                                 size_t size);
268 NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
269                                 ssize_t *received,
270                                 uint8_t **rcvbuf);
271 struct tevent_req *cli_smb2_write_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_write_recv(struct tevent_req *req,
280                              size_t *pwritten);
281 struct tevent_req *cli_smb2_writeall_send(TALLOC_CTX *mem_ctx,
282                         struct tevent_context *ev,
283                         struct cli_state *cli,
284                         uint16_t fnum,
285                         uint16_t mode,
286                         const uint8_t *buf,
287                         off_t offset,
288                         size_t size);
289 NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
290                         size_t *pwritten);
291 struct tevent_req *cli_smb2_splice_send(TALLOC_CTX *mem_ctx,
292                         struct tevent_context *ev,
293                         struct cli_state *cli,
294                         uint16_t src_fnum, uint16_t dst_fnum,
295                         off_t size, off_t src_offset, off_t dst_offset,
296                         int (*splice_cb)(off_t n, void *priv), void *priv);
297 NTSTATUS cli_smb2_splice_recv(struct tevent_req *req, off_t *written);
298 NTSTATUS cli_smb2_shadow_copy_data(TALLOC_CTX *mem_ctx,
299                         struct cli_state *cli,
300                         uint16_t fnum,
301                         bool get_names,
302                         char ***pnames,
303                         int *pnum_names);
304 NTSTATUS cli_smb2_ftruncate(struct cli_state *cli,
305                         uint16_t fnum,
306                         uint64_t newsize);
307 struct tevent_req *cli_smb2_notify_send(
308         TALLOC_CTX *mem_ctx,
309         struct tevent_context *ev,
310         struct cli_state *cli,
311         uint16_t fnum,
312         uint32_t buffer_size,
313         uint32_t completion_filter,
314         bool recursive);
315 NTSTATUS cli_smb2_notify_recv(struct tevent_req *req,
316                               TALLOC_CTX *mem_ctx,
317                               struct notify_change **pchanges,
318                               uint32_t *pnum_changes);
319 NTSTATUS cli_smb2_notify(struct cli_state *cli, uint16_t fnum,
320                          uint32_t buffer_size, uint32_t completion_filter,
321                          bool recursive, TALLOC_CTX *mem_ctx,
322                          struct notify_change **pchanges,
323                          uint32_t *pnum_changes);
324 struct tevent_req *cli_smb2_set_reparse_point_fnum_send(
325                         TALLOC_CTX *mem_ctx,
326                         struct tevent_context *ev,
327                         struct cli_state *cli,
328                         uint16_t fnum,
329                         DATA_BLOB in_buf);
330 NTSTATUS cli_smb2_set_reparse_point_fnum_recv(struct tevent_req *req);
331
332 struct tevent_req *cli_smb2_get_reparse_point_fnum_send(
333                         TALLOC_CTX *mem_ctx,
334                         struct tevent_context *ev,
335                         struct cli_state *cli,
336                         uint16_t fnum);
337 NTSTATUS cli_smb2_get_reparse_point_fnum_recv(struct tevent_req *req,
338                         TALLOC_CTX *mem_ctx,
339                         DATA_BLOB *output);
340
341 #endif /* __SMB2CLI_FNUM_H__ */