summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/auth/auth_domain.c1
-rw-r--r--source3/auth/auth_server.c1
-rw-r--r--source3/client/client.c1
-rw-r--r--source3/client/clitar.c1
-rw-r--r--source3/client/smbspool.c1
-rw-r--r--source3/include/proto.h812
-rw-r--r--source3/lib/netapi/cm.c1
-rw-r--r--source3/libgpo/gpo_filesync.c1
-rw-r--r--source3/libnet/libnet_join.c1
-rw-r--r--source3/libsmb/async_smb.c1
-rw-r--r--source3/libsmb/cli_np_tstream.c1
-rw-r--r--source3/libsmb/cliconnect.c1
-rw-r--r--source3/libsmb/clidfs.c1
-rw-r--r--source3/libsmb/clidgram.c1
-rw-r--r--source3/libsmb/clientgen.c1
-rw-r--r--source3/libsmb/clierror.c1
-rw-r--r--source3/libsmb/clifile.c1
-rw-r--r--source3/libsmb/clifsinfo.c1
-rw-r--r--source3/libsmb/clilist.c1
-rw-r--r--source3/libsmb/climessage.c1
-rw-r--r--source3/libsmb/clioplock.c1
-rw-r--r--source3/libsmb/cliprint.c1
-rw-r--r--source3/libsmb/cliquota.c1
-rw-r--r--source3/libsmb/clirap.c1
-rw-r--r--source3/libsmb/clirap2.c1
-rw-r--r--source3/libsmb/clireadwrite.c1
-rw-r--r--source3/libsmb/clisecdesc.c1
-rw-r--r--source3/libsmb/clisigning.c1
-rw-r--r--source3/libsmb/clistr.c1
-rw-r--r--source3/libsmb/clitrans.c1
-rw-r--r--source3/libsmb/libsmb.h23
-rw-r--r--source3/libsmb/libsmb_cache.c1
-rw-r--r--source3/libsmb/libsmb_context.c1
-rw-r--r--source3/libsmb/libsmb_dir.c1
-rw-r--r--source3/libsmb/libsmb_file.c1
-rw-r--r--source3/libsmb/libsmb_misc.c1
-rw-r--r--source3/libsmb/libsmb_printjob.c1
-rw-r--r--source3/libsmb/libsmb_server.c1
-rw-r--r--source3/libsmb/libsmb_stat.c1
-rw-r--r--source3/libsmb/libsmb_xattr.c1
-rw-r--r--source3/libsmb/passchange.c1
-rw-r--r--source3/libsmb/proto.h833
-rw-r--r--source3/libsmb/smb_seal.c1
-rw-r--r--source3/libsmb/trusts_util.c1
-rw-r--r--source3/nmbd/nmbd_packets.c1
-rw-r--r--source3/nmbd/nmbd_synclists.c1
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c1
-rw-r--r--source3/rpcclient/cmd_spoolss.c1
-rw-r--r--source3/rpcclient/rpcclient.c1
-rw-r--r--source3/smbd/ntquotas.c1
-rw-r--r--source3/smbd/nttrans.c1
-rw-r--r--source3/smbd/process.c1
-rw-r--r--source3/smbd/seal.c1
-rw-r--r--source3/torture/denytest.c1
-rw-r--r--source3/torture/locktest.c1
-rw-r--r--source3/torture/locktest2.c1
-rw-r--r--source3/torture/mangle_test.c1
-rw-r--r--source3/torture/masktest.c1
-rw-r--r--source3/torture/nbench.c1
-rw-r--r--source3/torture/nbio.c1
-rw-r--r--source3/torture/scanner.c1
-rw-r--r--source3/torture/test_async_echo.c1
-rw-r--r--source3/torture/test_case_insensitive.c1
-rw-r--r--source3/torture/test_notify_online.c1
-rw-r--r--source3/torture/test_posix_append.c1
-rw-r--r--source3/torture/torture.c1
-rw-r--r--source3/torture/utable.c1
-rw-r--r--source3/utils/net_ads.c1
-rw-r--r--source3/utils/net_dom.c1
-rw-r--r--source3/utils/net_rap.c1
-rw-r--r--source3/utils/net_rpc.c1
-rw-r--r--source3/utils/net_rpc_join.c1
-rw-r--r--source3/utils/net_rpc_printer.c1
-rw-r--r--source3/utils/net_rpc_shell.c1
-rw-r--r--source3/utils/net_rpc_trust.c1
-rw-r--r--source3/utils/net_time.c1
-rw-r--r--source3/utils/net_util.c1
-rw-r--r--source3/utils/netlookup.c1
-rw-r--r--source3/utils/smbcacls.c1
-rw-r--r--source3/utils/smbcquotas.c1
-rw-r--r--source3/utils/smbtree.c1
-rw-r--r--source3/web/diagnose.c1
-rw-r--r--source3/winbindd/winbindd_cm.c1
83 files changed, 936 insertions, 812 deletions
diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c
index 5824d91a0a..8a716038a8 100644
--- a/source3/auth/auth_domain.c
+++ b/source3/auth/auth_domain.c
@@ -26,6 +26,7 @@
#include "rpc_client/cli_netlogon.h"
#include "secrets.h"
#include "passdb.h"
+#include "libsmb/libsmb.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c
index 37705c7b19..3334fde9bb 100644
--- a/source3/auth/auth_server.c
+++ b/source3/auth/auth_server.c
@@ -22,6 +22,7 @@
#include "auth.h"
#include "system/passwd.h"
#include "smbd/smbd.h"
+#include "libsmb/libsmb.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
diff --git a/source3/client/client.c b/source3/client/client.c
index 836d1016be..45494efe62 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -32,6 +32,7 @@
#include "../libcli/smbreadline/smbreadline.h"
#include "../libcli/security/security.h"
#include "system/select.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "trans2.h"
#include "libsmb/nmblib.h"
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index f04071f2dc..2a78a187c8 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -38,6 +38,7 @@
#include "system/filesys.h"
#include "clitar.h"
#include "client/client_proto.h"
+#include "libsmb/libsmb.h"
static int clipfind(char **aret, int ret, char *tok);
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index 5a736c4930..e16086dd67 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "system/passwd.h"
+#include "libsmb/libsmb.h"
/*
* Starting with CUPS 1.3, Kerberos support is provided by cupsd including
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 352e092f4d..c7d0827665 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -964,735 +964,6 @@ void wins_srv_tags_free(char **list);
struct in_addr wins_srv_ip_tag(const char *tag, struct in_addr src_ip);
unsigned wins_srv_count_tag(const char *tag);
-/* The following definitions come from libsmb/cliconnect.c */
-
-ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
- const char *pass, const char *user_domain,
- const char * dest_realm);
-
-NTSTATUS cli_session_setup(struct cli_state *cli,
- const char *user,
- const char *pass, int passlen,
- const char *ntpass, int ntpasslen,
- const char *workgroup);
-struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli,
- struct tevent_req **psmbreq);
-struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli);
-NTSTATUS cli_session_setup_guest_recv(struct tevent_req *req);
-struct tevent_req *cli_ulogoff_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct cli_state *cli);
-NTSTATUS cli_ulogoff_recv(struct tevent_req *req);
-NTSTATUS cli_ulogoff(struct cli_state *cli);
-struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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);
-struct tevent_req *cli_tdis_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct cli_state *cli);
-NTSTATUS cli_tdis_recv(struct tevent_req *req);
-NTSTATUS cli_tdis(struct cli_state *cli);
-NTSTATUS cli_negprot(struct cli_state *cli);
-struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli);
-NTSTATUS cli_negprot_recv(struct tevent_req *req);
-bool cli_session_request(struct cli_state *cli,
- struct nmb_name *calling, struct nmb_name *called);
-NTSTATUS cli_connect(struct cli_state *cli,
- const char *host,
- struct sockaddr_storage *dest_ss);
-NTSTATUS cli_start_connection(struct cli_state **output_cli,
- const char *my_name,
- const char *dest_host,
- struct sockaddr_storage *dest_ss, int port,
- int signing_state, int flags);
-NTSTATUS cli_full_connection(struct cli_state **output_cli,
- const char *my_name,
- const char *dest_host,
- 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);
-bool attempt_netbios_session_request(struct cli_state **ppcli, const char *srchost, const char *desthost,
- struct sockaddr_storage *pdest_ss);
-NTSTATUS cli_raw_tcon(struct cli_state *cli,
- const char *service, const char *pass, const char *dev,
- uint16 *max_xmit, uint16 *tid);
-struct cli_state *get_ipc_connect(char *server,
- struct sockaddr_storage *server_ss,
- const struct user_auth_info *user_info);
-struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx,
- 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(struct cli_state *c,
- const char *username,
- const char *password,
- const char *domain,
- const char *sharename);
-struct cli_state *cli_cm_open(TALLOC_CTX *ctx,
- struct cli_state *referring_cli,
- const char *server,
- const char *share,
- const struct user_auth_info *auth_info,
- bool show_hdr,
- bool force_encrypt,
- int max_protocol,
- int port,
- int name_type);
-void cli_cm_display(const struct cli_state *c);
-struct client_dfs_referral;
-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);
-bool cli_resolve_path(TALLOC_CTX *ctx,
- const char *mountpt,
- const struct user_auth_info *dfs_auth_info,
- struct cli_state *rootcli,
- const char *path,
- struct cli_state **targetcli,
- char **pp_targetpath);
-
-bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
- struct cli_state *cli,
- const char *sharename,
- char **pp_newserver,
- char **pp_newshare,
- bool force_encrypt,
- const char *username,
- const char *password,
- const char *domain);
-
-/* 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);
-void cli_set_port(struct cli_state *cli, int port);
-bool cli_state_seqnum_persistent(struct cli_state *cli,
- uint16_t mid);
-bool cli_state_seqnum_remove(struct cli_state *cli,
- uint16_t mid);
-bool cli_receive_smb(struct cli_state *cli);
-bool cli_send_smb(struct cli_state *cli);
-void cli_setup_packet_buf(struct cli_state *cli, char *buf);
-void cli_setup_packet(struct cli_state *cli);
-void cli_setup_bcc(struct cli_state *cli, void *p);
-NTSTATUS cli_set_domain(struct cli_state *cli, const char *domain);
-NTSTATUS cli_set_username(struct cli_state *cli, const char *username);
-NTSTATUS cli_set_password(struct cli_state *cli, const char *password);
-NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password);
-struct cli_state *cli_initialise(void);
-struct cli_state *cli_initialise_ex(int signing_state);
-void cli_nt_pipes_close(struct cli_state *cli);
-void cli_shutdown(struct cli_state *cli);
-void cli_sockopt(struct cli_state *cli, const char *options);
-uint16 cli_setpid(struct cli_state *cli, uint16 pid);
-bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
-struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
- 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);
-bool cli_ucs2(struct cli_state *cli);
-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,
- 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 */
-
-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 *eclass, uint32 *ecode);
-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);
-NTSTATUS cli_get_nt_error(struct cli_state *cli);
-void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
-void cli_reset_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);
-
-struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- 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,
- struct event_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);
-struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- 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);
-struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli,
- const char *fname);
-NTSTATUS cli_posix_getfacl_recv(struct tevent_req *req,
- TALLOC_CTX *mem_ctx,
- size_t *prb_size,
- char **retbuf);
-NTSTATUS cli_posix_getfacl(struct cli_state *cli,
- const char *fname,
- TALLOC_CTX *mem_ctx,
- size_t *prb_size,
- char **retbuf);
-struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli,
- const char *fname);
-NTSTATUS cli_posix_stat_recv(struct tevent_req *req,
- SMB_STRUCT_STAT *sbuf);
-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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- struct cli_state *cli,
- const char *fname_src,
- const char *fname_dst);
-NTSTATUS cli_rename_recv(struct tevent_req *req);
-NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
-struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- 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);
-
-struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx,
- struct event_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_unlink_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli,
- const char *fname,
- uint16_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);
-
-struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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);
-NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum);
-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,
- uint16_t *pfid);
-uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
- size_t str_len, size_t *pconverted_size);
-uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix,
- const uint8_t *bytes, size_t num_bytes);
-struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli, const char *fname,
- int flags, int share_mode,
- struct tevent_req **psmbreq);
-struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
- struct cli_state *cli, const char *fname,
- int flags, int share_mode);
-NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum);
-NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
-struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli, uint16_t fnum,
- struct tevent_req **psubreq);
-struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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);
-bool cli_lock(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,
- struct event_context *ev,
- 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);
-bool 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 event_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 event_context *ev,
- 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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- struct cli_state *cli,
- uint16_t fnum);
-NTSTATUS cli_getattrE_recv(struct tevent_req *req,
- uint16_t *attr,
- SMB_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,
- SMB_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 event_context *ev,
- 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,
- struct event_context *ev,
- struct cli_state *cli,
- const char *fname);
-NTSTATUS cli_getatr_recv(struct tevent_req *req,
- uint16_t *attr,
- SMB_OFF_T *size,
- time_t *write_time);
-NTSTATUS cli_getatr(struct cli_state *cli,
- const char *fname,
- uint16_t *attr,
- SMB_OFF_T *size,
- time_t *write_time);
-struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- struct cli_state *cli,
- const char *fname,
- uint16_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,
- time_t mtime);
-struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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);
-struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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);
-
-/* 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);
-NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16 *pmajor,
- uint16 *pminor, uint32 *pcaplow,
- uint32 *pcaphigh);
-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,
- uint16 major, uint16 minor,
- uint32 caplow, uint32 caphigh);
-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);
-NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name,
- uint32 *pserial_number, time_t *pdate);
-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,
- uint32 *optimal_transfer_size,
- uint32 *block_size,
- 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);
-NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
- const char *user,
- const char *pass,
- const char *domain);
-NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli);
-NTSTATUS cli_force_encryption(struct cli_state *c,
- const char *username,
- const char *password,
- const char *domain);
-
-/* The following definitions come from libsmb/clilist.c */
-
-NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16 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,
- NTSTATUS (*fn)(const char *mnt, struct file_info *finfo,
- const char *mask, void *private_data),
- void *private_data);
-struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct cli_state *cli,
- const char *mask,
- uint16_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 attribute,
- NTSTATUS (*fn)(const char *, struct file_info *, const char *,
- void *), void *state);
-
-/* 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 */
-
-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);
-NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level);
-void cli_oplock_handler(struct cli_state *cli,
- NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char));
-
-/* 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);
-NTSTATUS cli_get_user_quota(struct cli_state *cli, int quota_fnum,
- SMB_NTQUOTA_STRUCT *pqt);
-NTSTATUS cli_set_user_quota(struct cli_state *cli, int quota_fnum,
- SMB_NTQUOTA_STRUCT *pqt);
-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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- 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,
- struct event_context *ev,
- struct cli_state *cli,
- uint16_t fnum, off_t start_offset,
- SMB_OFF_T size, size_t window_size,
- NTSTATUS (*sink)(char *buf, size_t n,
- void *priv),
- void *priv);
-NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received);
-NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
- off_t start_offset, SMB_OFF_T size, size_t window_size,
- NTSTATUS (*sink)(char *buf, size_t n, void *priv),
- void *priv, SMB_OFF_T *received);
-ssize_t cli_read(struct cli_state *cli, uint16_t fnum, char *buf,
- off_t offset, size_t size);
-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,
- struct event_context *ev,
- 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,
- struct event_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_andx_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);
-
-struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
- 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);
-
-/* The following definitions come from libsmb/clisecdesc.c */
-
-struct security_descriptor *cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
- TALLOC_CTX *mem_ctx);
-NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
- struct security_descriptor *sd);
-
/* The following definitions come from libsmb/clispnego.c */
DATA_BLOB spnego_gen_negTokenInit(TALLOC_CTX *ctx,
@@ -1736,57 +1007,6 @@ DATA_BLOB spnego_gen_auth_response_and_mic(TALLOC_CTX *ctx,
bool spnego_mech_list_blob(TALLOC_CTX *mem_ctx,
char **oid_list, DATA_BLOB *data);
-/* The following definitions come from libsmb/clistr.c */
-
-size_t clistr_push_fn(struct cli_state *cli,
- void *dest,
- const char *src,
- int dest_len,
- int flags);
-size_t clistr_pull_fn(const char *inbuf,
- char *dest,
- const void *src,
- int dest_len,
- int src_len,
- int flags);
-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);
-size_t clistr_align_out(struct cli_state *cli, const void *p, int flags);
-
-/* The following definitions come from libsmb/clitrans.c */
-
-struct tevent_req *cli_trans_send(
- TALLOC_CTX *mem_ctx, struct event_context *ev,
- struct cli_state *cli, uint8_t 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);
-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);
-
/* The following definitions come from libsmb/conncache.c */
NTSTATUS check_negative_conn_cache( const char *domain, const char *server);
@@ -1964,38 +1184,6 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3);
struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid);
bool netsamlogon_cache_have(const struct dom_sid *user_sid);
-/* The following definitions come from libsmb/smb_seal.c */
-
-NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16 *p_enc_ctx_num);
-bool common_encryption_on(struct smb_trans_enc_state *es);
-NTSTATUS common_ntlm_decrypt_buffer(struct ntlmssp_state *ntlmssp_state, char *buf);
-NTSTATUS common_ntlm_encrypt_buffer(struct ntlmssp_state *ntlmssp_state,
- uint16 enc_ctx_num,
- char *buf,
- char **ppbuf_out);
-NTSTATUS common_encrypt_buffer(struct smb_trans_enc_state *es, char *buffer, char **buf_out);
-NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf);
-void common_free_encryption_state(struct smb_trans_enc_state **pp_es);
-void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf);
-bool cli_encryption_on(struct cli_state *cli);
-void cli_free_encryption_context(struct cli_state *cli);
-void cli_free_enc_buffer(struct cli_state *cli, char *buf);
-NTSTATUS cli_decrypt_message(struct cli_state *cli);
-NTSTATUS cli_encrypt_message(struct cli_state *cli, char *buf, char **buf_out);
-
-/* The following definitions come from libsmb/clisigning.c */
-
-bool cli_simple_set_signing(struct cli_state *cli,
- const DATA_BLOB user_session_key,
- const DATA_BLOB response);
-bool cli_temp_set_signing(struct cli_state *cli);
-void cli_calculate_sign_mac(struct cli_state *cli, char *buf, uint32_t *seqnum);
-bool cli_check_sign_mac(struct cli_state *cli, const char *buf, uint32_t seqnum);
-bool client_is_signing_on(struct cli_state *cli);
-bool client_is_signing_allowed(struct cli_state *cli);
-bool client_is_signing_mandatory(struct cli_state *cli);
-void cli_set_signing_negotiated(struct cli_state *cli);
-
/* The following definitions come from libsmb/smberr.c */
const char *smb_dos_err_name(uint8 e_class, uint16 num);
diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c
index 290194ba2d..4c9bfcb419 100644
--- a/source3/lib/netapi/cm.c
+++ b/source3/lib/netapi/cm.c
@@ -22,6 +22,7 @@
#include "lib/netapi/netapi.h"
#include "lib/netapi/netapi_private.h"
+#include "libsmb/libsmb.h"
#include "rpc_client/cli_pipe.h"
/********************************************************************
diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c
index be656eea7e..91e1c2725a 100644
--- a/source3/libgpo/gpo_filesync.c
+++ b/source3/libgpo/gpo_filesync.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "system/filesys.h"
+#include "libsmb/libsmb.h"
#include "../libgpo/gpo.h"
#include "libgpo/gpo_proto.h"
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index c3693a8925..b65bac907d 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -38,6 +38,7 @@
#include "krb5_env.h"
#include "../libcli/security/security.h"
#include "passdb.h"
+#include "libsmb/libsmb.h"
/****************************************************************
****************************************************************/
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 0a7697291e..0e4392460b 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "../lib/async_req/async_sock.h"
#include "../lib/util/tevent_ntstatus.h"
#include "../lib/util/tevent_unix.h"
diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c
index 667f7c2554..99a7e4fd07 100644
--- a/source3/libsmb/cli_np_tstream.c
+++ b/source3/libsmb/cli_np_tstream.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "system/network.h"
+#include "libsmb/libsmb.h"
#include "../lib/util/tevent_ntstatus.h"
#include "../lib/tsocket/tsocket.h"
#include "../lib/tsocket/tsocket_internal.h"
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 1383978c91..7f48aee998 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "popt_common.h"
#include "../libcli/auth/libcli_auth.h"
#include "../libcli/auth/spnego.h"
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index a0d60482ee..89dcf94482 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "msdfs.h"
#include "trans2.h"
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c
index b699b9df55..aed03ef382 100644
--- a/source3/libsmb/clidgram.c
+++ b/source3/libsmb/clidgram.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "../lib/util/tevent_ntstatus.h"
#include "libsmb/clidgram.h"
#include "libsmb/nmblib.h"
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 4e1c827368..ec0965fc88 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -19,6 +19,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "../lib/util/tevent_ntstatus.h"
#include "smb_signing.h"
#include "async_smb.h"
diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c
index 015afb18aa..145ce15c6f 100644
--- a/source3/libsmb/clierror.c
+++ b/source3/libsmb/clierror.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
/*****************************************************
RAP error codes - a small start but will be extended.
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 5b28737ac7..48488c1651 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
+#include "libsmb/libsmb.h"
#include "../lib/util/tevent_ntstatus.h"
#include "async_smb.h"
#include "libsmb/clirap.h"
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c
index 4701b0317b..b346654c8d 100644
--- a/source3/libsmb/clifsinfo.c
+++ b/source3/libsmb/clifsinfo.c
@@ -19,6 +19,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "../libcli/auth/spnego.h"
#include "../libcli/auth/ntlmssp.h"
#include "../lib/util/tevent_ntstatus.h"
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index f7ca9ac99c..9408cb7d1d 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "../lib/util/tevent_ntstatus.h"
#include "async_smb.h"
#include "trans2.h"
diff --git a/source3/libsmb/climessage.c b/source3/libsmb/climessage.c
index 75659d7cc4..55ffd8d9a5 100644
--- a/source3/libsmb/climessage.c
+++ b/source3/libsmb/climessage.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "../lib/util/tevent_ntstatus.h"
#include "async_smb.h"
+#include "libsmb/libsmb.h"
struct cli_message_start_state {
uint16_t grp;
diff --git a/source3/libsmb/clioplock.c b/source3/libsmb/clioplock.c
index aed489f6f3..8c9ab126ba 100644
--- a/source3/libsmb/clioplock.c
+++ b/source3/libsmb/clioplock.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "../lib/util/tevent_ntstatus.h"
#include "async_smb.h"
+#include "libsmb/libsmb.h"
/****************************************************************************
send an ack for an oplock break request
diff --git a/source3/libsmb/cliprint.c b/source3/libsmb/cliprint.c
index 30eedce208..06cb02521f 100644
--- a/source3/libsmb/cliprint.c
+++ b/source3/libsmb/cliprint.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
/*****************************************************************************
diff --git a/source3/libsmb/cliquota.c b/source3/libsmb/cliquota.c
index 94694e4530..74430fe0ca 100644
--- a/source3/libsmb/cliquota.c
+++ b/source3/libsmb/cliquota.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "../librpc/gen_ndr/ndr_security.h"
#include "fake_file.h"
#include "../libcli/security/security.h"
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index 36a8e3a559..291f3b1484 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -25,6 +25,7 @@
#include "../lib/crypto/arcfour.h"
#include "../lib/util/tevent_ntstatus.h"
#include "async_smb.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "trans2.h"
diff --git a/source3/libsmb/clirap2.c b/source3/libsmb/clirap2.c
index 44a9d7c8c4..03b4ca7541 100644
--- a/source3/libsmb/clirap2.c
+++ b/source3/libsmb/clirap2.c
@@ -76,6 +76,7 @@
/*****************************************************/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "../librpc/gen_ndr/rap.h"
#include "../librpc/gen_ndr/svcctl.h"
#include "libsmb/clirap.h"
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index fcfb01268c..b7fd2bfc97 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "../lib/util/tevent_ntstatus.h"
#include "async_smb.h"
#include "trans2.h"
diff --git a/source3/libsmb/clisecdesc.c b/source3/libsmb/clisecdesc.c
index 5543ce5033..c998c70826 100644
--- a/source3/libsmb/clisecdesc.c
+++ b/source3/libsmb/clisecdesc.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
/****************************************************************************
query the security descriptor for a open file
diff --git a/source3/libsmb/clisigning.c b/source3/libsmb/clisigning.c
index 1752edb023..ac4db7626f 100644
--- a/source3/libsmb/clisigning.c
+++ b/source3/libsmb/clisigning.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "smb_signing.h"
bool cli_simple_set_signing(struct cli_state *cli,
diff --git a/source3/libsmb/clistr.c b/source3/libsmb/clistr.c
index 944479c2a8..f185bb03a5 100644
--- a/source3/libsmb/clistr.c
+++ b/source3/libsmb/clistr.c
@@ -19,6 +19,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
size_t clistr_push_fn(struct cli_state *cli,
void *dest,
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c
index 995f2c0505..a464cf39b3 100644
--- a/source3/libsmb/clitrans.c
+++ b/source3/libsmb/clitrans.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "../lib/util/tevent_ntstatus.h"
#include "async_smb.h"
diff --git a/source3/libsmb/libsmb.h b/source3/libsmb/libsmb.h
new file mode 100644
index 0000000000..210e55ebaa
--- /dev/null
+++ b/source3/libsmb/libsmb.h
@@ -0,0 +1,23 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ 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_LIBSMB_H
+#define _LIBSMB_LIBSMB_H
+
+#include "libsmb/proto.h"
+
+#endif /* _LIBSMB_LIBSMB_H */
diff --git a/source3/libsmb/libsmb_cache.c b/source3/libsmb/libsmb_cache.c
index f9770d363c..598fa81376 100644
--- a/source3/libsmb/libsmb_cache.c
+++ b/source3/libsmb/libsmb_cache.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c
index f81631e5f6..a7f236718a 100644
--- a/source3/libsmb/libsmb_context.c
+++ b/source3/libsmb/libsmb_context.c
@@ -23,6 +23,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
#include "secrets.h"
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 3602bc5377..ea75dbf264 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -23,6 +23,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "popt_common.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c
index 74357f5eb9..c822eab798 100644
--- a/source3/libsmb/libsmb_file.c
+++ b/source3/libsmb/libsmb_file.c
@@ -23,6 +23,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
diff --git a/source3/libsmb/libsmb_misc.c b/source3/libsmb/libsmb_misc.c
index a6e96350f5..7808d8e4f0 100644
--- a/source3/libsmb/libsmb_misc.c
+++ b/source3/libsmb/libsmb_misc.c
@@ -23,6 +23,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
diff --git a/source3/libsmb/libsmb_printjob.c b/source3/libsmb/libsmb_printjob.c
index ea0cb37a14..db46ceee9c 100644
--- a/source3/libsmb/libsmb_printjob.c
+++ b/source3/libsmb/libsmb_printjob.c
@@ -23,6 +23,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index 961c9cde83..45be66072f 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -24,6 +24,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
#include "../librpc/gen_ndr/ndr_lsa.h"
diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c
index 817e4a1f57..b579a5f5c1 100644
--- a/source3/libsmb/libsmb_stat.c
+++ b/source3/libsmb/libsmb_stat.c
@@ -23,6 +23,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c
index f8dd7fdefb..583179daa0 100644
--- a/source3/libsmb/libsmb_xattr.c
+++ b/source3/libsmb/libsmb_xattr.c
@@ -23,6 +23,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
#include "../librpc/gen_ndr/ndr_lsa.h"
diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c
index d37389a485..fc68e41bd9 100644
--- a/source3/libsmb/passchange.c
+++ b/source3/libsmb/passchange.c
@@ -21,6 +21,7 @@
#include "../librpc/gen_ndr/ndr_samr.h"
#include "rpc_client/cli_pipe.h"
#include "rpc_client/cli_samr.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "libsmb/nmblib.h"
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
new file mode 100644
index 0000000000..e135abe319
--- /dev/null
+++ b/source3/libsmb/proto.h
@@ -0,0 +1,833 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ 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_
+
+/* The following definitions come from libsmb/cliconnect.c */
+
+ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
+ const char *pass, const char *user_domain,
+ const char * dest_realm);
+
+NTSTATUS cli_session_setup(struct cli_state *cli,
+ const char *user,
+ const char *pass, int passlen,
+ const char *ntpass, int ntpasslen,
+ const char *workgroup);
+struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli,
+ struct tevent_req **psmbreq);
+struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli);
+NTSTATUS cli_session_setup_guest_recv(struct tevent_req *req);
+struct tevent_req *cli_ulogoff_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct cli_state *cli);
+NTSTATUS cli_ulogoff_recv(struct tevent_req *req);
+NTSTATUS cli_ulogoff(struct cli_state *cli);
+struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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);
+struct tevent_req *cli_tdis_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct cli_state *cli);
+NTSTATUS cli_tdis_recv(struct tevent_req *req);
+NTSTATUS cli_tdis(struct cli_state *cli);
+NTSTATUS cli_negprot(struct cli_state *cli);
+struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli);
+NTSTATUS cli_negprot_recv(struct tevent_req *req);
+bool cli_session_request(struct cli_state *cli,
+ struct nmb_name *calling, struct nmb_name *called);
+NTSTATUS cli_connect(struct cli_state *cli,
+ const char *host,
+ struct sockaddr_storage *dest_ss);
+NTSTATUS cli_start_connection(struct cli_state **output_cli,
+ const char *my_name,
+ const char *dest_host,
+ struct sockaddr_storage *dest_ss, int port,
+ int signing_state, int flags);
+NTSTATUS cli_full_connection(struct cli_state **output_cli,
+ const char *my_name,
+ const char *dest_host,
+ 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);
+bool attempt_netbios_session_request(struct cli_state **ppcli, const char *srchost, const char *desthost,
+ struct sockaddr_storage *pdest_ss);
+NTSTATUS cli_raw_tcon(struct cli_state *cli,
+ const char *service, const char *pass, const char *dev,
+ uint16 *max_xmit, uint16 *tid);
+struct cli_state *get_ipc_connect(char *server,
+ struct sockaddr_storage *server_ss,
+ const struct user_auth_info *user_info);
+struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx,
+ 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(struct cli_state *c,
+ const char *username,
+ const char *password,
+ const char *domain,
+ const char *sharename);
+struct cli_state *cli_cm_open(TALLOC_CTX *ctx,
+ struct cli_state *referring_cli,
+ const char *server,
+ const char *share,
+ const struct user_auth_info *auth_info,
+ bool show_hdr,
+ bool force_encrypt,
+ int max_protocol,
+ int port,
+ int name_type);
+void cli_cm_display(const struct cli_state *c);
+struct client_dfs_referral;
+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);
+bool cli_resolve_path(TALLOC_CTX *ctx,
+ const char *mountpt,
+ const struct user_auth_info *dfs_auth_info,
+ struct cli_state *rootcli,
+ const char *path,
+ struct cli_state **targetcli,
+ char **pp_targetpath);
+
+bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
+ struct cli_state *cli,
+ const char *sharename,
+ char **pp_newserver,
+ char **pp_newshare,
+ bool force_encrypt,
+ const char *username,
+ const char *password,
+ const char *domain);
+
+/* 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);
+void cli_set_port(struct cli_state *cli, int port);
+bool cli_state_seqnum_persistent(struct cli_state *cli,
+ uint16_t mid);
+bool cli_state_seqnum_remove(struct cli_state *cli,
+ uint16_t mid);
+bool cli_receive_smb(struct cli_state *cli);
+bool cli_send_smb(struct cli_state *cli);
+void cli_setup_packet_buf(struct cli_state *cli, char *buf);
+void cli_setup_packet(struct cli_state *cli);
+void cli_setup_bcc(struct cli_state *cli, void *p);
+NTSTATUS cli_set_domain(struct cli_state *cli, const char *domain);
+NTSTATUS cli_set_username(struct cli_state *cli, const char *username);
+NTSTATUS cli_set_password(struct cli_state *cli, const char *password);
+NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password);
+struct cli_state *cli_initialise(void);
+struct cli_state *cli_initialise_ex(int signing_state);
+void cli_nt_pipes_close(struct cli_state *cli);
+void cli_shutdown(struct cli_state *cli);
+void cli_sockopt(struct cli_state *cli, const char *options);
+uint16 cli_setpid(struct cli_state *cli, uint16 pid);
+bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
+struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+ 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);
+bool cli_ucs2(struct cli_state *cli);
+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,
+ 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 */
+
+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 *eclass, uint32 *ecode);
+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);
+NTSTATUS cli_get_nt_error(struct cli_state *cli);
+void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
+void cli_reset_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);
+
+struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ 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,
+ struct event_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);
+struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ 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);
+struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli,
+ const char *fname);
+NTSTATUS cli_posix_getfacl_recv(struct tevent_req *req,
+ TALLOC_CTX *mem_ctx,
+ size_t *prb_size,
+ char **retbuf);
+NTSTATUS cli_posix_getfacl(struct cli_state *cli,
+ const char *fname,
+ TALLOC_CTX *mem_ctx,
+ size_t *prb_size,
+ char **retbuf);
+struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli,
+ const char *fname);
+NTSTATUS cli_posix_stat_recv(struct tevent_req *req,
+ SMB_STRUCT_STAT *sbuf);
+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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ struct cli_state *cli,
+ const char *fname_src,
+ const char *fname_dst);
+NTSTATUS cli_rename_recv(struct tevent_req *req);
+NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
+struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ 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);
+
+struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx,
+ struct event_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_unlink_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli,
+ const char *fname,
+ uint16_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);
+
+struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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);
+NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum);
+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,
+ uint16_t *pfid);
+uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
+ size_t str_len, size_t *pconverted_size);
+uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix,
+ const uint8_t *bytes, size_t num_bytes);
+struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli, const char *fname,
+ int flags, int share_mode,
+ struct tevent_req **psmbreq);
+struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+ struct cli_state *cli, const char *fname,
+ int flags, int share_mode);
+NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum);
+NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
+struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli, uint16_t fnum,
+ struct tevent_req **psubreq);
+struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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);
+bool cli_lock(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,
+ struct event_context *ev,
+ 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);
+bool 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 event_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 event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ struct cli_state *cli,
+ uint16_t fnum);
+NTSTATUS cli_getattrE_recv(struct tevent_req *req,
+ uint16_t *attr,
+ SMB_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,
+ SMB_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 event_context *ev,
+ 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,
+ struct event_context *ev,
+ struct cli_state *cli,
+ const char *fname);
+NTSTATUS cli_getatr_recv(struct tevent_req *req,
+ uint16_t *attr,
+ SMB_OFF_T *size,
+ time_t *write_time);
+NTSTATUS cli_getatr(struct cli_state *cli,
+ const char *fname,
+ uint16_t *attr,
+ SMB_OFF_T *size,
+ time_t *write_time);
+struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli,
+ const char *fname,
+ uint16_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,
+ time_t mtime);
+struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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);
+struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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);
+
+/* 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);
+NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16 *pmajor,
+ uint16 *pminor, uint32 *pcaplow,
+ uint32 *pcaphigh);
+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,
+ uint16 major, uint16 minor,
+ uint32 caplow, uint32 caphigh);
+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);
+NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name,
+ uint32 *pserial_number, time_t *pdate);
+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,
+ uint32 *optimal_transfer_size,
+ uint32 *block_size,
+ 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);
+NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
+ const char *user,
+ const char *pass,
+ const char *domain);
+NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli);
+NTSTATUS cli_force_encryption(struct cli_state *c,
+ const char *username,
+ const char *password,
+ const char *domain);
+
+/* The following definitions come from libsmb/clilist.c */
+
+NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16 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,
+ NTSTATUS (*fn)(const char *mnt, struct file_info *finfo,
+ const char *mask, void *private_data),
+ void *private_data);
+struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct cli_state *cli,
+ const char *mask,
+ uint16_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 attribute,
+ NTSTATUS (*fn)(const char *, struct file_info *, const char *,
+ void *), void *state);
+
+/* 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 */
+
+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);
+NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level);
+void cli_oplock_handler(struct cli_state *cli,
+ NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char));
+
+/* 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);
+NTSTATUS cli_get_user_quota(struct cli_state *cli, int quota_fnum,
+ SMB_NTQUOTA_STRUCT *pqt);
+NTSTATUS cli_set_user_quota(struct cli_state *cli, int quota_fnum,
+ SMB_NTQUOTA_STRUCT *pqt);
+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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ 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,
+ struct event_context *ev,
+ struct cli_state *cli,
+ uint16_t fnum, off_t start_offset,
+ SMB_OFF_T size, size_t window_size,
+ NTSTATUS (*sink)(char *buf, size_t n,
+ void *priv),
+ void *priv);
+NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received);
+NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
+ off_t start_offset, SMB_OFF_T size, size_t window_size,
+ NTSTATUS (*sink)(char *buf, size_t n, void *priv),
+ void *priv, SMB_OFF_T *received);
+ssize_t cli_read(struct cli_state *cli, uint16_t fnum, char *buf,
+ off_t offset, size_t size);
+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,
+ struct event_context *ev,
+ 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,
+ struct event_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_andx_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);
+
+struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+ 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);
+
+/* The following definitions come from libsmb/clisecdesc.c */
+
+struct security_descriptor *cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
+ TALLOC_CTX *mem_ctx);
+NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
+ struct security_descriptor *sd);
+
+/* The following definitions come from libsmb/clistr.c */
+
+size_t clistr_push_fn(struct cli_state *cli,
+ void *dest,
+ const char *src,
+ int dest_len,
+ int flags);
+size_t clistr_pull_fn(const char *inbuf,
+ char *dest,
+ const void *src,
+ int dest_len,
+ int src_len,
+ int flags);
+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);
+size_t clistr_align_out(struct cli_state *cli, const void *p, int flags);
+
+/* The following definitions come from libsmb/clitrans.c */
+
+struct tevent_req *cli_trans_send(
+ TALLOC_CTX *mem_ctx, struct event_context *ev,
+ struct cli_state *cli, uint8_t 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);
+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);
+
+/* The following definitions come from libsmb/smb_seal.c */
+
+NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16 *p_enc_ctx_num);
+bool common_encryption_on(struct smb_trans_enc_state *es);
+NTSTATUS common_ntlm_decrypt_buffer(struct ntlmssp_state *ntlmssp_state, char *buf);
+NTSTATUS common_ntlm_encrypt_buffer(struct ntlmssp_state *ntlmssp_state,
+ uint16 enc_ctx_num,
+ char *buf,
+ char **ppbuf_out);
+NTSTATUS common_encrypt_buffer(struct smb_trans_enc_state *es, char *buffer, char **buf_out);
+NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf);
+void common_free_encryption_state(struct smb_trans_enc_state **pp_es);
+void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf);
+bool cli_encryption_on(struct cli_state *cli);
+void cli_free_encryption_context(struct cli_state *cli);
+void cli_free_enc_buffer(struct cli_state *cli, char *buf);
+NTSTATUS cli_decrypt_message(struct cli_state *cli);
+NTSTATUS cli_encrypt_message(struct cli_state *cli, char *buf, char **buf_out);
+
+/* The following definitions come from libsmb/clisigning.c */
+
+bool cli_simple_set_signing(struct cli_state *cli,
+ const DATA_BLOB user_session_key,
+ const DATA_BLOB response);
+bool cli_temp_set_signing(struct cli_state *cli);
+void cli_calculate_sign_mac(struct cli_state *cli, char *buf, uint32_t *seqnum);
+bool cli_check_sign_mac(struct cli_state *cli, const char *buf, uint32_t seqnum);
+bool client_is_signing_on(struct cli_state *cli);
+bool client_is_signing_allowed(struct cli_state *cli);
+bool client_is_signing_mandatory(struct cli_state *cli);
+void cli_set_signing_negotiated(struct cli_state *cli);
+
+#endif /* _LIBSMB_PROTO_H_ */
diff --git a/source3/libsmb/smb_seal.c b/source3/libsmb/smb_seal.c
index 0eed15d4a3..5426c8d17a 100644
--- a/source3/libsmb/smb_seal.c
+++ b/source3/libsmb/smb_seal.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "../libcli/auth/ntlmssp.h"
#include "smb_crypt.h"
+#include "libsmb/libsmb.h"
/******************************************************************************
Pull out the encryption context for this packet. 0 means global context.
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index 744f577f35..c5f32520d9 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -27,6 +27,7 @@
#include "../librpc/gen_ndr/ndr_netlogon.h"
#include "secrets.h"
#include "passdb.h"
+#include "libsmb/libsmb.h"
/*********************************************************
Change the domain password on the PDC.
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index a93e79c908..f414c9c862 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -23,6 +23,7 @@
#include "nmbd/nmbd.h"
#include "../lib/util/select.h"
#include "system/select.h"
+#include "libsmb/libsmb.h"
extern int ClientNMB;
extern int ClientDGRAM;
diff --git a/source3/nmbd/nmbd_synclists.c b/source3/nmbd/nmbd_synclists.c
index fc2b25edca..e160a8271f 100644
--- a/source3/nmbd/nmbd_synclists.c
+++ b/source3/nmbd/nmbd_synclists.c
@@ -30,6 +30,7 @@
#include "system/filesys.h"
#include "../librpc/gen_ndr/svcctl.h"
#include "nmbd/nmbd.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "smbprofile.h"
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 38523fc495..711939474c 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -51,6 +51,7 @@
#include "messages.h"
#include "rpc_server/spoolss/srv_spoolss_nt.h"
#include "util_tdb.h"
+#include "libsmb/libsmb.h"
/* macros stolen from s4 spoolss server */
#define SPOOLSS_BUFFER_UNION(fn,info,level) \
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 3d5f23a6e7..42095acc54 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -32,6 +32,7 @@
#include "../libcli/security/display_sec.h"
#include "../libcli/security/security_descriptor.h"
#include "../libcli/registry/util_reg.h"
+#include "libsmb/libsmb.h"
#define RPCCLIENT_PRINTERNAME(_printername, _cli, _arg) \
{ \
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 17a4cc9226..c2f3e4c917 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -30,6 +30,7 @@
#include "../libcli/smbreadline/smbreadline.h"
#include "../libcli/security/security.h"
#include "passdb.h"
+#include "libsmb/libsmb.h"
enum pipe_auth_type_spnego {
PIPE_AUTH_TYPE_SPNEGO_NONE = 0,
diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c
index d0056756ac..cdd08904e4 100644
--- a/source3/smbd/ntquotas.c
+++ b/source3/smbd/ntquotas.c
@@ -22,6 +22,7 @@
#include "../lib/util/util_pw.h"
#include "system/passwd.h"
#include "passdb/lookup_sid.h"
+#include "libsmb/libsmb.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_QUOTA
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 33f05bd789..27ac26763c 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -29,6 +29,7 @@
#include "auth.h"
#include "ntioctl.h"
#include "smbprofile.h"
+#include "libsmb/libsmb.h"
extern const struct generic_mapping file_generic_mapping;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 9306aa3e93..d4aadc9ee6 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -34,6 +34,7 @@
#include "messages.h"
#include "smbprofile.h"
#include "rpc_server/spoolss/srv_spoolss_nt.h"
+#include "libsmb/libsmb.h"
extern bool global_machine_password_needs_changing;
diff --git a/source3/smbd/seal.c b/source3/smbd/seal.c
index a34a19a684..28f70b6241 100644
--- a/source3/smbd/seal.c
+++ b/source3/smbd/seal.c
@@ -26,6 +26,7 @@
#include "smb_crypt.h"
#include "../lib/util/asn1.h"
#include "auth.h"
+#include "libsmb/libsmb.h"
/******************************************************************************
Server side encryption.
diff --git a/source3/torture/denytest.c b/source3/torture/denytest.c
index c2ba428452..be01e829dc 100644
--- a/source3/torture/denytest.c
+++ b/source3/torture/denytest.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "torture/proto.h"
+#include "libsmb/libsmb.h"
extern bool torture_showall;
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index 242099092b..95e49756f5 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "system/filesys.h"
#include "locking/proto.h"
#include "libsmb/nmblib.h"
diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c
index 500df6bb13..aba6d2ff13 100644
--- a/source3/torture/locktest2.c
+++ b/source3/torture/locktest2.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "libsmb/libsmb.h"
#include "system/filesys.h"
#include "locking/proto.h"
diff --git a/source3/torture/mangle_test.c b/source3/torture/mangle_test.c
index becb30ad11..a7719d0802 100644
--- a/source3/torture/mangle_test.c
+++ b/source3/torture/mangle_test.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "torture/proto.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "util_tdb.h"
diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c
index 818fef1330..37cb43e540 100644
--- a/source3/torture/masktest.c
+++ b/source3/torture/masktest.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "trans2.h"
+#include "libsmb/libsmb.h"
#include "libsmb/nmblib.h"
static fstring password;
diff --git a/source3/torture/nbench.c b/source3/torture/nbench.c
index beab9167e7..efae14c76c 100644
--- a/source3/torture/nbench.c
+++ b/source3/torture/nbench.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "torture/proto.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "../lib/util/tevent_ntstatus.h"
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c
index 085d206a75..7634f52b14 100644
--- a/source3/torture/nbio.c
+++ b/source3/torture/nbio.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "torture/proto.h"
#include "../libcli/security/security.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#define MAX_FILES 1000
diff --git a/source3/torture/scanner.c b/source3/torture/scanner.c
index 66278302fd..1ca4ca4595 100644
--- a/source3/torture/scanner.c
+++ b/source3/torture/scanner.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "torture/proto.h"
+#include "libsmb/libsmb.h"
#define VERBOSE 0
#define OP_MIN 0
diff --git a/source3/torture/test_async_echo.c b/source3/torture/test_async_echo.c
index e443d4f8a7..d097f49ca5 100644
--- a/source3/torture/test_async_echo.c
+++ b/source3/torture/test_async_echo.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "torture/proto.h"
+#include "libsmb/libsmb.h"
#include "rpc_client/cli_pipe.h"
#include "librpc/gen_ndr/ndr_echo_c.h"
diff --git a/source3/torture/test_case_insensitive.c b/source3/torture/test_case_insensitive.c
index df9d149861..26b3d65d7e 100644
--- a/source3/torture/test_case_insensitive.c
+++ b/source3/torture/test_case_insensitive.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "torture/proto.h"
#include "system/filesys.h"
+#include "libsmb/libsmb.h"
/*
* Regression test file creates on case insensitive file systems (e.g. OS/X)
diff --git a/source3/torture/test_notify_online.c b/source3/torture/test_notify_online.c
index a56cc1169a..b9ebc00b54 100644
--- a/source3/torture/test_notify_online.c
+++ b/source3/torture/test_notify_online.c
@@ -21,6 +21,7 @@
#include "torture/proto.h"
#include "libcli/security/security.h"
#include "lib/util/tevent_ntstatus.h"
+#include "libsmb/libsmb.h"
extern char *test_filename;
diff --git a/source3/torture/test_posix_append.c b/source3/torture/test_posix_append.c
index e18a1c1421..2f562633e5 100644
--- a/source3/torture/test_posix_append.c
+++ b/source3/torture/test_posix_append.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "torture/proto.h"
#include "../libcli/security/security.h"
+#include "libsmb/libsmb.h"
/*
* Make sure that GENERIC_WRITE does not trigger append. See
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index f16b5a748e..e413a3918d 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -31,6 +31,7 @@
#include "dbwrap.h"
#include "talloc_dict.h"
#include "async_smb.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "trans2.h"
#include "libsmb/nmblib.h"
diff --git a/source3/torture/utable.c b/source3/torture/utable.c
index 075343a02e..4c6605d921 100644
--- a/source3/torture/utable.c
+++ b/source3/torture/utable.c
@@ -21,6 +21,7 @@
#include "system/filesys.h"
#include "torture/proto.h"
#include "../libcli/security/security.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
bool torture_utable(int dummy)
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index f753095322..560b58efef 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -36,6 +36,7 @@
#include "secrets.h"
#include "krb5_env.h"
#include "../libcli/security/security.h"
+#include "libsmb/libsmb.h"
#ifdef HAVE_ADS
diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c
index 4378d01fe7..2b67b7b2fe 100644
--- a/source3/utils/net_dom.c
+++ b/source3/utils/net_dom.c
@@ -23,6 +23,7 @@
#include "../librpc/gen_ndr/ndr_winreg.h"
#include "lib/netapi/netapi.h"
#include "lib/netapi/netapi_net.h"
+#include "libsmb/libsmb.h"
int net_dom_usage(struct net_context *c, int argc, const char **argv)
{
diff --git a/source3/utils/net_rap.c b/source3/utils/net_rap.c
index 21a4f0a170..36f6d33197 100644
--- a/source3/utils/net_rap.c
+++ b/source3/utils/net_rap.c
@@ -26,6 +26,7 @@
#include "../librpc/gen_ndr/rap.h"
#include "../librpc/gen_ndr/svcctl.h"
#include "utils/net.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
/* The following messages were for error checking that is not properly
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 7072b4ef32..05da68dbd1 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -39,6 +39,7 @@
#include "lib/netapi/netapi_net.h"
#include "rpc_client/init_lsa.h"
#include "../libcli/security/security.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "nsswitch/libwbclient/wbclient.h"
#include "passdb.h"
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index 7cdcc9ea74..88bb6f83c1 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -30,6 +30,7 @@
#include "rpc_client/cli_netlogon.h"
#include "secrets.h"
#include "rpc_client/init_lsa.h"
+#include "libsmb/libsmb.h"
/* Macro for checking RPC error codes to make things more readable */
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 8b2ac81bcf..2fb52212c9 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -27,6 +27,7 @@
#include "registry/reg_objects.h"
#include "../libcli/security/security.h"
#include "../libcli/registry/util_reg.h"
+#include "libsmb/libsmb.h"
/* support itanium as well */
static const struct print_architecture_table_node archi_table[]= {
diff --git a/source3/utils/net_rpc_shell.c b/source3/utils/net_rpc_shell.c
index 1985bf8b0b..4339dc836c 100644
--- a/source3/utils/net_rpc_shell.c
+++ b/source3/utils/net_rpc_shell.c
@@ -26,6 +26,7 @@
#include "lib/netapi/netapi.h"
#include "lib/netapi/netapi_net.h"
#include "../libcli/smbreadline/smbreadline.h"
+#include "libsmb/libsmb.h"
static NTSTATUS rpc_sh_info(struct net_context *c,
TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx,
diff --git a/source3/utils/net_rpc_trust.c b/source3/utils/net_rpc_trust.c
index da0a7cca67..5d2c7264fa 100644
--- a/source3/utils/net_rpc_trust.c
+++ b/source3/utils/net_rpc_trust.c
@@ -25,6 +25,7 @@
#include "../librpc/gen_ndr/ndr_lsa_c.h"
#include "../lib/crypto/crypto.h"
#include "../libcli/security/dom_sid.h"
+#include "libsmb/libsmb.h"
#define ARG_OTHERSERVER "otherserver="
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index fdb46dbba5..0edb58c14a 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "utils/net.h"
#include "libsmb/nmblib.h"
+#include "libsmb/libsmb.h"
/*
return the time on a server. This does not require any authentication
diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c
index ffcda14e7f..cc5171f014 100644
--- a/source3/utils/net_util.c
+++ b/source3/utils/net_util.c
@@ -27,6 +27,7 @@
#include "../librpc/gen_ndr/ndr_dssetup_c.h"
#include "secrets.h"
#include "../libcli/security/security.h"
+#include "libsmb/libsmb.h"
NTSTATUS net_rpc_lookup_name(struct net_context *c,
TALLOC_CTX *mem_ctx, struct cli_state *cli,
diff --git a/source3/utils/netlookup.c b/source3/utils/netlookup.c
index b160ee5586..d2a79640e9 100644
--- a/source3/utils/netlookup.c
+++ b/source3/utils/netlookup.c
@@ -24,6 +24,7 @@
#include "rpc_client/cli_pipe.h"
#include "../librpc/gen_ndr/ndr_lsa.h"
#include "rpc_client/cli_lsarpc.h"
+#include "libsmb/libsmb.h"
/********************************************************
Connection cachine struct. Goes away when ctx destroyed.
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index efadaee4c6..2fd9a53b5d 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -27,6 +27,7 @@
#include "../librpc/gen_ndr/ndr_lsa.h"
#include "rpc_client/cli_lsarpc.h"
#include "../libcli/security/security.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "passdb/machine_sid.h"
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index 0efa60608b..955ec8c6fd 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -28,6 +28,7 @@
#include "rpc_client/cli_lsarpc.h"
#include "fake_file.h"
#include "../libcli/security/security.h"
+#include "libsmb/libsmb.h"
static char *server;
diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c
index 3f7fc97698..41f4103e5a 100644
--- a/source3/utils/smbtree.c
+++ b/source3/utils/smbtree.c
@@ -23,6 +23,7 @@
#include "popt_common.h"
#include "rpc_client/cli_pipe.h"
#include "../librpc/gen_ndr/ndr_srvsvc_c.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
static int use_bcast;
diff --git a/source3/web/diagnose.c b/source3/web/diagnose.c
index cf93991f94..d5c5e90d49 100644
--- a/source3/web/diagnose.c
+++ b/source3/web/diagnose.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "web/swat_proto.h"
#include "lib/winbind_util.h"
+#include "libsmb/libsmb.h"
#ifdef WITH_WINBIND
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index f5a9e73905..c6c93baea9 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -69,6 +69,7 @@
#include "rpc_client/cli_lsarpc.h"
#include "../librpc/gen_ndr/ndr_dssetup_c.h"
#include "libads/sitename_cache.h"
+#include "libsmb/libsmb.h"
#include "libsmb/clidgram.h"
#include "ads.h"
#include "secrets.h"