along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef _SOURCE3_SMBD_GLOBALS_H_
+#define _SOURCE3_SMBD_GLOBALS_H_
+
#include "system/select.h"
#include "librpc/gen_ndr/smbXsrv.h"
#include "smbprofile.h"
extern struct smbd_dmapi_context *dmapi_ctx;
#endif
-/* how many write cache buffers have been allocated */
-extern unsigned int allocated_write_caches;
-
/* A singleton cache to speed up searching by dev/inode. */
struct fsp_singleton_cache {
files_struct *fsp;
struct conn_ctx {
connection_struct *conn;
uint64_t vuid;
- bool need_chdir;
- bool done_chdir;
userdom_struct user_info;
};
/* A stack of current_user connection contexts. */
void smbd_lock_socket(struct smbXsrv_connection *xconn);
void smbd_unlock_socket(struct smbXsrv_connection *xconn);
-NTSTATUS smbd_do_locking(struct smb_request *req,
- files_struct *fsp,
- uint8_t type,
- int32_t timeout,
- uint16_t num_locks,
- struct smbd_lock_element *locks,
- bool *async);
+struct GUID smbd_request_guid(struct smb_request *smb1req, uint16_t idx);
+
NTSTATUS smbd_do_unlocking(struct smb_request *req,
files_struct *fsp,
uint16_t num_ulocks,
- struct smbd_lock_element *ulocks);
+ struct smbd_lock_element *ulocks,
+ enum brl_flavour lock_flav);
NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
TALLOC_CTX *mem_ctx,
+ struct smb_request *req,
uint16_t info_level,
files_struct *fsp,
struct smb_filename *smb_fname,
uint32_t dirtype,
bool dont_descend,
bool ask_sharemode,
+ bool get_dosmode,
bool (*match_fn)(TALLOC_CTX *ctx,
void *private_data,
const char *dname,
bool (*mode_fn)(TALLOC_CTX *ctx,
void *private_data,
struct smb_filename *smb_fname,
+ bool get_dosmode,
uint32_t *_mode),
void *private_data,
char **_fname,
int requires_resume_key,
bool dont_descend,
bool ask_sharemode,
+ bool get_dosmode,
uint8_t align,
bool do_pad,
char **ppdata,
char *base_data,
char *end_data,
int space_remaining,
+ struct smb_filename **smb_fname,
bool *got_exact_match,
int *_last_entry_off,
struct ea_list *name_list,
void send_break_message_smb2(files_struct *fsp,
uint32_t break_from,
uint32_t break_to);
-struct blocking_lock_record *get_pending_smb2req_blr(struct smbd_smb2_request *smb2req);
-bool push_blocking_lock_request_smb2( struct byte_range_lock *br_lck,
- struct smb_request *req,
- files_struct *fsp,
- int lock_timeout,
- int lock_num,
- uint64_t smblctx,
- enum brl_type lock_type,
- enum brl_flavour lock_flav,
- uint64_t offset,
- uint64_t count,
- uint64_t blocking_smblctx);
-void process_blocking_lock_queue_smb2(
- struct smbd_server_connection *sconn, struct timeval tv_curr);
-void cancel_pending_lock_requests_by_fid_smb2(files_struct *fsp,
- struct byte_range_lock *br_lck,
- enum file_close_type close_type);
/* From smbd/smb2_create.c */
int map_smb2_oplock_levels_to_samba(uint8_t in_oplock_level);
bool get_deferred_open_message_state_smb2(struct smbd_smb2_request *smb2req,
struct smbXsrv_client *client;
-
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 smbd_smb2_request *current_req);
NTSTATUS smb2srv_session_shutdown_recv(struct tevent_req *req);
NTSTATUS smbXsrv_session_logoff(struct smbXsrv_session *session);
-NTSTATUS smbXsrv_session_logoff_all(struct smbXsrv_connection *conn);
+NTSTATUS smbXsrv_session_logoff_all(struct smbXsrv_client *client);
NTSTATUS smb1srv_session_table_init(struct smbXsrv_connection *conn);
NTSTATUS smb1srv_session_lookup(struct smbXsrv_connection *conn,
uint16_t vuid, NTTIME now,
NTSTATUS smb1srv_tcon_lookup(struct smbXsrv_connection *conn,
uint16_t tree_id, NTTIME now,
struct smbXsrv_tcon **tcon);
-NTSTATUS smb1srv_tcon_disconnect_all(struct smbXsrv_connection *conn);
+NTSTATUS smb1srv_tcon_disconnect_all(struct smbXsrv_client *client);
NTSTATUS smb2srv_tcon_table_init(struct smbXsrv_session *session);
NTSTATUS smb2srv_tcon_create(struct smbXsrv_session *session,
NTTIME now,
struct auth_session_info *session_info,
NTTIME now,
struct smbXsrv_open **_open);
-uint32_t smbXsrv_open_hash(struct smbXsrv_open *_open);
NTSTATUS smbXsrv_open_update(struct smbXsrv_open *_open);
NTSTATUS smbXsrv_open_close(struct smbXsrv_open *op, NTTIME now);
NTSTATUS smb1srv_open_table_init(struct smbXsrv_connection *conn);
struct messaging_context *msg_ctx;
struct notify_context *notify_ctx;
bool using_smb2;
- bool aapl_zero_file_id; /* Apple-specific */
int trans_num;
size_t num_users;
struct {
struct bitmap *dptr_bmap;
struct dptr_struct *dirptrs;
- int dirhandles_open;
} searches;
uint64_t num_requests;
struct {
struct notify_mid_map *notify_mid_maps;
-
- struct {
- /* dlink list we store pending lock records on. */
- struct blocking_lock_record *blocking_lock_queue;
- /* dlink list we move cancelled lock records onto. */
- struct blocking_lock_record *blocking_lock_cancelled_queue;
-
- /* The event that makes us process our blocking lock queue */
- struct tevent_timer *brl_timeout;
-
- bool blocking_lock_unlock_state;
- bool blocking_lock_cancel_state;
- } locks;
} smb1;
- struct {
- struct {
- /* The event that makes us process our blocking lock queue */
- struct tevent_timer *brl_timeout;
- bool blocking_lock_unlock_state;
- } locks;
- } smb2;
struct pthreadpool_tevent *pool;
extern struct smbXsrv_client *global_smbXsrv_client;
void smbd_init_globals(void);
+
+#endif /* _SOURCE3_SMBD_GLOBALS_H_ */