ctdb/docs: Include ceph rados namespace support in man page
[samba.git] / source3 / smbd / proto.h
index 32e5c33896b6f880f802a88609e32ae8625d58e1..ba7218f4d1cd065ced45d9b3e8c101e27e4062a5 100644 (file)
@@ -52,7 +52,6 @@ struct dcesrv_context;
 
 /* The following definitions come from smbd/smb2_signing.c */
 
-bool smb2_srv_init_signing(struct smbXsrv_connection *conn);
 bool srv_init_signing(struct smbXsrv_connection *conn);
 
 /* The following definitions come from smbd/aio.c  */
@@ -143,6 +142,8 @@ bool has_other_nonposix_opens(struct share_mode_lock *lck,
 
 int conn_num_open(struct smbd_server_connection *sconn);
 bool conn_snum_used(struct smbd_server_connection *sconn, int snum);
+enum protocol_types conn_protocol(struct smbd_server_connection *sconn);
+bool conn_using_smb2(struct smbd_server_connection *sconn);
 connection_struct *conn_new(struct smbd_server_connection *sconn);
 bool conn_idle_all(struct smbd_server_connection *sconn, time_t t);
 void conn_clear_vuid_caches(struct smbd_server_connection *sconn, uint64_t vuid);
@@ -176,72 +177,6 @@ uint64_t get_dfree_info(connection_struct *conn, struct smb_filename *fname,
                        uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
 void flush_dfree_cache(void);
 
-/* The following definitions come from smbd/dir.c  */
-
-bool init_dptrs(struct smbd_server_connection *sconn);
-const char *dptr_path(struct smbd_server_connection *sconn, int key);
-const char *dptr_wcard(struct smbd_server_connection *sconn, int key);
-uint16_t dptr_attr(struct smbd_server_connection *sconn, int key);
-void dptr_closecnum(connection_struct *conn);
-NTSTATUS dptr_create(connection_struct *conn,
-               struct smb_request *req,
-               files_struct *fsp,
-               bool old_handle,
-               bool expect_close,
-               uint16_t spid,
-               const char *wcard,
-               uint32_t attr,
-               struct dptr_struct **dptr_ret);
-void dptr_CloseDir(files_struct *fsp);
-void dptr_SeekDir(struct dptr_struct *dptr, long offset);
-long dptr_TellDir(struct dptr_struct *dptr);
-bool dptr_has_wild(struct dptr_struct *dptr);
-int dptr_dnum(struct dptr_struct *dptr);
-bool dptr_get_priv(struct dptr_struct *dptr);
-void dptr_set_priv(struct dptr_struct *dptr);
-bool dptr_case_sensitive(struct dptr_struct *dptr);
-bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst);
-bool dptr_fill(struct smbd_server_connection *sconn,
-              char *buf1,unsigned int key);
-files_struct *dptr_fetch_fsp(struct smbd_server_connection *sconn,
-                              char *buf,int *num);
-struct smb_Dir;
-struct files_struct *dir_hnd_fetch_fsp(struct smb_Dir *dir_hnd);
-files_struct *dptr_fetch_lanman2_fsp(struct smbd_server_connection *sconn,
-                                      int dptr_num);
-bool get_dir_entry(TALLOC_CTX *ctx,
-               struct dptr_struct *dirptr,
-               const char *mask,
-               uint32_t dirtype,
-               char **pp_fname_out,
-               off_t *size,
-               uint32_t *mode,
-               struct timespec *date,
-               bool check_descend,
-               bool ask_sharemode);
-struct smb_Dir;
-bool is_visible_fsp(files_struct *fsp);
-NTSTATUS OpenDir(TALLOC_CTX *mem_ctx,
-                connection_struct *conn,
-                const struct smb_filename *smb_dname,
-                const char *mask,
-                uint32_t attr,
-                struct smb_Dir **_dir_hnd);
-NTSTATUS OpenDir_from_pathref(TALLOC_CTX *mem_ctx,
-                             struct files_struct *dirfsp,
-                             const char *mask,
-                             uint32_t attr,
-                             struct smb_Dir **_dir_hnd);
-const char *ReadDirName(struct smb_Dir *dir_hnd, long *poffset,
-                       SMB_STRUCT_STAT *sbuf, char **talloced);
-void RewindDir(struct smb_Dir *dir_hnd, long *poffset);
-void SeekDir(struct smb_Dir *dirp, long offset);
-long TellDir(struct smb_Dir *dirp);
-NTSTATUS can_delete_directory(struct connection_struct *conn,
-                               const char *dirname);
-bool have_file_open_below(connection_struct *conn,
-                       const struct smb_filename *name);
-
 /* The following definitions come from smbd/dmapi.c  */
 
 const void *dmapi_get_current_session(void);
@@ -262,7 +197,8 @@ mode_t unix_mode(connection_struct *conn, int dosmode,
                 const struct smb_filename *smb_fname,
                 struct files_struct *parent_dirfsp);
 uint32_t dos_mode_msdfs(connection_struct *conn,
-                     const struct smb_filename *smb_fname);
+                       const char *name,
+                       const struct stat_ex *st);
 uint32_t fdos_mode(struct files_struct *fsp);
 struct tevent_req *dos_mode_at_send(TALLOC_CTX *mem_ctx,
                                    struct tevent_context *ev,
@@ -362,13 +298,6 @@ char *get_original_lcomp(TALLOC_CTX *ctx,
                        connection_struct *conn,
                        const char *filename_in,
                        uint32_t ucf_flags);
-NTSTATUS filename_convert_smb1_search_path(TALLOC_CTX *ctx,
-                                          connection_struct *conn,
-                                          char *name_in,
-                                          uint32_t ucf_flags,
-                                          struct files_struct **_dirfsp,
-                                          struct smb_filename **_smb_fname_out,
-                                          char **_mask_out);
 NTSTATUS get_real_filename_at(struct files_struct *dirfsp,
                              const char *name,
                              TALLOC_CTX *mem_ctx,
@@ -448,21 +377,32 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp,
 NTSTATUS open_stream_pathref_fsp(
        struct files_struct **_base_fsp,
        struct smb_filename *smb_fname);
-NTSTATUS openat_pathref_dirfsp_nosymlink(
+
+struct reparse_data_buffer;
+
+NTSTATUS openat_pathref_fsp_nosymlink(
        TALLOC_CTX *mem_ctx,
        struct connection_struct *conn,
+       struct files_struct *dirfsp,
        const char *path_in,
        NTTIME twrp,
        bool posix,
        struct smb_filename **_smb_fname,
-       size_t *unparsed,
-       char **substitute);
+       struct reparse_data_buffer **_symlink_err);
+NTSTATUS openat_pathref_fsp_lcomp(struct files_struct *dirfsp,
+                                 struct smb_filename *smb_fname_rel,
+                                 uint32_t ucf_flags);
 NTSTATUS readlink_talloc(
        TALLOC_CTX *mem_ctx,
        struct files_struct *dirfsp,
        struct smb_filename *smb_relname,
        char **_substitute);
 
+NTSTATUS read_symlink_reparse(TALLOC_CTX *mem_ctx,
+                             struct files_struct *dirfsp,
+                             struct smb_filename *smb_relname,
+                             struct reparse_data_buffer **_reparse);
+
 void smb_fname_fsp_unlink(struct smb_filename *smb_fname);
 
 NTSTATUS move_smb_fname_fsp_link(struct smb_filename *smb_fname_dst,
@@ -556,11 +496,6 @@ bool remove_msdfs_link(const struct junction_map *jucn,
 struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx,
                                      struct auth_session_info *session_info,
                                      size_t *p_num_jn);
-NTSTATUS dfs_filename_convert(TALLOC_CTX *ctx,
-                             connection_struct *conn,
-                             uint32_t ucf_flags,
-                             const char *dfs_path_in,
-                             char **pp_path_out);
 struct connection_struct;
 struct smb_filename;
 
@@ -793,11 +728,6 @@ void smbd_contend_level2_oplocks_begin(files_struct *fsp,
                                  enum level2_contention_type type);
 void smbd_contend_level2_oplocks_end(files_struct *fsp,
                                enum level2_contention_type type);
-void share_mode_entry_to_message(char *msg, const struct file_id *id,
-                                const struct share_mode_entry *e);
-void message_to_share_mode_entry(struct file_id *id,
-                                struct share_mode_entry *e,
-                                const char *msg);
 bool init_oplocks(struct smbd_server_connection *sconn);
 void init_kernel_oplocks(struct smbd_server_connection *sconn);
 
@@ -871,15 +801,12 @@ NTSTATUS make_default_filesystem_acl(
 
 /* The following definitions come from smbd/smb2_process.c  */
 
-bool smb2_srv_send(struct smbXsrv_connection *xconn, char *buffer,
-                  bool no_signing, uint32_t seqnum,
-                  bool do_encrypt,
-                  struct smb_perfcount_data *pcd);
 #if !defined(WITH_SMB1SERVER)
-bool smb1_srv_send(struct smbXsrv_connection *xconn, char *buffer,
-                  bool do_signing, uint32_t seqnum,
-                  bool do_encrypt,
-                  struct smb_perfcount_data *pcd);
+bool smb1_srv_send(struct smbXsrv_connection *xconn,
+                  char *buffer,
+                  bool do_signing,
+                  uint32_t seqnum,
+                  bool do_encrypt);
 #endif
 size_t srv_smb1_set_message(char *buf,
                       size_t num_words,
@@ -913,9 +840,11 @@ bool create_smb1_outbuf(TALLOC_CTX *mem_ctx, struct smb_request *req,
 void construct_smb1_reply_common_req(struct smb_request *req, char *outbuf);
 void reply_smb1_outbuf(struct smb_request *req, uint8_t num_words, uint32_t num_bytes);
 void process_smb(struct smbXsrv_connection *xconn,
-                uint8_t *inbuf, size_t nread, size_t unread_bytes,
-                uint32_t seqnum, bool encrypted,
-                struct smb_perfcount_data *deferred_pcd);
+                uint8_t *inbuf,
+                size_t nread,
+                size_t unread_bytes,
+                uint32_t seqnum,
+                bool encrypted);
 void smbd_process(struct tevent_context *ev_ctx,
                  struct messaging_context *msg_ctx,
                  int sock_fd,
@@ -935,9 +864,11 @@ bool disk_quotas(connection_struct *conn, struct smb_filename *fname,
 
 /* The following definitions come from smbd/smb2_reply.c  */
 
-NTSTATUS check_path_syntax(char *path);
-NTSTATUS check_path_syntax_posix(char *path);
-NTSTATUS check_path_syntax_smb2(char *path, bool dfs_path);
+NTSTATUS check_path_syntax(char *path, bool posix);
+NTSTATUS smb1_strip_dfs_path(TALLOC_CTX *mem_ctx,
+                            uint32_t *ucf_flags,
+                            char **in_path);
+NTSTATUS smb2_strip_dfs_path(const char *in_path, const char **out_path);
 size_t srvstr_get_path(TALLOC_CTX *ctx,
                        const char *inbuf,
                        uint16_t smb_flags2,
@@ -980,7 +911,6 @@ ssize_t sendfile_short_send(struct smbXsrv_connection *xconn,
                            size_t smb_maxcnt);
 NTSTATUS rename_internals_fsp(connection_struct *conn,
                        files_struct *fsp,
-                       struct files_struct *dst_dirfsp,
                        struct smb_filename *smb_fname_dst_in,
                        const char *dst_original_lcomp,
                        uint32_t attrs,
@@ -990,7 +920,6 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
                        struct smb_request *req,
                        struct files_struct *src_dirfsp,
                        struct smb_filename *smb_fname_src,
-                       struct files_struct *dst_dirfsp,
                        struct smb_filename *smb_fname_dst,
                        const char *dst_original_lcomp,
                        uint32_t attrs,
@@ -1115,8 +1044,8 @@ NTSTATUS smb_set_file_disposition_info(connection_struct *conn,
                                       files_struct *fsp,
                                       struct smb_filename *smb_fname);
 NTSTATUS refuse_symlink_fsp(const struct files_struct *fsp);
-NTSTATUS check_access_fsp(struct files_struct *fsp,
-                         uint32_t access_mask);
+NTSTATUS check_any_access_fsp(struct files_struct *fsp,
+                             uint32_t access_requested);
 uint64_t smb_roundup(connection_struct *conn, uint64_t val);
 bool samba_private_attr_name(const char *unix_ea_name);
 NTSTATUS get_ea_value_fsp(TALLOC_CTX *mem_ctx,
@@ -1134,9 +1063,7 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
                connection_struct *conn,
                struct smb_request *req,
                bool overwrite_if_exists,
-               struct files_struct *old_dirfsp,
                const struct smb_filename *smb_fname_old,
-               struct files_struct *new_dirfsp,
                struct smb_filename *smb_fname_new);
 NTSTATUS smb_set_file_time(connection_struct *conn,
                           files_struct *fsp,
@@ -1229,8 +1156,7 @@ int vfs_set_blocking(files_struct *fsp, bool set);
 off_t vfs_transfer_file(files_struct *in, files_struct *out, off_t n);
 const char *vfs_readdirname(connection_struct *conn,
                            struct files_struct *dirfsp,
-                           void *p,
-                           SMB_STRUCT_STAT *sbuf,
+                           DIR *d,
                            char **talloced);
 int vfs_ChDir(connection_struct *conn,
                        const struct smb_filename *smb_fname);
@@ -1271,21 +1197,12 @@ NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
                                       files_struct **result,
                                       DATA_BLOB *new_cookie);
 
-/* The following definitions come from smbd/smb2_posix.c */
-ssize_t smb2_posix_cc_info(
+struct smb3_file_posix_information;
+void smb3_file_posix_information_init(
        connection_struct *conn,
-       uint32_t reparse_tag,
-       const SMB_STRUCT_STAT *psbuf,
-       const struct dom_sid *owner,
-       const struct dom_sid *group,
-       uint8_t *buf,
-       size_t buflen);
-ssize_t store_smb2_posix_info(
-       connection_struct *conn,
-       const SMB_STRUCT_STAT *psbuf,
+       const struct stat_ex *st,
        uint32_t reparse_tag,
        uint32_t dos_attributes,
-       uint8_t *buf,
-       size_t buflen);
+       struct smb3_file_posix_information *dst);
 
 #endif /* _SMBD_PROTO_H_ */