WHATSNEW: SMB3 Directory Leases
[samba4-gss.git] / source3 / smbd / dir.h
blob21e4632eb632102da3e0ac7d7e5b32ae10e867bd
1 /*
2 * Unix SMB/Netbios implementation.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef _SOURCE3_SMBD_DIR_H_
19 #define _SOURCE3_SMBD_DIR_H_
21 #include "includes.h"
23 struct smb_Dir;
24 struct dptr_struct;
26 NTSTATUS can_delete_directory_fsp(files_struct *fsp);
27 struct files_struct *dir_hnd_fetch_fsp(struct smb_Dir *dir_hnd);
28 uint16_t dptr_attr(struct smbd_server_connection *sconn, int key);
29 bool dptr_case_sensitive(struct dptr_struct *dptr);
30 void dptr_closecnum(connection_struct *conn);
31 void dptr_CloseDir(files_struct *fsp);
32 NTSTATUS dptr_create(connection_struct *conn,
33 struct smb_request *req,
34 files_struct *fsp,
35 bool old_handle,
36 const char *wcard,
37 uint32_t attr,
38 struct dptr_struct **dptr_ret);
39 int dptr_dnum(struct dptr_struct *dptr);
40 files_struct *dptr_fetch_lanman2_fsp(struct smbd_server_connection *sconn,
41 int dptr_num);
42 unsigned int dptr_FileNumber(struct dptr_struct *dptr);
43 bool dptr_get_priv(struct dptr_struct *dptr);
44 bool dptr_has_wild(struct dptr_struct *dptr);
45 const char *dptr_path(struct smbd_server_connection *sconn, int key);
46 char *dptr_ReadDirName(TALLOC_CTX *ctx, struct dptr_struct *dptr);
47 void dptr_RewindDir(struct dptr_struct *dptr);
48 void dptr_set_priv(struct dptr_struct *dptr);
49 const char *dptr_wcard(struct smbd_server_connection *sconn, int key);
50 bool have_file_open_below(struct files_struct *fsp);
51 bool opens_below_forall(struct connection_struct *conn,
52 const struct smb_filename *dir_name,
53 int (*fn)(struct share_mode_data *data,
54 struct share_mode_entry *e,
55 void *private_data),
56 void *private_data);
57 bool opens_below_forall_read(struct connection_struct *conn,
58 const struct smb_filename *dir_name,
59 int (*fn)(const struct share_mode_data *data,
60 const struct share_mode_entry *e,
61 void *private_data),
62 void *private_data);
63 bool init_dptrs(struct smbd_server_connection *sconn);
64 bool is_visible_fsp(files_struct *fsp);
65 NTSTATUS OpenDir(TALLOC_CTX *mem_ctx,
66 connection_struct *conn,
67 const struct smb_filename *smb_dname,
68 const char *mask,
69 uint32_t attr,
70 struct smb_Dir **_dir_hnd);
71 NTSTATUS OpenDir_from_pathref(TALLOC_CTX *mem_ctx,
72 struct files_struct *dirfsp,
73 const char *mask,
74 uint32_t attr,
75 struct smb_Dir **_dir_hnd);
76 const char *ReadDirName(struct smb_Dir *dir_hnd, char **talloced);
77 void RewindDir(struct smb_Dir *dir_hnd);
78 bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
79 struct dptr_struct *dirptr,
80 const char *mask,
81 uint32_t dirtype,
82 bool dont_descend,
83 bool ask_sharemode,
84 bool get_dosmode,
85 bool (*match_fn)(TALLOC_CTX *ctx,
86 void *private_data,
87 const char *dname,
88 const char *mask,
89 char **_fname),
90 void *private_data,
91 char **_fname,
92 struct smb_filename **_smb_fname,
93 uint32_t *_mode);
94 char *smbd_dirptr_get_last_name_sent(struct dptr_struct *dirptr);
95 void smbd_dirptr_push_overflow(struct dptr_struct *dirptr,
96 char **_fname,
97 struct smb_filename **_smb_fname,
98 uint32_t mode);
99 void smbd_dirptr_set_last_name_sent(struct dptr_struct *dirptr, char **_fname);
100 #endif