r21386: Run all NDR tests in the buildfarm, import some functions from Samba3's IDL.
[ira/wip.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 import "security.idl";
12
13 [
14   pointer_default(unique)
15 ]
16 interface xattr
17 {
18         const char *XATTR_DOSATTRIB_NAME = "user.DosAttrib";
19         const int XATTR_DOSATTRIB_ESTIMATED_SIZE = 64;
20
21         /* we store basic dos attributes in a DosAttrib xattr. By
22            using a union we can cope with new version of this
23            structure more easily */
24
25         typedef struct {
26                 uint32 attrib;
27                 uint32 ea_size;
28                 udlong size;
29                 udlong alloc_size;
30                 NTTIME create_time;
31                 NTTIME change_time;
32         } xattr_DosInfo1;
33
34         const int XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME = 0x1;
35
36         typedef struct {
37                 uint32     flags;
38                 uint32     attrib;
39                 uint32     ea_size;
40                 udlong     size;
41                 udlong     alloc_size;
42                 NTTIME     create_time;
43                 NTTIME     change_time;
44                 NTTIME     write_time; /* only used when sticky write time is set */
45                 utf8string name;
46         } xattr_DosInfo2;
47
48         typedef [switch_type(uint16)] union {
49                 [case(1)] xattr_DosInfo1 info1;
50                 [case(2)] xattr_DosInfo2 info2;
51         } xattr_DosInfo;
52
53         typedef [public] struct {
54                 uint16 version;
55                 [switch_is(version)] xattr_DosInfo info;
56         } xattr_DosAttrib;
57
58
59         /* we store DOS style extended attributes in a DosEAs xattr */
60         const char *XATTR_DOSEAS_NAME = "user.DosEAs";
61
62         typedef struct {
63                 utf8string name;
64                 DATA_BLOB value;
65         } xattr_EA;
66
67         typedef [public] struct {
68                 uint16 num_eas;
69                 [size_is(num_eas)] xattr_EA *eas;
70         } xattr_DosEAs;
71
72         /* we store stream information in this xattr structure. Then
73            the streams themselves are stored in
74            user.DosStream.STREAMNAME or in external files, according
75            to the flags */
76         const char *XATTR_DOSSTREAMS_NAME = "user.DosStreams";
77
78         const int XATTR_STREAM_FLAG_INTERNAL = 0x00000001;
79
80         /* stream data is stored in attributes with the given prefix */
81         const char *XATTR_DOSSTREAM_PREFIX = "user.DosStream.";
82
83         const int XATTR_MAX_STREAM_SIZE = 0x4000;
84
85         typedef struct {
86                 uint32     flags;
87                 udlong     size;
88                 udlong     alloc_size;
89                 utf8string name;
90         } xattr_DosStream;
91
92         typedef [public] struct {
93                 uint32 num_streams;
94                 [size_is(num_streams)] xattr_DosStream *streams;
95         } xattr_DosStreams;
96
97
98         /* we store the NT ACL a NTACL xattr. It is versioned so we
99            can later add other acl attribs (such as posix acl mapping)
100            
101            we put this xattr in the security namespace to ensure that
102            only trusted users can write to the ACL
103         */
104         const char *XATTR_NTACL_NAME = "security.NTACL";
105
106         typedef [switch_type(uint16)] union {
107                 [case(1)] security_descriptor *sd;
108         } xattr_NTACL_Info;
109
110         typedef [public] struct {
111                 uint16 version;
112                 [switch_is(version)] xattr_NTACL_Info info;
113         } xattr_NTACL;
114
115 }