summaryrefslogtreecommitdiff
path: root/source3/modules/onefs.h
blob: b12a67e36720a1f44cc1572918510a98b8b65bc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/*
 * Unix SMB/CIFS implementation.
 * Support for OneFS
 *
 * Copyright (C) Steven Danneman, 2008
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _ONEFS_H
#define _ONEFS_H

/*
 * vfs interface handlers
 */
DIR *onefs_opendir(struct vfs_handle_struct *handle,
			      const char *fname, const char *mask,
			      uint32 attributes);

struct dirent *onefs_readdir(struct vfs_handle_struct *handle,
				 DIR *dirp, SMB_STRUCT_STAT *sbuf);

void onefs_seekdir(struct vfs_handle_struct *handle, DIR *dirp,
		   long offset);

long onefs_telldir(struct vfs_handle_struct *handle, DIR *dirp);

void onefs_rewinddir(struct vfs_handle_struct *handle, DIR *dirp);

int onefs_closedir(struct vfs_handle_struct *handle, DIR *dir);

void onefs_init_search_op(struct vfs_handle_struct *handle,
			  DIR *dirp);

NTSTATUS onefs_create_file(vfs_handle_struct *handle,
			   struct smb_request *req,
			   uint16_t root_dir_fid,
			   struct smb_filename *smb_fname,
			   uint32_t access_mask,
			   uint32_t share_access,
			   uint32_t create_disposition,
			   uint32_t create_options,
			   uint32_t file_attributes,
			   uint32_t oplock_request,
			   uint64_t allocation_size,
			   struct security_descriptor *sd,
			   struct ea_list *ea_list,
			   files_struct **result,
			   int *pinfo);

int onefs_close(vfs_handle_struct *handle, struct files_struct *fsp);

int onefs_rename(vfs_handle_struct *handle,
		 const struct smb_filename *smb_fname_src,
		 const struct smb_filename *smb_fname_dst);

int onefs_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname);

int onefs_fstat(vfs_handle_struct *handle, struct files_struct *fsp,
		SMB_STRUCT_STAT *sbuf);

int onefs_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname);

int onefs_unlink(vfs_handle_struct *handle,
		 const struct smb_filename *smb_fname);

NTSTATUS onefs_streaminfo(vfs_handle_struct *handle,
			  struct files_struct *fsp,
			  const char *fname,
			  TALLOC_CTX *mem_ctx,
			  unsigned int *num_streams,
			  struct stream_struct **streams);

int onefs_vtimes_streams(vfs_handle_struct *handle,
			 const struct smb_filename *smb_fname,
			 int flags, struct timespec times[3]);

NTSTATUS onefs_brl_lock_windows(vfs_handle_struct *handle,
				struct byte_range_lock *br_lck,
				struct lock_struct *plock,
				bool blocking_lock,
				struct blocking_lock_record *blr);

bool onefs_brl_unlock_windows(vfs_handle_struct *handle,
			      struct messaging_context *msg_ctx,
			      struct byte_range_lock *br_lck,
			      const struct lock_struct *plock);

bool onefs_brl_cancel_windows(vfs_handle_struct *handle,
			      struct byte_range_lock *br_lck,
			      struct lock_struct *plock,
			      struct blocking_lock_record *blr);

bool onefs_strict_lock(vfs_handle_struct *handle,
			files_struct *fsp,
			struct lock_struct *plock);

void onefs_strict_unlock(vfs_handle_struct *handle,
			files_struct *fsp,
			struct lock_struct *plock);

NTSTATUS onefs_notify_watch(vfs_handle_struct *vfs_handle,
			    struct sys_notify_context *ctx,
			    struct notify_entry *e,
			    void (*callback)(struct sys_notify_context *ctx,
					void *private_data,
					struct notify_event *ev),
			    void *private_data,
			    void *handle_p);

NTSTATUS onefs_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
			   uint32 security_info, struct security_descriptor **ppdesc);

NTSTATUS onefs_get_nt_acl(vfs_handle_struct *handle, const char* name,
			  uint32 security_info, struct security_descriptor **ppdesc);

NTSTATUS onefs_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
			   uint32 security_info_sent,
			   const struct security_descriptor *psd);

/*
 * Utility functions
 */
struct ifs_security_descriptor;
NTSTATUS onefs_samba_sd_to_sd(uint32_t security_info_sent,
			      const struct security_descriptor *psd,
			      struct ifs_security_descriptor *sd, int snum,
			      uint32_t *security_info_effective);

NTSTATUS onefs_stream_prep_smb_fname(TALLOC_CTX *ctx,
				     const struct smb_filename *smb_fname_in,
				     struct smb_filename **smb_fname_out);

int onefs_rdp_add_dir_state(connection_struct *conn, DIR *dirp);

/*
 * System Interfaces
 */
int onefs_sys_create_file(connection_struct *conn,
			  int base_fd,
			  const char *path,
		          uint32_t access_mask,
		          uint32_t open_access_mask,
			  uint32_t share_access,
			  uint32_t create_options,
			  int flags,
			  mode_t mode,
			  int oplock_request,
			  uint64_t id,
			  struct security_descriptor *sd,
			  uint32_t ntfs_flags,
			  int *granted_oplock);

ssize_t onefs_sys_sendfile(connection_struct *conn, int tofd, int fromfd,
			   const DATA_BLOB *header, off_t offset,
			   size_t count);

ssize_t onefs_sys_recvfile(int fromfd, int tofd, off_t offset,
			   size_t count);

void init_stat_ex_from_onefs_stat(struct stat_ex *dst, const struct stat *src);

int onefs_sys_stat(const char *fname, SMB_STRUCT_STAT *sbuf);

int onefs_sys_fstat(int fd, SMB_STRUCT_STAT *sbuf);

int onefs_sys_fstat_at(int base_fd, const char *fname, SMB_STRUCT_STAT *sbuf,
		       int flags);

int onefs_sys_lstat(const char *fname, SMB_STRUCT_STAT *sbuf);



#endif /* _ONEFS_H */