#include <atalk/vfs.h>Go to the source code of this file.
Data Structures | |
| struct | ea_entry |
| struct | ea |
Macros | |
| #define | ENOATTR ENODATA |
| #define | MAX_EA_SIZE 3802 |
| #define | MAX_REPLY_EXTRA_BYTES 6 |
| #define | ATTRNAMEBUFSIZ 4096 |
| #define | XATTR_CREATE 0x1 |
| #define | XATTR_REPLACE 0x2 |
| #define | AD_EA_META "org.netatalk.Metadata" |
| #define | AD_EA_META_LEN (sizeof(AD_EA_META) - 1) |
| #define | AD_EA_RESO "org.netatalk.ResourceFork" |
| #define | NOT_NETATALK_EA(a) |
| #define | EA_INITED 0xea494e54 |
| #define | EA_MAGIC 0x61644541 |
| #define | EA_VERSION1 0x01 |
| #define | EA_VERSION EA_VERSION1 |
| #define | EA_MAGIC_OFF 0 |
| #define | EA_MAGIC_LEN 4 |
| #define | EA_VERSION_OFF (EA_MAGIC_OFF + EA_MAGIC_LEN) |
| #define | EA_VERSION_LEN 2 |
| #define | EA_COUNT_OFF (EA_VERSION_OFF + EA_VERSION_LEN) |
| #define | EA_COUNT_LEN 2 |
| #define | EA_HEADER_SIZE (EA_MAGIC_LEN + EA_VERSION_LEN + EA_COUNT_LEN) |
Enumerations | |
| enum | { kXAttrNoFollow = 0x1 , kXAttrCreate = 0x2 , kXAttrReplace = 0x4 } |
| enum | eaflags_t { EA_CREATE = (1 << 1) , EA_RDONLY = (1 << 2) , EA_RDWR = (1 << 3) , EA_DIR = (1 << 4) } |
Functions | |
| ssize_t | sys_getxattr (const char *path, const char *name, void *value, size_t size) |
| ssize_t | sys_lgetxattr (const char *path, const char *name, void *value, size_t size) |
| ssize_t | sys_fgetxattr (int filedes, const char *name, void *value, size_t size) |
| ssize_t | sys_listxattr (const char *path, char *list, size_t size) |
| ssize_t | sys_llistxattr (const char *path, char *list, size_t size) |
| ssize_t | sys_flistxattr (int filedes, const char *path, char *list, size_t size) |
| int | sys_removexattr (const char *path, const char *name) |
| int | sys_lremovexattr (const char *path, const char *name) |
| int | sys_fremovexattr (int filedes, const char *path, const char *name) |
| int | sys_setxattr (const char *path, const char *name, const void *value, size_t size, int flags) |
| int | sys_lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags) |
| int | sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags) |
| int | sys_copyxattr (const char *src, const char *dst) |
| int | sys_getxattrfd (int fd, const char *uname, int oflag,...) |
| int | get_easize (const struct vol *vol, char *rbuf, size_t *rbuflen, const char *uname, int oflag, const char *attruname, int fd) |
| get size of an EA | |
| int | get_eacontent (const struct vol *vol, char *rbuf, size_t *rbuflen, const char *uname, int oflag, const char *attruname, int maxreply, int fd) |
| copy EA into rbuf | |
| int | list_eas (const struct vol *vol, char *attrnamebuf, size_t *buflen, const char *uname, int oflag, int fd) |
| copy names of EAs into attrnamebuf | |
| int | set_ea (const struct vol *vol, const char *uname, const char *attruname, const char *ibuf, size_t attrsize, int oflag, int fd) |
| set a Solaris native EA | |
| int | remove_ea (const struct vol *vol, const char *uname, const char *attruname, int oflag, int fd) |
| remove a EA from a file | |
| int | ea_deletefile (const struct vol *vol, int dirfd, const char *file) |
| int | ea_renamefile (const struct vol *vol, int dirfd, const char *src, const char *dst) |
| int | ea_copyfile (const struct vol *vol, int sfd, const char *src, const char *dst) |
| copy EAs | |
| int | ea_chown (const struct vol *vol, const char *path, uid_t uid, gid_t gid) |
| int | ea_chmod_file (const struct vol *vol, const char *name, mode_t mode, struct stat *st) |
| int | ea_chmod_dir (const struct vol *vol, const char *name, mode_t mode, struct stat *st) |
| int | sys_get_easize (const struct vol *vol, char *rbuf, size_t *rbuflen, const char *uname, int oflag, const char *attruname, int fd) |
| get size of a native EA | |
| int | sys_get_eacontent (const struct vol *vol, char *rbuf, size_t *rbuflen, const char *uname, int oflag, const char *attruname, int maxreply, int fd) |
| copy native EA into rbuf | |
| int | sys_list_eas (const struct vol *vol, char *attrnamebuf, size_t *buflen, const char *uname, int oflag, int fd) |
| copy names of native EAs into attrnamebuf | |
| int | sys_set_ea (const struct vol *vol, const char *uname, const char *attruname, const char *ibuf, size_t attrsize, int oflag, int fd) |
| set a native EA | |
| int | sys_remove_ea (const struct vol *vol, const char *uname, const char *attruname, int oflag, int fd) |
| remove a native EA | |
| int | sys_ea_copyfile (const struct vol *vol, int sfd, const char *src, const char *dst) |
| copy EAs | |
| int | ea_open (const struct vol *vol, const char *uname, eaflags_t eaflags, struct ea *ea) |
| open EA header file, create if it doesnt exits and called with O_CREATE | |
| int | ea_openat (const struct vol *vol, int dirfd, const char *uname, eaflags_t eaflags, struct ea *ea) |
| openat like wrapper for ea_open, takes a additional file descriptor | |
| int | ea_close (struct ea *ea) |
| flushes and closes an ea handle | |
| char * | ea_path (const struct ea *ea, const char *eaname, int macname) |
| return name of ea header filename | |
| #define AD_EA_META "org.netatalk.Metadata" |
| #define AD_EA_META_LEN (sizeof(AD_EA_META) - 1) |
| #define AD_EA_RESO "org.netatalk.ResourceFork" |
| #define ATTRNAMEBUFSIZ 4096 |
Library user must provide a static buffer of size ATTRNAMEBUFSIZ. It's used when listing EAs as intermediate buffer. For afpd it's defined in extattrs.c.
| #define EA_COUNT_LEN 2 |
| #define EA_COUNT_OFF (EA_VERSION_OFF + EA_VERSION_LEN) |
| #define EA_HEADER_SIZE (EA_MAGIC_LEN + EA_VERSION_LEN + EA_COUNT_LEN) |
| #define EA_INITED 0xea494e54 |
ea"INT", for interfacing ea_open w. ea_close
| #define EA_MAGIC 0x61644541 |
"adEA"
| #define EA_MAGIC_LEN 4 |
| #define EA_MAGIC_OFF 0 |
| #define EA_VERSION EA_VERSION1 |
| #define EA_VERSION1 0x01 |
| #define EA_VERSION_LEN 2 |
| #define EA_VERSION_OFF (EA_MAGIC_OFF + EA_MAGIC_LEN) |
| #define ENOATTR ENODATA |
| #define MAX_EA_SIZE 3802 |
This seems to be the current limit fo HFS+, we arbitrarily force that which also safes us from buffer overflows
| #define MAX_REPLY_EXTRA_BYTES 6 |
req_count has space for AFP response bitmap and length as well, so 6 bytes
| #define NOT_NETATALK_EA | ( | a | ) |
| #define XATTR_CREATE 0x1 |
set value, fail if attr already exists
| #define XATTR_REPLACE 0x2 |
set value, fail if attr does not exist
| enum eaflags_t |
|
extern |
|
extern |
|
extern |
|
extern |
flushes and closes an ea handle
| [in,out] | ea | pointer to ea handle |
|
extern |
copy EAs
| [in] | vol | current volume |
| [in] | sfd | source file descriptor |
| [in] | src | source path |
| [in] | dst | destination path |
|
extern |
|
extern |
open EA header file, create if it doesnt exits and called with O_CREATE
| [in] | vol | current volume |
| [in] | uname | filename for which we have to open a header |
| [in] | eaflags | flag to control open behavior:
|
| [out] | ea | pointer to a struct ea that we fill |
|
extern |
openat like wrapper for ea_open, takes a additional file descriptor
| [in] | vol | current volume |
| [in] | dirfd | openat like file descriptor |
| [in] | uname | filename for which we have to open a header |
| [in] | eaflags | flag to control open behavior:
|
| [out] | ea | pointer to a struct ea that we fill |
|
extern |
return name of ea header filename
| [in] | ea | ea handle |
| [in] | eaname | name of EA or NULL |
| [in] | macname | if != 0 call mtoupath on eaname |
|
extern |
|
extern |
copy EA into rbuf
| [in] | vol | current volume |
| [out] | rbuf | DSI reply buffer |
| [in,out] | rbuflen | current length of data in reply buffer |
| [in] | uname | filename |
| [in] | oflag | link and create flag |
| [in] | attruname | name of attribute |
| [in] | maxreply | maximum EA size as of current specs/real-life |
| [in] | fd | file descriptor |
|
extern |
get size of an EA
| [in] | vol | current volume |
| [out] | rbuf | DSI reply buffer |
| [in,out] | rbuflen | current length of data in reply buffer |
| [in] | uname | filename |
| [in] | oflag | link and create flag |
| [in] | attruname | name of attribute |
| [in] | fd | file descriptor |
|
extern |
copy names of EAs into attrnamebuf
| [in] | vol | current volume |
| [out] | attrnamebuf | store names a consecutive C strings here |
| [in,out] | buflen | length of names in attrnamebuf |
| [in] | uname | filename |
| [in] | oflag | link and create flag |
| [in] | fd | file descriptor |
|
extern |
remove a EA from a file
| [in] | vol | current volume |
| [in] | uname | filename |
| [in] | attruname | EA name |
| [in] | oflag | link and create flag |
| [in] | fd | file descriptor |
|
extern |
set a Solaris native EA
| [in] | vol | current volume |
| [in] | uname | filename |
| [in] | attruname | EA name |
| [in] | ibuf | buffer with EA content |
| [in] | attrsize | length EA in ibuf |
| [in] | oflag | link and create flag |
| [in] | fd | file descriptor |
| int sys_copyxattr | ( | const char * | src, |
| const char * | dst ) |
|
extern |
copy EAs
| [in] | vol | current volume |
| [in] | sfd | source file descriptor |
| [in] | src | source path |
| [in] | dst | destination path |
| ssize_t sys_fgetxattr | ( | int | filedes, |
| const char * | name, | ||
| void * | value, | ||
| size_t | size ) |
| ssize_t sys_flistxattr | ( | int | filedes, |
| const char * | path, | ||
| char * | list, | ||
| size_t | size ) |
| int sys_fremovexattr | ( | int | filedes, |
| const char * | path, | ||
| const char * | name ) |
| int sys_fsetxattr | ( | int | filedes, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size, | ||
| int | flags ) |
|
extern |
copy native EA into rbuf
| [in] | vol | current volume |
| [out] | rbuf | DSI reply buffer |
| [in,out] | rbuflen | current length of data in reply buffer |
| [in] | uname | filename |
| [in] | oflag | link and create flag |
| [in] | attruname | name of attribute |
| [in] | maxreply | maximum EA size as of current specs/real-life |
| [in] | fd | file descriptor |
|
extern |
get size of a native EA
| [in] | vol | current volume |
| [out] | rbuf | DSI reply buffer |
| [in,out] | rbuflen | current length of data in reply buffer |
| [in] | uname | filename |
| [in] | oflag | link and create flag |
| [in] | attruname | name of attribute |
| [in] | fd | file descriptor |
| ssize_t sys_getxattr | ( | const char * | path, |
| const char * | name, | ||
| void * | value, | ||
| size_t | size ) |
| int sys_getxattrfd | ( | int | fd, |
| const char * | uname, | ||
| int | oflag, | ||
| ... ) |
| ssize_t sys_lgetxattr | ( | const char * | path, |
| const char * | name, | ||
| void * | value, | ||
| size_t | size ) |
|
extern |
copy names of native EAs into attrnamebuf
| [in] | vol | current volume |
| [out] | attrnamebuf | store names a consecutive C strings here |
| [in,out] | buflen | length of names in attrnamebuf |
| [in] | uname | filename |
| [in] | oflag | link and create flag |
| [in] | fd | file descriptor |
| ssize_t sys_listxattr | ( | const char * | path, |
| char * | list, | ||
| size_t | size ) |
| ssize_t sys_llistxattr | ( | const char * | path, |
| char * | list, | ||
| size_t | size ) |
| int sys_lremovexattr | ( | const char * | path, |
| const char * | name ) |
| int sys_lsetxattr | ( | const char * | path, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size, | ||
| int | flags ) |
|
extern |
remove a native EA
| [in] | vol | current volume |
| [in] | uname | filename |
| [in] | attruname | EA name |
| [in] | oflag | link and create flag |
| [in] | fd | file descriptor |
| int sys_removexattr | ( | const char * | path, |
| const char * | name ) |
|
extern |
set a native EA
| [in] | vol | current volume |
| [in] | uname | filename |
| [in] | attruname | EA name |
| [in] | ibuf | buffer with EA content |
| [in] | attrsize | length EA in ibuf |
| [in] | oflag | link and create flag |
| [in] | fd | file descriptor |
| int sys_setxattr | ( | const char * | path, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size, | ||
| int | flags ) |