#define CLI_BUFFER_SIZE (0xFFFF)
+/* default client timeout to 20 seconds on most commands */
+#define CLIENT_TIMEOUT (20 * 1000)
+
/*
* These definitions depend on smb.h
*/
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 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;
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_mux;
int initialised;
int win95;
- bool is_guestlogin;
/* 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_ccache;
+ bool pw_nt_hash;
bool got_kerberos_mechanism; /* Server supports krb5 in SPNEGO. */
bool use_oplocks; /* should we use oplocks? */
/* 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);
-
- enum protocol_types protocol;
-
- struct {
- struct {
- uint32_t capabilities;
- uint32_t max_xmit;
- } client;
-
- struct {
- uint32_t capabilities;
- uint32_t max_xmit;
- } server;
-
- uint32_t capabilities;
- uint32_t max_xmit;
-
- uint16_t mid;
- } smb1;
- } conn;
+ struct smbXcli_conn *conn;
+ const char *remote_realm;
struct {
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;
-
- /* SMB2 tcon */
- uint8_t share_type;
- uint32_t share_flags;
- uint32_t share_capabilities;
- uint32_t maximal_access;
+ struct smbXcli_session *session;
+ struct smbXcli_tcon *tcon;
+ struct idr_context *open_handles;
} smb2;
};
#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 */