3 import
"drsuapi.idl", "misc.idl", "samr.idl", "lsa.idl";
6 uuid("12345778-1234-abcd-0001-00000001"),
8 pointer_default(unique),
9 helper
("../librpc/ndr/ndr_drsblobs.h"),
10 helpstring("Active Directory Replication LDAP Blobs")
13 typedef bitmap drsuapi_DsReplicaSyncOptions drsuapi_DsReplicaSyncOptions
;
14 typedef bitmap drsuapi_DsReplicaNeighbourFlags drsuapi_DsReplicaNeighbourFlags
;
15 typedef [v1_enum] enum drsuapi_DsAttributeId drsuapi_DsAttributeId
;
16 typedef [v1_enum] enum lsa_TrustAuthType lsa_TrustAuthType
;
18 * replPropertyMetaData
23 drsuapi_DsAttributeId attid
;
25 NTTIME_1sec originating_change_time
;
26 GUID originating_invocation_id
;
27 hyper originating_usn
;
29 } replPropertyMetaData1
;
34 replPropertyMetaData1 array
[count
];
35 } replPropertyMetaDataCtr1
;
37 typedef [nodiscriminant
] union {
38 [case(1)] replPropertyMetaDataCtr1 ctr1
;
39 } replPropertyMetaDataCtr
;
41 typedef [public] struct {
44 [switch_is(version)] replPropertyMetaDataCtr ctr
;
45 } replPropertyMetaDataBlob
;
47 void decode_replPropertyMetaData
(
48 [in] replPropertyMetaDataBlob blob
59 drsuapi_DsReplicaCursor cursors
[count
];
60 } replUpToDateVectorCtr1
;
65 drsuapi_DsReplicaCursor2 cursors
[count
];
66 } replUpToDateVectorCtr2
;
68 typedef [nodiscriminant
] union {
69 [case(1)] replUpToDateVectorCtr1 ctr1
;
70 [case(2)] replUpToDateVectorCtr2 ctr2
;
71 } replUpToDateVectorCtr
;
73 typedef [public] struct {
76 [switch_is(version)] replUpToDateVectorCtr ctr
;
77 } replUpToDateVectorBlob
;
79 void decode_replUpToDateVector
(
80 [in] replUpToDateVectorBlob blob
88 typedef [public,gensize
] struct {
89 [value
(strlen
(dns_name
)+1)] uint32 __dns_name_size
;
90 [charset
(DOS
)] uint8 dns_name
[__dns_name_size
];
91 } repsFromTo1OtherInfo
;
93 typedef [public,gensize
,flag
(NDR_PAHEX
)] struct {
94 /* this includes the 8 bytes of the repsFromToBlob header */
95 [value
(ndr_size_repsFromTo1
(this
, ndr
->iconv_convenience
, ndr
->flags
)+8)] uint32 blobsize
;
96 uint32 consecutive_sync_failures
;
97 NTTIME_1sec last_success
;
98 NTTIME_1sec last_attempt
;
99 WERROR result_last_attempt
;
100 [relative
] repsFromTo1OtherInfo
*other_info
;
101 [value
(ndr_size_repsFromTo1OtherInfo
(other_info
, ndr
->iconv_convenience
, ndr
->flags
))] uint32 other_info_length
;
102 drsuapi_DsReplicaNeighbourFlags replica_flags
;
105 drsuapi_DsReplicaHighWaterMark highwatermark
;
106 GUID source_dsa_obj_guid
; /* the 'objectGuid' field of the CN=NTDS Settings object */
107 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
111 typedef [nodiscriminant
] union {
112 [case(1)] repsFromTo1 ctr1
;
115 typedef [public] struct {
118 [switch_is(version)] repsFromTo ctr
;
121 void decode_repsFromTo
(
122 [in] repsFromToBlob blob
126 * partialAttributeSet
128 * w2k3 uses version 1
132 drsuapi_DsAttributeId array
[count
];
133 } partialAttributeSetCtr1
;
135 typedef [nodiscriminant
] union {
136 [case(1)] partialAttributeSetCtr1 ctr1
;
137 } partialAttributeSetCtr
;
139 typedef [public] struct {
142 [switch_is(version)] partialAttributeSetCtr ctr
;
143 } partialAttributeSetBlob
;
145 void decode_partialAttributeSet
(
146 [in] partialAttributeSetBlob blob
153 * samba4 uses 0x44534442 'DSDB'
155 * as we windows don't return the prefixMap attribute when you ask for
156 * we don't know the format, but the attribute is not replicated
157 * so that we can choose our own format...
159 typedef [v1_enum] enum {
160 PREFIX_MAP_VERSION_DSDB
= 0x44534442
163 typedef [nodiscriminant
] union {
164 [case(PREFIX_MAP_VERSION_DSDB
)] drsuapi_DsReplicaOIDMapping_Ctr dsdb
;
167 typedef [public] struct {
168 prefixMapVersion
version;
170 [switch_is(version)] prefixMapCtr ctr
;
173 void decode_prefixMap
(
174 [in] prefixMapBlob blob
178 * the cookie for the LDAP dirsync control
180 typedef [nodiscriminant
,gensize
] union {
182 [default] replUpToDateVectorBlob uptodateness_vector
;
183 } ldapControlDirSyncExtra
;
186 [value
(3)] uint32 u1
;
190 [value
(ndr_size_ldapControlDirSyncExtra
(&extra
, extra.uptodateness_vector.
version, ndr
->iconv_convenience
, 0))]
192 drsuapi_DsReplicaHighWaterMark highwatermark
;
194 [switch_is(extra_length
)] ldapControlDirSyncExtra extra
;
195 } ldapControlDirSyncBlob
;
197 typedef [public,relative_base
] struct {
198 [charset
(DOS
),value
("MSDS")] uint8 msds
[4];
199 [subcontext
(0)] ldapControlDirSyncBlob blob
;
200 } ldapControlDirSyncCookie
;
202 void decode_ldapControlDirSync
(
203 [in] ldapControlDirSyncCookie cookie
207 [value
(2*strlen_m
(name
))] uint16 name_len
;
208 [value
(strlen
(data
))] uint16 data_len
;
209 uint16 reserved
; /* 2 for 'Packages', 1 for 'Primary:*', but should be ignored */
210 [charset
(UTF16
)] uint8 name
[name_len
];
212 * the data field contains data as HEX strings
215 * data contains the list of packages
216 * as non termiated UTF16 strings with
217 * a UTF16 NULL byte as separator
219 * 'Primary:Kerberos-Newer-Keys':
222 * 'Primary:Kerberos':
228 * 'Primary:CLEARTEXT':
229 * data contains the cleartext password
230 * as UTF16 string encoded as HEX string
232 [charset
(DOS
)] uint8 data
[data_len
];
233 } supplementalCredentialsPackage
;
235 /* this are 0x30 (48) whitespaces (0x20) */
236 const string SUPPLEMENTAL_CREDENTIALS_PREFIX
= " ";
238 typedef [flag
(NDR_PAHEX
)] enum {
239 SUPPLEMENTAL_CREDENTIALS_SIGNATURE
= 0x0050
240 } supplementalCredentialsSignature
;
242 typedef [gensize
] struct {
243 [value
(SUPPLEMENTAL_CREDENTIALS_PREFIX
),charset
(UTF16
)] uint16 prefix
[0x30];
244 [value
(SUPPLEMENTAL_CREDENTIALS_SIGNATURE
)] supplementalCredentialsSignature signature
;
246 supplementalCredentialsPackage packages
[num_packages
];
247 } supplementalCredentialsSubBlob
;
249 typedef [public] struct {
250 [value
(0)] uint32 unknown1
;
251 [value
(ndr_size_supplementalCredentialsSubBlob
(&sub
, ndr
->iconv_convenience
, ndr
->flags
))] uint32 __ndr_size
;
252 [value
(0)] uint32 unknown2
;
253 [subcontext
(0),subcontext_size
(__ndr_size
)] supplementalCredentialsSubBlob sub
;
254 [value
(0)] uint8 unknown3
;
255 } supplementalCredentialsBlob
;
257 void decode_supplementalCredentials
(
258 [in] supplementalCredentialsBlob blob
261 typedef [public] struct {
262 [flag
(STR_NOTERM|NDR_REMAINING
)] string_array names
;
263 } package_PackagesBlob
;
265 void decode_Packages
(
266 [in] package_PackagesBlob blob
270 [value
(2*strlen_m
(string))] uint16 length
;
271 [value
(2*strlen_m
(string))] uint16 size
;
272 [relative
,subcontext
(0),subcontext_size
(size
),flag
(STR_NOTERM|NDR_REMAINING
)] string *string;
273 } package_PrimaryKerberosString
;
276 [value
(0)] uint16 reserved1
;
277 [value
(0)] uint16 reserved2
;
278 [value
(0)] uint32 reserved3
;
280 [value
((value?value
->length
:0))] uint32 value_len
;
281 [relative
,subcontext
(0),subcontext_size
(value_len
),flag
(NDR_REMAINING
)] DATA_BLOB
*value
;
282 } package_PrimaryKerberosKey3
;
287 package_PrimaryKerberosString salt
;
288 package_PrimaryKerberosKey3 keys
[num_keys
];
289 package_PrimaryKerberosKey3 old_keys
[num_old_keys
];
290 [value
(0)] uint32 padding1
;
291 [value
(0)] uint32 padding2
;
292 [value
(0)] uint32 padding3
;
293 [value
(0)] uint32 padding4
;
294 [value
(0)] uint32 padding5
;
295 } package_PrimaryKerberosCtr3
;
298 [value
(0)] uint16 reserved1
;
299 [value
(0)] uint16 reserved2
;
300 [value
(0)] uint32 reserved3
;
301 uint32 iteration_count
;
303 [value
((value?value
->length
:0))] uint32 value_len
;
304 [relative
,subcontext
(0),subcontext_size
(value_len
),flag
(NDR_REMAINING
)] DATA_BLOB
*value
;
305 } package_PrimaryKerberosKey4
;
309 [value
(0)] uint16 num_service_keys
;
311 uint16 num_older_keys
;
312 package_PrimaryKerberosString salt
;
313 uint32 default_iteration_count
;
314 package_PrimaryKerberosKey4 keys
[num_keys
];
315 package_PrimaryKerberosKey4 service_keys
[num_service_keys
];
316 package_PrimaryKerberosKey4 old_keys
[num_old_keys
];
317 package_PrimaryKerberosKey4 older_keys
[num_older_keys
];
318 } package_PrimaryKerberosCtr4
;
320 typedef [nodiscriminant
] union {
321 [case(3)] package_PrimaryKerberosCtr3 ctr3
;
322 [case(4)] package_PrimaryKerberosCtr4 ctr4
;
323 } package_PrimaryKerberosCtr
;
325 typedef [public] struct {
327 [value
(0)] uint16 flags
;
328 [switch_is(version)] package_PrimaryKerberosCtr ctr
;
329 } package_PrimaryKerberosBlob
;
331 void decode_PrimaryKerberos
(
332 [in] package_PrimaryKerberosBlob blob
335 typedef [public] struct {
336 [flag
(NDR_REMAINING
)] DATA_BLOB cleartext
;
337 } package_PrimaryCLEARTEXTBlob
;
339 void decode_PrimaryCLEARTEXT
(
340 [in] package_PrimaryCLEARTEXTBlob blob
343 typedef [flag
(NDR_PAHEX
)] struct {
345 } package_PrimaryWDigestHash
;
347 typedef [public] struct {
348 [value
(0x31)] uint16 unknown1
;
349 [value
(0x01)] uint8 unknown2
;
351 [value
(0)] uint32 unknown3
;
352 [value
(0)] udlong uuknown4
;
353 package_PrimaryWDigestHash hashes
[num_hashes
];
354 } package_PrimaryWDigestBlob
;
356 void decode_PrimaryWDigest
(
357 [in] package_PrimaryWDigestBlob blob
361 [value
(0)] uint32 size
;
365 [value
(16)] uint32 size
;
366 samr_Password password
;
370 * the secret value is encoded as UTF16 if it's a string
371 * but depending the AuthType, it might also be krb5 trusts have random bytes here, so converting to UTF16
374 * TODO: We should try handle the case of a random buffer in all places
375 * we deal with cleartext passwords from windows
377 * so we don't use this:
380 * [charset(UTF16)] uint8 value[value_len];
385 uint8 password
[size
];
389 [value
(4)] uint32 size
;
393 typedef [nodiscriminant
] union {
394 [case(TRUST_AUTH_TYPE_NONE
)] AuthInfoNone none
;
395 [case(TRUST_AUTH_TYPE_NT4OWF
)] AuthInfoNT4Owf nt4owf
;
396 [case(TRUST_AUTH_TYPE_CLEAR
)] AuthInfoClear clear
;
397 [case(TRUST_AUTH_TYPE_VERSION
)] AuthInfoVersion
version;
400 typedef [public] struct {
401 NTTIME LastUpdateTime
;
402 lsa_TrustAuthType AuthType
;
404 [switch_is(AuthType
)] AuthInfo AuthInfo
;
405 [flag
(NDR_ALIGN4
)] DATA_BLOB _pad
;
406 } AuthenticationInformation
;
408 typedef [nopull
,nopush
,noprint
] struct {
409 /* sizeis here is bogus, but this is here just for the structure */
410 [size_is(1)] AuthenticationInformation array
[];
411 } AuthenticationInformationArray
;
413 /* This is nopull,nopush because we pass count down to the
414 * manual parser of AuthenticationInformationArray */
415 typedef [public,nopull
,nopush
,noprint
,gensize
] struct {
417 [relative
] AuthenticationInformationArray
*current
;
418 [relative
] AuthenticationInformationArray
*previous
;
419 } trustAuthInOutBlob
;
421 void decode_trustAuthInOut
(
422 [in] trustAuthInOutBlob blob
425 typedef [public,gensize
] struct {
427 [relative
] AuthenticationInformation
*current
[count
];
428 } trustCurrentPasswords
;
430 typedef [public,nopull
] struct {
431 uint8 confounder
[512];
432 [subcontext
(0),subcontext_size
(outgoing_size
)] trustCurrentPasswords outgoing
;
433 [subcontext
(0),subcontext_size
(incoming_size
)] trustCurrentPasswords incoming
;
434 [value
(ndr_size_trustCurrentPasswords
(&outgoing
, ndr
->iconv_convenience
, ndr
->flags
))] uint32 outgoing_size
;
435 [value
(ndr_size_trustCurrentPasswords
(&incoming
, ndr
->iconv_convenience
, ndr
->flags
))] uint32 incoming_size
;
436 } trustDomainPasswords
;
438 void decode_trustDomainPasswords
(
439 [in] trustDomainPasswords blob
442 typedef [public] struct {
449 [size_is(__size
),charset
(DOS
)] uint8
*string;
450 } ExtendedErrorAString
;
454 [size_is(__size
),charset
(UTF16
)] uint16
*string;
455 } ExtendedErrorUString
;
459 [size_is(length
)] uint8
*data
;
463 EXTENDED_ERROR_COMPUTER_NAME_PRESENT
= 1,
464 EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT
= 2
465 } ExtendedErrorComputerNamePresent
;
467 typedef [switch_type(ExtendedErrorComputerNamePresent
)] union {
468 [case(EXTENDED_ERROR_COMPUTER_NAME_PRESENT
)] ExtendedErrorUString name
;
469 [case(EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT
)];
470 } ExtendedErrorComputerNameU
;
473 ExtendedErrorComputerNamePresent present
;
474 [switch_is(present
)] ExtendedErrorComputerNameU n
;
475 } ExtendedErrorComputerName
;
478 EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING
= 1,
479 EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING
= 2,
480 EXTENDED_ERROR_PARAM_TYPE_UINT32
= 3,
481 EXTENDED_ERROR_PARAM_TYPE_UINT16
= 4,
482 EXTENDED_ERROR_PARAM_TYPE_UINT64
= 5,
483 EXTENDED_ERROR_PARAM_TYPE_NONE
= 6,
484 EXTENDED_ERROR_PARAM_TYPE_BLOB
= 7
485 } ExtendedErrorParamType
;
487 typedef [switch_type(ExtendedErrorParamType
)] union {
488 [case(EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING
)] ExtendedErrorAString a_string
;
489 [case(EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING
)] ExtendedErrorUString u_string
;
490 [case(EXTENDED_ERROR_PARAM_TYPE_UINT32
)] uint32 uint32
;
491 [case(EXTENDED_ERROR_PARAM_TYPE_UINT16
)] uint16 uint16
;
492 [case(EXTENDED_ERROR_PARAM_TYPE_UINT64
)] hyper uint64
;
493 [case(EXTENDED_ERROR_PARAM_TYPE_NONE
)];
494 [case(EXTENDED_ERROR_PARAM_TYPE_BLOB
)] ExtendedErrorBlob blob
;
495 } ExtendedErrorParamU
;
498 ExtendedErrorParamType type
;
499 [switch_is(type
)] ExtendedErrorParamU p
;
500 } ExtendedErrorParam
;
502 typedef [public] struct {
503 ExtendedErrorInfo
*next
;
504 ExtendedErrorComputerName computer_name
;
507 uint32 generating_component
;
509 uint16 detection_location
;
512 [size_is(num_params
)] ExtendedErrorParam params
[];
516 [unique] ExtendedErrorInfo
*info
;
517 } ExtendedErrorInfoPtr
;
519 void decode_ExtendedErrorInfo
(
520 [in,subcontext
(0xFFFFFC01)] ExtendedErrorInfoPtr
ptr