s3:libsmb: setup a smbXcli_tcon for SMB2
[kai/samba.git] / source3 / include / client.h
index 7c039ae59092eec6356136e3157e75f2f9b570e4..00a7e1b40cb200c9ba141769e4fac8ca0efed260 100644 (file)
 #ifndef _CLIENT_H
 #define _CLIENT_H
 
-/* the client asks for a smaller buffer to save ram and also to get more
-   overlap on the wire. This size gives us a nice read/write size, which
-   will be a multiple of the page size on almost any system */
 #define CLI_BUFFER_SIZE (0xFFFF)
-#define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */
-#define CLI_SAMBA_MAX_LARGE_WRITEX_SIZE (127*1024) /* Works for Samba servers */
-#define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */
-#define CLI_WINDOWS_MAX_LARGE_WRITEX_SIZE ((64*1024)-2) /* Windows servers are broken.... */
-#define CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE (0xFFFF00) /* 24-bit len. */
-#define CLI_SAMBA_MAX_POSIX_LARGE_WRITEX_SIZE (0xFFFF00) /* 24-bit len. */
 
 /*
  * These definitions depend on smb.h
@@ -46,15 +37,17 @@ struct print_job_info {
        time_t t;
 };
 
+struct smbXcli_conn;
+struct smbXcli_session;
+
 struct cli_state {
        /**
         * A list of subsidiary connections for DFS.
         */
         struct cli_state *prev, *next;
-       enum protocol_types protocol;
-       int sec_mode;
        int rap_error;
        NTSTATUS raw_status; /* maybe via NT_STATUS_DOS() */
+       bool map_dos_errors;
 
        /* The credentials used to open the cli_state connection. */
        char *domain;
@@ -73,29 +66,16 @@ struct cli_state {
        char *share;
        char *dev;
 
-       DATA_BLOB secblob; /* cryptkey or negTokenInit */
-       uint32 sesskey;
-       int serverzone;
-       uint32 servertime;
-       int readbraw_supported;
-       int writebraw_supported;
        int timeout; /* in milliseconds. */
-       size_t max_xmit;
-       size_t max_mux;
        int initialised;
        int win95;
-       bool is_samba;
        bool is_guestlogin;
-       uint32 capabilities;
        /* What the server offered. */
        uint32_t server_posix_capabilities;
        /* What the client requested. */
        uint32_t requested_posix_capabilities;
        bool dfsroot;
-
-       struct smb_signing_state *signing_state;
-
-       struct smb_trans_enc_state *trans_enc_state; /* Setup if we're encrypting SMB's. */
+       bool backup_intent;
 
        /* the session key for this CLI, outside
           any per-pipe authenticaion */
@@ -106,67 +86,32 @@ struct cli_state {
 
        bool use_kerberos;
        bool fallback_after_kerberos;
-       bool use_spnego;
        bool use_ccache;
+       bool pw_nt_hash;
        bool got_kerberos_mechanism; /* Server supports krb5 in SPNEGO. */
 
        bool use_oplocks; /* should we use oplocks? */
-       bool use_level_II_oplocks; /* should we use level II oplocks? */
 
-       bool force_dos_errors;
-       bool force_ascii;
        bool case_sensitive; /* False by default. */
 
        /* Where (if anywhere) this is mounted under DFS. */
        char *dfs_mountpoint;
 
-       struct {
-               int fd;
-               struct sockaddr_storage local_ss;
-               struct sockaddr_storage remote_ss;
-               const char *remote_name;
-               const char *remote_realm;
-               struct tevent_req *read_smb_req;
-               struct tevent_queue *outgoing;
-               struct tevent_req **pending;
-               /*
-                * The incoming dispatch function should return:
-                * - NT_STATUS_RETRY, if more incoming PDUs are expected.
-                * - NT_STATUS_OK, if no more processing is desired, e.g.
-                *                 the dispatch function called
-                *                 tevent_req_done().
-                * - All other return values disconnect the connection.
-                */
-               NTSTATUS (*dispatch_incoming)(struct cli_state *cli,
-                                             TALLOC_CTX *frame,
-                                             uint8_t *inbuf);
-       } conn;
+       struct smbXcli_conn *conn;
+       const char *remote_realm;
 
        struct {
-               uint16_t mid;
                uint16_t pid;
                uint16_t vc_num;
-               uint16_t tid;
-               uint16_t uid;
+               struct smbXcli_session *session;
+               struct smbXcli_tcon *tcon;
        } smb1;
 
        struct {
-               uint64_t mid;
                uint32_t pid;
                uint32_t tid;
-               uint64_t uid;
-
-               /* SMB2 negprot */
-               uint16_t security_mode;
-               uint16_t dialect_revision;
-               struct GUID server_guid;
-               uint32_t server_capabilities;
-               uint32_t max_transact_size;
-               uint32_t max_read_size;
-               uint32_t max_write_size;
-               struct timespec system_time;
-               struct timespec server_start_time;
-               DATA_BLOB gss_blob;
+               struct smbXcli_session *session;
+               struct smbXcli_tcon *tcon;
 
                /* SMB2 tcon */
                uint8_t share_type;
@@ -198,5 +143,6 @@ struct file_info {
 #define CLI_FULL_CONNECTION_USE_CCACHE 0x0040
 #define CLI_FULL_CONNECTION_FORCE_DOS_ERRORS 0x0080
 #define CLI_FULL_CONNECTION_FORCE_ASCII 0x0100
+#define CLI_FULL_CONNECTION_USE_NT_HASH 0x0200
 
 #endif /* _CLIENT_H */