3 import "drsuapi.idl", "misc.idl";
6 uuid("12345778-1234-abcd-0001-00000001"),
8 pointer_default(unique),
9 helpstring("Active Directory Replication LDAP Blobs")
12 typedef bitmap drsuapi_DsReplicaSyncOptions drsuapi_DsReplicaSyncOptions;
13 typedef bitmap drsuapi_DsReplicaNeighbourFlags drsuapi_DsReplicaNeighbourFlags;
14 typedef [v1_enum] enum drsuapi_DsAttributeId drsuapi_DsAttributeId;
17 * replPropertyMetaData
22 drsuapi_DsAttributeId attid;
24 NTTIME_1sec originating_change_time;
25 GUID originating_invocation_id;
26 hyper originating_usn;
28 } replPropertyMetaData1;
33 replPropertyMetaData1 array[count];
34 } replPropertyMetaDataCtr1;
36 typedef [nodiscriminant] union {
37 [case(1)] replPropertyMetaDataCtr1 ctr1;
38 } replPropertyMetaDataCtr;
40 typedef [public] struct {
43 [switch_is(version)] replPropertyMetaDataCtr ctr;
44 } replPropertyMetaDataBlob;
46 void decode_replPropertyMetaData(
47 [in] replPropertyMetaDataBlob blob
58 drsuapi_DsReplicaCursor cursors[count];
59 } replUpToDateVectorCtr1;
64 drsuapi_DsReplicaCursor2 cursors[count];
65 } replUpToDateVectorCtr2;
67 typedef [nodiscriminant] union {
68 [case(1)] replUpToDateVectorCtr1 ctr1;
69 [case(2)] replUpToDateVectorCtr2 ctr2;
70 } replUpToDateVectorCtr;
72 typedef [public] struct {
75 [switch_is(version)] replUpToDateVectorCtr ctr;
76 } replUpToDateVectorBlob;
78 void decode_replUpToDateVector(
79 [in] replUpToDateVectorBlob blob
87 typedef [public,gensize] struct {
88 [value(strlen(dns_name)+1)] uint32 __dns_name_size;
89 [charset(DOS)] uint8 dns_name[__dns_name_size];
90 } repsFromTo1OtherInfo;
92 typedef [public,gensize,flag(NDR_PAHEX)] struct {
93 /* this includes the 8 bytes of the repsFromToBlob header */
94 [value(ndr_size_repsFromTo1(this, ndr->flags)+8)] uint32 blobsize;
95 uint32 consecutive_sync_failures;
96 NTTIME_1sec last_success;
97 NTTIME_1sec last_attempt;
98 WERROR result_last_attempt;
99 [relative] repsFromTo1OtherInfo *other_info;
100 [value(ndr_size_repsFromTo1OtherInfo(other_info, ndr->flags))] uint32 other_info_length;
101 drsuapi_DsReplicaNeighbourFlags replica_flags;
104 drsuapi_DsReplicaHighWaterMark highwatermark;
105 GUID source_dsa_obj_guid; /* the 'objectGuid' field of the CN=NTDS Settings object */
106 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
110 typedef [nodiscriminant] union {
111 [case(1)] repsFromTo1 ctr1;
114 typedef [public] struct {
117 [switch_is(version)] repsFromTo ctr;
120 void decode_repsFromTo(
121 [in] repsFromToBlob blob
125 * partialAttributeSet
127 * w2k3 uses version 1
131 drsuapi_DsAttributeId array[count];
132 } partialAttributeSetCtr1;
134 typedef [nodiscriminant] union {
135 [case(1)] partialAttributeSetCtr1 ctr1;
136 } partialAttributeSetCtr;
138 typedef [public] struct {
141 [switch_is(version)] partialAttributeSetCtr ctr;
142 } partialAttributeSetBlob;
144 void decode_partialAttributeSet(
145 [in] partialAttributeSetBlob blob
152 * samba4 uses 0x44534442 'DSDB'
154 * as we windows don't return the prefixMap attribute when you ask for
155 * we don't know the format, but the attribute is not replicated
156 * so that we can choose our own format...
158 typedef [v1_enum] enum {
159 PREFIX_MAP_VERSION_DSDB = 0x44534442
162 typedef [nodiscriminant] union {
163 [case(PREFIX_MAP_VERSION_DSDB)] drsuapi_DsReplicaOIDMapping_Ctr dsdb;
166 typedef [public] struct {
167 prefixMapVersion version;
169 [switch_is(version)] prefixMapCtr ctr;
172 void decode_prefixMap(
173 [in] prefixMapBlob blob
177 * the cookie for the LDAP dirsync control
179 typedef [nodiscriminant,gensize] union {
181 [default] replUpToDateVectorBlob uptodateness_vector;
182 } ldapControlDirSyncExtra;
185 [value(3)] uint32 u1;
189 [value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, 0))]
191 drsuapi_DsReplicaHighWaterMark highwatermark;
193 [switch_is(extra_length)] ldapControlDirSyncExtra extra;
194 } ldapControlDirSyncBlob;
196 typedef [public,relative_base] struct {
197 [charset(DOS),value("MSDS")] uint8 msds[4];
198 [subcontext(0)] ldapControlDirSyncBlob blob;
199 } ldapControlDirSyncCookie;
201 void decode_ldapControlDirSync(
202 [in] ldapControlDirSyncCookie cookie
206 [value(2*strlen_m(name))] uint16 name_len;
207 [value(strlen(data))] uint16 data_len;
208 uint16 unknown1; /* 2 for name = 'Packages', 1 for name = 'Primary:*' */
209 [charset(UTF16)] uint8 name[name_len];
211 * the data field contains data as HEX strings
214 * data contains the list of packages
215 * as non termiated UTF16 strings with
216 * a UTF16 NULL byte as separator
218 * 'Primary:Kerberos':
224 * 'Primary:CLEARTEXT':
225 * data contains the cleartext password
226 * as UTF16 string encoded as HEX string
228 [charset(DOS)] uint8 data[data_len];
229 } supplementalCredentialsPackage;
231 /* this are 0x30 (48) whitespaces (0x20) followed by 'P' (0x50) */
232 const string SUPPLEMENTAL_CREDENTIALS_PREFIX = " P";
234 typedef [gensize] struct {
235 [value(SUPPLEMENTAL_CREDENTIALS_PREFIX),charset(UTF16)] uint16 prefix[0x31];
237 supplementalCredentialsPackage packages[num_packages];
238 } supplementalCredentialsSubBlob;
240 typedef [public] struct {
241 [value(0)] uint32 unknown1;
242 [value(ndr_size_supplementalCredentialsSubBlob(&sub, ndr->flags))] uint32 __ndr_size;
243 [value(0)] uint32 unknown2;
244 [subcontext(0),subcontext_size(__ndr_size)] supplementalCredentialsSubBlob sub;
245 [value(0)] uint8 unknown3;
246 } supplementalCredentialsBlob;
248 void decode_supplementalCredentials(
249 [in] supplementalCredentialsBlob blob
252 typedef [public] struct {
253 [flag(STR_NOTERM|NDR_REMAINING)] string_array names;
254 } package_PackagesBlob;
256 void decode_Packages(
257 [in] package_PackagesBlob blob
261 [value(2*strlen_m(string))] uint16 length;
262 [value(2*strlen_m(string))] uint16 size;
263 [relative,subcontext(0),subcontext_size(size),flag(STR_NOTERM|NDR_REMAINING)] string *string;
264 } package_PrimaryKerberosString;
268 [value((value?value->length:0))] uint32 value_len;
269 [relative,subcontext(0),subcontext_size(value_len),flag(NDR_REMAINING)] DATA_BLOB *value;
270 [value(0)] uint32 unknown1;
271 [value(0)] uint32 unknown2;
272 } package_PrimaryKerberosKey;
277 package_PrimaryKerberosString salt;
278 [value(0)] uint32 unknown1;
279 [value(0)] uint32 unknown2;
280 package_PrimaryKerberosKey keys[num_keys];
281 package_PrimaryKerberosKey old_keys[num_old_keys];
282 udlong unknown3[num_keys];
283 udlong unknown3_old[num_old_keys];
284 } package_PrimaryKerberosCtr3;
286 typedef [nodiscriminant] union {
287 [case(3)] package_PrimaryKerberosCtr3 ctr3;
288 } package_PrimaryKerberosCtr;
290 typedef [public] struct {
291 [value(3)] uint32 version;
292 [switch_is(version)] package_PrimaryKerberosCtr ctr;
293 } package_PrimaryKerberosBlob;
295 void decode_PrimaryKerberos(
296 [in] package_PrimaryKerberosBlob blob
299 typedef [public] struct {
300 [flag(STR_NOTERM|NDR_REMAINING)] string cleartext;
301 } package_PrimaryCLEARTEXTBlob;
303 void decode_PrimaryCLEARTEXT(
304 [in] package_PrimaryCLEARTEXTBlob blob
307 typedef [flag(NDR_PAHEX)] struct {
309 } package_PrimaryWDigestHash;
311 typedef [public] struct {
312 [value(0x31)] uint16 unknown1;
313 [value(0x01)] uint8 unknown2;
315 [value(0)] uint32 unknown3;
316 [value(0)] udlong uuknown4;
317 package_PrimaryWDigestHash hashes[num_hashes];
318 } package_PrimaryWDigestBlob;
320 void decode_PrimaryWDigest(
321 [in] package_PrimaryWDigestBlob blob
328 * the secret value is encoded as UTF16 if it's a string
329 * but krb5 trusts have random bytes here, so converting to UTF16
332 * TODO: We should try handle the case of a random buffer in all places
333 * we deal with cleartext passwords from windows
335 * so we don't use this:
338 * [charset(UTF16)] uint8 value[value_len];
341 [flag(NDR_ALIGN4)] DATA_BLOB _pad;
342 } trustAuthInOutSecret1;
345 [relative] trustAuthInOutSecret1 *value1;
346 [relative] trustAuthInOutSecret1 *value2;
347 } trustAuthInOutCtr1;
357 [flag(NDR_ALIGN4)] DATA_BLOB _pad;
358 } trustAuthInOutSecret2V1;
367 [flag(NDR_ALIGN4)] DATA_BLOB _pad;
368 } trustAuthInOutSecret2V2;
371 [relative] trustAuthInOutSecret2V1 *value1;
372 [relative] trustAuthInOutSecret2V2 *value2;
373 } trustAuthInOutCtr2;
375 typedef [nodiscriminant] union {
376 [case(1)] trustAuthInOutCtr1 ctr1;
377 [case(2)] trustAuthInOutCtr2 ctr2;
380 typedef [public] struct {
382 [switch_is(version)] trustAuthInOutCtr ctr;
383 } trustAuthInOutBlob;
385 void decode_trustAuthInOut(
386 [in] trustAuthInOutBlob blob
389 typedef [public] struct {
394 typedef [public] struct {
395 DsCompressedChunk chunks[5];
398 void decode_DsCompressed(
399 [in] DsCompressedBlob blob