r3428: switched to using minimal includes for the auto-generated RPC code.
[samba.git] / source4 / librpc / idl / misc.idl
1 #include "idl_types.h"
2
3 /*
4   miscellaneous IDL structures
5 */
6
7 interface misc
8 {
9         /* a NULL sid */
10         const string SID_NULL = "S-1-0-0";
11
12         /* the world domain */
13         const string SID_WORLD_DOMAIN = "S-1-1";
14         const string SID_WORLD        = "S-1-1-0";
15
16         /* SECURITY_CREATOR_SID_AUTHORITY */
17         const string SID_CREATOR_OWNER_DOMAIN = "S-1-3";
18         const string SID_CREATOR_OWNER        = "S-1-3-0";
19         const string SID_CREATOR_GROUP        = "S-1-3-1";
20
21         /* SECURITY_NT_AUTHORITY */
22         const string SID_NT_AUTHORITY        = "S-1-5";
23         const string SID_NETWORK             = "S-1-5-2";
24         const string SID_ANONYMOUS           = "S-1-5-7";
25         const string SID_AUTHENTICATED_USERS = "S-1-5-11";
26         const string SID_SYSTEM              = "S-1-5-18";
27
28         /* SECURITY_BUILTIN_DOMAIN_RID */
29         const string SID_BUILTIN                   = "S-1-5-32";
30         const string SID_BUILTIN_ADMINISTRATORS    = "S-1-5-32-544";
31         const string SID_BUILTIN_USERS             = "S-1-5-32-545";
32         const string SID_BUILTIN_GUESTS            = "S-1-5-32-546";
33         const string SID_BUILTIN_POWER_USERS       = "S-1-5-32-547";
34         const string SID_BUILTIN_ACCOUNT_OPERATORS = "S-1-5-32-548";
35         const string SID_BUILTIN_SERVER_OPERATORS  = "S-1-5-32-549";
36         const string SID_BUILTIN_PRINT_OPERATORS   = "S-1-5-32-550";
37         const string SID_BUILTIN_BACKUP_OPERATORS  = "S-1-5-32-551";
38         const string SID_BUILTIN_REPLICATOR        = "S-1-5-32-552";
39
40         /* server roles */
41         typedef enum {
42                 ROLE_STANDALONE    = 0,
43                 ROLE_DOMAIN_MEMBER = 1,
44                 ROLE_DOMAIN_BDC    = 2,
45                 ROLE_DOMAIN_PDC    = 3
46         } samr_Role;
47
48
49         typedef [public,noprint,gensize] struct {
50                 uint32 time_low;
51                 uint16 time_mid;
52                 uint16 time_hi_and_version;
53                 uint8  clock_seq[2];
54                 uint8  node[6];
55         } GUID;
56
57         /* a domain SID. Note that unlike Samba3 this contains a pointer,
58            so you can't copy them using assignment */
59         typedef [public,noprint] struct {
60                 uint8  sid_rev_num;             /**< SID revision number */
61                 uint8  num_auths;               /**< Number of sub-authorities */
62                 uint8  id_auth[6];              /**< Identifier Authority */
63                 uint32 sub_auths[num_auths];
64         } dom_sid;
65
66         typedef [public] struct {
67                 uint8 type;  /* xxxx_xxxx_ACE_TYPE - e.g allowed / denied etc */
68                 uint8 flags; /* xxxx_INHERIT_xxxx - e.g OBJECT_INHERIT_ACE */
69                 [value(ndr_size_security_ace(r))] uint16 size;
70                 uint32 access_mask;
71
72 #if 0
73                 /* the 'obj' part is present when type is XXXX_TYPE_XXXX_OBJECT */
74                 struct {
75                         uint32 flags;
76                         GUID object_guid;
77                         GUID inherit_guid;
78                 } *obj;
79 #endif
80
81                 dom_sid trustee;
82         } security_ace;
83
84         typedef [public] struct {
85                 uint16 revision;
86                 [value(ndr_size_security_acl(r))] uint16 size;
87                 uint32 num_aces;
88                 security_ace aces[num_aces];
89         } security_acl;
90
91         /* default revision for new ACLs */
92         const int SD_REVISION                    = 1;
93
94         /* security_descriptor->type bits */
95         const int SEC_DESC_OWNER_DEFAULTED       = 0x0001;
96         const int SEC_DESC_GROUP_DEFAULTED       = 0x0002;
97         const int SEC_DESC_DACL_PRESENT          = 0x0004;
98         const int SEC_DESC_DACL_DEFAULTED        = 0x0008;
99         const int SEC_DESC_SACL_PRESENT          = 0x0010;
100         const int SEC_DESC_SACL_DEFAULTED        = 0x0020;
101         const int SEC_DESC_DACL_TRUSTED          = 0x0040;
102         const int SEC_DESC_SERVER_SECURITY       = 0x0080;
103         const int SEC_DESC_DACL_AUTO_INHERIT_REQ = 0x0100;
104         const int SEC_DESC_SACL_AUTO_INHERIT_REQ = 0x0200;
105         const int SEC_DESC_DACL_AUTO_INHERITED   = 0x0400;
106         const int SEC_DESC_SACL_AUTO_INHERITED   = 0x0800;
107         const int SEC_DESC_DACL_PROTECTED        = 0x1000;
108         const int SEC_DESC_SACL_PROTECTED        = 0x2000;
109         const int SEC_DESC_RM_CONTROL_VALID      = 0x4000;
110         const int SEC_DESC_SELF_RELATIVE         = 0x8000;
111
112         typedef [public,flag(NDR_LITTLE_ENDIAN)] struct {
113                 uint8 revision;
114                 uint16 type;     /* SEC_DESC_xxxx flags */
115                 [relative] dom_sid *owner_sid; 
116                 [relative] dom_sid *group_sid;
117                 [relative] security_acl *sacl; /* system ACL */
118                 [relative] security_acl *dacl; /* user (discretionary) ACL */
119         } security_descriptor;
120
121         typedef [public] struct {
122                 uint32 handle_type;
123                 GUID   uuid;
124         } policy_handle;
125
126         /* this is also used in samr and netlogon */
127         typedef [public, flag(NDR_PAHEX)] struct {
128                 uint16 units_per_week;
129                 [size_is(1260), length_is(units_per_week/8)] uint8 *bitmap;
130         } samr_LogonHours;
131
132         typedef [public, flag(NDR_PAHEX)] struct {
133                 uint8 hash[16];
134         } samr_Password;
135
136         typedef [public,flag(NDR_PAHEX)] struct {
137                 uint8 key[16];
138         } netr_UserSessionKey;
139
140         typedef [public,flag(NDR_PAHEX)] struct {
141                 uint8 key[8];
142         } netr_LMSessionKey;
143
144         typedef [public, flag(NDR_PAHEX)] struct {
145                 uint8 data[8];
146         } netr_Credential;
147
148         typedef [public] struct {
149                 netr_Credential cred;
150                 time_t timestamp;
151         } netr_Authenticator;
152
153 }