501ac2ab7dc032cbf47078004b76fb77dd572baf
[jra/samba/.git] / source4 / librpc / idl / xattr.idl
1 #include "idl_types.h"
2
3 /*
4    IDL structures for xattr file attributes
5
6    this has nothing to do with RPC, we are just using our NDR/IDL
7    infrastructure as a convenient way to store linearised information
8    about a file in a architecture independent manner
9 */
10
11 [
12   depends(security)
13 ]
14 interface xattr
15 {
16         const string XATTR_DOSATTRIB_NAME = "user.DosAttrib";
17         const string XATTR_DOSATTRIB_ESTIMATED_SIZE = 64;
18
19         /* we store basic dos attributes in a DosAttrib xattr. By
20            using a union we can cope with new version of this
21            structure more easily */
22
23         typedef struct {
24                 uint32 attrib;
25                 uint32 ea_size;
26                 uint64 size;
27                 uint64 alloc_size;
28                 NTTIME create_time;
29                 NTTIME change_time;
30         } xattr_DosInfo1;
31
32         const int XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME = 0x1;
33
34         typedef struct {
35                 uint32     flags;
36                 uint32     attrib;
37                 uint32     ea_size;
38                 uint64     size;
39                 uint64     alloc_size;
40                 NTTIME     create_time;
41                 NTTIME     change_time;
42                 NTTIME     write_time; /* only used when sticky write time is set */
43                 utf8string name;       /* will be used for case-insensitive speedup */
44         } xattr_DosInfo2;
45
46         typedef union {
47                 [case(1)] xattr_DosInfo1 info1;
48                 [case(2)] xattr_DosInfo2 info2;
49         } xattr_DosInfo;
50
51         typedef [public] struct {
52                 uint16 version;
53                 [switch_is(version)] xattr_DosInfo info;
54         } xattr_DosAttrib;
55
56
57         /* we store DOS style extended attributes in a DosEAs xattr */
58         const string XATTR_DOSEAS_NAME = "user.DosEAs";
59
60         typedef struct {
61                 utf8string name;
62                 DATA_BLOB value;
63         } xattr_EA;
64
65         typedef [public] struct {
66                 uint16 num_eas;
67                 [size_is(num_eas)] xattr_EA *eas;
68         } xattr_DosEAs;
69
70         /* we store stream information in this xattr structure. Then
71            the streams themselves are stored in
72            user.DosStream.STREAMNAME or in external files, according
73            to the flags */
74         const string XATTR_DOSSTREAMS_NAME = "user.DosStreams";
75
76         const int XATTR_STREAM_FLAG_INTERNAL = 0x00000001;
77
78         /* stream data is stored in attributes with the given prefix */
79         const string XATTR_DOSSTREAM_PREFIX = "user.DosStream.";
80
81         const int XATTR_MAX_STREAM_SIZE = 0x4000;
82
83         typedef struct {
84                 uint32     flags;
85                 uint64     size;
86                 uint64     alloc_size;
87                 utf8string name;
88         } xattr_DosStream;
89
90         typedef [public] struct {
91                 uint32 num_streams;
92                 [size_is(num_streams)] xattr_DosStream *streams;
93         } xattr_DosStreams;
94
95
96         /* we store the NT ACL a NTACL xattr. It is versioned so we
97            can later add other acl attribs (such as posix acl mapping)
98            
99            we put this xattr in the security namespace to ensure that
100            only trusted users can write to the ACL
101         */
102         const string XATTR_NTACL_NAME = "security.NTACL";
103
104         typedef union {
105                 [case(1)] security_descriptor *sd;
106         } xattr_NTACL_Info;
107
108         typedef [public] struct {
109                 uint16 version;
110                 [switch_is(version)] xattr_NTACL_Info info;
111         } xattr_NTACL;
112
113 }