diff options
Diffstat (limited to 'sftp_server/server.h')
-rw-r--r-- | sftp_server/server.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sftp_server/server.h b/sftp_server/server.h index f4f30a27..b37b1fb4 100644 --- a/sftp_server/server.h +++ b/sftp_server/server.h @@ -44,3 +44,46 @@ struct dir { list *Write; }; +/* acl_* functions returns this : */ +/* 1 : operation allowed */ +/* 0 : operation denied */ +int acl_open(char *file, int mode); +int acl_opendir(char *dir); +int acl_stat(char *file); +int acl_rm(char *file); +int acl_rmdir(char *dir); +int acl_mv(char *from, char *to); +int acl_mkdir(char *dir); +int acl_symlink(char *from, char *to); +int acl_setstat(char *file); + +/* still experimental */ + +#define BLOCKLEN 65536 + +/* here is how it works : */ +/* the buffer is BLOCKLEN long. */ +/* Bytes is the number of valid bytes into the buffer. these valid bytes */ +/* begin at &buffer[0] */ +/* buffer+start is mapped at offset. */ +/* thus, there are (bytes-start) bytes ready to be read. */ + +struct file { + int fd; + u64 offset; + unsigned char buffer[BLOCKLEN]; + int bytes; + int start; // number of the first byte pointed by offset + int mode; + int eof; + int delayed_write; /* there are data into the buffer to be read */ + int write_end; /* end of data, relative to buffer[0] */ + int write_start; /* begining of data */ +}; + + +struct file *file_open(char *filename, int mode); +int file_sync(struct file *file); +int file_close(struct file *file); + + |