s3:libsmb: remove unused cli_state->dfsroot
[mat/samba.git] / source3 / include / client.h
index b01136be379ef7c567cd6ca0e97fe30b4e975778..babcfb8a660f293326443236f6347ff7b30bc39c 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. */
+
+/* default client timeout to 20 seconds on most commands */
+#define CLIENT_TIMEOUT (20 * 1000)
 
 /*
  * These definitions depend on smb.h
@@ -46,24 +40,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;
-       int port;
-       int fd;
-       uint16 cnum;
-       uint16 pid;
-       uint16 mid;
-       uint16 vuid;
-       int protocol;
-       int sec_mode;
        int rap_error;
        NTSTATUS raw_status; /* maybe via NT_STATUS_DOS() */
-       int privileges;
-
-       char *desthost;
+       bool map_dos_errors;
 
        /* The credentials used to open the cli_state connection. */
        char *domain;
@@ -81,84 +68,46 @@ struct cli_state {
 
        char *share;
        char *dev;
-       struct nmb_name called;
-       struct sockaddr_storage src_ss;
-       struct nmb_name calling;
-       struct sockaddr_storage dest_ss;
-
-       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. */
-
-       /* the session key for this CLI, outside
-          any per-pipe authenticaion */
-       DATA_BLOB user_session_key;
+       bool backup_intent;
 
        /* The list of pipes currently open on this connection. */
        struct rpc_pipe_client *pipe_list;
 
        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? */
-
-       /* a oplock break request handler */
-       NTSTATUS (*oplock_handler)(struct cli_state *cli, uint16_t fnum, unsigned char level);
 
-       bool force_dos_errors;
        bool case_sensitive; /* False by default. */
 
        /* Where (if anywhere) this is mounted under DFS. */
        char *dfs_mountpoint;
 
-       struct tevent_queue *outgoing;
-       struct tevent_req **pending;
+       struct smbXcli_conn *conn;
+       const char *remote_realm;
+
+       struct {
+               uint16_t pid;
+               uint16_t vc_num;
+               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;
-               uint16_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;
-
-               /* SMB2 tcon */
-               uint8_t share_type;
-               uint32_t share_flags;
-               uint32_t maximal_access;
+               struct smbXcli_session *session;
+               struct smbXcli_tcon *tcon;
+               struct idr_context *open_handles;
        } smb2;
 };
 
@@ -182,5 +131,8 @@ struct file_info {
 #define CLI_FULL_CONNECTION_OPLOCKS 0x0010
 #define CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS 0x0020
 #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 */