4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/vnode.h>
40 #include <sys/nvpair.h>
42 /* Attribute names for nvlist's */
43 #define A_CRTIME "crtime"
44 #define A_HIDDEN "hidden"
45 #define A_SYSTEM "system"
46 #define A_READONLY "readonly"
47 #define A_ARCHIVE "archive"
48 #define A_NOUNLINK "nounlink"
49 #define A_IMMUTABLE "immutable"
50 #define A_APPENDONLY "appendonly"
51 #define A_NODUMP "nodump"
52 #define A_OPAQUE "opaque"
53 #define A_AV_QUARANTINED "av_quarantined"
54 #define A_AV_MODIFIED "av_modified"
56 #define A_AV_SCANSTAMP "av_scanstamp"
57 #define A_OWNERSID "ownersid"
58 #define A_GROUPSID "groupsid"
60 /* Attribute option for utilities */
63 #define O_READONLY "R"
65 #define O_NOUNLINK "u"
66 #define O_IMMUTABLE "i"
67 #define O_APPENDONLY "a"
69 #define O_AV_QUARANTINED "q"
70 #define O_AV_MODIFIED "m"
73 /* ownersid and groupsid are composed of two nvpairs */
74 #define SID_DOMAIN "domain"
98 #define VIEW_READONLY "SUNWattr_ro"
99 #define VIEW_READWRITE "SUNWattr_rw"
102 * These are the supported views into the virtual sysattr directory.
103 * Additional views should be added before XATTR_VIEW_LAST.
106 XATTR_VIEW_INVALID
= -1,
108 XATTR_VIEW_READWRITE
,
115 xattr_view_t x_xattr_view
;
116 data_type_t x_data_type
;
120 #define XATTR_MAXFIDSZ NFS_FHMAXDATA
124 char parent_fid
[XATTR_MAXFIDSZ
];
129 #define XATTR_FIDSZ (sizeof (xattr_fid_t) - sizeof (uint16_t))
131 int xattr_dir_vget(vfs_t
*, vnode_t
**, fid_t
*);
132 int xattr_sysattr_casechk(char *name
);
135 int attr_count(void);
136 const char *attr_to_name(f_attr_t
);
137 const char *attr_to_option(f_attr_t
);
138 f_attr_t
name_to_attr(const char *name
);
139 f_attr_t
option_to_attr(const char *option
);
140 xattr_view_t
attr_to_xattr_view(f_attr_t attr
);
141 data_type_t
attr_to_data_type(f_attr_t attr
);
147 #endif /* _SYS_ATTR_H */