NTSTATUS cli_tdis(struct cli_state *cli);
NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss,
uint16_t port, int name_type, const char *myname,
- int signing_state, int flags, struct cli_state **pcli);
+ enum smb_signing_setting signing_state, int flags, struct cli_state **pcli);
NTSTATUS cli_start_connection(struct cli_state **output_cli,
const char *my_name,
const char *dest_host,
const struct sockaddr_storage *dest_ss, int port,
- int signing_state, int flags);
+ enum smb_signing_setting signing_state, int flags);
NTSTATUS cli_smb1_setup_encryption(struct cli_state *cli,
struct cli_credentials *creds);
struct tevent_req *cli_full_connection_creds_send(
const struct sockaddr_storage *dest_ss, int port,
const char *service, const char *service_type,
struct cli_credentials *creds,
- int flags, int signing_state);
+ int flags);
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 *service, const char *service_type,
struct cli_credentials *creds,
int flags,
- int signing_state);
-NTSTATUS cli_full_connection(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,
- const char *user, const char *domain,
- const char *password, int flags,
- int signing_state);
+ enum smb_signing_setting signing_state);
NTSTATUS cli_raw_tcon(struct cli_state *cli,
const char *service, const char *pass, const char *dev,
uint16_t *max_xmit, uint16_t *tid);
struct sockaddr_storage *mb_ip,
const struct user_auth_info *user_info,
char **pp_workgroup_out);
-struct cli_state *get_ipc_connect_master_ip_bcast(TALLOC_CTX *ctx,
- const struct user_auth_info *user_info,
- char **pp_workgroup_out);
/* The following definitions come from libsmb/clidfs.c */
NTSTATUS cli_cm_force_encryption_creds(struct cli_state *c,
struct cli_credentials *creds,
const char *sharename);
-NTSTATUS cli_cm_force_encryption(struct cli_state *c,
- const char *username,
- const char *password,
- const char *domain,
- const char *sharename);
NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
struct cli_state *referring_cli,
const char *server,
const struct user_auth_info *auth_info,
bool force_encrypt,
int max_protocol,
+ const struct sockaddr_storage *dest_ss,
int port,
int name_type,
struct cli_state **pcli);
/* The following definitions come from libsmb/clientgen.c */
-int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
bool cli_set_backup_intent(struct cli_state *cli, bool flag);
extern struct GUID cli_state_client_guid;
struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
int fd,
const char *remote_name,
- int signing_state,
+ enum smb_signing_setting signing_state,
int flags);
void cli_nt_pipes_close(struct cli_state *cli);
void cli_shutdown(struct cli_state *cli);
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);
-bool is_andx_req(uint8_t cmd);
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,
/* The following definitions come from libsmb/clierror.c */
-const char *cli_errstr(struct cli_state *cli);
NTSTATUS cli_nt_error(struct cli_state *cli);
void cli_dos_error(struct cli_state *cli, uint8_t *eclass, uint32_t *ecode);
int cli_errno(struct cli_state *cli);
const char *path,
uint8_t *data,
size_t data_len);
+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);
struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct tevent_req *cli_posix_readlink_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
- const char *fname,
- size_t len);
-NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
- char *retpath, size_t len);
-NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname,
- char *linkpath, size_t len);
+ const char *fname);
+NTSTATUS cli_posix_readlink_recv(
+ 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);
struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
const void *acl_buf,
size_t acl_buf_size);
struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct cli_state *cli,
- const char *fname);
-NTSTATUS cli_posix_stat_recv(struct tevent_req *req,
- SMB_STRUCT_STAT *sbuf);
+ struct tevent_context *ev,
+ struct cli_state *cli,
+ const char *fname,
+ SMB_STRUCT_STAT *sbuf);
+NTSTATUS cli_posix_stat_recv(struct tevent_req *req);
NTSTATUS cli_posix_stat(struct cli_state *cli,
const char *fname,
SMB_STRUCT_STAT *sbuf);
NTSTATUS cli_ntrename_recv(struct tevent_req *req);
NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
-struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct cli_state *cli,
- const char *fname_src,
- const char *fname_dst);
-NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req);
-NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst);
+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);
struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
const char *fname,
- uint16_t mayhave_attrs);
+ uint32_t mayhave_attrs);
NTSTATUS cli_unlink_recv(struct tevent_req *req);
-NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs);
+NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint32_t mayhave_attrs);
struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
uint32_t ShareAccess,
uint32_t CreateDisposition,
uint32_t CreateOptions,
+ uint32_t ImpersonationLevel,
uint8_t SecurityFlags);
NTSTATUS cli_ntcreate_recv(struct tevent_req *req,
uint16_t *pfnum,
NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
uint32_t offset, uint32_t len,
int timeout, unsigned char locktype);
+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);
+
NTSTATUS cli_lock32(struct cli_state *cli, uint16_t fnum, uint32_t offset,
uint32_t len, int timeout, enum brl_type lock_type);
struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
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);
-NTSTATUS cli_lock64(struct cli_state *cli, uint16_t fnum,
- uint64_t offset, uint64_t len, int timeout,
- enum brl_type lock_type);
-struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct cli_state *cli,
- uint16_t fnum,
- uint64_t offset,
- uint64_t len);
-NTSTATUS cli_unlock64_recv(struct tevent_req *req);
-NTSTATUS cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
struct cli_state *cli,
uint16_t fnum);
NTSTATUS cli_getattrE_recv(struct tevent_req *req,
- uint16_t *attr,
+ uint32_t *pattr,
off_t *size,
time_t *change_time,
time_t *access_time,
time_t *write_time);
-NTSTATUS cli_getattrE(struct cli_state *cli,
- uint16_t fnum,
- uint16_t *attr,
- off_t *size,
- time_t *change_time,
- time_t *access_time,
- time_t *write_time);
struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
struct cli_state *cli,
const char *fname);
NTSTATUS cli_getatr_recv(struct tevent_req *req,
- uint16_t *attr,
+ uint32_t *pattr,
off_t *size,
time_t *write_time);
NTSTATUS cli_getatr(struct cli_state *cli,
const char *fname,
- uint16_t *attr,
+ uint32_t *pattr,
off_t *size,
time_t *write_time);
struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
const char *fname,
- uint16_t attr,
+ uint32_t attr,
time_t mtime);
NTSTATUS cli_setatr_recv(struct tevent_req *req);
NTSTATUS cli_setatr(struct cli_state *cli,
const char *fname,
- uint16_t attr,
+ uint32_t attr,
time_t mtime);
struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
/* The following definitions come from libsmb/clilist.c */
-NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16_t attribute,
+NTSTATUS is_bad_finfo_name(const struct cli_state *cli,
+ const struct file_info *finfo);
+
+NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint32_t attribute,
NTSTATUS (*fn)(const char *, struct file_info *,
const char *, void *), void *state);
NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
- uint16_t attribute, int info_level,
+ uint32_t attribute, int info_level,
NTSTATUS (*fn)(const char *mnt, struct file_info *finfo,
const char *mask, void *private_data),
void *private_data);
struct tevent_context *ev,
struct cli_state *cli,
const char *mask,
- uint16_t attribute,
+ uint32_t attribute,
uint16_t info_level);
NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct file_info **finfo, size_t *num_finfo);
-NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint16_t attribute,
+NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint32_t attribute,
NTSTATUS (*fn)(const char *, struct file_info *, const char *,
void *), void *state);
off_t start_offset, off_t size, size_t window_size,
NTSTATUS (*sink)(char *buf, size_t n, void *priv),
void *priv, off_t *received);
+NTSTATUS cli_read_sink(char *buf, size_t n, void *priv);
+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);
NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum,
char *buf, off_t offset, size_t size,
size_t *nread);
off_t offset, size_t size);
NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten);
+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);
+
+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);
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);
NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
const struct security_descriptor *sd);
+NTSTATUS cli_query_mxac(struct cli_state *cli,
+ const char *filename,
+ uint32_t *mxac);
+
/* The following definitions come from libsmb/clistr.c */
-size_t clistr_pull_talloc(TALLOC_CTX *ctx,
- const char *base,
- uint16_t flags2,
- char **pp_dest,
- const void *src,
- int src_len,
- int flags);
bool clistr_is_previous_version_path(const char *path,
const char **startp,
const char **endp,