selftest:Samba4: report when samba is started and ready
[Samba.git] / source3 / libsmb / cli_smb2_fnum.h
blob921dc71d9ebaf07a42d0797dcaee1e6946071c75
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;
28 struct tevent_req *cli_smb2_create_fnum_send(TALLOC_CTX *mem_ctx,
29 struct tevent_context *ev,
30 struct cli_state *cli,
31 const char *fname,
32 uint32_t create_flags,
33 uint32_t impersonation_level,
34 uint32_t desired_access,
35 uint32_t file_attributes,
36 uint32_t share_access,
37 uint32_t create_disposition,
38 uint32_t create_options);
39 NTSTATUS cli_smb2_create_fnum_recv(struct tevent_req *req, uint16_t *pfnum,
40 struct smb_create_returns *cr);
41 NTSTATUS cli_smb2_create_fnum(struct cli_state *cli,
42 const char *fname,
43 uint32_t create_flags,
44 uint32_t impersonation_level,
45 uint32_t desired_access,
46 uint32_t file_attributes,
47 uint32_t share_access,
48 uint32_t create_disposition,
49 uint32_t create_options,
50 uint16_t *pfid,
51 struct smb_create_returns *cr);
53 struct tevent_req *cli_smb2_close_fnum_send(TALLOC_CTX *mem_ctx,
54 struct tevent_context *ev,
55 struct cli_state *cli,
56 uint16_t fnum);
57 NTSTATUS cli_smb2_close_fnum_recv(struct tevent_req *req);
58 NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum);
59 struct tevent_req *cli_smb2_delete_on_close_send(TALLOC_CTX *mem_ctx,
60 struct tevent_context *ev,
61 struct cli_state *cli,
62 uint16_t fnum,
63 bool flag);
64 NTSTATUS cli_smb2_delete_on_close_recv(struct tevent_req *req);
65 NTSTATUS cli_smb2_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
66 NTSTATUS cli_smb2_mkdir(struct cli_state *cli, const char *dirname);
67 NTSTATUS cli_smb2_rmdir(struct cli_state *cli, const char *dirname);
68 NTSTATUS cli_smb2_unlink(struct cli_state *cli,const char *fname);
69 NTSTATUS cli_smb2_list(struct cli_state *cli,
70 const char *pathname,
71 uint16_t attribute,
72 NTSTATUS (*fn)(const char *,
73 struct file_info *,
74 const char *,
75 void *),
76 void *state);
77 NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
78 const char *name,
79 SMB_STRUCT_STAT *sbuf,
80 uint32_t *attributes);
81 NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli,
82 const char *name,
83 fstring alt_name);
84 NTSTATUS cli_smb2_chkpath(struct cli_state *cli,
85 const char *name);
86 NTSTATUS cli_smb2_qfileinfo_basic(struct cli_state *cli,
87 uint16_t fnum,
88 uint16_t *mode,
89 off_t *size,
90 struct timespec *create_time,
91 struct timespec *access_time,
92 struct timespec *write_time,
93 struct timespec *change_time,
94 SMB_INO_T *ino);
95 NTSTATUS cli_smb2_getattrE(struct cli_state *cli,
96 uint16_t fnum,
97 uint16_t *attr,
98 off_t *size,
99 time_t *change_time,
100 time_t *access_time,
101 time_t *write_time);
102 NTSTATUS cli_smb2_getatr(struct cli_state *cli,
103 const char *name,
104 uint16_t *attr,
105 off_t *size,
106 time_t *write_time);
107 NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
108 const char *fname,
109 struct timespec *create_time,
110 struct timespec *access_time,
111 struct timespec *write_time,
112 struct timespec *change_time,
113 off_t *size,
114 uint16_t *mode,
115 SMB_INO_T *ino);
116 NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
117 const char *name,
118 TALLOC_CTX *mem_ctx,
119 unsigned int *pnum_streams,
120 struct stream_struct **pstreams);
121 NTSTATUS cli_smb2_setpathinfo(struct cli_state *cli,
122 const char *name,
123 uint8_t in_info_type,
124 uint8_t in_file_info_class,
125 const DATA_BLOB *p_in_data);
126 NTSTATUS cli_smb2_setatr(struct cli_state *cli,
127 const char *fname,
128 uint16_t attr,
129 time_t mtime);
130 NTSTATUS cli_smb2_setattrE(struct cli_state *cli,
131 uint16_t fnum,
132 time_t change_time,
133 time_t access_time,
134 time_t write_time);
135 NTSTATUS cli_smb2_dskattr(struct cli_state *cli,
136 const char *path,
137 uint64_t *bsize,
138 uint64_t *total,
139 uint64_t *avail);
140 NTSTATUS cli_smb2_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
141 NTSTATUS cli_smb2_get_fs_full_size_info(struct cli_state *cli,
142 uint64_t *total_allocation_units,
143 uint64_t *caller_allocation_units,
144 uint64_t *actual_allocation_units,
145 uint64_t *sectors_per_allocation_unit,
146 uint64_t *bytes_per_sector);
147 NTSTATUS cli_smb2_get_fs_volume_info(struct cli_state *cli,
148 TALLOC_CTX *mem_ctx,
149 char **_volume_name,
150 uint32_t *pserial_number,
151 time_t *pdate);
152 NTSTATUS cli_smb2_query_security_descriptor(struct cli_state *cli,
153 uint16_t fnum,
154 uint32_t sec_info,
155 TALLOC_CTX *mem_ctx,
156 struct security_descriptor **ppsd);
157 NTSTATUS cli_smb2_set_security_descriptor(struct cli_state *cli,
158 uint16_t fnum,
159 uint32_t sec_info,
160 const struct security_descriptor *sd);
161 NTSTATUS cli_smb2_rename(struct cli_state *cli,
162 const char *fname_src,
163 const char *fname_dst,
164 bool replace);
165 NTSTATUS cli_smb2_set_ea_fnum(struct cli_state *cli,
166 uint16_t fnum,
167 const char *ea_name,
168 const char *ea_val,
169 size_t ea_len);
170 NTSTATUS cli_smb2_get_ea_list_path(struct cli_state *cli,
171 const char *name,
172 TALLOC_CTX *ctx,
173 size_t *pnum_eas,
174 struct ea_struct **pea_list);
175 NTSTATUS cli_smb2_set_ea_path(struct cli_state *cli,
176 const char *name,
177 const char *ea_name,
178 const char *ea_val,
179 size_t ea_len);
180 NTSTATUS cli_smb2_get_user_quota(struct cli_state *cli,
181 int quota_fnum,
182 SMB_NTQUOTA_STRUCT *pqt);
183 NTSTATUS cli_smb2_list_user_quota_step(struct cli_state *cli,
184 TALLOC_CTX *mem_ctx,
185 int quota_fnum,
186 SMB_NTQUOTA_LIST **pqt_list,
187 bool first);
188 NTSTATUS cli_smb2_get_fs_quota_info(struct cli_state *cli,
189 int quota_fnum,
190 SMB_NTQUOTA_STRUCT *pqt);
191 NTSTATUS cli_smb2_set_user_quota(struct cli_state *cli,
192 int quota_fnum,
193 SMB_NTQUOTA_LIST *qtl);
194 NTSTATUS cli_smb2_set_fs_quota_info(struct cli_state *cli,
195 int quota_fnum,
196 SMB_NTQUOTA_STRUCT *pqt);
197 struct tevent_req *cli_smb2_read_send(TALLOC_CTX *mem_ctx,
198 struct tevent_context *ev,
199 struct cli_state *cli,
200 uint16_t fnum,
201 off_t offset,
202 size_t size);
203 NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
204 ssize_t *received,
205 uint8_t **rcvbuf);
206 struct tevent_req *cli_smb2_write_send(TALLOC_CTX *mem_ctx,
207 struct tevent_context *ev,
208 struct cli_state *cli,
209 uint16_t fnum,
210 uint16_t mode,
211 const uint8_t *buf,
212 off_t offset,
213 size_t size);
214 NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
215 size_t *pwritten);
216 struct tevent_req *cli_smb2_writeall_send(TALLOC_CTX *mem_ctx,
217 struct tevent_context *ev,
218 struct cli_state *cli,
219 uint16_t fnum,
220 uint16_t mode,
221 const uint8_t *buf,
222 off_t offset,
223 size_t size);
224 NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
225 size_t *pwritten);
226 struct tevent_req *cli_smb2_splice_send(TALLOC_CTX *mem_ctx,
227 struct tevent_context *ev,
228 struct cli_state *cli,
229 uint16_t src_fnum, uint16_t dst_fnum,
230 off_t size, off_t src_offset, off_t dst_offset,
231 int (*splice_cb)(off_t n, void *priv), void *priv);
232 NTSTATUS cli_smb2_splice_recv(struct tevent_req *req, off_t *written);
233 NTSTATUS cli_smb2_shadow_copy_data(TALLOC_CTX *mem_ctx,
234 struct cli_state *cli,
235 uint16_t fnum,
236 bool get_names,
237 char ***pnames,
238 int *pnum_names);
239 NTSTATUS cli_smb2_ftruncate(struct cli_state *cli,
240 uint16_t fnum,
241 uint64_t newsize);
242 struct tevent_req *cli_smb2_notify_send(
243 TALLOC_CTX *mem_ctx,
244 struct tevent_context *ev,
245 struct cli_state *cli,
246 uint16_t fnum,
247 uint32_t buffer_size,
248 uint32_t completion_filter,
249 bool recursive);
250 NTSTATUS cli_smb2_notify_recv(struct tevent_req *req,
251 TALLOC_CTX *mem_ctx,
252 struct notify_change **pchanges,
253 uint32_t *pnum_changes);
254 NTSTATUS cli_smb2_notify(struct cli_state *cli, uint16_t fnum,
255 uint32_t buffer_size, uint32_t completion_filter,
256 bool recursive, TALLOC_CTX *mem_ctx,
257 struct notify_change **pchanges,
258 uint32_t *pnum_changes);
259 struct tevent_req *cli_smb2_set_reparse_point_fnum_send(
260 TALLOC_CTX *mem_ctx,
261 struct tevent_context *ev,
262 struct cli_state *cli,
263 uint16_t fnum,
264 DATA_BLOB in_buf);
265 NTSTATUS cli_smb2_set_reparse_point_fnum_recv(struct tevent_req *req);
267 struct tevent_req *cli_smb2_get_reparse_point_fnum_send(
268 TALLOC_CTX *mem_ctx,
269 struct tevent_context *ev,
270 struct cli_state *cli,
271 uint16_t fnum);
272 NTSTATUS cli_smb2_get_reparse_point_fnum_recv(struct tevent_req *req,
273 TALLOC_CTX *mem_ctx,
274 DATA_BLOB *output);
276 #endif /* __SMB2CLI_FNUM_H__ */