2011-05-06 11:47:43 +02:00
/*
Unix SMB / CIFS implementation .
2011-06-10 15:06:36 +02:00
Copyright ( C ) Andrew Bartlett 2001 - 2003
Copyright ( C ) Andrew Tridgell 1994 - 1998 , 2000 - 2001
Copyright ( C ) Gerald ( Jerry ) Carter 2004
Copyright ( C ) Jelmer Vernooij 2003
Copyright ( C ) Jeremy Allison 2001 - 2009 , 2011
Copyright ( C ) Stefan Metzmacher 2003 , 2009
Copyright ( C ) Volker Lendecke 2011
2011-05-06 11:47:43 +02:00
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program . If not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef _LIBSMB_PROTO_H_
# define _LIBSMB_PROTO_H_
2011-09-15 17:56:04 +02:00
struct smb_trans_enc_state ;
2016-10-26 13:17:59 +02:00
struct cli_credentials ;
2017-08-18 16:10:06 +02:00
struct cli_state ;
struct file_info ;
struct print_job_info ;
2011-09-15 17:56:04 +02:00
2011-05-06 11:47:43 +02:00
/* The following definitions come from libsmb/cliconnect.c */
2016-10-28 12:09:05 +02:00
struct cli_credentials * cli_session_creds_init ( TALLOC_CTX * mem_ctx ,
const char * username ,
const char * domain ,
const char * realm ,
const char * password ,
bool use_kerberos ,
bool fallback_after_kerberos ,
bool use_ccache ,
bool password_is_nt_hash ) ;
2016-12-08 12:11:45 +01:00
NTSTATUS cli_session_creds_prepare_krb5 ( struct cli_state * cli ,
struct cli_credentials * creds ) ;
2016-10-26 13:17:59 +02:00
struct tevent_req * cli_session_setup_creds_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
struct cli_credentials * creds ) ;
NTSTATUS cli_session_setup_creds_recv ( struct tevent_req * req ) ;
NTSTATUS cli_session_setup_creds ( struct cli_state * cli ,
struct cli_credentials * creds ) ;
2016-10-28 12:01:50 +02:00
NTSTATUS cli_session_setup_anon ( struct cli_state * cli ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_session_setup_guest_create ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
struct tevent_req * * psmbreq ) ;
struct tevent_req * cli_session_setup_guest_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ) ;
NTSTATUS cli_session_setup_guest_recv ( struct tevent_req * req ) ;
NTSTATUS cli_ulogoff ( struct cli_state * cli ) ;
struct tevent_req * cli_tcon_andx_create ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * share , const char * dev ,
const char * pass , int passlen ,
struct tevent_req * * psmbreq ) ;
struct tevent_req * cli_tcon_andx_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * share , const char * dev ,
const char * pass , int passlen ) ;
NTSTATUS cli_tcon_andx_recv ( struct tevent_req * req ) ;
NTSTATUS cli_tcon_andx ( struct cli_state * cli , const char * share ,
const char * dev , const char * pass , int passlen ) ;
2016-12-07 17:32:58 +01:00
NTSTATUS cli_tree_connect_creds ( struct cli_state * cli ,
const char * share , const char * dev ,
struct cli_credentials * creds ) ;
2011-09-20 06:57:37 +02:00
NTSTATUS cli_tree_connect ( struct cli_state * cli , const char * share ,
2016-12-08 07:13:57 +01:00
const char * dev , const char * pass ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_tdis ( struct cli_state * cli ) ;
2011-07-22 11:54:03 +02:00
NTSTATUS cli_connect_nb ( const char * host , const struct sockaddr_storage * dest_ss ,
2011-05-28 20:39:54 +02:00
uint16_t port , int name_type , const char * myname ,
2020-05-28 17:59:19 +02:00
enum smb_signing_setting signing_state , int flags , struct cli_state * * pcli ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_start_connection ( struct cli_state * * output_cli ,
const char * my_name ,
const char * dest_host ,
2011-07-22 12:01:27 +02:00
const struct sockaddr_storage * dest_ss , int port ,
2020-05-28 17:59:19 +02:00
enum smb_signing_setting signing_state , int flags ) ;
2016-10-31 23:02:27 +01:00
NTSTATUS cli_smb1_setup_encryption ( struct cli_state * cli ,
struct cli_credentials * creds ) ;
2016-10-26 13:48:58 +02:00
struct tevent_req * cli_full_connection_creds_send (
2013-04-05 14:55:26 +02:00
TALLOC_CTX * mem_ctx , struct tevent_context * ev ,
const char * my_name , const char * dest_host ,
const struct sockaddr_storage * dest_ss , int port ,
const char * service , const char * service_type ,
2016-10-26 13:48:58 +02:00
struct cli_credentials * creds ,
2020-05-28 18:20:02 +02:00
int flags ) ;
2016-10-26 13:48:58 +02:00
NTSTATUS cli_full_connection_creds_recv ( struct tevent_req * req ,
struct cli_state * * output_cli ) ;
NTSTATUS cli_full_connection_creds ( struct cli_state * * output_cli ,
const char * my_name ,
const char * dest_host ,
const struct sockaddr_storage * dest_ss , int port ,
const char * service , const char * service_type ,
struct cli_credentials * creds ,
2020-06-04 14:59:14 +02:00
int flags ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_raw_tcon ( struct cli_state * cli ,
const char * service , const char * pass , const char * dev ,
2015-05-09 16:59:45 -07:00
uint16_t * max_xmit , uint16_t * tid ) ;
2011-05-06 11:47:43 +02:00
struct cli_state * get_ipc_connect ( char * server ,
struct sockaddr_storage * server_ss ,
2021-01-13 15:35:11 +01:00
struct cli_credentials * creds ) ;
2011-05-06 11:47:43 +02:00
struct cli_state * get_ipc_connect_master_ip ( TALLOC_CTX * ctx ,
struct sockaddr_storage * mb_ip ,
2021-01-13 15:40:08 +01:00
struct cli_credentials * creds ,
2011-05-06 11:47:43 +02:00
char * * pp_workgroup_out ) ;
/* The following definitions come from libsmb/clidfs.c */
2011-07-03 19:59:37 +02:00
NTSTATUS cli_cm_open ( TALLOC_CTX * ctx ,
2020-08-18 17:26:54 +02:00
struct cli_state * referring_cli ,
const char * server ,
const char * share ,
struct cli_credentials * creds ,
const struct sockaddr_storage * dest_ss ,
int port ,
int name_type ,
struct cli_state * * pcli ) ;
2011-07-22 16:05:54 +02:00
void cli_cm_display ( struct cli_state * c ) ;
2011-05-06 11:47:43 +02:00
struct client_dfs_referral ;
2017-06-26 09:43:31 -07:00
NTSTATUS cli_dfs_get_referral_ex ( TALLOC_CTX * ctx ,
struct cli_state * cli ,
const char * path ,
uint16_t max_referral_level ,
struct client_dfs_referral * * refs ,
size_t * num_refs ,
size_t * consumed ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_dfs_get_referral ( TALLOC_CTX * ctx ,
struct cli_state * cli ,
const char * path ,
struct client_dfs_referral * * refs ,
size_t * num_refs ,
size_t * consumed ) ;
2011-07-03 20:53:55 +02:00
NTSTATUS cli_resolve_path ( TALLOC_CTX * ctx ,
const char * mountpt ,
2020-08-18 17:42:25 +02:00
struct cli_credentials * creds ,
2011-07-03 20:53:55 +02:00
struct cli_state * rootcli ,
const char * path ,
struct cli_state * * targetcli ,
char * * pp_targetpath ) ;
2011-05-06 11:47:43 +02:00
bool cli_check_msdfs_proxy ( TALLOC_CTX * ctx ,
struct cli_state * cli ,
const char * sharename ,
char * * pp_newserver ,
char * * pp_newshare ,
2016-11-04 12:25:34 +01:00
struct cli_credentials * creds ) ;
2011-05-06 11:47:43 +02:00
/* The following definitions come from libsmb/clientgen.c */
unsigned int cli_set_timeout ( struct cli_state * cli , unsigned int timeout ) ;
2011-12-01 13:24:22 -08:00
bool cli_set_backup_intent ( struct cli_state * cli , bool flag ) ;
2014-06-20 01:03:08 +02:00
extern struct GUID cli_state_client_guid ;
2011-07-21 21:47:36 +02:00
struct cli_state * cli_state_create ( TALLOC_CTX * mem_ctx ,
int fd ,
2011-07-22 16:53:51 +02:00
const char * remote_name ,
2020-05-28 17:59:19 +02:00
enum smb_signing_setting signing_state ,
2011-09-07 21:10:24 +02:00
int flags ) ;
2011-05-06 11:47:43 +02:00
void cli_shutdown ( struct cli_state * cli ) ;
2011-07-19 12:52:10 +02:00
uint16_t cli_state_get_vc_num ( struct cli_state * cli ) ;
2016-06-10 16:51:11 -07:00
uint32_t cli_setpid ( struct cli_state * cli , uint32_t pid ) ;
uint32_t cli_getpid ( struct cli_state * cli ) ;
2017-08-14 12:13:18 +02:00
bool cli_state_is_encryption_on ( struct cli_state * cli ) ;
2011-07-19 16:25:52 +02:00
bool cli_state_has_tcon ( struct cli_state * cli ) ;
2017-06-13 16:26:00 -07:00
uint32_t cli_state_get_tid ( struct cli_state * cli ) ;
uint32_t cli_state_set_tid ( struct cli_state * cli , uint32_t tid ) ;
2017-06-13 16:15:00 -07:00
struct smbXcli_tcon ;
struct smbXcli_tcon * cli_state_save_tcon ( struct cli_state * cli ) ;
void cli_state_restore_tcon ( struct cli_state * cli , struct smbXcli_tcon * tcon ) ;
2011-07-21 09:20:43 +02:00
uint16_t cli_state_get_uid ( struct cli_state * cli ) ;
uint16_t cli_state_set_uid ( struct cli_state * cli , uint16_t uid ) ;
2011-05-06 11:47:43 +02:00
bool cli_set_case_sensitive ( struct cli_state * cli , bool case_sensitive ) ;
2011-09-13 11:23:49 +02:00
uint32_t cli_state_available_size ( struct cli_state * cli , uint32_t ofs ) ;
2011-09-13 21:41:17 +02:00
time_t cli_state_server_time ( struct cli_state * cli ) ;
2013-02-18 09:59:58 +01:00
struct tevent_req * cli_echo_send ( TALLOC_CTX * mem_ctx , struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli , uint16_t num_echos ,
DATA_BLOB data ) ;
NTSTATUS cli_echo_recv ( struct tevent_req * req ) ;
NTSTATUS cli_echo ( struct cli_state * cli , uint16_t num_echos , DATA_BLOB data ) ;
NTSTATUS cli_smb ( TALLOC_CTX * mem_ctx , struct cli_state * cli ,
uint8_t smb_command , uint8_t additional_flags ,
uint8_t wct , uint16_t * vwv ,
uint32_t num_bytes , const uint8_t * bytes ,
struct tevent_req * * result_parent ,
uint8_t min_wct , uint8_t * pwct , uint16_t * * pvwv ,
uint32_t * pnum_bytes , uint8_t * * pbytes ) ;
/* The following definitions come from libsmb/clierror.c */
NTSTATUS cli_nt_error ( struct cli_state * cli ) ;
2015-05-09 16:59:45 -07:00
void cli_dos_error ( struct cli_state * cli , uint8_t * eclass , uint32_t * ecode ) ;
2020-12-15 17:05:34 +01:00
int cli_status_to_errno ( NTSTATUS status ) ;
2011-05-06 11:47:43 +02:00
int cli_errno ( struct cli_state * cli ) ;
bool cli_is_error ( struct cli_state * cli ) ;
bool cli_is_nt_error ( struct cli_state * cli ) ;
bool cli_is_dos_error ( struct cli_state * cli ) ;
bool cli_state_is_connected ( struct cli_state * cli ) ;
/* The following definitions come from libsmb/clifile.c */
struct tevent_req * cli_setpathinfo_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
uint16_t level ,
const char * path ,
uint8_t * data ,
size_t data_len ) ;
NTSTATUS cli_setpathinfo_recv ( struct tevent_req * req ) ;
NTSTATUS cli_setpathinfo ( struct cli_state * cli ,
uint16_t level ,
const char * path ,
uint8_t * data ,
size_t data_len ) ;
2020-03-30 15:12:48 +02:00
struct tevent_req * cli_setfileinfo_send (
TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
uint16_t fnum ,
uint16_t level ,
uint8_t * data ,
size_t data_len ) ;
NTSTATUS cli_setfileinfo_recv ( struct tevent_req * req ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_posix_symlink_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * oldname ,
const char * newname ) ;
NTSTATUS cli_posix_symlink_recv ( struct tevent_req * req ) ;
NTSTATUS cli_posix_symlink ( struct cli_state * cli ,
const char * oldname ,
const char * newname ) ;
struct tevent_req * cli_posix_readlink_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
2019-03-26 09:48:16 +01:00
const char * fname ) ;
2019-03-25 12:32:07 +01:00
NTSTATUS cli_posix_readlink_recv (
2019-03-26 09:48:16 +01:00
struct tevent_req * req , TALLOC_CTX * mem_ctx , char * * target ) ;
NTSTATUS cli_posix_readlink (
struct cli_state * cli ,
const char * fname ,
TALLOC_CTX * mem_ctx ,
char * * target ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_posix_hardlink_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * oldname ,
const char * newname ) ;
NTSTATUS cli_posix_hardlink_recv ( struct tevent_req * req ) ;
NTSTATUS cli_posix_hardlink ( struct cli_state * cli ,
const char * oldname ,
const char * newname ) ;
uint32_t unix_perms_to_wire ( mode_t perms ) ;
mode_t wire_perms_to_unix ( uint32_t perms ) ;
2016-01-06 17:17:24 -08:00
struct tevent_req * cli_posix_getacl_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ) ;
2016-01-06 17:17:24 -08:00
NTSTATUS cli_posix_getacl_recv ( struct tevent_req * req ,
2011-05-06 11:47:43 +02:00
TALLOC_CTX * mem_ctx ,
size_t * prb_size ,
char * * retbuf ) ;
2016-01-06 17:17:24 -08:00
NTSTATUS cli_posix_getacl ( struct cli_state * cli ,
2011-05-06 11:47:43 +02:00
const char * fname ,
TALLOC_CTX * mem_ctx ,
size_t * prb_size ,
char * * retbuf ) ;
2016-01-06 17:02:52 -08:00
struct tevent_req * cli_posix_setacl_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
const char * fname ,
const void * acl_buf ,
size_t acl_buf_size ) ;
NTSTATUS cli_posix_setacl_recv ( struct tevent_req * req ) ;
NTSTATUS cli_posix_setacl ( struct cli_state * cli ,
const char * fname ,
const void * acl_buf ,
size_t acl_buf_size ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_posix_stat_send ( TALLOC_CTX * mem_ctx ,
2019-03-13 16:10:33 +01:00
struct tevent_context * ev ,
struct cli_state * cli ,
2020-03-10 11:51:09 -07:00
const char * fname ,
SMB_STRUCT_STAT * sbuf ) ;
NTSTATUS cli_posix_stat_recv ( struct tevent_req * req ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_posix_stat ( struct cli_state * cli ,
const char * fname ,
SMB_STRUCT_STAT * sbuf ) ;
struct tevent_req * cli_posix_chmod_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ,
mode_t mode ) ;
NTSTATUS cli_posix_chmod_recv ( struct tevent_req * req ) ;
NTSTATUS cli_posix_chmod ( struct cli_state * cli , const char * fname , mode_t mode ) ;
struct tevent_req * cli_posix_chown_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ,
uid_t uid ,
gid_t gid ) ;
NTSTATUS cli_posix_chown_recv ( struct tevent_req * req ) ;
NTSTATUS cli_posix_chown ( struct cli_state * cli ,
const char * fname ,
uid_t uid ,
gid_t gid ) ;
struct tevent_req * cli_rename_send ( TALLOC_CTX * mem_ctx ,
2017-03-26 09:14:43 +03:00
struct tevent_context * ev ,
struct cli_state * cli ,
const char * fname_src ,
const char * fname_dst ,
bool replace ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_rename_recv ( struct tevent_req * req ) ;
2017-03-21 23:13:07 +02:00
NTSTATUS cli_rename ( struct cli_state * cli ,
const char * fname_src ,
const char * fname_dst ,
bool replace ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_ntrename_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname_src ,
const char * fname_dst ) ;
NTSTATUS cli_ntrename_recv ( struct tevent_req * req ) ;
NTSTATUS cli_ntrename ( struct cli_state * cli , const char * fname_src , const char * fname_dst ) ;
2019-03-18 10:34:53 +01:00
struct tevent_req * cli_hardlink_send (
TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
const char * fname_src ,
const char * fname_dst ) ;
NTSTATUS cli_hardlink_recv ( struct tevent_req * req ) ;
NTSTATUS cli_hardlink (
struct cli_state * cli ,
const char * fname_src ,
const char * fname_dst ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_unlink_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ,
2020-06-03 21:03:39 -07:00
uint32_t mayhave_attrs ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_unlink_recv ( struct tevent_req * req ) ;
2020-06-03 21:03:39 -07:00
NTSTATUS cli_unlink ( struct cli_state * cli , const char * fname , uint32_t mayhave_attrs ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_mkdir_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * dname ) ;
NTSTATUS cli_mkdir_recv ( struct tevent_req * req ) ;
NTSTATUS cli_mkdir ( struct cli_state * cli , const char * dname ) ;
struct tevent_req * cli_rmdir_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * dname ) ;
NTSTATUS cli_rmdir_recv ( struct tevent_req * req ) ;
NTSTATUS cli_rmdir ( struct cli_state * cli , const char * dname ) ;
struct tevent_req * cli_nt_delete_on_close_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
uint16_t fnum ,
bool flag ) ;
NTSTATUS cli_nt_delete_on_close_recv ( struct tevent_req * req ) ;
NTSTATUS cli_nt_delete_on_close ( struct cli_state * cli , uint16_t fnum , bool flag ) ;
struct tevent_req * cli_ntcreate_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ,
uint32_t CreatFlags ,
uint32_t DesiredAccess ,
uint32_t FileAttributes ,
uint32_t ShareAccess ,
uint32_t CreateDisposition ,
uint32_t CreateOptions ,
2018-12-07 16:38:57 +01:00
uint32_t ImpersonationLevel ,
2011-05-06 11:47:43 +02:00
uint8_t SecurityFlags ) ;
2014-05-08 20:55:57 -07:00
NTSTATUS cli_ntcreate_recv ( struct tevent_req * req ,
uint16_t * pfnum ,
struct smb_create_returns * cr ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_ntcreate ( struct cli_state * cli ,
const char * fname ,
uint32_t CreatFlags ,
uint32_t DesiredAccess ,
uint32_t FileAttributes ,
uint32_t ShareAccess ,
uint32_t CreateDisposition ,
uint32_t CreateOptions ,
uint8_t SecurityFlags ,
2014-05-08 20:55:57 -07:00
uint16_t * pfid ,
struct smb_create_returns * cr ) ;
2011-12-03 21:13:08 -08:00
struct tevent_req * cli_openx_create ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli , const char * fname ,
int flags , int share_mode ,
struct tevent_req * * psmbreq ) ;
2013-02-18 09:59:58 +01:00
struct tevent_req * cli_openx_send ( TALLOC_CTX * mem_ctx , struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli , const char * fname ,
int flags , int share_mode ) ;
2011-12-03 21:13:08 -08:00
NTSTATUS cli_openx_recv ( struct tevent_req * req , uint16_t * fnum ) ;
NTSTATUS cli_openx ( struct cli_state * cli , const char * fname , int flags , int share_mode , uint16_t * pfnum ) ;
2011-12-03 21:31:32 -08:00
NTSTATUS cli_open ( struct cli_state * cli , const char * fname , int flags , int share_mode , uint16_t * pfnum ) ;
2017-11-22 00:47:48 +00:00
struct tevent_req * cli_smb1_close_create ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli , uint16_t fnum ,
struct tevent_req * * psubreq ) ;
struct tevent_req * cli_close_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli , uint16_t fnum ) ;
NTSTATUS cli_close_recv ( struct tevent_req * req ) ;
NTSTATUS cli_close ( struct cli_state * cli , uint16_t fnum ) ;
struct tevent_req * cli_ftruncate_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
uint16_t fnum ,
uint64_t size ) ;
NTSTATUS cli_ftruncate_recv ( struct tevent_req * req ) ;
NTSTATUS cli_ftruncate ( struct cli_state * cli , uint16_t fnum , uint64_t size ) ;
NTSTATUS cli_locktype ( struct cli_state * cli , uint16_t fnum ,
uint32_t offset , uint32_t len ,
int timeout , unsigned char locktype ) ;
2019-05-29 17:45:19 +02:00
struct smb1_lock_element {
uint16_t pid ;
uint64_t offset ;
uint64_t length ;
} ;
struct tevent_req * cli_lockingx_create (
TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
uint16_t fnum ,
uint8_t typeoflock ,
uint8_t newoplocklevel ,
int32_t timeout ,
uint16_t num_unlocks ,
const struct smb1_lock_element * unlocks ,
uint16_t num_locks ,
const struct smb1_lock_element * locks ,
struct tevent_req * * psmbreq ) ;
struct tevent_req * cli_lockingx_send (
TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
uint16_t fnum ,
uint8_t typeoflock ,
uint8_t newoplocklevel ,
int32_t timeout ,
uint16_t num_unlocks ,
const struct smb1_lock_element * unlocks ,
uint16_t num_locks ,
const struct smb1_lock_element * locks ) ;
NTSTATUS cli_lockingx_recv ( struct tevent_req * req ) ;
NTSTATUS cli_lockingx (
struct cli_state * cli ,
uint16_t fnum ,
uint8_t typeoflock ,
uint8_t newoplocklevel ,
int32_t timeout ,
uint16_t num_unlocks ,
const struct smb1_lock_element * unlocks ,
uint16_t num_locks ,
const struct smb1_lock_element * locks ) ;
2011-07-11 11:13:18 +02:00
NTSTATUS cli_lock32 ( struct cli_state * cli , uint16_t fnum , uint32_t offset ,
uint32_t len , int timeout , enum brl_type lock_type ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_unlock_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
uint16_t fnum ,
uint64_t offset ,
uint64_t len ) ;
NTSTATUS cli_unlock_recv ( struct tevent_req * req ) ;
NTSTATUS cli_unlock ( struct cli_state * cli , uint16_t fnum , uint32_t offset , uint32_t len ) ;
struct tevent_req * cli_posix_lock_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
uint16_t fnum ,
uint64_t offset ,
uint64_t len ,
bool wait_lock ,
enum brl_type lock_type ) ;
NTSTATUS cli_posix_lock_recv ( struct tevent_req * req ) ;
NTSTATUS cli_posix_lock ( struct cli_state * cli , uint16_t fnum ,
uint64_t offset , uint64_t len ,
bool wait_lock , enum brl_type lock_type ) ;
struct tevent_req * cli_posix_unlock_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
uint16_t fnum ,
uint64_t offset ,
uint64_t len ) ;
NTSTATUS cli_posix_unlock_recv ( struct tevent_req * req ) ;
NTSTATUS cli_posix_unlock ( struct cli_state * cli , uint16_t fnum , uint64_t offset , uint64_t len ) ;
struct tevent_req * cli_getattrE_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
uint16_t fnum ) ;
NTSTATUS cli_getattrE_recv ( struct tevent_req * req ,
2020-06-03 13:00:56 -07:00
uint32_t * pattr ,
2012-04-05 14:53:08 +10:00
off_t * size ,
2011-05-06 11:47:43 +02:00
time_t * change_time ,
time_t * access_time ,
time_t * write_time ) ;
struct tevent_req * cli_setattrE_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
uint16_t fnum ,
time_t change_time ,
time_t access_time ,
time_t write_time ) ;
NTSTATUS cli_setattrE_recv ( struct tevent_req * req ) ;
NTSTATUS cli_setattrE ( struct cli_state * cli ,
uint16_t fnum ,
time_t change_time ,
time_t access_time ,
time_t write_time ) ;
struct tevent_req * cli_getatr_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ) ;
NTSTATUS cli_getatr_recv ( struct tevent_req * req ,
2020-06-03 13:15:17 -07:00
uint32_t * pattr ,
2012-04-05 14:53:08 +10:00
off_t * size ,
2011-05-06 11:47:43 +02:00
time_t * write_time ) ;
NTSTATUS cli_getatr ( struct cli_state * cli ,
const char * fname ,
2020-06-03 13:15:17 -07:00
uint32_t * pattr ,
2012-04-05 14:53:08 +10:00
off_t * size ,
2011-05-06 11:47:43 +02:00
time_t * write_time ) ;
struct tevent_req * cli_setatr_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ,
2020-06-03 14:12:38 -07:00
uint32_t attr ,
2011-05-06 11:47:43 +02:00
time_t mtime ) ;
NTSTATUS cli_setatr_recv ( struct tevent_req * req ) ;
NTSTATUS cli_setatr ( struct cli_state * cli ,
const char * fname ,
2020-06-03 14:12:38 -07:00
uint32_t attr ,
2011-05-06 11:47:43 +02:00
time_t mtime ) ;
struct tevent_req * cli_chkpath_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ) ;
NTSTATUS cli_chkpath_recv ( struct tevent_req * req ) ;
NTSTATUS cli_chkpath ( struct cli_state * cli , const char * path ) ;
struct tevent_req * cli_dskattr_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ) ;
NTSTATUS cli_dskattr_recv ( struct tevent_req * req , int * bsize , int * total ,
int * avail ) ;
NTSTATUS cli_dskattr ( struct cli_state * cli , int * bsize , int * total , int * avail ) ;
2016-01-06 00:08:25 +02:00
NTSTATUS cli_disk_size ( struct cli_state * cli , const char * path , uint64_t * bsize ,
uint64_t * total , uint64_t * avail ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_ctemp_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * path ) ;
NTSTATUS cli_ctemp_recv ( struct tevent_req * req ,
TALLOC_CTX * ctx ,
uint16_t * pfnum ,
char * * outfile ) ;
NTSTATUS cli_ctemp ( struct cli_state * cli ,
TALLOC_CTX * ctx ,
const char * path ,
uint16_t * pfnum ,
char * * out_path ) ;
NTSTATUS cli_raw_ioctl ( struct cli_state * cli , uint16_t fnum , uint32_t code , DATA_BLOB * blob ) ;
NTSTATUS cli_set_ea_path ( struct cli_state * cli , const char * path ,
const char * ea_name , const char * ea_val ,
size_t ea_len ) ;
NTSTATUS cli_set_ea_fnum ( struct cli_state * cli , uint16_t fnum ,
const char * ea_name , const char * ea_val ,
size_t ea_len ) ;
struct tevent_req * cli_get_ea_list_path_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
const char * fname ) ;
NTSTATUS cli_get_ea_list_path_recv ( struct tevent_req * req , TALLOC_CTX * mem_ctx ,
size_t * pnum_eas , struct ea_struct * * peas ) ;
NTSTATUS cli_get_ea_list_path ( struct cli_state * cli , const char * path ,
TALLOC_CTX * ctx ,
size_t * pnum_eas ,
struct ea_struct * * pea_list ) ;
struct tevent_req * cli_posix_open_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ,
int flags ,
mode_t mode ) ;
NTSTATUS cli_posix_open_recv ( struct tevent_req * req , uint16_t * pfnum ) ;
NTSTATUS cli_posix_open ( struct cli_state * cli , const char * fname ,
int flags , mode_t mode , uint16_t * fnum ) ;
struct tevent_req * cli_posix_mkdir_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ,
mode_t mode ) ;
NTSTATUS cli_posix_mkdir_recv ( struct tevent_req * req ) ;
NTSTATUS cli_posix_mkdir ( struct cli_state * cli , const char * fname , mode_t mode ) ;
struct tevent_req * cli_posix_unlink_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ) ;
NTSTATUS cli_posix_unlink_recv ( struct tevent_req * req ) ;
NTSTATUS cli_posix_unlink ( struct cli_state * cli , const char * fname ) ;
struct tevent_req * cli_posix_rmdir_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
const char * fname ) ;
NTSTATUS cli_posix_rmdir_recv ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
NTSTATUS cli_posix_rmdir ( struct cli_state * cli , const char * fname ) ;
struct tevent_req * cli_notify_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli , uint16_t fnum ,
uint32_t buffer_size ,
uint32_t completion_filter , bool recursive ) ;
NTSTATUS cli_notify_recv ( struct tevent_req * req , TALLOC_CTX * mem_ctx ,
uint32_t * pnum_changes ,
struct notify_change * * pchanges ) ;
2012-03-22 12:17:14 +01:00
NTSTATUS cli_notify ( struct cli_state * cli , uint16_t fnum , uint32_t buffer_size ,
uint32_t completion_filter , bool recursive ,
TALLOC_CTX * mem_ctx , uint32_t * pnum_changes ,
struct notify_change * * pchanges ) ;
2011-05-06 11:47:43 +02:00
2011-06-18 09:10:30 +02:00
struct tevent_req * cli_nttrans_create_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-06-18 09:10:30 +02:00
struct cli_state * cli ,
const char * fname ,
uint32_t CreatFlags ,
uint32_t DesiredAccess ,
uint32_t FileAttributes ,
uint32_t ShareAccess ,
uint32_t CreateDisposition ,
uint32_t CreateOptions ,
uint8_t SecurityFlags ,
struct security_descriptor * secdesc ,
struct ea_struct * eas ,
int num_eas ) ;
2014-05-08 20:55:57 -07:00
NTSTATUS cli_nttrans_create_recv ( struct tevent_req * req ,
uint16_t * fnum ,
struct smb_create_returns * cr ) ;
2011-06-18 09:10:30 +02:00
NTSTATUS cli_nttrans_create ( struct cli_state * cli ,
const char * fname ,
uint32_t CreatFlags ,
uint32_t DesiredAccess ,
uint32_t FileAttributes ,
uint32_t ShareAccess ,
uint32_t CreateDisposition ,
uint32_t CreateOptions ,
uint8_t SecurityFlags ,
struct security_descriptor * secdesc ,
struct ea_struct * eas ,
int num_eas ,
2014-05-08 20:55:57 -07:00
uint16_t * pfid ,
struct smb_create_returns * cr ) ;
2011-06-18 09:10:30 +02:00
2011-05-06 11:47:43 +02:00
/* The following definitions come from libsmb/clifsinfo.c */
struct tevent_req * cli_unix_extensions_version_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ) ;
NTSTATUS cli_unix_extensions_version_recv ( struct tevent_req * req ,
uint16_t * pmajor , uint16_t * pminor ,
uint32_t * pcaplow ,
uint32_t * pcaphigh ) ;
2015-05-09 16:59:45 -07:00
NTSTATUS cli_unix_extensions_version ( struct cli_state * cli , uint16_t * pmajor ,
uint16_t * pminor , uint32_t * pcaplow ,
uint32_t * pcaphigh ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_set_unix_extensions_capabilities_send (
TALLOC_CTX * mem_ctx , struct tevent_context * ev , struct cli_state * cli ,
uint16_t major , uint16_t minor , uint32_t caplow , uint32_t caphigh ) ;
NTSTATUS cli_set_unix_extensions_capabilities_recv ( struct tevent_req * req ) ;
NTSTATUS cli_set_unix_extensions_capabilities ( struct cli_state * cli ,
2015-05-09 16:59:45 -07:00
uint16_t major , uint16_t minor ,
2015-05-13 17:26:01 -07:00
uint32_t caplow , uint32_t caphigh ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_get_fs_attr_info_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ) ;
NTSTATUS cli_get_fs_attr_info_recv ( struct tevent_req * req , uint32_t * fs_attr ) ;
NTSTATUS cli_get_fs_attr_info ( struct cli_state * cli , uint32_t * fs_attr ) ;
2011-07-06 13:57:20 +02:00
NTSTATUS cli_get_fs_volume_info ( struct cli_state * cli ,
TALLOC_CTX * mem_ctx , char * * volume_name ,
2015-05-09 16:59:45 -07:00
uint32_t * pserial_number , time_t * pdate ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_get_fs_full_size_info ( struct cli_state * cli ,
uint64_t * total_allocation_units ,
uint64_t * caller_allocation_units ,
uint64_t * actual_allocation_units ,
uint64_t * sectors_per_allocation_unit ,
uint64_t * bytes_per_sector ) ;
NTSTATUS cli_get_posix_fs_info ( struct cli_state * cli ,
2015-05-09 16:59:45 -07:00
uint32_t * optimal_transfer_size ,
uint32_t * block_size ,
2011-05-06 11:47:43 +02:00
uint64_t * total_blocks ,
uint64_t * blocks_available ,
uint64_t * user_blocks_available ,
uint64_t * total_file_nodes ,
uint64_t * free_file_nodes ,
uint64_t * fs_identifier ) ;
2016-05-24 16:58:11 -07:00
struct tevent_req * cli_posix_whoami_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ) ;
NTSTATUS cli_posix_whoami_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
uint64_t * puid ,
uint64_t * pgid ,
uint32_t * pnum_gids ,
uint64_t * * pgids ,
uint32_t * pnum_sids ,
struct dom_sid * * psids ,
bool * pguest ) ;
NTSTATUS cli_posix_whoami ( struct cli_state * cli ,
TALLOC_CTX * mem_ctx ,
uint64_t * puid ,
uint64_t * pgid ,
uint32_t * num_gids ,
uint64_t * * gids ,
uint32_t * num_sids ,
struct dom_sid * * sids ,
bool * pguest ) ;
2011-05-06 11:47:43 +02:00
/* The following definitions come from libsmb/clilist.c */
2019-08-05 13:39:53 -07:00
NTSTATUS is_bad_finfo_name ( const struct cli_state * cli ,
const struct file_info * finfo ) ;
2020-06-03 13:56:37 -07:00
NTSTATUS cli_list_old ( struct cli_state * cli , const char * Mask , uint32_t attribute ,
2020-10-19 10:09:23 +02:00
NTSTATUS ( * fn ) ( struct file_info * ,
2011-05-06 11:47:43 +02:00
const char * , void * ) , void * state ) ;
NTSTATUS cli_list_trans ( struct cli_state * cli , const char * mask ,
2020-06-03 14:07:21 -07:00
uint32_t attribute , int info_level ,
2020-10-30 18:49:52 +01:00
NTSTATUS ( * fn ) (
struct file_info * finfo ,
const char * mask ,
void * private_data ) ,
2011-05-06 11:47:43 +02:00
void * private_data ) ;
struct tevent_req * cli_list_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
const char * mask ,
2020-06-03 14:07:21 -07:00
uint32_t attribute ,
2011-05-06 11:47:43 +02:00
uint16_t info_level ) ;
2020-10-26 09:21:17 +01:00
NTSTATUS cli_list_recv (
struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
struct file_info * * pfinfo ) ;
2020-09-27 11:41:48 +02:00
NTSTATUS cli_list ( struct cli_state * cli ,
const char * mask ,
uint32_t attribute ,
2020-10-19 10:09:23 +02:00
NTSTATUS ( * fn ) ( struct file_info * finfo ,
2020-09-27 11:41:48 +02:00
const char * mask ,
void * private_data ) ,
void * private_data ) ;
2011-05-06 11:47:43 +02:00
/* The following definitions come from libsmb/climessage.c */
struct tevent_req * cli_message_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
const char * host , const char * username ,
const char * message ) ;
NTSTATUS cli_message_recv ( struct tevent_req * req ) ;
NTSTATUS cli_message ( struct cli_state * cli , const char * host ,
const char * username , const char * message ) ;
/* The following definitions come from libsmb/clioplock.c */
2011-08-28 17:16:11 +02:00
struct tevent_req * cli_smb_oplock_break_waiter_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-08-28 17:16:11 +02:00
struct cli_state * cli ) ;
NTSTATUS cli_smb_oplock_break_waiter_recv ( struct tevent_req * req ,
uint16_t * pfnum ,
uint8_t * plevel ) ;
2011-05-06 11:47:43 +02:00
struct tevent_req * cli_oplock_ack_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
uint16_t fnum , uint8_t level ) ;
NTSTATUS cli_oplock_ack_recv ( struct tevent_req * req ) ;
/* The following definitions come from libsmb/cliprint.c */
int cli_print_queue ( struct cli_state * cli ,
void ( * fn ) ( struct print_job_info * ) ) ;
int cli_printjob_del ( struct cli_state * cli , int job ) ;
/* The following definitions come from libsmb/cliquota.c */
NTSTATUS cli_get_quota_handle ( struct cli_state * cli , uint16_t * quota_fnum ) ;
void free_ntquota_list ( SMB_NTQUOTA_LIST * * qt_list ) ;
2016-09-12 22:33:12 +03:00
bool parse_user_quota_record ( const uint8_t * rdata ,
unsigned int rdata_count ,
unsigned int * offset ,
SMB_NTQUOTA_STRUCT * pqt ) ;
2016-09-21 18:37:40 +03:00
bool add_record_to_ntquota_list ( TALLOC_CTX * mem_ctx ,
SMB_NTQUOTA_STRUCT * pqt ,
SMB_NTQUOTA_LIST * * pqt_list ) ;
2016-09-19 21:14:01 +03:00
NTSTATUS parse_user_quota_list ( const uint8_t * curdata ,
uint32_t curdata_size ,
TALLOC_CTX * mem_ctx ,
SMB_NTQUOTA_LIST * * pqt_list ) ;
2016-09-20 06:45:03 +03:00
NTSTATUS parse_fs_quota_buffer ( const uint8_t * rdata ,
unsigned int rdata_count ,
SMB_NTQUOTA_STRUCT * pqt ) ;
2016-09-21 18:37:40 +03:00
NTSTATUS build_user_quota_buffer ( SMB_NTQUOTA_LIST * qt_list ,
uint32_t maxlen ,
TALLOC_CTX * mem_ctx ,
DATA_BLOB * outbuf ,
SMB_NTQUOTA_LIST * * end_ptr ) ;
2016-09-21 23:58:33 +03:00
NTSTATUS build_fs_quota_buffer ( TALLOC_CTX * mem_ctx ,
const SMB_NTQUOTA_STRUCT * pqt ,
DATA_BLOB * blob ,
uint32_t maxlen ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_get_user_quota ( struct cli_state * cli , int quota_fnum ,
SMB_NTQUOTA_STRUCT * pqt ) ;
2016-09-21 18:37:40 +03:00
NTSTATUS cli_set_user_quota ( struct cli_state * cli ,
int quota_fnum ,
SMB_NTQUOTA_LIST * qtl ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_list_user_quota ( struct cli_state * cli , int quota_fnum ,
SMB_NTQUOTA_LIST * * pqt_list ) ;
NTSTATUS cli_get_fs_quota_info ( struct cli_state * cli , int quota_fnum ,
SMB_NTQUOTA_STRUCT * pqt ) ;
NTSTATUS cli_set_fs_quota_info ( struct cli_state * cli , int quota_fnum ,
SMB_NTQUOTA_STRUCT * pqt ) ;
/* The following definitions come from libsmb/clireadwrite.c */
struct tevent_req * cli_read_andx_create ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli , uint16_t fnum ,
off_t offset , size_t size ,
struct tevent_req * * psmbreq ) ;
struct tevent_req * cli_read_andx_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli , uint16_t fnum ,
off_t offset , size_t size ) ;
NTSTATUS cli_read_andx_recv ( struct tevent_req * req , ssize_t * received ,
uint8_t * * rcvbuf ) ;
struct tevent_req * cli_pull_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
uint16_t fnum , off_t start_offset ,
2012-04-05 14:53:08 +10:00
off_t size , size_t window_size ,
2011-05-06 11:47:43 +02:00
NTSTATUS ( * sink ) ( char * buf , size_t n ,
void * priv ) ,
void * priv ) ;
2012-04-05 14:53:08 +10:00
NTSTATUS cli_pull_recv ( struct tevent_req * req , off_t * received ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_pull ( struct cli_state * cli , uint16_t fnum ,
2012-04-05 14:53:08 +10:00
off_t start_offset , off_t size , size_t window_size ,
2011-05-06 11:47:43 +02:00
NTSTATUS ( * sink ) ( char * buf , size_t n , void * priv ) ,
2012-04-05 14:53:08 +10:00
void * priv , off_t * received ) ;
2019-01-03 17:48:39 +13:00
NTSTATUS cli_read_sink ( char * buf , size_t n , void * priv ) ;
2018-04-04 16:18:28 +02:00
struct tevent_req * cli_read_send (
TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
uint16_t fnum ,
char * buf ,
off_t offset ,
size_t size ) ;
NTSTATUS cli_read_recv ( struct tevent_req * req , size_t * received ) ;
2011-07-19 11:11:27 +02:00
NTSTATUS cli_read ( struct cli_state * cli , uint16_t fnum ,
char * buf , off_t offset , size_t size ,
size_t * nread ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_smbwrite ( struct cli_state * cli , uint16_t fnum , char * buf ,
off_t offset , size_t size1 , size_t * ptotal ) ;
struct tevent_req * cli_write_andx_create ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli , uint16_t fnum ,
uint16_t mode , const uint8_t * buf ,
off_t offset , size_t size ,
struct tevent_req * * reqs_before ,
int num_reqs_before ,
struct tevent_req * * psmbreq ) ;
struct tevent_req * cli_write_andx_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 09:59:58 +01:00
struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli , uint16_t fnum ,
uint16_t mode , const uint8_t * buf ,
off_t offset , size_t size ) ;
NTSTATUS cli_write_andx_recv ( struct tevent_req * req , size_t * pwritten ) ;
2018-12-07 14:26:43 +01:00
struct tevent_req * cli_write_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli , uint16_t fnum ,
uint16_t mode , const uint8_t * buf ,
off_t offset , size_t size ) ;
NTSTATUS cli_write_recv ( struct tevent_req * req , size_t * pwritten ) ;
2018-04-04 16:32:01 +02:00
struct tevent_req * cli_writeall_send (
TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
uint16_t fnum ,
uint16_t mode ,
const uint8_t * buf ,
off_t offset ,
size_t size ) ;
NTSTATUS cli_writeall_recv ( struct tevent_req * req , size_t * pwritten ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_writeall ( struct cli_state * cli , uint16_t fnum , uint16_t mode ,
const uint8_t * buf , off_t offset , size_t size ,
size_t * pwritten ) ;
2013-02-18 09:59:58 +01:00
struct tevent_req * cli_push_send ( TALLOC_CTX * mem_ctx , struct tevent_context * ev ,
2011-05-06 11:47:43 +02:00
struct cli_state * cli ,
uint16_t fnum , uint16_t mode ,
off_t start_offset , size_t window_size ,
size_t ( * source ) ( uint8_t * buf , size_t n ,
void * priv ) ,
void * priv ) ;
NTSTATUS cli_push_recv ( struct tevent_req * req ) ;
NTSTATUS cli_push ( struct cli_state * cli , uint16_t fnum , uint16_t mode ,
off_t start_offset , size_t window_size ,
size_t ( * source ) ( uint8_t * buf , size_t n , void * priv ) ,
void * priv ) ;
2015-05-27 23:13:15 +01:00
NTSTATUS cli_splice ( struct cli_state * srccli , struct cli_state * dstcli ,
uint16_t src_fnum , uint16_t dst_fnum ,
off_t size ,
off_t src_offset , off_t dst_offset ,
off_t * written ,
int ( * splice_cb ) ( off_t n , void * priv ) , void * priv ) ;
2011-05-06 11:47:43 +02:00
/* The following definitions come from libsmb/clisecdesc.c */
2020-11-09 21:37:10 +01:00
struct tevent_req * cli_query_security_descriptor_send (
TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
uint16_t fnum ,
uint32_t sec_info ) ;
NTSTATUS cli_query_security_descriptor_recv (
struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
struct security_descriptor * * sd ) ;
2012-11-30 13:52:53 +01:00
NTSTATUS cli_query_security_descriptor ( struct cli_state * cli ,
uint16_t fnum ,
uint32_t sec_info ,
TALLOC_CTX * mem_ctx ,
struct security_descriptor * * sd ) ;
2011-07-22 15:11:31 +02:00
NTSTATUS cli_query_secdesc ( struct cli_state * cli , uint16_t fnum ,
TALLOC_CTX * mem_ctx , struct security_descriptor * * sd ) ;
2020-11-10 20:55:29 +01:00
struct tevent_req * cli_set_security_descriptor_send (
TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
uint16_t fnum ,
uint32_t sec_info ,
const struct security_descriptor * sd ) ;
NTSTATUS cli_set_security_descriptor_recv ( struct tevent_req * req ) ;
2012-11-30 13:52:53 +01:00
NTSTATUS cli_set_security_descriptor ( struct cli_state * cli ,
uint16_t fnum ,
uint32_t sec_info ,
const struct security_descriptor * sd ) ;
2011-05-06 11:47:43 +02:00
NTSTATUS cli_set_secdesc ( struct cli_state * cli , uint16_t fnum ,
2011-07-23 09:55:06 +02:00
const struct security_descriptor * sd ) ;
2011-05-06 11:47:43 +02:00
2019-03-01 09:49:17 +01:00
NTSTATUS cli_query_mxac ( struct cli_state * cli ,
const char * filename ,
uint32_t * mxac ) ;
2011-05-06 11:47:43 +02:00
/* The following definitions come from libsmb/clistr.c */
2016-08-18 17:15:01 -07:00
bool clistr_is_previous_version_path ( const char * path ,
const char * * startp ,
const char * * endp ,
time_t * ptime ) ;
2011-05-06 11:47:43 +02:00
/* The following definitions come from libsmb/clitrans.c */
struct tevent_req * cli_trans_send (
2011-10-26 15:43:08 +02:00
TALLOC_CTX * mem_ctx , struct tevent_context * ev ,
2016-08-18 12:45:32 -07:00
struct cli_state * cli , uint16_t additional_flags2 , uint8_t cmd ,
2011-05-06 11:47:43 +02:00
const char * pipe_name , uint16_t fid , uint16_t function , int flags ,
uint16_t * setup , uint8_t num_setup , uint8_t max_setup ,
uint8_t * param , uint32_t num_param , uint32_t max_param ,
uint8_t * data , uint32_t num_data , uint32_t max_data ) ;
NTSTATUS cli_trans_recv ( struct tevent_req * req , TALLOC_CTX * mem_ctx ,
uint16_t * recv_flags2 ,
uint16_t * * setup , uint8_t min_setup ,
uint8_t * num_setup ,
uint8_t * * param , uint32_t min_param ,
uint32_t * num_param ,
uint8_t * * data , uint32_t min_data ,
uint32_t * num_data ) ;
NTSTATUS cli_trans ( TALLOC_CTX * mem_ctx , struct cli_state * cli ,
uint8_t trans_cmd ,
const char * pipe_name , uint16_t fid , uint16_t function ,
int flags ,
uint16_t * setup , uint8_t num_setup , uint8_t max_setup ,
uint8_t * param , uint32_t num_param , uint32_t max_param ,
uint8_t * data , uint32_t num_data , uint32_t max_data ,
uint16_t * recv_flags2 ,
uint16_t * * rsetup , uint8_t min_rsetup , uint8_t * num_rsetup ,
uint8_t * * rparam , uint32_t min_rparam , uint32_t * num_rparam ,
uint8_t * * rdata , uint32_t min_rdata , uint32_t * num_rdata ) ;
2011-06-23 15:33:58 +02:00
/* The following definitions come from libsmb/reparse_symlink.c */
bool symlink_reparse_buffer_marshall (
const char * substitute , const char * printname , uint32_t flags ,
TALLOC_CTX * mem_ctx , uint8_t * * pdst , size_t * pdstlen ) ;
bool symlink_reparse_buffer_parse (
const uint8_t * src , size_t srclen , TALLOC_CTX * mem_ctx ,
char * * psubstitute_name , char * * pprint_name , uint32_t * pflags ) ;
2011-06-23 16:49:17 +02:00
/* The following definitions come from libsmb/clisymlink.c */
struct tevent_req * cli_symlink_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
const char * oldpath ,
const char * newpath ,
uint32_t flags ) ;
NTSTATUS cli_symlink_recv ( struct tevent_req * req ) ;
NTSTATUS cli_symlink ( struct cli_state * cli , const char * oldname ,
const char * newname , uint32_t flags ) ;
2011-06-30 15:06:46 +02:00
struct tevent_req * cli_readlink_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct cli_state * cli ,
const char * fname ) ;
NTSTATUS cli_readlink_recv ( struct tevent_req * req , TALLOC_CTX * mem_ctx ,
char * * psubstitute_name , char * * pprint_name ,
uint32_t * pflags ) ;
NTSTATUS cli_readlink ( struct cli_state * cli , const char * fname ,
TALLOC_CTX * mem_ctx , char * * psubstitute_name ,
char * * pprint_name , uint32_t * pflags ) ;
2017-05-26 15:01:17 +01:00
NTSTATUS fill_quota_buffer ( TALLOC_CTX * mem_ctx ,
SMB_NTQUOTA_LIST * tmp_list ,
bool return_single ,
uint32_t max_data ,
DATA_BLOB * blob ,
SMB_NTQUOTA_LIST * * end_ptr ) ;
2017-08-18 16:10:06 +02:00
/* The following definitions come from libsmb/passchange.c */
NTSTATUS remote_password_change ( const char * remote_machine ,
const char * domain , const char * user_name ,
const char * old_passwd , const char * new_passwd ,
char * * err_str ) ;
2011-05-06 11:47:43 +02:00
# endif /* _LIBSMB_PROTO_H_ */