2000-02-03 04:47:50 +00:00
/*
2002-01-30 06:08:46 +00:00
Unix SMB / CIFS implementation .
2000-02-03 04:47:50 +00:00
VFS structures and parameters
Copyright ( C ) Tim Potter 1999
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 2 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 , write to the Free Software
Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
# ifndef _VFS_H
# define _VFS_H
2000-10-05 19:04:41 +00:00
/* Avoid conflict with an AIX include file */
# ifdef vfs_ops
# undef vfs_ops
# endif
2000-10-06 03:21:49 +00:00
/*
* As we ' re now ( thanks Andrew ! : - ) using file_structs and connection
* structs in the vfs - then anyone writing a vfs must include includes . h . . .
*/
2000-02-03 04:47:50 +00:00
2000-11-06 21:44:33 +00:00
/*
* This next constant specifies the version number of the VFS interface
* this smbd will load . Increment this if * ANY * changes are made to the
* vfs_ops below . JRA .
*/
2002-01-10 00:28:09 +00:00
/* Changed to version 2 for CIFS UNIX extensions (mknod and link added). JRA. */
2002-03-12 00:08:08 +00:00
/* Changed to version 3 for POSIX acl extensions. JRA. */
# define SMB_VFS_INTERFACE_VERSION 3
2000-11-06 21:44:33 +00:00
2000-02-03 04:47:50 +00:00
/* VFS operations structure */
2000-10-06 03:21:49 +00:00
struct connection_struct ;
struct files_struct ;
struct security_descriptor_info ;
2000-02-03 04:47:50 +00:00
struct vfs_ops {
2002-01-10 00:28:09 +00:00
/* Disk operations */
2000-02-03 04:47:50 +00:00
2002-01-10 00:28:09 +00:00
int ( * connect ) ( struct connection_struct * conn , const char * service , const char * user ) ;
void ( * disconnect ) ( struct connection_struct * conn ) ;
SMB_BIG_UINT ( * disk_free ) ( struct connection_struct * conn , const char * path , BOOL small_query , SMB_BIG_UINT * bsize ,
SMB_BIG_UINT * dfree , SMB_BIG_UINT * dsize ) ;
2000-02-03 04:47:50 +00:00
2002-01-10 00:28:09 +00:00
/* Directory operations */
2000-02-03 04:47:50 +00:00
2002-01-10 00:28:09 +00:00
DIR * ( * opendir ) ( struct connection_struct * conn , const char * fname ) ;
struct dirent * ( * readdir ) ( struct connection_struct * conn , DIR * dirp ) ;
int ( * mkdir ) ( struct connection_struct * conn , const char * path , mode_t mode ) ;
int ( * rmdir ) ( struct connection_struct * conn , const char * path ) ;
int ( * closedir ) ( struct connection_struct * conn , DIR * dir ) ;
2000-02-03 04:47:50 +00:00
2002-01-10 00:28:09 +00:00
/* File operations */
2000-02-03 04:47:50 +00:00
2002-01-10 00:28:09 +00:00
int ( * open ) ( struct connection_struct * conn , const char * fname , int flags , mode_t mode ) ;
int ( * close ) ( struct files_struct * fsp , int fd ) ;
ssize_t ( * read ) ( struct files_struct * fsp , int fd , void * data , size_t n ) ;
ssize_t ( * write ) ( struct files_struct * fsp , int fd , const void * data , size_t n ) ;
SMB_OFF_T ( * lseek ) ( struct files_struct * fsp , int filedes , SMB_OFF_T offset , int whence ) ;
int ( * rename ) ( struct connection_struct * conn , const char * old , const char * new ) ;
int ( * fsync ) ( struct files_struct * fsp , int fd ) ;
int ( * stat ) ( struct connection_struct * conn , const char * fname , SMB_STRUCT_STAT * sbuf ) ;
int ( * fstat ) ( struct files_struct * fsp , int fd , SMB_STRUCT_STAT * sbuf ) ;
int ( * lstat ) ( struct connection_struct * conn , const char * path , SMB_STRUCT_STAT * sbuf ) ;
int ( * unlink ) ( struct connection_struct * conn , const char * path ) ;
int ( * chmod ) ( struct connection_struct * conn , const char * path , mode_t mode ) ;
int ( * fchmod ) ( struct files_struct * fsp , int fd , mode_t mode ) ;
2001-07-04 07:15:53 +00:00
int ( * chown ) ( struct connection_struct * conn , const char * path , uid_t uid , gid_t gid ) ;
2001-04-14 00:19:12 +00:00
int ( * fchown ) ( struct files_struct * fsp , int fd , uid_t uid , gid_t gid ) ;
2001-07-04 07:15:53 +00:00
int ( * chdir ) ( struct connection_struct * conn , const char * path ) ;
2000-10-06 03:21:49 +00:00
char * ( * getwd ) ( struct connection_struct * conn , char * buf ) ;
2001-07-04 07:15:53 +00:00
int ( * utime ) ( struct connection_struct * conn , const char * path , struct utimbuf * times ) ;
2000-10-06 03:21:49 +00:00
int ( * ftruncate ) ( struct files_struct * fsp , int fd , SMB_OFF_T offset ) ;
BOOL ( * lock ) ( struct files_struct * fsp , int fd , int op , SMB_OFF_T offset , SMB_OFF_T count , int type ) ;
2001-06-29 22:32:24 +00:00
int ( * symlink ) ( struct connection_struct * conn , const char * oldpath , const char * newpath ) ;
int ( * readlink ) ( struct connection_struct * conn , const char * path , char * buf , size_t bufsiz ) ;
2002-01-10 00:28:09 +00:00
int ( * link ) ( struct connection_struct * conn , const char * oldpath , const char * newpath ) ;
int ( * mknod ) ( struct connection_struct * conn , const char * path , mode_t mode , SMB_DEV_T dev ) ;
2000-10-06 03:21:49 +00:00
2001-01-23 01:52:30 +00:00
/* NT ACL operations. */
2000-10-06 03:21:49 +00:00
size_t ( * fget_nt_acl ) ( struct files_struct * fsp , int fd , struct security_descriptor_info * * ppdesc ) ;
2001-07-04 07:15:53 +00:00
size_t ( * get_nt_acl ) ( struct files_struct * fsp , const char * name , struct security_descriptor_info * * ppdesc ) ;
2000-10-06 03:21:49 +00:00
BOOL ( * fset_nt_acl ) ( struct files_struct * fsp , int fd , uint32 security_info_sent , struct security_descriptor_info * psd ) ;
2001-07-04 07:15:53 +00:00
BOOL ( * set_nt_acl ) ( struct files_struct * fsp , const char * name , uint32 security_info_sent , struct security_descriptor_info * psd ) ;
2001-01-23 01:52:30 +00:00
/* POSIX ACL operations. */
2001-07-04 07:15:53 +00:00
int ( * chmod_acl ) ( struct connection_struct * conn , const char * name , mode_t mode ) ;
2001-01-23 01:52:30 +00:00
int ( * fchmod_acl ) ( struct files_struct * fsp , int fd , mode_t mode ) ;
2002-03-12 00:08:08 +00:00
int ( * sys_acl_get_entry ) ( struct connection_struct * conn , SMB_ACL_T theacl , int entry_id , SMB_ACL_ENTRY_T * entry_p ) ;
int ( * sys_acl_get_tag_type ) ( struct connection_struct * conn , SMB_ACL_ENTRY_T entry_d , SMB_ACL_TAG_T * tag_type_p ) ;
int ( * sys_acl_get_permset ) ( struct connection_struct * conn , SMB_ACL_ENTRY_T entry_d , SMB_ACL_PERMSET_T * permset_p ) ;
void * ( * sys_acl_get_qualifier ) ( struct connection_struct * conn , SMB_ACL_ENTRY_T entry_d ) ;
SMB_ACL_T ( * sys_acl_get_file ) ( struct connection_struct * conn , const char * path_p , SMB_ACL_TYPE_T type ) ;
SMB_ACL_T ( * sys_acl_get_fd ) ( struct files_struct * fsp , int fd ) ;
int ( * sys_acl_clear_perms ) ( struct connection_struct * conn , SMB_ACL_PERMSET_T permset ) ;
int ( * sys_acl_add_perm ) ( struct connection_struct * conn , SMB_ACL_PERMSET_T permset , SMB_ACL_PERM_T perm ) ;
char * ( * sys_acl_to_text ) ( struct connection_struct * conn , SMB_ACL_T theacl , ssize_t * plen ) ;
SMB_ACL_T ( * sys_acl_init ) ( struct connection_struct * conn , int count ) ;
int ( * sys_acl_create_entry ) ( struct connection_struct * conn , SMB_ACL_T * pacl , SMB_ACL_ENTRY_T * pentry ) ;
int ( * sys_acl_set_tag_type ) ( struct connection_struct * conn , SMB_ACL_ENTRY_T entry , SMB_ACL_TAG_T tagtype ) ;
int ( * sys_acl_set_qualifier ) ( struct connection_struct * conn , SMB_ACL_ENTRY_T entry , void * qual ) ;
int ( * sys_acl_set_permset ) ( struct connection_struct * conn , SMB_ACL_ENTRY_T entry , SMB_ACL_PERMSET_T permset ) ;
int ( * sys_acl_valid ) ( struct connection_struct * conn , SMB_ACL_T theacl ) ;
int ( * sys_acl_set_file ) ( struct connection_struct * conn , const char * name , SMB_ACL_TYPE_T acltype , SMB_ACL_T theacl ) ;
int ( * sys_acl_set_fd ) ( struct files_struct * fsp , int fd , SMB_ACL_T theacl ) ;
int ( * sys_acl_delete_def_file ) ( struct connection_struct * conn , const char * path ) ;
int ( * sys_acl_get_perm ) ( struct connection_struct * conn , SMB_ACL_PERMSET_T permset , SMB_ACL_PERM_T perm ) ;
int ( * sys_acl_free_text ) ( struct connection_struct * conn , char * text ) ;
int ( * sys_acl_free_acl ) ( struct connection_struct * conn , SMB_ACL_T posix_acl ) ;
int ( * sys_acl_free_qualifier ) ( struct connection_struct * conn , void * qualifier , SMB_ACL_TAG_T tagtype ) ;
2000-02-03 04:47:50 +00:00
} ;
struct vfs_options {
struct vfs_options * prev , * next ;
char * name ;
char * value ;
} ;
# endif /* _VFS_H */