r21331: add comment about how the cleartext password is stored
[samba.git] / source4 / librpc / idl / drsblobs.idl
1 #include "idl_types.h"
2
3 import "drsuapi.idl";
4
5 [
6   uuid("12345778-1234-abcd-0001-00000001"),
7   version(0.0),
8   pointer_default(unique),
9   helpstring("Active Directory Replication LDAP Blobs")
10 ]
11 interface drsblobs {
12         declare bitmap drsuapi_DsReplicaSyncOptions;
13         declare bitmap drsuapi_DsReplicaNeighbourFlags;
14         declare [v1_enum] enum drsuapi_DsAttributeId;
15
16         /*
17          * replPropertyMetaData
18          * w2k  uses version 1
19          * w2k3 uses version 1
20          */
21         typedef struct {
22                 drsuapi_DsAttributeId attid;
23                 uint32 version;
24                 NTTIME_1sec orginating_time;
25                 GUID orginating_invocation_id;
26                 hyper orginating_usn;
27                 hyper local_usn;
28         } replPropertyMetaData1;
29
30         typedef struct {
31                 uint32 count;
32                 uint32 reserved;
33                 replPropertyMetaData1 array[count];
34         } replPropertyMetaDataCtr1;
35
36         typedef [nodiscriminant] union {
37                 [case(1)] replPropertyMetaDataCtr1 ctr1;
38         } replPropertyMetaDataCtr;
39         
40         typedef [public] struct {
41                 uint32 version;
42                 uint32 reserved;
43                 [switch_is(version)] replPropertyMetaDataCtr ctr;
44         } replPropertyMetaDataBlob;
45
46         void decode_replPropertyMetaData(
47                 [in] replPropertyMetaDataBlob blob
48                 );
49
50         /*
51          * replUpToDateVector
52          * w2k  uses version 1
53          * w2k3 uses version 2
54          */
55         typedef struct {
56                 uint32 count;
57                 uint32 reserved;
58                 drsuapi_DsReplicaCursor cursors[count];
59         } replUpToDateVectorCtr1;
60
61         typedef struct {
62                 uint32 count;
63                 uint32 reserved;
64                 drsuapi_DsReplicaCursor2 cursors[count];
65         } replUpToDateVectorCtr2;
66
67         typedef [nodiscriminant] union {
68                 [case(1)] replUpToDateVectorCtr1 ctr1;
69                 [case(2)] replUpToDateVectorCtr2 ctr2;
70         } replUpToDateVectorCtr;
71
72         typedef [public] struct {
73                 uint32 version;
74                 uint32 reserved;
75                 [switch_is(version)] replUpToDateVectorCtr ctr;
76         } replUpToDateVectorBlob;
77
78         void decode_replUpToDateVector(
79                 [in] replUpToDateVectorBlob blob
80                 );
81
82         /*
83          * repsFrom/repsTo
84          * w2k  uses version 1
85          * w2k3 uses version 1
86          */
87         typedef [public,gensize] struct {
88                 asclstr dns_name;
89         } repsFromTo1OtherInfo;
90
91         typedef [public,gensize,flag(NDR_PAHEX)] struct {
92                 /* this includes the 8 bytes of the repsFromToBlob header */
93                 [value(ndr_size_repsFromTo1(r, ndr->flags)+8)] uint32 blobsize;
94                 uint32 consecutive_sync_failures;
95                 NTTIME_1sec last_success;
96                 NTTIME_1sec last_attempt;
97                 WERROR result_last_attempt;
98                 [relative] repsFromTo1OtherInfo *other_info;
99                 [value(ndr_size_repsFromTo1OtherInfo(other_info, ndr->flags))] uint32 other_info_length;
100                 drsuapi_DsReplicaNeighbourFlags replica_flags;
101                 uint8 schedule[84];
102                 uint32 reserved;
103                 drsuapi_DsReplicaHighWaterMark highwatermark;
104                 GUID source_dsa_obj_guid; /* the 'objectGuid' field of the CN=NTDS Settings object */
105                 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
106                 GUID transport_guid;
107         } repsFromTo1;
108
109         typedef [nodiscriminant] union {
110                 [case(1)] repsFromTo1 ctr1;
111         } repsFromTo;
112
113         typedef [public] struct {
114                 uint32 version;
115                 uint32 reserved;
116                 [switch_is(version)] repsFromTo ctr;
117         } repsFromToBlob;
118
119         void decode_repsFromTo(
120                 [in] repsFromToBlob blob
121                 );
122
123         /*
124          * partialAttributeSet
125          * w2k  uses version 1
126          * w2k3 uses version 1
127          */
128         typedef struct {
129                 uint32 count;
130                 drsuapi_DsAttributeId array[count];
131         } partialAttributeSetCtr1;
132
133         typedef [nodiscriminant] union {
134                 [case(1)] partialAttributeSetCtr1 ctr1;
135         } partialAttributeSetCtr;
136
137         typedef [public] struct {
138                 uint32 version;
139                 uint32 reserved;
140                 [switch_is(version)] partialAttributeSetCtr ctr;
141         } partialAttributeSetBlob;
142
143         void decode_partialAttributeSet(
144                 [in] partialAttributeSetBlob blob
145                 );
146
147         /*
148          * prefixMap
149          * w2k  unknown
150          * w2k3 unknown
151          * samba4 uses 0x44544442 'DSDB'
152          *
153          * as we windows don't return the prefixMap attribute when you ask for
154          * we don't know the format, but the attribute is not replicated
155          * so that we can choose our own format...
156          */
157         typedef [v1_enum] enum {
158                 PREFIX_MAP_VERSION_DSDB = 0x44544442
159         } prefixMapVersion;
160
161         typedef [nodiscriminant] union {
162                 [case(PREFIX_MAP_VERSION_DSDB)] drsuapi_DsReplicaOIDMapping_Ctr dsdb;
163         } prefixMapCtr;
164
165         typedef [public] struct {
166                 prefixMapVersion version;
167                 uint32 reserved;
168                 [switch_is(version)] prefixMapCtr ctr;
169         } prefixMapBlob;
170
171         void decode_prefixMap(
172                 [in] prefixMapBlob blob
173                 );
174
175         /*
176          * the cookie for the LDAP dirsync control
177          */
178         typedef [nodiscriminant,gensize] union {
179                 [case(0)];
180                 [default] replUpToDateVectorBlob uptodateness_vector;
181         } ldapControlDirSyncExtra;
182
183         typedef struct {
184                 [value(3)] uint32 u1;
185                 NTTIME time;
186                 uint32 u2;
187                 uint32 u3;
188                 [value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, 0))] 
189                         uint32 extra_length;
190                 drsuapi_DsReplicaHighWaterMark highwatermark;
191                 GUID guid1;
192                 [switch_is(extra_length)] ldapControlDirSyncExtra extra;
193         } ldapControlDirSyncBlob;
194
195         typedef [public,relative_base] struct {
196                 [charset(DOS),value("MSDS")] uint8 msds[4];
197                 [subcontext(0)] ldapControlDirSyncBlob blob;
198         } ldapControlDirSyncCookie;
199
200         void decode_ldapControlDirSync(
201                 [in] ldapControlDirSyncCookie cookie
202                 );
203
204         typedef struct {
205                 uint16 name_len;
206                 uint16 data_len;
207                 uint16 unknown1; /* 2 for name = 'Packages', 1 for name = 'Primary:*' */
208                 [charset(UTF16)] uint8 name[name_len];
209                 /* 
210                  * the data field contains data as HEX strings
211                  *
212                  * 'Packages':
213                  *    it seems to contains HEX strings
214                  *    of GUID's concatenated together.
215                  *    w2k only has 'Primary:Kerberos'
216                  *    and there's a 32 byte hex string.
217                  *    w2k3 also has 'Primary:WDigest'
218                  *    and there's a 64 byte hex string.
219                  *    ...but this 'Primary:CLEARTEXT'
220                  *    also there's a 104 byte hex string
221                  *    (instead of 3 * (16*2) = 96 ).
222                  *
223                  * 'Primary:Kerberos':
224                  *    ...
225                  *
226                  * 'Primary:WDigest':
227                  *    ...
228                  *
229                  * 'Primary:CLEARTEXT':
230                  *    data contains the cleartext password
231                  *    as UTF16 string encoded as HEX string
232                  */
233                 [charset(DOS)] uint8 data[data_len];
234         } supplementalCredentialsPackage;
235
236         /* this are 0x30 (48) whitespaces (0x20) followed by 'P' (0x50) */
237         const string SUPPLEMENTAL_CREDENTIALS_PREFIX = "                                                P";
238
239         typedef struct {
240                 [value(SUPPLEMENTAL_CREDENTIALS_PREFIX),charset(UTF16)] uint16 prefix[0x31];
241                 uint16 num_packages;
242                 supplementalCredentialsPackage packages[num_packages];
243         } supplementalCredentialsSubBlob;
244
245         typedef [public] struct {
246                 [value(0)] uint32 unknown1;
247                 uint32 __ndr_size;
248                 [value(0)] uint32 unknown2;
249                 [subcontext(0),subcontext_size(__ndr_size)] supplementalCredentialsSubBlob sub;
250                 [value(0)] uint8 unknown3;
251         } supplementalCredentialsBlob;
252
253         void decode_supplementalCredentials(
254                 [in] supplementalCredentialsBlob blob
255                 );
256
257         typedef [public] struct {
258                 uint32 marker;
259                 DATA_BLOB data;
260         } DsCompressedChunk;
261
262         typedef [public] struct {
263                 DsCompressedChunk chunks[5];
264         } DsCompressedBlob;
265
266         void decode_DsCompressed(
267                 [in] DsCompressedBlob blob
268                 );
269 }