Add in secure channel type used by AD trusts
[kai/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 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 /*
35         We use xattrDosInfo1 again when we store values.
36         Because the sticky write time is now stored in the opendb
37         and xattr_DosInfo2Old is only present to parse existing
38         values from disk.
39
40         const int XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME = 0x1;
41 */
42         typedef struct {
43                 uint32     flags;
44                 uint32     attrib;
45                 uint32     ea_size;
46                 udlong     size;
47                 udlong     alloc_size;
48                 NTTIME     create_time;
49                 NTTIME     change_time;
50                 NTTIME     write_time; /* only used when sticky write time is set */
51                 utf8string name;
52         } xattr_DosInfo2Old;
53
54         typedef [switch_type(uint16)] union {
55                 [case(1)] xattr_DosInfo1 info1;
56                 [case(2)] xattr_DosInfo2Old oldinfo2;
57         } xattr_DosInfo;
58
59         typedef [public] struct {
60                 uint16 version;
61                 [switch_is(version)] xattr_DosInfo info;
62         } xattr_DosAttrib;
63
64
65         /* we store DOS style extended attributes in a DosEAs xattr */
66         const char *XATTR_DOSEAS_NAME = "user.DosEAs";
67
68         typedef struct {
69                 utf8string name;
70                 DATA_BLOB value;
71         } xattr_EA;
72
73         typedef [public] struct {
74                 uint16 num_eas;
75                 [size_is(num_eas)] xattr_EA *eas;
76         } xattr_DosEAs;
77
78         /* we store stream information in this xattr structure. Then
79            the streams themselves are stored in
80            user.DosStream.STREAMNAME or in external files, according
81            to the flags */
82         const char *XATTR_DOSSTREAMS_NAME = "user.DosStreams";
83
84         const int XATTR_STREAM_FLAG_INTERNAL = 0x00000001;
85
86         /* stream data is stored in attributes with the given prefix */
87         const char *XATTR_DOSSTREAM_PREFIX = "user.DosStream.";
88
89         const int XATTR_MAX_STREAM_SIZE     = 0x4000;
90         const int XATTR_MAX_STREAM_SIZE_TDB = 0x100000;
91
92         typedef struct {
93                 uint32     flags;
94                 udlong     size;
95                 udlong     alloc_size;
96                 utf8string name;
97         } xattr_DosStream;
98
99         typedef [public] struct {
100                 uint32 num_streams;
101                 [size_is(num_streams)] xattr_DosStream *streams;
102         } xattr_DosStreams;
103
104
105         /* we store the NT ACL a NTACL xattr. It is versioned so we
106            can later add other acl attribs (such as posix acl mapping)
107
108            we put this xattr in the security namespace to ensure that
109            only trusted users can write to the ACL
110
111            stored in "security.NTACL"
112
113            Version 1. raw SD stored as Samba4 does it.
114            Version 2. raw SD + last changed timestamp so we
115                       can discard if this doesn't match the POSIX st_ctime.
116         */
117
118         const char *XATTR_NTACL_NAME = "security.NTACL";
119
120         typedef [public] struct {
121                 security_descriptor *sd;
122                 NTTIME last_changed;
123         } security_descriptor_timestamp;
124
125         typedef [switch_type(uint16)] union {
126                 [case(1)] security_descriptor *sd;
127                 [case(2)] security_descriptor_timestamp *sd_ts;
128         } xattr_NTACL_Info;
129
130         typedef [public] struct {
131                 uint16 version;
132                 [switch_is(version)] xattr_NTACL_Info info;
133         } xattr_NTACL;
134 }