#ifndef _CLIENT_H
#define _CLIENT_H
#define CLI_BUFFER_SIZE (0xFFFF)
#define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024)
#define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2)
struct print_job_info
{
uint16 id;
uint16 priority;
size_t size;
fstring user;
fstring name;
time_t t;
};
struct cli_pipe_auth_data {
enum pipe_auth_type auth_type;
enum pipe_auth_level auth_level;
union {
struct schannel_auth_struct *schannel_auth;
NTLMSSP_STATE *ntlmssp_state;
struct kerberos_auth_struct *kerberos_auth;
} a_u;
void (*cli_auth_data_free_func)(struct cli_pipe_auth_data *);
};
struct rpc_pipe_client {
struct rpc_pipe_client *prev, *next;
TALLOC_CTX *mem_ctx;
struct cli_state *cli;
int pipe_idx;
const char *pipe_name;
uint16 fnum;
const char *domain;
const char *user_name;
struct pwd_info pwd;
uint16 max_xmit_frag;
uint16 max_recv_frag;
struct cli_pipe_auth_data auth;
struct dcinfo *dc;
};
struct cli_state {
int port;
int fd;
int smb_rw_error;
uint16 cnum;
uint16 pid;
uint16 mid;
uint16 vuid;
int protocol;
int sec_mode;
int rap_error;
int privileges;
fstring desthost;
fstring domain;
fstring user_name;
struct pwd_info pwd;
fstring server_type;
fstring server_os;
fstring server_domain;
fstring share;
fstring dev;
struct nmb_name called;
struct nmb_name calling;
fstring full_dest_host_name;
struct in_addr dest_ip;
DATA_BLOB secblob;
uint32 sesskey;
int serverzone;
uint32 servertime;
int readbraw_supported;
int writebraw_supported;
int timeout;
size_t max_xmit;
size_t max_mux;
char *outbuf;
char *inbuf;
unsigned int bufsize;
int initialised;
int win95;
BOOL is_samba;
uint32 capabilities;
BOOL dfsroot;
TALLOC_CTX *mem_ctx;
smb_sign_info sign_info;
DATA_BLOB user_session_key;
struct rpc_pipe_client *pipe_list;
BOOL use_kerberos;
BOOL fallback_after_kerberos;
BOOL use_spnego;
BOOL got_kerberos_mechanism;
BOOL use_oplocks;
BOOL use_level_II_oplocks;
BOOL (*oplock_handler)(struct cli_state *cli, int fnum, unsigned char level);
BOOL force_dos_errors;
BOOL case_sensitive;
};
typedef struct file_info {
struct cli_state *cli;
SMB_BIG_UINT size;
uint16 mode;
uid_t uid;
gid_t gid;
struct timespec mtime_ts;
struct timespec atime_ts;
struct timespec ctime_ts;
pstring name;
pstring dir;
char short_name[13*3];
} file_info;
#define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001
#define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002
#define CLI_FULL_CONNECTION_ANONYMOUS_FALLBACK 0x0004
#endif