source: trunk/server/source3/libsmb/proto.h@ 952

Last change on this file since 952 was 745, checked in by Silvan Scherrer, 13 years ago

Samba Server: updated trunk to 3.6.0

File size: 35.5 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3
4 Copyright (C) Andrew Bartlett 2001-2003
5 Copyright (C) Andrew Tridgell 1994-1998,2000-2001
6 Copyright (C) Gerald (Jerry) Carter 2004
7 Copyright (C) Jelmer Vernooij 2003
8 Copyright (C) Jeremy Allison 2001-2009,2011
9 Copyright (C) Stefan Metzmacher 2003,2009
10 Copyright (C) Volker Lendecke 2011
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 3 of the License, or
15 (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
24*/
25
26#ifndef _LIBSMB_PROTO_H_
27#define _LIBSMB_PROTO_H_
28
29/* The following definitions come from libsmb/cliconnect.c */
30
31ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
32 const char *pass, const char *user_domain,
33 const char * dest_realm);
34
35NTSTATUS cli_session_setup(struct cli_state *cli,
36 const char *user,
37 const char *pass, int passlen,
38 const char *ntpass, int ntpasslen,
39 const char *workgroup);
40struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
41 struct event_context *ev,
42 struct cli_state *cli,
43 struct tevent_req **psmbreq);
44struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
45 struct event_context *ev,
46 struct cli_state *cli);
47NTSTATUS cli_session_setup_guest_recv(struct tevent_req *req);
48struct tevent_req *cli_ulogoff_send(TALLOC_CTX *mem_ctx,
49 struct tevent_context *ev,
50 struct cli_state *cli);
51NTSTATUS cli_ulogoff_recv(struct tevent_req *req);
52NTSTATUS cli_ulogoff(struct cli_state *cli);
53struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
54 struct event_context *ev,
55 struct cli_state *cli,
56 const char *share, const char *dev,
57 const char *pass, int passlen,
58 struct tevent_req **psmbreq);
59struct tevent_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx,
60 struct event_context *ev,
61 struct cli_state *cli,
62 const char *share, const char *dev,
63 const char *pass, int passlen);
64NTSTATUS cli_tcon_andx_recv(struct tevent_req *req);
65NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share,
66 const char *dev, const char *pass, int passlen);
67struct tevent_req *cli_tdis_send(TALLOC_CTX *mem_ctx,
68 struct tevent_context *ev,
69 struct cli_state *cli);
70NTSTATUS cli_tdis_recv(struct tevent_req *req);
71NTSTATUS cli_tdis(struct cli_state *cli);
72NTSTATUS cli_negprot(struct cli_state *cli);
73struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
74 struct event_context *ev,
75 struct cli_state *cli);
76NTSTATUS cli_negprot_recv(struct tevent_req *req);
77bool cli_session_request(struct cli_state *cli,
78 struct nmb_name *calling, struct nmb_name *called);
79NTSTATUS cli_connect(struct cli_state *cli,
80 const char *host,
81 struct sockaddr_storage *dest_ss);
82NTSTATUS cli_start_connection(struct cli_state **output_cli,
83 const char *my_name,
84 const char *dest_host,
85 struct sockaddr_storage *dest_ss, int port,
86 int signing_state, int flags);
87NTSTATUS cli_full_connection(struct cli_state **output_cli,
88 const char *my_name,
89 const char *dest_host,
90 struct sockaddr_storage *dest_ss, int port,
91 const char *service, const char *service_type,
92 const char *user, const char *domain,
93 const char *password, int flags,
94 int signing_state);
95bool attempt_netbios_session_request(struct cli_state **ppcli, const char *srchost, const char *desthost,
96 struct sockaddr_storage *pdest_ss);
97NTSTATUS cli_raw_tcon(struct cli_state *cli,
98 const char *service, const char *pass, const char *dev,
99 uint16 *max_xmit, uint16 *tid);
100struct cli_state *get_ipc_connect(char *server,
101 struct sockaddr_storage *server_ss,
102 const struct user_auth_info *user_info);
103struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx,
104 struct sockaddr_storage *mb_ip,
105 const struct user_auth_info *user_info,
106 char **pp_workgroup_out);
107struct cli_state *get_ipc_connect_master_ip_bcast(TALLOC_CTX *ctx,
108 const struct user_auth_info *user_info,
109 char **pp_workgroup_out);
110
111/* The following definitions come from libsmb/clidfs.c */
112
113NTSTATUS cli_cm_force_encryption(struct cli_state *c,
114 const char *username,
115 const char *password,
116 const char *domain,
117 const char *sharename);
118struct cli_state *cli_cm_open(TALLOC_CTX *ctx,
119 struct cli_state *referring_cli,
120 const char *server,
121 const char *share,
122 const struct user_auth_info *auth_info,
123 bool show_hdr,
124 bool force_encrypt,
125 int max_protocol,
126 int port,
127 int name_type);
128void cli_cm_display(const struct cli_state *c);
129struct client_dfs_referral;
130NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
131 struct cli_state *cli,
132 const char *path,
133 struct client_dfs_referral **refs,
134 size_t *num_refs,
135 size_t *consumed);
136bool cli_resolve_path(TALLOC_CTX *ctx,
137 const char *mountpt,
138 const struct user_auth_info *dfs_auth_info,
139 struct cli_state *rootcli,
140 const char *path,
141 struct cli_state **targetcli,
142 char **pp_targetpath);
143
144bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
145 struct cli_state *cli,
146 const char *sharename,
147 char **pp_newserver,
148 char **pp_newshare,
149 bool force_encrypt,
150 const char *username,
151 const char *password,
152 const char *domain);
153
154/* The following definitions come from libsmb/clientgen.c */
155
156int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
157unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
158void cli_set_port(struct cli_state *cli, int port);
159bool cli_state_seqnum_persistent(struct cli_state *cli,
160 uint16_t mid);
161bool cli_state_seqnum_remove(struct cli_state *cli,
162 uint16_t mid);
163bool cli_receive_smb(struct cli_state *cli);
164bool cli_send_smb(struct cli_state *cli);
165void cli_setup_packet_buf(struct cli_state *cli, char *buf);
166void cli_setup_packet(struct cli_state *cli);
167void cli_setup_bcc(struct cli_state *cli, void *p);
168NTSTATUS cli_set_domain(struct cli_state *cli, const char *domain);
169NTSTATUS cli_set_username(struct cli_state *cli, const char *username);
170NTSTATUS cli_set_password(struct cli_state *cli, const char *password);
171NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password);
172struct cli_state *cli_initialise(void);
173struct cli_state *cli_initialise_ex(int signing_state);
174void cli_nt_pipes_close(struct cli_state *cli);
175void cli_shutdown(struct cli_state *cli);
176void cli_sockopt(struct cli_state *cli, const char *options);
177uint16 cli_setpid(struct cli_state *cli, uint16 pid);
178bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
179struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
180 struct cli_state *cli, uint16_t num_echos,
181 DATA_BLOB data);
182NTSTATUS cli_echo_recv(struct tevent_req *req);
183NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
184bool cli_ucs2(struct cli_state *cli);
185bool is_andx_req(uint8_t cmd);
186NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
187 uint8_t smb_command, uint8_t additional_flags,
188 uint8_t wct, uint16_t *vwv,
189 uint32_t num_bytes, const uint8_t *bytes,
190 struct tevent_req **result_parent,
191 uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
192 uint32_t *pnum_bytes, uint8_t **pbytes);
193
194/* The following definitions come from libsmb/clierror.c */
195
196const char *cli_errstr(struct cli_state *cli);
197NTSTATUS cli_nt_error(struct cli_state *cli);
198void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *ecode);
199int cli_errno(struct cli_state *cli);
200bool cli_is_error(struct cli_state *cli);
201bool cli_is_nt_error(struct cli_state *cli);
202bool cli_is_dos_error(struct cli_state *cli);
203NTSTATUS cli_get_nt_error(struct cli_state *cli);
204void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
205void cli_reset_error(struct cli_state *cli);
206bool cli_state_is_connected(struct cli_state *cli);
207
208/* The following definitions come from libsmb/clifile.c */
209
210struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
211 struct tevent_context *ev,
212 struct cli_state *cli,
213 uint16_t level,
214 const char *path,
215 uint8_t *data,
216 size_t data_len);
217NTSTATUS cli_setpathinfo_recv(struct tevent_req *req);
218NTSTATUS cli_setpathinfo(struct cli_state *cli,
219 uint16_t level,
220 const char *path,
221 uint8_t *data,
222 size_t data_len);
223
224struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
225 struct event_context *ev,
226 struct cli_state *cli,
227 const char *oldname,
228 const char *newname);
229NTSTATUS cli_posix_symlink_recv(struct tevent_req *req);
230NTSTATUS cli_posix_symlink(struct cli_state *cli,
231 const char *oldname,
232 const char *newname);
233struct tevent_req *cli_posix_readlink_send(TALLOC_CTX *mem_ctx,
234 struct event_context *ev,
235 struct cli_state *cli,
236 const char *fname,
237 size_t len);
238NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
239 char *retpath, size_t len);
240NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname,
241 char *linkpath, size_t len);
242struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
243 struct event_context *ev,
244 struct cli_state *cli,
245 const char *oldname,
246 const char *newname);
247NTSTATUS cli_posix_hardlink_recv(struct tevent_req *req);
248NTSTATUS cli_posix_hardlink(struct cli_state *cli,
249 const char *oldname,
250 const char *newname);
251uint32_t unix_perms_to_wire(mode_t perms);
252mode_t wire_perms_to_unix(uint32_t perms);
253struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx,
254 struct event_context *ev,
255 struct cli_state *cli,
256 const char *fname);
257NTSTATUS cli_posix_getfacl_recv(struct tevent_req *req,
258 TALLOC_CTX *mem_ctx,
259 size_t *prb_size,
260 char **retbuf);
261NTSTATUS cli_posix_getfacl(struct cli_state *cli,
262 const char *fname,
263 TALLOC_CTX *mem_ctx,
264 size_t *prb_size,
265 char **retbuf);
266struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
267 struct event_context *ev,
268 struct cli_state *cli,
269 const char *fname);
270NTSTATUS cli_posix_stat_recv(struct tevent_req *req,
271 SMB_STRUCT_STAT *sbuf);
272NTSTATUS cli_posix_stat(struct cli_state *cli,
273 const char *fname,
274 SMB_STRUCT_STAT *sbuf);
275struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx,
276 struct event_context *ev,
277 struct cli_state *cli,
278 const char *fname,
279 mode_t mode);
280NTSTATUS cli_posix_chmod_recv(struct tevent_req *req);
281NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode);
282struct tevent_req *cli_posix_chown_send(TALLOC_CTX *mem_ctx,
283 struct event_context *ev,
284 struct cli_state *cli,
285 const char *fname,
286 uid_t uid,
287 gid_t gid);
288NTSTATUS cli_posix_chown_recv(struct tevent_req *req);
289NTSTATUS cli_posix_chown(struct cli_state *cli,
290 const char *fname,
291 uid_t uid,
292 gid_t gid);
293struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
294 struct event_context *ev,
295 struct cli_state *cli,
296 const char *fname_src,
297 const char *fname_dst);
298NTSTATUS cli_rename_recv(struct tevent_req *req);
299NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
300struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx,
301 struct event_context *ev,
302 struct cli_state *cli,
303 const char *fname_src,
304 const char *fname_dst);
305NTSTATUS cli_ntrename_recv(struct tevent_req *req);
306NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
307
308struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx,
309 struct event_context *ev,
310 struct cli_state *cli,
311 const char *fname_src,
312 const char *fname_dst);
313NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req);
314NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst);
315
316struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
317 struct event_context *ev,
318 struct cli_state *cli,
319 const char *fname,
320 uint16_t mayhave_attrs);
321NTSTATUS cli_unlink_recv(struct tevent_req *req);
322NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs);
323
324struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
325 struct event_context *ev,
326 struct cli_state *cli,
327 const char *dname);
328NTSTATUS cli_mkdir_recv(struct tevent_req *req);
329NTSTATUS cli_mkdir(struct cli_state *cli, const char *dname);
330struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
331 struct event_context *ev,
332 struct cli_state *cli,
333 const char *dname);
334NTSTATUS cli_rmdir_recv(struct tevent_req *req);
335NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname);
336struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx,
337 struct event_context *ev,
338 struct cli_state *cli,
339 uint16_t fnum,
340 bool flag);
341NTSTATUS cli_nt_delete_on_close_recv(struct tevent_req *req);
342NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
343struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
344 struct event_context *ev,
345 struct cli_state *cli,
346 const char *fname,
347 uint32_t CreatFlags,
348 uint32_t DesiredAccess,
349 uint32_t FileAttributes,
350 uint32_t ShareAccess,
351 uint32_t CreateDisposition,
352 uint32_t CreateOptions,
353 uint8_t SecurityFlags);
354NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum);
355NTSTATUS cli_ntcreate(struct cli_state *cli,
356 const char *fname,
357 uint32_t CreatFlags,
358 uint32_t DesiredAccess,
359 uint32_t FileAttributes,
360 uint32_t ShareAccess,
361 uint32_t CreateDisposition,
362 uint32_t CreateOptions,
363 uint8_t SecurityFlags,
364 uint16_t *pfid);
365uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
366 size_t str_len, size_t *pconverted_size);
367uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix,
368 const uint8_t *bytes, size_t num_bytes);
369struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
370 struct event_context *ev,
371 struct cli_state *cli, const char *fname,
372 int flags, int share_mode,
373 struct tevent_req **psmbreq);
374struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
375 struct cli_state *cli, const char *fname,
376 int flags, int share_mode);
377NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum);
378NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
379struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
380 struct event_context *ev,
381 struct cli_state *cli, uint16_t fnum,
382 struct tevent_req **psubreq);
383struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
384 struct event_context *ev,
385 struct cli_state *cli, uint16_t fnum);
386NTSTATUS cli_close_recv(struct tevent_req *req);
387NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
388struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx,
389 struct event_context *ev,
390 struct cli_state *cli,
391 uint16_t fnum,
392 uint64_t size);
393NTSTATUS cli_ftruncate_recv(struct tevent_req *req);
394NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
395NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
396 uint32_t offset, uint32_t len,
397 int timeout, unsigned char locktype);
398bool cli_lock(struct cli_state *cli, uint16_t fnum,
399 uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type);
400struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
401 struct event_context *ev,
402 struct cli_state *cli,
403 uint16_t fnum,
404 uint64_t offset,
405 uint64_t len);
406NTSTATUS cli_unlock_recv(struct tevent_req *req);
407NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
408bool cli_lock64(struct cli_state *cli, uint16_t fnum,
409 uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type);
410struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx,
411 struct event_context *ev,
412 struct cli_state *cli,
413 uint16_t fnum,
414 uint64_t offset,
415 uint64_t len);
416NTSTATUS cli_unlock64_recv(struct tevent_req *req);
417NTSTATUS cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
418struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx,
419 struct event_context *ev,
420 struct cli_state *cli,
421 uint16_t fnum,
422 uint64_t offset,
423 uint64_t len,
424 bool wait_lock,
425 enum brl_type lock_type);
426NTSTATUS cli_posix_lock_recv(struct tevent_req *req);
427NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum,
428 uint64_t offset, uint64_t len,
429 bool wait_lock, enum brl_type lock_type);
430struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx,
431 struct event_context *ev,
432 struct cli_state *cli,
433 uint16_t fnum,
434 uint64_t offset,
435 uint64_t len);
436NTSTATUS cli_posix_unlock_recv(struct tevent_req *req);
437NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
438struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
439 struct event_context *ev,
440 struct cli_state *cli,
441 uint16_t fnum);
442NTSTATUS cli_getattrE_recv(struct tevent_req *req,
443 uint16_t *attr,
444 SMB_OFF_T *size,
445 time_t *change_time,
446 time_t *access_time,
447 time_t *write_time);
448NTSTATUS cli_getattrE(struct cli_state *cli,
449 uint16_t fnum,
450 uint16_t *attr,
451 SMB_OFF_T *size,
452 time_t *change_time,
453 time_t *access_time,
454 time_t *write_time);
455struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
456 struct event_context *ev,
457 struct cli_state *cli,
458 uint16_t fnum,
459 time_t change_time,
460 time_t access_time,
461 time_t write_time);
462NTSTATUS cli_setattrE_recv(struct tevent_req *req);
463NTSTATUS cli_setattrE(struct cli_state *cli,
464 uint16_t fnum,
465 time_t change_time,
466 time_t access_time,
467 time_t write_time);
468struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
469 struct event_context *ev,
470 struct cli_state *cli,
471 const char *fname);
472NTSTATUS cli_getatr_recv(struct tevent_req *req,
473 uint16_t *attr,
474 SMB_OFF_T *size,
475 time_t *write_time);
476NTSTATUS cli_getatr(struct cli_state *cli,
477 const char *fname,
478 uint16_t *attr,
479 SMB_OFF_T *size,
480 time_t *write_time);
481struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
482 struct event_context *ev,
483 struct cli_state *cli,
484 const char *fname,
485 uint16_t attr,
486 time_t mtime);
487NTSTATUS cli_setatr_recv(struct tevent_req *req);
488NTSTATUS cli_setatr(struct cli_state *cli,
489 const char *fname,
490 uint16_t attr,
491 time_t mtime);
492struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
493 struct event_context *ev,
494 struct cli_state *cli,
495 const char *fname);
496NTSTATUS cli_chkpath_recv(struct tevent_req *req);
497NTSTATUS cli_chkpath(struct cli_state *cli, const char *path);
498struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx,
499 struct event_context *ev,
500 struct cli_state *cli);
501NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total,
502 int *avail);
503NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
504struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
505 struct event_context *ev,
506 struct cli_state *cli,
507 const char *path);
508NTSTATUS cli_ctemp_recv(struct tevent_req *req,
509 TALLOC_CTX *ctx,
510 uint16_t *pfnum,
511 char **outfile);
512NTSTATUS cli_ctemp(struct cli_state *cli,
513 TALLOC_CTX *ctx,
514 const char *path,
515 uint16_t *pfnum,
516 char **out_path);
517NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob);
518NTSTATUS cli_set_ea_path(struct cli_state *cli, const char *path,
519 const char *ea_name, const char *ea_val,
520 size_t ea_len);
521NTSTATUS cli_set_ea_fnum(struct cli_state *cli, uint16_t fnum,
522 const char *ea_name, const char *ea_val,
523 size_t ea_len);
524struct tevent_req *cli_get_ea_list_path_send(TALLOC_CTX *mem_ctx,
525 struct tevent_context *ev,
526 struct cli_state *cli,
527 const char *fname);
528NTSTATUS cli_get_ea_list_path_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
529 size_t *pnum_eas, struct ea_struct **peas);
530NTSTATUS cli_get_ea_list_path(struct cli_state *cli, const char *path,
531 TALLOC_CTX *ctx,
532 size_t *pnum_eas,
533 struct ea_struct **pea_list);
534struct tevent_req *cli_posix_open_send(TALLOC_CTX *mem_ctx,
535 struct event_context *ev,
536 struct cli_state *cli,
537 const char *fname,
538 int flags,
539 mode_t mode);
540NTSTATUS cli_posix_open_recv(struct tevent_req *req, uint16_t *pfnum);
541NTSTATUS cli_posix_open(struct cli_state *cli, const char *fname,
542 int flags, mode_t mode, uint16_t *fnum);
543struct tevent_req *cli_posix_mkdir_send(TALLOC_CTX *mem_ctx,
544 struct event_context *ev,
545 struct cli_state *cli,
546 const char *fname,
547 mode_t mode);
548NTSTATUS cli_posix_mkdir_recv(struct tevent_req *req);
549NTSTATUS cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode);
550
551struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx,
552 struct event_context *ev,
553 struct cli_state *cli,
554 const char *fname);
555NTSTATUS cli_posix_unlink_recv(struct tevent_req *req);
556NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname);
557
558struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
559 struct event_context *ev,
560 struct cli_state *cli,
561 const char *fname);
562NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
563NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname);
564struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
565 struct tevent_context *ev,
566 struct cli_state *cli, uint16_t fnum,
567 uint32_t buffer_size,
568 uint32_t completion_filter, bool recursive);
569NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
570 uint32_t *pnum_changes,
571 struct notify_change **pchanges);
572
573/* The following definitions come from libsmb/clifsinfo.c */
574
575struct tevent_req *cli_unix_extensions_version_send(TALLOC_CTX *mem_ctx,
576 struct tevent_context *ev,
577 struct cli_state *cli);
578NTSTATUS cli_unix_extensions_version_recv(struct tevent_req *req,
579 uint16_t *pmajor, uint16_t *pminor,
580 uint32_t *pcaplow,
581 uint32_t *pcaphigh);
582NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16 *pmajor,
583 uint16 *pminor, uint32 *pcaplow,
584 uint32 *pcaphigh);
585struct tevent_req *cli_set_unix_extensions_capabilities_send(
586 TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli,
587 uint16_t major, uint16_t minor, uint32_t caplow, uint32_t caphigh);
588NTSTATUS cli_set_unix_extensions_capabilities_recv(struct tevent_req *req);
589NTSTATUS cli_set_unix_extensions_capabilities(struct cli_state *cli,
590 uint16 major, uint16 minor,
591 uint32 caplow, uint32 caphigh);
592struct tevent_req *cli_get_fs_attr_info_send(TALLOC_CTX *mem_ctx,
593 struct tevent_context *ev,
594 struct cli_state *cli);
595NTSTATUS cli_get_fs_attr_info_recv(struct tevent_req *req, uint32_t *fs_attr);
596NTSTATUS cli_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
597NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name,
598 uint32 *pserial_number, time_t *pdate);
599NTSTATUS cli_get_fs_full_size_info(struct cli_state *cli,
600 uint64_t *total_allocation_units,
601 uint64_t *caller_allocation_units,
602 uint64_t *actual_allocation_units,
603 uint64_t *sectors_per_allocation_unit,
604 uint64_t *bytes_per_sector);
605NTSTATUS cli_get_posix_fs_info(struct cli_state *cli,
606 uint32 *optimal_transfer_size,
607 uint32 *block_size,
608 uint64_t *total_blocks,
609 uint64_t *blocks_available,
610 uint64_t *user_blocks_available,
611 uint64_t *total_file_nodes,
612 uint64_t *free_file_nodes,
613 uint64_t *fs_identifier);
614NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
615 const char *user,
616 const char *pass,
617 const char *domain);
618NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli);
619NTSTATUS cli_force_encryption(struct cli_state *c,
620 const char *username,
621 const char *password,
622 const char *domain);
623
624/* The following definitions come from libsmb/clilist.c */
625
626NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
627 NTSTATUS (*fn)(const char *, struct file_info *,
628 const char *, void *), void *state);
629NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
630 uint16_t attribute, int info_level,
631 NTSTATUS (*fn)(const char *mnt, struct file_info *finfo,
632 const char *mask, void *private_data),
633 void *private_data);
634struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
635 struct tevent_context *ev,
636 struct cli_state *cli,
637 const char *mask,
638 uint16_t attribute,
639 uint16_t info_level);
640NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
641 struct file_info **finfo, size_t *num_finfo);
642NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
643 NTSTATUS (*fn)(const char *, struct file_info *, const char *,
644 void *), void *state);
645
646/* The following definitions come from libsmb/climessage.c */
647
648struct tevent_req *cli_message_send(TALLOC_CTX *mem_ctx,
649 struct tevent_context *ev,
650 struct cli_state *cli,
651 const char *host, const char *username,
652 const char *message);
653NTSTATUS cli_message_recv(struct tevent_req *req);
654NTSTATUS cli_message(struct cli_state *cli, const char *host,
655 const char *username, const char *message);
656
657/* The following definitions come from libsmb/clioplock.c */
658
659struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
660 struct tevent_context *ev,
661 struct cli_state *cli,
662 uint16_t fnum, uint8_t level);
663NTSTATUS cli_oplock_ack_recv(struct tevent_req *req);
664NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level);
665void cli_oplock_handler(struct cli_state *cli,
666 NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char));
667
668/* The following definitions come from libsmb/cliprint.c */
669
670int cli_print_queue(struct cli_state *cli,
671 void (*fn)(struct print_job_info *));
672int cli_printjob_del(struct cli_state *cli, int job);
673
674/* The following definitions come from libsmb/cliquota.c */
675
676NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum);
677void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list);
678NTSTATUS cli_get_user_quota(struct cli_state *cli, int quota_fnum,
679 SMB_NTQUOTA_STRUCT *pqt);
680NTSTATUS cli_set_user_quota(struct cli_state *cli, int quota_fnum,
681 SMB_NTQUOTA_STRUCT *pqt);
682NTSTATUS cli_list_user_quota(struct cli_state *cli, int quota_fnum,
683 SMB_NTQUOTA_LIST **pqt_list);
684NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum,
685 SMB_NTQUOTA_STRUCT *pqt);
686NTSTATUS cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum,
687 SMB_NTQUOTA_STRUCT *pqt);
688
689/* The following definitions come from libsmb/clireadwrite.c */
690
691struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx,
692 struct event_context *ev,
693 struct cli_state *cli, uint16_t fnum,
694 off_t offset, size_t size,
695 struct tevent_req **psmbreq);
696struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
697 struct event_context *ev,
698 struct cli_state *cli, uint16_t fnum,
699 off_t offset, size_t size);
700NTSTATUS cli_read_andx_recv(struct tevent_req *req, ssize_t *received,
701 uint8_t **rcvbuf);
702struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
703 struct event_context *ev,
704 struct cli_state *cli,
705 uint16_t fnum, off_t start_offset,
706 SMB_OFF_T size, size_t window_size,
707 NTSTATUS (*sink)(char *buf, size_t n,
708 void *priv),
709 void *priv);
710NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received);
711NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
712 off_t start_offset, SMB_OFF_T size, size_t window_size,
713 NTSTATUS (*sink)(char *buf, size_t n, void *priv),
714 void *priv, SMB_OFF_T *received);
715ssize_t cli_read(struct cli_state *cli, uint16_t fnum, char *buf,
716 off_t offset, size_t size);
717NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf,
718 off_t offset, size_t size1, size_t *ptotal);
719struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
720 struct event_context *ev,
721 struct cli_state *cli, uint16_t fnum,
722 uint16_t mode, const uint8_t *buf,
723 off_t offset, size_t size,
724 struct tevent_req **reqs_before,
725 int num_reqs_before,
726 struct tevent_req **psmbreq);
727struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx,
728 struct event_context *ev,
729 struct cli_state *cli, uint16_t fnum,
730 uint16_t mode, const uint8_t *buf,
731 off_t offset, size_t size);
732NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten);
733
734NTSTATUS cli_writeall(struct cli_state *cli, uint16_t fnum, uint16_t mode,
735 const uint8_t *buf, off_t offset, size_t size,
736 size_t *pwritten);
737
738struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
739 struct cli_state *cli,
740 uint16_t fnum, uint16_t mode,
741 off_t start_offset, size_t window_size,
742 size_t (*source)(uint8_t *buf, size_t n,
743 void *priv),
744 void *priv);
745NTSTATUS cli_push_recv(struct tevent_req *req);
746NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
747 off_t start_offset, size_t window_size,
748 size_t (*source)(uint8_t *buf, size_t n, void *priv),
749 void *priv);
750
751/* The following definitions come from libsmb/clisecdesc.c */
752
753struct security_descriptor *cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
754 TALLOC_CTX *mem_ctx);
755NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
756 struct security_descriptor *sd);
757
758/* The following definitions come from libsmb/clistr.c */
759
760size_t clistr_push_fn(const char *function,
761 unsigned int line,
762 struct cli_state *cli,
763 void *dest,
764 const char *src,
765 int dest_len,
766 int flags);
767size_t clistr_pull_fn(const char *function,
768 unsigned int line,
769 const char *inbuf,
770 char *dest,
771 const void *src,
772 int dest_len,
773 int src_len,
774 int flags);
775size_t clistr_pull_talloc_fn(const char *function,
776 unsigned int line,
777 TALLOC_CTX *ctx,
778 const char *base,
779 uint16_t flags2,
780 char **pp_dest,
781 const void *src,
782 int src_len,
783 int flags);
784size_t clistr_align_out(struct cli_state *cli, const void *p, int flags);
785
786/* The following definitions come from libsmb/clitrans.c */
787
788struct tevent_req *cli_trans_send(
789 TALLOC_CTX *mem_ctx, struct event_context *ev,
790 struct cli_state *cli, uint8_t cmd,
791 const char *pipe_name, uint16_t fid, uint16_t function, int flags,
792 uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
793 uint8_t *param, uint32_t num_param, uint32_t max_param,
794 uint8_t *data, uint32_t num_data, uint32_t max_data);
795NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
796 uint16_t *recv_flags2,
797 uint16_t **setup, uint8_t min_setup,
798 uint8_t *num_setup,
799 uint8_t **param, uint32_t min_param,
800 uint32_t *num_param,
801 uint8_t **data, uint32_t min_data,
802 uint32_t *num_data);
803NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
804 uint8_t trans_cmd,
805 const char *pipe_name, uint16_t fid, uint16_t function,
806 int flags,
807 uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
808 uint8_t *param, uint32_t num_param, uint32_t max_param,
809 uint8_t *data, uint32_t num_data, uint32_t max_data,
810 uint16_t *recv_flags2,
811 uint16_t **rsetup, uint8_t min_rsetup, uint8_t *num_rsetup,
812 uint8_t **rparam, uint32_t min_rparam, uint32_t *num_rparam,
813 uint8_t **rdata, uint32_t min_rdata, uint32_t *num_rdata);
814
815/* The following definitions come from libsmb/smb_seal.c */
816
817NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16 *p_enc_ctx_num);
818bool common_encryption_on(struct smb_trans_enc_state *es);
819NTSTATUS common_ntlm_decrypt_buffer(struct ntlmssp_state *ntlmssp_state, char *buf);
820NTSTATUS common_ntlm_encrypt_buffer(struct ntlmssp_state *ntlmssp_state,
821 uint16 enc_ctx_num,
822 char *buf,
823 char **ppbuf_out);
824NTSTATUS common_encrypt_buffer(struct smb_trans_enc_state *es, char *buffer, char **buf_out);
825NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf);
826void common_free_encryption_state(struct smb_trans_enc_state **pp_es);
827void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf);
828bool cli_encryption_on(struct cli_state *cli);
829void cli_free_encryption_context(struct cli_state *cli);
830void cli_free_enc_buffer(struct cli_state *cli, char *buf);
831NTSTATUS cli_decrypt_message(struct cli_state *cli);
832NTSTATUS cli_encrypt_message(struct cli_state *cli, char *buf, char **buf_out);
833
834/* The following definitions come from libsmb/clisigning.c */
835
836bool cli_simple_set_signing(struct cli_state *cli,
837 const DATA_BLOB user_session_key,
838 const DATA_BLOB response);
839bool cli_temp_set_signing(struct cli_state *cli);
840void cli_calculate_sign_mac(struct cli_state *cli, char *buf, uint32_t *seqnum);
841bool cli_check_sign_mac(struct cli_state *cli, const char *buf, uint32_t seqnum);
842bool client_is_signing_on(struct cli_state *cli);
843bool client_is_signing_allowed(struct cli_state *cli);
844bool client_is_signing_mandatory(struct cli_state *cli);
845void cli_set_signing_negotiated(struct cli_state *cli);
846
847#endif /* _LIBSMB_PROTO_H_ */
Note: See TracBrowser for help on using the repository browser.