extern char *sparse_buf;
extern char *LastDir;
-/* Current number of oplocks we have outstanding. */
-extern int32_t exclusive_oplocks_open;
-extern int32_t level_II_oplocks_open;
extern struct kernel_oplocks *koplocks;
struct smbd_parent_context;
struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req);
void remove_smb2_chained_fsp(files_struct *fsp);
+NTSTATUS smbd_smb2_request_verify_creditcharge(struct smbd_smb2_request *req,
+ uint32_t data_length);
+
NTSTATUS smbd_smb2_request_verify_sizes(struct smbd_smb2_request *req,
size_t expected_body_size);
char *private_data,
size_t priv_len);
+struct smbXsrv_connection {
+ struct smbd_server_connection *sconn;
+
+ const struct tsocket_address *local_address;
+ const struct tsocket_address *remote_address;
+ const char *remote_hostname;
+
+ struct tevent_context *ev_ctx;
+ struct messaging_context *msg_ctx;
+
+ enum protocol_types protocol;
+
+ struct {
+ struct {
+ uint32_t capabilities;
+ struct GUID guid;
+ uint16_t security_mode;
+ uint16_t num_dialects;
+ uint16_t *dialects;
+ } client;
+ struct {
+ uint32_t capabilities;
+ struct GUID guid;
+ uint16_t security_mode;
+ uint16_t dialect;
+ uint32_t max_trans;
+ uint32_t max_read;
+ uint32_t max_write;
+ } server;
+ } smb2;
+};
+
+NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn,
+ enum protocol_types protocol);
+
struct smbd_smb2_request {
struct smbd_smb2_request *prev, *next;
const char *remote_hostname;
struct tevent_context *ev_ctx;
struct messaging_context *msg_ctx;
+ struct sys_notify_context *sys_notify_ctx;
+ struct notify_context *notify_ctx;
struct {
bool got_session;
} nbt;
size_t num_connections;
struct connection_struct *connections;
+ size_t num_files;
struct files_struct *files;
+
struct bitmap *file_bmap;
int real_max_open_files;
- int files_used;
struct fsp_singleton_cache fsp_fi_cache;
unsigned long file_gen_counter;
int first_file;
uint64_t num_requests;
+ /* Current number of oplocks we have outstanding. */
+ struct {
+ int32_t exclusive_open;
+ int32_t level_II_open;
+ } oplocks;
+
struct {
struct fd_event *fde;
struct {
bool encrypted_passwords;
bool spnego;
- struct auth_context *auth_context;
+ struct auth4_context *auth_context;
bool done;
/*
* Size of the data we can receive. Set by us.
uint32_t max_trans;
uint32_t max_read;
uint32_t max_write;
+ bool supports_multicredit;
struct bitmap *credits_bitmap;
bool compound_related_in_progress;
} smb2;
+
+ struct smbXsrv_connection *conn;
};
-extern struct smbd_server_connection *smbd_server_conn;
+extern struct smbXsrv_connection *global_smbXsrv_connection;
void smbd_init_globals(void);