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
;
33 [value
(0)] uint32 reserved
;
34 replPropertyMetaData1 array
[count
];
35 } replPropertyMetaDataCtr1
;
37 typedef [nodiscriminant
] union {
38 [case(1)] replPropertyMetaDataCtr1 ctr1
;
39 } replPropertyMetaDataCtr
;
41 typedef [public] struct {
43 [value
(0)] uint32 reserved
;
44 [switch_is(version)] replPropertyMetaDataCtr ctr
;
45 } replPropertyMetaDataBlob
;
47 void decode_replPropertyMetaData
(
48 [in] replPropertyMetaDataBlob blob
58 [value
(0)] uint32 reserved
;
59 drsuapi_DsReplicaCursor cursors
[count
];
60 } replUpToDateVectorCtr1
;
64 [value
(0)] uint32 reserved
;
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 {
75 [value
(0)] uint32 reserved
;
76 [switch_is(version)] replUpToDateVectorCtr ctr
;
77 } replUpToDateVectorBlob
;
79 void decode_replUpToDateVector
(
80 [in] replUpToDateVectorBlob blob
89 typedef [public,gensize
] struct {
90 [value
(strlen
(dns_name
)+1)] uint32 __dns_name_size
;
91 [charset
(DOS
)] uint8 dns_name
[__dns_name_size
];
92 } repsFromTo1OtherInfo
;
94 typedef [public,gensize
,flag
(NDR_PAHEX
)] struct {
95 /* this includes the 8 bytes of the repsFromToBlob header */
96 [value
(ndr_size_repsFromTo1
(this
, ndr
->iconv_convenience
, ndr
->flags
)+8)] uint32 blobsize
;
97 uint32 consecutive_sync_failures
;
98 NTTIME_1sec last_success
;
99 NTTIME_1sec last_attempt
;
100 WERROR result_last_attempt
;
101 [relative
] repsFromTo1OtherInfo
*other_info
;
102 [value
(ndr_size_repsFromTo1OtherInfo
(other_info
, ndr
->iconv_convenience
, ndr
->flags
))] uint32 other_info_length
;
103 drsuapi_DsReplicaNeighbourFlags replica_flags
;
105 [value
(0)] uint32 reserved
;
106 drsuapi_DsReplicaHighWaterMark highwatermark
;
107 GUID source_dsa_obj_guid
; /* the 'objectGuid' field of the CN=NTDS Settings object */
108 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
112 typedef [public,relative_base
,gensize
] struct {
113 [value
(ndr_size_repsFromTo2OtherInfo
(this
,ndr
->iconv_convenience
, ndr
->flags
))]
115 [relative
] nstring
*dns_name1
;
117 [relative
] nstring
*dns_name2
;
119 } repsFromTo2OtherInfo
;
121 typedef [public,gensize
,flag
(NDR_PAHEX
)] struct {
122 /* this includes the 8 bytes of the repsFromToBlob header */
123 [value
(ndr_size_repsFromTo2
(this
, ndr
->iconv_convenience
, ndr
->flags
)+8)] uint32 blobsize
;
124 uint32 consecutive_sync_failures
;
125 NTTIME_1sec last_success
;
126 NTTIME_1sec last_attempt
;
127 WERROR result_last_attempt
;
128 [relative
] repsFromTo2OtherInfo
*other_info
;
129 [value
(ndr_size_repsFromTo2OtherInfo
(other_info
, ndr
->iconv_convenience
, ndr
->flags
))] uint32 other_info_length
;
130 drsuapi_DsReplicaNeighbourFlags replica_flags
;
132 [value
(0)] uint32 reserved
;
133 drsuapi_DsReplicaHighWaterMark highwatermark
;
134 GUID source_dsa_obj_guid
; /* the 'objectGuid' field of the CN=NTDS Settings object */
135 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
140 typedef [nodiscriminant
] union {
141 [case(1)] repsFromTo1 ctr1
;
142 [case(2)] repsFromTo2 ctr2
;
145 typedef [public] struct {
147 [value
(0)] uint32 reserved
;
148 [switch_is(version)] repsFromTo ctr
;
151 void decode_repsFromTo
(
152 [in] repsFromToBlob blob
156 * partialAttributeSet
158 * w2k3 uses version 1
162 drsuapi_DsAttributeId array
[count
];
163 } partialAttributeSetCtr1
;
165 typedef [nodiscriminant
] union {
166 [case(1)] partialAttributeSetCtr1 ctr1
;
167 } partialAttributeSetCtr
;
169 typedef [public] struct {
171 [value
(0)] uint32 reserved
;
172 [switch_is(version)] partialAttributeSetCtr ctr
;
173 } partialAttributeSetBlob
;
175 void decode_partialAttributeSet
(
176 [in] partialAttributeSetBlob blob
183 * samba4 uses 0x44534442 'DSDB'
185 * as we windows don't return the prefixMap attribute when you ask for
186 * we don't know the format, but the attribute is not replicated
187 * so that we can choose our own format...
189 typedef [v1_enum] enum {
190 PREFIX_MAP_VERSION_DSDB
= 0x44534442
193 typedef [nodiscriminant
] union {
194 [case(PREFIX_MAP_VERSION_DSDB
)] drsuapi_DsReplicaOIDMapping_Ctr dsdb
;
197 typedef [public] struct {
198 prefixMapVersion
version;
199 [value
(0)] uint32 reserved
;
200 [switch_is(version)] prefixMapCtr ctr
;
203 void decode_prefixMap
(
204 [in] prefixMapBlob blob
209 * the cookie for the LDAP dirsync control
211 typedef [nodiscriminant
,gensize
] union {
213 [default] replUpToDateVectorBlob uptodateness_vector
;
214 } ldapControlDirSyncExtra
;
217 [value
(3)] uint32 u1
;
221 [value
(ndr_size_ldapControlDirSyncExtra
(&extra
, extra.uptodateness_vector.
version, ndr
->iconv_convenience
, 0))]
223 drsuapi_DsReplicaHighWaterMark highwatermark
;
225 [switch_is(extra_length
)] ldapControlDirSyncExtra extra
;
226 } ldapControlDirSyncBlob
;
228 typedef [public,relative_base
] struct {
229 [charset
(DOS
),value
("MSDS")] uint8 msds
[4];
230 [subcontext
(0)] ldapControlDirSyncBlob blob
;
231 } ldapControlDirSyncCookie
;
233 void decode_ldapControlDirSync
(
234 [in] ldapControlDirSyncCookie cookie
238 [value
(2*strlen_m
(name
))] uint16 name_len
;
239 [value
(strlen
(data
))] uint16 data_len
;
240 uint16 reserved
; /* 2 for 'Packages', 1 for 'Primary:*', but should be ignored */
241 [charset
(UTF16
)] uint8 name
[name_len
];
243 * the data field contains data as HEX strings
246 * data contains the list of packages
247 * as non termiated UTF16 strings with
248 * a UTF16 NULL byte as separator
250 * 'Primary:Kerberos-Newer-Keys':
253 * 'Primary:Kerberos':
259 * 'Primary:CLEARTEXT':
260 * data contains the cleartext password
261 * as UTF16 string encoded as HEX string
263 [charset
(DOS
)] uint8 data
[data_len
];
264 } supplementalCredentialsPackage
;
266 /* this are 0x30 (48) whitespaces (0x20) */
267 const string SUPPLEMENTAL_CREDENTIALS_PREFIX
= " ";
269 typedef [flag
(NDR_PAHEX
)] enum {
270 SUPPLEMENTAL_CREDENTIALS_SIGNATURE
= 0x0050
271 } supplementalCredentialsSignature
;
273 typedef [gensize
] struct {
274 [value
(SUPPLEMENTAL_CREDENTIALS_PREFIX
),charset
(UTF16
)] uint16 prefix
[0x30];
275 [value
(SUPPLEMENTAL_CREDENTIALS_SIGNATURE
)] supplementalCredentialsSignature signature
;
277 supplementalCredentialsPackage packages
[num_packages
];
278 } supplementalCredentialsSubBlob
;
280 typedef [public] struct {
281 [value
(0)] uint32 unknown1
;
282 [value
(ndr_size_supplementalCredentialsSubBlob
(&sub
, ndr
->iconv_convenience
, ndr
->flags
))] uint32 __ndr_size
;
283 [value
(0)] uint32 unknown2
;
284 [subcontext
(0),subcontext_size
(__ndr_size
)] supplementalCredentialsSubBlob sub
;
285 [value
(0)] uint8 unknown3
;
286 } supplementalCredentialsBlob
;
288 void decode_supplementalCredentials
(
289 [in] supplementalCredentialsBlob blob
292 typedef [public] struct {
293 [flag
(STR_NOTERM|NDR_REMAINING
)] string_array names
;
294 } package_PackagesBlob
;
296 void decode_Packages
(
297 [in] package_PackagesBlob blob
301 [value
(2*strlen_m
(string))] uint16 length
;
302 [value
(2*strlen_m
(string))] uint16 size
;
303 [relative
,subcontext
(0),subcontext_size
(size
),flag
(STR_NOTERM|NDR_REMAINING
)] string *string;
304 } package_PrimaryKerberosString
;
307 [value
(0)] uint16 reserved1
;
308 [value
(0)] uint16 reserved2
;
309 [value
(0)] uint32 reserved3
;
311 [value
((value?value
->length
:0))] uint32 value_len
;
312 [relative
,subcontext
(0),subcontext_size
(value_len
),flag
(NDR_REMAINING
)] DATA_BLOB
*value
;
313 } package_PrimaryKerberosKey3
;
318 package_PrimaryKerberosString salt
;
319 package_PrimaryKerberosKey3 keys
[num_keys
];
320 package_PrimaryKerberosKey3 old_keys
[num_old_keys
];
321 [value
(0)] uint32 padding1
;
322 [value
(0)] uint32 padding2
;
323 [value
(0)] uint32 padding3
;
324 [value
(0)] uint32 padding4
;
325 [value
(0)] uint32 padding5
;
326 } package_PrimaryKerberosCtr3
;
329 [value
(0)] uint16 reserved1
;
330 [value
(0)] uint16 reserved2
;
331 [value
(0)] uint32 reserved3
;
332 uint32 iteration_count
;
334 [value
((value?value
->length
:0))] uint32 value_len
;
335 [relative
,subcontext
(0),subcontext_size
(value_len
),flag
(NDR_REMAINING
)] DATA_BLOB
*value
;
336 } package_PrimaryKerberosKey4
;
340 [value
(0)] uint16 num_service_keys
;
342 uint16 num_older_keys
;
343 package_PrimaryKerberosString salt
;
344 uint32 default_iteration_count
;
345 package_PrimaryKerberosKey4 keys
[num_keys
];
346 package_PrimaryKerberosKey4 service_keys
[num_service_keys
];
347 package_PrimaryKerberosKey4 old_keys
[num_old_keys
];
348 package_PrimaryKerberosKey4 older_keys
[num_older_keys
];
349 } package_PrimaryKerberosCtr4
;
351 typedef [nodiscriminant
] union {
352 [case(3)] package_PrimaryKerberosCtr3 ctr3
;
353 [case(4)] package_PrimaryKerberosCtr4 ctr4
;
354 } package_PrimaryKerberosCtr
;
356 typedef [public] struct {
358 [value
(0)] uint16 flags
;
359 [switch_is(version)] package_PrimaryKerberosCtr ctr
;
360 } package_PrimaryKerberosBlob
;
362 void decode_PrimaryKerberos
(
363 [in] package_PrimaryKerberosBlob blob
366 typedef [public] struct {
367 [flag
(NDR_REMAINING
)] DATA_BLOB cleartext
;
368 } package_PrimaryCLEARTEXTBlob
;
370 void decode_PrimaryCLEARTEXT
(
371 [in] package_PrimaryCLEARTEXTBlob blob
374 typedef [flag
(NDR_PAHEX
)] struct {
376 } package_PrimaryWDigestHash
;
378 typedef [public] struct {
379 [value
(0x31)] uint16 unknown1
;
380 [value
(0x01)] uint8 unknown2
;
382 [value
(0)] uint32 unknown3
;
383 [value
(0)] udlong uuknown4
;
384 package_PrimaryWDigestHash hashes
[num_hashes
];
385 } package_PrimaryWDigestBlob
;
387 void decode_PrimaryWDigest
(
388 [in] package_PrimaryWDigestBlob blob
392 [value
(0)] uint32 size
;
396 [value
(16)] uint32 size
;
397 samr_Password password
;
401 * the secret value is encoded as UTF16 if it's a string
402 * but depending the AuthType, it might also be krb5 trusts have random bytes here, so converting to UTF16
405 * TODO: We should try handle the case of a random buffer in all places
406 * we deal with cleartext passwords from windows
408 * so we don't use this:
411 * [charset(UTF16)] uint8 value[value_len];
416 uint8 password
[size
];
420 [value
(4)] uint32 size
;
424 typedef [nodiscriminant
] union {
425 [case(TRUST_AUTH_TYPE_NONE
)] AuthInfoNone none
;
426 [case(TRUST_AUTH_TYPE_NT4OWF
)] AuthInfoNT4Owf nt4owf
;
427 [case(TRUST_AUTH_TYPE_CLEAR
)] AuthInfoClear clear
;
428 [case(TRUST_AUTH_TYPE_VERSION
)] AuthInfoVersion
version;
431 typedef [public] struct {
432 NTTIME LastUpdateTime
;
433 lsa_TrustAuthType AuthType
;
435 [switch_is(AuthType
)] AuthInfo AuthInfo
;
436 [flag
(NDR_ALIGN4
)] DATA_BLOB _pad
;
437 } AuthenticationInformation
;
439 typedef [nopull
,nopush
,noprint
] struct {
440 /* sizeis here is bogus, but this is here just for the structure */
441 [size_is(1)] AuthenticationInformation array
[];
442 } AuthenticationInformationArray
;
444 /* This is nopull,nopush because we pass count down to the
445 * manual parser of AuthenticationInformationArray */
446 typedef [public,nopull
,nopush
,noprint
,gensize
] struct {
448 [relative
] AuthenticationInformationArray
*current
;
449 [relative
] AuthenticationInformationArray
*previous
;
450 } trustAuthInOutBlob
;
452 void decode_trustAuthInOut
(
453 [in] trustAuthInOutBlob blob
456 typedef [public,gensize
] struct {
458 [relative
] AuthenticationInformation
*current
[count
];
459 } trustCurrentPasswords
;
461 typedef [public,nopull
] struct {
462 uint8 confounder
[512];
463 [subcontext
(0),subcontext_size
(outgoing_size
)] trustCurrentPasswords outgoing
;
464 [subcontext
(0),subcontext_size
(incoming_size
)] trustCurrentPasswords incoming
;
465 [value
(ndr_size_trustCurrentPasswords
(&outgoing
, ndr
->iconv_convenience
, ndr
->flags
))] uint32 outgoing_size
;
466 [value
(ndr_size_trustCurrentPasswords
(&incoming
, ndr
->iconv_convenience
, ndr
->flags
))] uint32 incoming_size
;
467 } trustDomainPasswords
;
469 void decode_trustDomainPasswords
(
470 [in] trustDomainPasswords blob
473 typedef [public] struct {
480 [size_is(__size
),charset
(DOS
)] uint8
*string;
481 } ExtendedErrorAString
;
485 [size_is(__size
),charset
(UTF16
)] uint16
*string;
486 } ExtendedErrorUString
;
490 [size_is(length
)] uint8
*data
;
494 EXTENDED_ERROR_COMPUTER_NAME_PRESENT
= 1,
495 EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT
= 2
496 } ExtendedErrorComputerNamePresent
;
498 typedef [switch_type(ExtendedErrorComputerNamePresent
)] union {
499 [case(EXTENDED_ERROR_COMPUTER_NAME_PRESENT
)] ExtendedErrorUString name
;
500 [case(EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT
)];
501 } ExtendedErrorComputerNameU
;
504 ExtendedErrorComputerNamePresent present
;
505 [switch_is(present
)] ExtendedErrorComputerNameU n
;
506 } ExtendedErrorComputerName
;
509 EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING
= 1,
510 EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING
= 2,
511 EXTENDED_ERROR_PARAM_TYPE_UINT32
= 3,
512 EXTENDED_ERROR_PARAM_TYPE_UINT16
= 4,
513 EXTENDED_ERROR_PARAM_TYPE_UINT64
= 5,
514 EXTENDED_ERROR_PARAM_TYPE_NONE
= 6,
515 EXTENDED_ERROR_PARAM_TYPE_BLOB
= 7
516 } ExtendedErrorParamType
;
518 typedef [switch_type(ExtendedErrorParamType
)] union {
519 [case(EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING
)] ExtendedErrorAString a_string
;
520 [case(EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING
)] ExtendedErrorUString u_string
;
521 [case(EXTENDED_ERROR_PARAM_TYPE_UINT32
)] uint32 uint32
;
522 [case(EXTENDED_ERROR_PARAM_TYPE_UINT16
)] uint16 uint16
;
523 [case(EXTENDED_ERROR_PARAM_TYPE_UINT64
)] hyper uint64
;
524 [case(EXTENDED_ERROR_PARAM_TYPE_NONE
)];
525 [case(EXTENDED_ERROR_PARAM_TYPE_BLOB
)] ExtendedErrorBlob blob
;
526 } ExtendedErrorParamU
;
529 ExtendedErrorParamType type
;
530 [switch_is(type
)] ExtendedErrorParamU p
;
531 } ExtendedErrorParam
;
533 typedef [public] struct {
534 ExtendedErrorInfo
*next
;
535 ExtendedErrorComputerName computer_name
;
538 uint32 generating_component
;
540 uint16 detection_location
;
543 [size_is(num_params
)] ExtendedErrorParam params
[];
547 [unique] ExtendedErrorInfo
*info
;
548 } ExtendedErrorInfoPtr
;
550 void decode_ExtendedErrorInfo
(
551 [in,subcontext
(0xFFFFFC01)] ExtendedErrorInfoPtr
ptr