s3:smbd/oplock: pass smbd_server_connection to linux_init_kernel_oplocks()
[kai/samba.git] / source3 / smbd / proto.h
index ab7d0a80136a3f99e653e20ad70cc91f89c7492f..22eeae988ee285c1af1cd5a19b057fd7bf0fef15 100644 (file)
@@ -86,6 +86,7 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
                                uint64_t in_offset,
                                DATA_BLOB in_data,
                                bool write_through);
+bool cancel_smb2_aio(struct smb_request *smbreq);
 int wait_for_aio_completion(files_struct *fsp);
 void cancel_aio_by_fsp(files_struct *fsp);
 void smbd_aio_complete_aio_ex(struct aio_extra *aio_ex);
@@ -163,6 +164,7 @@ void msg_force_tdis(struct messaging_context *msg,
 
 bool yield_connection(connection_struct *conn, const char *name);
 int count_current_connections( const char *sharename, bool clear  );
+bool connections_snum_used(struct smbd_server_connection *unused, int snum);
 bool claim_connection(connection_struct *conn, const char *name);
 
 /* The following definitions come from smbd/dfree.c  */
@@ -239,8 +241,6 @@ void DirCacheAdd(struct smb_Dir *dirp, const char *name, long offset);
 bool SearchDir(struct smb_Dir *dirp, const char *name, long *poffset);
 NTSTATUS can_delete_directory(struct connection_struct *conn,
                                const char *dirname);
-NTSTATUS smbd_can_delete_directory(struct connection_struct *conn,
-                               const char *dirname);
 
 /* The following definitions come from smbd/dmapi.c  */
 
@@ -303,17 +303,12 @@ void reply_openerror(struct smb_request *req, NTSTATUS status);
 
 /* The following definitions come from smbd/file_access.c  */
 
-bool can_access_file_acl(struct connection_struct *conn,
-                        const struct smb_filename *smb_fname,
-                        uint32_t access_mask);
 bool can_delete_file_in_directory(connection_struct *conn,
-                                 struct smb_filename *smb_fname);
-bool can_access_file_data(connection_struct *conn,
-                         const struct smb_filename *smb_fname,
-                         uint32 access_mask);
+                                 const struct smb_filename *smb_fname);
 bool can_write_to_file(connection_struct *conn,
                       const struct smb_filename *smb_fname);
 bool directory_has_default_acl(connection_struct *conn, const char *fname);
+NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode);
 
 /* The following definitions come from smbd/fileio.c  */
 
@@ -342,6 +337,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                      const char *orig_path,
                      struct smb_filename **smb_fname,
                      uint32_t ucf_flags);
