s3:libsmb: get rid of cli_state_remote_name
[samba.git] / source3 / libsmb / proto.h
index e0c8a67d6699f0031051682aef50ed98cfde016d..652e0caf8c30645e8c6ab485e6e8905af5e11dde 100644 (file)
@@ -27,6 +27,9 @@
 #define _LIBSMB_PROTO_H_
 
 #include "ads.h"
+#include "auth_info.h"
+
+struct smb_trans_enc_state;
 
 /* The following definitions come from libsmb/cliconnect.c  */
 
@@ -62,6 +65,8 @@ struct tevent_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx,
 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);
+NTSTATUS cli_tree_connect(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);
@@ -151,6 +156,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
 
 int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
 unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
+bool cli_set_backup_intent(struct cli_state *cli, bool flag);
 void cli_setup_packet_buf(struct cli_state *cli, char *buf);
 NTSTATUS cli_set_domain(struct cli_state *cli, const char *domain);
 NTSTATUS cli_set_username(struct cli_state *cli, const char *username);
@@ -165,10 +171,6 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
 bool cli_state_encryption_on(struct cli_state *cli);
 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);
-const struct sockaddr_storage *cli_state_local_sockaddr(struct cli_state *cli);
-const struct sockaddr_storage *cli_state_remote_sockaddr(struct cli_state *cli);
-const char *cli_state_remote_name(struct cli_state *cli);
 const char *cli_state_remote_realm(struct cli_state *cli);
 uint16_t cli_state_get_vc_num(struct cli_state *cli);
 uint32_t cli_state_server_session_key(struct cli_state *cli);
@@ -382,15 +384,16 @@ uint8_t *trans2_bytes_push_str(uint8_t *buf, bool ucs2,
                               size_t *pconverted_size);
 uint8_t *trans2_bytes_push_bytes(uint8_t *buf,
                                 const uint8_t *bytes, size_t num_bytes);
-struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
+struct tevent_req *cli_openx_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 tevent_req *cli_openx_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_openx_recv(struct tevent_req *req, uint16_t *fnum);
+NTSTATUS cli_openx(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
 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,
@@ -458,14 +461,14 @@ struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
                                 uint16_t fnum);
 NTSTATUS cli_getattrE_recv(struct tevent_req *req,
                         uint16_t *attr,
-                        SMB_OFF_T *size,
+                        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,
+                       off_t *size,
                        time_t *change_time,
                        time_t *access_time,
                        time_t *write_time);
@@ -488,12 +491,12 @@ struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
                                const char *fname);
 NTSTATUS cli_getatr_recv(struct tevent_req *req,
                                uint16_t *attr,
-                               SMB_OFF_T *size,
+                               off_t *size,
                                time_t *write_time);
 NTSTATUS cli_getatr(struct cli_state *cli,
                        const char *fname,
                        uint16_t *attr,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        time_t *write_time);
 struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
                                struct event_context *ev,
@@ -586,6 +589,10 @@ struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
 NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                         uint32_t *pnum_changes,
                         struct notify_change **pchanges);
+NTSTATUS cli_notify(struct cli_state *cli, uint16_t fnum, uint32_t buffer_size,
+                   uint32_t completion_filter, bool recursive,
+                   TALLOC_CTX *mem_ctx, uint32_t *pnum_changes,
+                   struct notify_change **pchanges);
 
 struct tevent_req *cli_nttrans_create_send(TALLOC_CTX *mem_ctx,
                                           struct event_context *ev,
@@ -754,15 +761,15 @@ 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,
+                                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_recv(struct tevent_req *req, 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,
+                 off_t start_offset, off_t size, size_t window_size,
                  NTSTATUS (*sink)(char *buf, size_t n, void *priv),
-                 void *priv, SMB_OFF_T *received);
+                 void *priv, off_t *received);
 NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum,
                  char *buf, off_t offset, size_t size,
                  size_t *nread);
@@ -820,7 +827,7 @@ size_t clistr_pull_talloc(TALLOC_CTX *ctx,
 /* The following definitions come from libsmb/clitrans.c  */
 
 struct tevent_req *cli_trans_send(
-       TALLOC_CTX *mem_ctx, struct event_context *ev,
+       TALLOC_CTX *mem_ctx, struct tevent_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,
@@ -846,32 +853,13 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
                   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 auth_ntlmssp_state *auth_ntlmssp_state, char *buf);
-NTSTATUS common_ntlm_encrypt_buffer(struct auth_ntlmssp_state *auth_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);
-
 /* 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);
-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);
-bool cli_set_signing_negotiated(struct cli_state *cli,
-                               bool allowed, bool mandatory);
 
 /* The following definitions come from libsmb/reparse_symlink.c  */