fixed options argument to ldb connect in python
[kai/samba.git] / 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         /* Slightly different version, used by the vfs_xattr_tdb module */
79         typedef [public] struct {
80                 uint32 num_eas;
81                 xattr_EA eas[num_eas];
82         } tdb_xattrs;
83
84         /* we store stream information in this xattr structure. Then
85            the streams themselves are stored in
86            user.DosStream.STREAMNAME or in external files, according
87            to the flags */
88         const char *XATTR_DOSSTREAMS_NAME = "user.DosStreams";
89
90         const int XATTR_STREAM_FLAG_INTERNAL = 0x00000001;
91
92         /* stream data is stored in attributes with the given prefix */
93         const char *XATTR_DOSSTREAM_PREFIX = "user.DosStream.";
94
95         const int XATTR_MAX_STREAM_SIZE     = 0x4000;
96         const int XATTR_MAX_STREAM_SIZE_TDB = 0x100000;
97
98         typedef struct {
99                 uint32     flags;
100                 udlong     size;
101                 udlong     alloc_size;
102                 utf8string name;
103         } xattr_DosStream;
104
105         typedef [public] struct {
106                 uint32 num_streams;
107                 [size_is(num_streams)] xattr_DosStream *streams;
108         } xattr_DosStreams;
109
110
111         /* we store the NT ACL a NTACL xattr. It is versioned so we
112            can later add other acl attribs (such as posix acl mapping)
113
114            we put this xattr in the security namespace to ensure that
115            only trusted users can write to the ACL
116
117            stored in "security.NTACL"
118
119            Version 1. raw SD stored as Samba4 does it.
120            Version 2. raw SD + last changed timestamp so we
121                       can discard if this doesn't match the POSIX st_ctime.
122         */
123
124         const char *XATTR_NTACL_NAME = "security.NTACL";
125
126         typedef [public] struct {
127                 security_descriptor *sd;
128                 NTTIME last_changed;
129         } security_descriptor_timestamp;
130
131         typedef [switch_type(uint16)] union {
132                 [case(1)] security_descriptor *sd;
133                 [case(2)] security_descriptor_timestamp *sd_ts;
134         } xattr_NTACL_Info;
135
136         typedef [public] struct {
137                 uint16 version;
138                 [switch_is(version)] xattr_NTACL_Info info;
139         } xattr_NTACL;
140 }