+NTSTATUS check_veto_path(connection_struct *conn, const char *name);
 NTSTATUS check_name(connection_struct *conn, const char *name);
 int get_real_filename(connection_struct *conn, const char *path,
                      const char *name, TALLOC_CTX *mem_ctx,
@@ -448,6 +444,7 @@ bool is_msdfs_link(connection_struct *conn,
 struct junction_map;
 NTSTATUS get_referred_path(TALLOC_CTX *ctx,
                        const char *dfs_path,
+                       struct smbd_server_connection *sconn,
                        struct junction_map *jucn,
                        int *consumedcntp,
                        bool *self_referralp);
@@ -457,11 +454,11 @@ int setup_dfs_referral(connection_struct *orig_conn,
                        char **ppdata, NTSTATUS *pstatus);
 bool create_junction(TALLOC_CTX *ctx,
                const char *dfs_path,
+               bool allow_broken_path,
                struct junction_map *jucn);
 bool create_msdfs_link(const struct junction_map *jucn);
 bool remove_msdfs_link(const struct junction_map *jucn);
-struct junction_map *enum_msdfs_links(struct smbd_server_connection *sconn,
-                                     TALLOC_CTX *ctx, size_t *p_num_jn);
+struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, size_t *p_num_jn);
 NTSTATUS resolve_dfspath(TALLOC_CTX *ctx,
                        connection_struct *conn,
                        bool dfs_pathnames,
@@ -577,11 +574,9 @@ void reply_nttranss(struct smb_request *req);
 
 /* The following definitions come from smbd/open.c  */
 
-NTSTATUS smb1_file_se_access_check(connection_struct *conn,
-                               const struct security_descriptor *sd,
-                               const struct security_token *token,
-                               uint32_t access_desired,
-                               uint32_t *access_granted);
+NTSTATUS smbd_check_access_rights(struct connection_struct *conn,
+                               const struct smb_filename *smb_fname,
+                               uint32_t access_mask);
 NTSTATUS fd_close(files_struct *fsp);
 void change_file_owner_to_parent(connection_struct *conn,
                                 const char *inherit_from_dir,
@@ -674,18 +669,18 @@ void smbd_contend_level2_oplocks_end(files_struct *fsp,
                                enum level2_contention_type type);
 void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e);
 void message_to_share_mode_entry(struct share_mode_entry *e, char *msg);
-bool init_oplocks(struct messaging_context *msg_ctx);
+bool init_oplocks(struct smbd_server_connection *sconn);
 
 /* The following definitions come from smbd/oplock_irix.c  */
 
-struct kernel_oplocks *irix_init_kernel_oplocks(TALLOC_CTX *mem_ctx) ;
+struct kernel_oplocks *irix_init_kernel_oplocks(struct smbd_server_connection *sconn);
 
 /* The following definitions come from smbd/oplock_linux.c  */
 
 void linux_set_lease_capability(void);
 int linux_set_lease_sighandler(int fd);
 int linux_setlease(int fd, int leasetype);
-struct kernel_oplocks *linux_init_kernel_oplocks(TALLOC_CTX *mem_ctx) ;
+struct kernel_oplocks *linux_init_kernel_oplocks(struct smbd_server_connection *sconn);
 
 /* The following definitions come from smbd/oplock_onefs.c  */
 
@@ -963,7 +958,6 @@ void init_sec_ctx(void);
 
 /* The following definitions come from smbd/server.c  */
 
-struct event_context *smbd_event_context(void);
 struct messaging_context *smbd_messaging_context(void);
 struct memcache *smbd_memcache(void);
 void delete_and_reload_printers(struct tevent_context *ev,
@@ -972,7 +966,8 @@ bool reload_services(struct messaging_context *msg_ctx, int smb_sock,
                     bool test);
 void exit_server(const char *const explanation);
 void exit_server_cleanly(const char *const explanation);
-void exit_server_fault(void);
+NTSTATUS messaging_send_to_children(struct messaging_context *msg_ctx,
+                                   uint32_t msg_type, DATA_BLOB* data);
 
 /* The following definitions come from smbd/service.c  */
 
@@ -1038,6 +1033,7 @@ void stat_cache_add( const char *full_orig_name,
                char *translated_path,
                bool case_sensitive);
 bool stat_cache_lookup(connection_struct *conn,
+                       bool posix_paths,
                        char **pp_name,
                        char **pp_dirpath,
                        char **pp_start,
@@ -1062,6 +1058,10 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf);
 
 /* The following definitions come from smbd/trans2.c  */
 
+NTSTATUS check_access(connection_struct *conn,
+                               files_struct *fsp,
+                               const struct smb_filename *smb_fname,
+                               uint32_t access_mask);
 uint64_t smb_roundup(connection_struct *conn, uint64_t val);
 uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf);
 NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
@@ -1177,6 +1177,12 @@ int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname,
                        SMB_STRUCT_STAT *psbuf);
 NTSTATUS vfs_stat_fsp(files_struct *fsp);
 NTSTATUS vfs_chown_fsp(files_struct *fsp, uid_t uid, gid_t gid);
+NTSTATUS vfs_streaminfo(connection_struct *conn,
+                       struct files_struct *fsp,
+                       const char *fname,
+                       TALLOC_CTX *mem_ctx,
+                       unsigned int *num_streams,
+                       struct stream_struct **streams);
 
 /* The following definitions come from smbd/avahi_register.c */
 
@@ -1185,6 +1191,6 @@ void *avahi_start_register(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 
 /* The following definitions come from smbd/msg_idmap.c */
 
-void id_cache_register_kill_msg(struct messaging_context *ctx);
+void msg_idmap_register_msg(struct messaging_context *ctx);
 
 #endif /* _SMBD_PROTO_H_ */