Length comparison of the linearized version is not correct.
[Samba/ekacnet.git] / librpc / idl / drsblobs.idl
blob087f0c982ddf52595da9deeb0eb57bb7c199f730
1 #include "idl_types.h"
3 import "drsuapi.idl", "misc.idl", "samr.idl", "lsa.idl";
6 uuid("12345778-1234-abcd-0001-00000001"),
7 version(0.0),
8 pointer_default(unique),
9 helpstring("Active Directory Replication LDAP Blobs")
11 interface drsblobs {
12 typedef bitmap drsuapi_DsReplicaSyncOptions drsuapi_DsReplicaSyncOptions;
13 typedef bitmap drsuapi_DsReplicaNeighbourFlags drsuapi_DsReplicaNeighbourFlags;
14 typedef [v1_enum] enum drsuapi_DsAttributeId drsuapi_DsAttributeId;
15 typedef [v1_enum] enum lsa_TrustAuthType lsa_TrustAuthType;
17 * replPropertyMetaData
18 * w2k uses version 1
19 * w2k3 uses version 1
21 typedef struct {
22 drsuapi_DsAttributeId attid;
23 uint32 version;
24 NTTIME_1sec originating_change_time;
25 GUID originating_invocation_id;
26 hyper originating_usn;
27 hyper local_usn;
28 } replPropertyMetaData1;
30 typedef struct {
31 uint32 count;
32 uint32 reserved;
33 replPropertyMetaData1 array[count];
34 } replPropertyMetaDataCtr1;
36 typedef [nodiscriminant] union {
37 [case(1)] replPropertyMetaDataCtr1 ctr1;
38 } replPropertyMetaDataCtr;
40 typedef [public] struct {
41 uint32 version;
42 uint32 reserved;
43 [switch_is(version)] replPropertyMetaDataCtr ctr;
44 } replPropertyMetaDataBlob;
46 void decode_replPropertyMetaData(
47 [in] replPropertyMetaDataBlob blob
51 * replUpToDateVector
52 * w2k uses version 1
53 * w2k3 uses version 2
55 typedef struct {
56 uint32 count;
57 uint32 reserved;
58 drsuapi_DsReplicaCursor cursors[count];
59 } replUpToDateVectorCtr1;
61 typedef struct {
62 uint32 count;
63 uint32 reserved;
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 {
73 uint32 version;
74 uint32 reserved;
75 [switch_is(version)] replUpToDateVectorCtr ctr;
76 } replUpToDateVectorBlob;
78 void decode_replUpToDateVector(
79 [in] replUpToDateVectorBlob blob
83 * repsFrom/repsTo
84 * w2k uses version 1
85 * w2k3 uses version 1
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;
102 uint8 schedule[84];
103 uint32 reserved;
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 */
107 GUID transport_guid;
108 } repsFromTo1;
110 typedef [nodiscriminant] union {
111 [case(1)] repsFromTo1 ctr1;
112 } repsFromTo;
114 typedef [public] struct {
115 uint32 version;
116 uint32 reserved;
117 [switch_is(version)] repsFromTo ctr;
118 } repsFromToBlob;
120 void decode_repsFromTo(
121 [in] repsFromToBlob blob
125 * partialAttributeSet
126 * w2k uses version 1
127 * w2k3 uses version 1
129 typedef struct {
130 uint32 count;
131 drsuapi_DsAttributeId array[count];
132 } partialAttributeSetCtr1;
134 typedef [nodiscriminant] union {
135 [case(1)] partialAttributeSetCtr1 ctr1;
136 } partialAttributeSetCtr;
138 typedef [public] struct {
139 uint32 version;
140 uint32 reserved;
141 [switch_is(version)] partialAttributeSetCtr ctr;
142 } partialAttributeSetBlob;
144 void decode_partialAttributeSet(
145 [in] partialAttributeSetBlob blob
149 * prefixMap
150 * w2k unknown
151 * w2k3 unknown
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
160 } prefixMapVersion;
162 typedef [nodiscriminant] union {
163 [case(PREFIX_MAP_VERSION_DSDB)] drsuapi_DsReplicaOIDMapping_Ctr dsdb;
164 } prefixMapCtr;
166 typedef [public] struct {
167 prefixMapVersion version;
168 uint32 reserved;
169 [switch_is(version)] prefixMapCtr ctr;
170 } prefixMapBlob;
172 void decode_prefixMap(
173 [in] prefixMapBlob blob
177 * the cookie for the LDAP dirsync control
179 typedef [nodiscriminant,gensize] union {
180 [case(0)];
181 [default] replUpToDateVectorBlob uptodateness_vector;
182 } ldapControlDirSyncExtra;
184 typedef struct {
185 [value(3)] uint32 u1;
186 NTTIME time;
187 uint32 u2;
188 uint32 u3;
189 [value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, 0))]
190 uint32 extra_length;
191 drsuapi_DsReplicaHighWaterMark highwatermark;
192 GUID guid1;
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
205 typedef struct {
206 [value(2*strlen_m(name))] uint16 name_len;
207 [value(strlen(data))] uint16 data_len;
208 uint16 reserved; /* 2 for 'Packages', 1 for 'Primary:*', but should be ignored */
209 [charset(UTF16)] uint8 name[name_len];
211 * the data field contains data as HEX strings
213 * 'Packages':
214 * data contains the list of packages
215 * as non termiated UTF16 strings with
216 * a UTF16 NULL byte as separator
218 * 'Primary:Kerberos-Newer-Keys':
219 * ...
221 * 'Primary:Kerberos':
222 * ...
224 * 'Primary:WDigest':
225 * ...
227 * 'Primary:CLEARTEXT':
228 * data contains the cleartext password
229 * as UTF16 string encoded as HEX string
231 [charset(DOS)] uint8 data[data_len];
232 } supplementalCredentialsPackage;
234 /* this are 0x30 (48) whitespaces (0x20) */
235 const string SUPPLEMENTAL_CREDENTIALS_PREFIX = " ";
237 typedef [flag(NDR_PAHEX)] enum {
238 SUPPLEMENTAL_CREDENTIALS_SIGNATURE = 0x0050
239 } supplementalCredentialsSignature;
241 typedef [gensize] struct {
242 [value(SUPPLEMENTAL_CREDENTIALS_PREFIX),charset(UTF16)] uint16 prefix[0x30];
243 [value(SUPPLEMENTAL_CREDENTIALS_SIGNATURE)] supplementalCredentialsSignature signature;
244 uint16 num_packages;
245 supplementalCredentialsPackage packages[num_packages];
246 } supplementalCredentialsSubBlob;
248 typedef [public] struct {
249 [value(0)] uint32 unknown1;
250 [value(ndr_size_supplementalCredentialsSubBlob(&sub, ndr->flags))] uint32 __ndr_size;
251 [value(0)] uint32 unknown2;
252 [subcontext(0),subcontext_size(__ndr_size)] supplementalCredentialsSubBlob sub;
253 [value(0)] uint8 unknown3;
254 } supplementalCredentialsBlob;
256 void decode_supplementalCredentials(
257 [in] supplementalCredentialsBlob blob
260 typedef [public] struct {
261 [flag(STR_NOTERM|NDR_REMAINING)] string_array names;
262 } package_PackagesBlob;
264 void decode_Packages(
265 [in] package_PackagesBlob blob
268 typedef struct {
269 [value(2*strlen_m(string))] uint16 length;
270 [value(2*strlen_m(string))] uint16 size;
271 [relative,subcontext(0),subcontext_size(size),flag(STR_NOTERM|NDR_REMAINING)] string *string;
272 } package_PrimaryKerberosString;
274 typedef struct {
275 [value(0)] uint16 reserved1;
276 [value(0)] uint16 reserved2;
277 [value(0)] uint32 reserved3;
278 uint32 keytype;
279 [value((value?value->length:0))] uint32 value_len;
280 [relative,subcontext(0),subcontext_size(value_len),flag(NDR_REMAINING)] DATA_BLOB *value;
281 } package_PrimaryKerberosKey3;
283 typedef struct {
284 uint16 num_keys;
285 uint16 num_old_keys;
286 package_PrimaryKerberosString salt;
287 package_PrimaryKerberosKey3 keys[num_keys];
288 package_PrimaryKerberosKey3 old_keys[num_old_keys];
289 [value(0)] uint32 padding1;
290 [value(0)] uint32 padding2;
291 [value(0)] uint32 padding3;
292 [value(0)] uint32 padding4;
293 [value(0)] uint32 padding5;
294 } package_PrimaryKerberosCtr3;
296 typedef struct {
297 [value(0)] uint16 reserved1;
298 [value(0)] uint16 reserved2;
299 [value(0)] uint32 reserved3;
300 uint32 iteration_count;
301 uint32 keytype;
302 [value((value?value->length:0))] uint32 value_len;
303 [relative,subcontext(0),subcontext_size(value_len),flag(NDR_REMAINING)] DATA_BLOB *value;
304 } package_PrimaryKerberosKey4;
306 typedef struct {
307 uint16 num_keys;
308 [value(0)] uint16 num_service_keys;
309 uint16 num_old_keys;
310 uint16 num_older_keys;
311 package_PrimaryKerberosString salt;
312 uint32 default_iteration_count;
313 package_PrimaryKerberosKey4 keys[num_keys];
314 package_PrimaryKerberosKey4 service_keys[num_service_keys];
315 package_PrimaryKerberosKey4 old_keys[num_old_keys];
316 package_PrimaryKerberosKey4 older_keys[num_older_keys];
317 } package_PrimaryKerberosCtr4;
319 typedef [nodiscriminant] union {
320 [case(3)] package_PrimaryKerberosCtr3 ctr3;
321 [case(4)] package_PrimaryKerberosCtr4 ctr4;
322 } package_PrimaryKerberosCtr;
324 typedef [public] struct {
325 uint16 version;
326 [value(0)] uint16 flags;
327 [switch_is(version)] package_PrimaryKerberosCtr ctr;
328 } package_PrimaryKerberosBlob;
330 void decode_PrimaryKerberos(
331 [in] package_PrimaryKerberosBlob blob
334 typedef [public] struct {
335 [flag(NDR_REMAINING)] DATA_BLOB cleartext;
336 } package_PrimaryCLEARTEXTBlob;
338 void decode_PrimaryCLEARTEXT(
339 [in] package_PrimaryCLEARTEXTBlob blob
342 typedef [flag(NDR_PAHEX)] struct {
343 uint8 hash[16];
344 } package_PrimaryWDigestHash;
346 typedef [public] struct {
347 [value(0x31)] uint16 unknown1;
348 [value(0x01)] uint8 unknown2;
349 uint8 num_hashes;
350 [value(0)] uint32 unknown3;
351 [value(0)] udlong uuknown4;
352 package_PrimaryWDigestHash hashes[num_hashes];
353 } package_PrimaryWDigestBlob;
355 void decode_PrimaryWDigest(
356 [in] package_PrimaryWDigestBlob blob
359 typedef struct {
360 [value(0)] uint32 size;
361 } AuthInfoNone;
363 typedef struct {
364 [value(16)] uint32 size;
365 samr_Password password;
366 } AuthInfoNT4Owf;
369 * the secret value is encoded as UTF16 if it's a string
370 * but depending the AuthType, it might also be krb5 trusts have random bytes here, so converting to UTF16
371 * mayfail...
373 * TODO: We should try handle the case of a random buffer in all places
374 * we deal with cleartext passwords from windows
376 * so we don't use this:
378 * uint32 value_len;
379 * [charset(UTF16)] uint8 value[value_len];
382 typedef struct {
383 uint32 size;
384 uint8 password[size];
385 } AuthInfoClear;
387 typedef struct {
388 [value(4)] uint32 size;
389 uint32 version;
390 } AuthInfoVersion;
392 typedef [nodiscriminant] union {
393 [case(TRUST_AUTH_TYPE_NONE)] AuthInfoNone none;
394 [case(TRUST_AUTH_TYPE_NT4OWF)] AuthInfoNT4Owf nt4owf;
395 [case(TRUST_AUTH_TYPE_CLEAR)] AuthInfoClear clear;
396 [case(TRUST_AUTH_TYPE_VERSION)] AuthInfoVersion version;
397 } AuthInfo;
399 typedef [public] struct {
400 NTTIME LastUpdateTime;
401 lsa_TrustAuthType AuthType;
403 [switch_is(AuthType)] AuthInfo AuthInfo;
404 [flag(NDR_ALIGN4)] DATA_BLOB _pad;
405 } AuthenticationInformation;
407 typedef [nopull,nopush,noprint] struct {
408 /* sizeis here is bogus, but this is here just for the structure */
409 [size_is(1)] AuthenticationInformation array[];
410 } AuthenticationInformationArray;
412 /* This is nopull,nopush because we pass count down to the
413 * manual parser of AuthenticationInformationArray */
414 typedef [public,nopull,nopush,noprint,gensize] struct {
415 uint32 count;
416 [relative] AuthenticationInformationArray *current;
417 [relative] AuthenticationInformationArray *previous;
418 } trustAuthInOutBlob;
420 void decode_trustAuthInOut(
421 [in] trustAuthInOutBlob blob
424 typedef [public,gensize] struct {
425 uint32 count;
426 [relative] AuthenticationInformation *current[count];
427 } trustCurrentPasswords;
429 typedef [public,nopull] struct {
430 uint8 confounder[512];
431 [subcontext(0),subcontext_size(outgoing_size)] trustCurrentPasswords outgoing;
432 [subcontext(0),subcontext_size(incoming_size)] trustCurrentPasswords incoming;
433 [value(ndr_size_trustCurrentPasswords(&outgoing, ndr->flags))] uint32 outgoing_size;
434 [value(ndr_size_trustCurrentPasswords(&incoming, ndr->flags))] uint32 incoming_size;
435 } trustDomainPasswords;
437 void decode_trustDomainPasswords(
438 [in] trustDomainPasswords blob
441 typedef [public] struct {
442 uint32 marker;
443 DATA_BLOB data;
444 } DsCompressedChunk;
446 typedef struct {
447 uint16 __size;
448 [size_is(__size),charset(DOS)] uint8 *string;
449 } ExtendedErrorAString;
451 typedef struct {
452 uint16 __size;
453 [size_is(__size),charset(UTF16)] uint16 *string;
454 } ExtendedErrorUString;
456 typedef struct {
457 uint16 length;
458 [size_is(length)] uint8 *data;
459 } ExtendedErrorBlob;
461 typedef enum {
462 EXTENDED_ERROR_COMPUTER_NAME_PRESENT = 1,
463 EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT= 2
464 } ExtendedErrorComputerNamePresent;
466 typedef [switch_type(ExtendedErrorComputerNamePresent)] union {
467 [case(EXTENDED_ERROR_COMPUTER_NAME_PRESENT)] ExtendedErrorUString name;
468 [case(EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT)];
469 } ExtendedErrorComputerNameU;
471 typedef struct {
472 ExtendedErrorComputerNamePresent present;
473 [switch_is(present)] ExtendedErrorComputerNameU n;
474 } ExtendedErrorComputerName;
476 typedef enum {
477 EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING = 1,
478 EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING = 2,
479 EXTENDED_ERROR_PARAM_TYPE_UINT32 = 3,
480 EXTENDED_ERROR_PARAM_TYPE_UINT16 = 4,
481 EXTENDED_ERROR_PARAM_TYPE_UINT64 = 5,
482 EXTENDED_ERROR_PARAM_TYPE_NONE = 6,
483 EXTENDED_ERROR_PARAM_TYPE_BLOB = 7
484 } ExtendedErrorParamType;
486 typedef [switch_type(ExtendedErrorParamType)] union {
487 [case(EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING)] ExtendedErrorAString a_string;
488 [case(EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING)] ExtendedErrorUString u_string;
489 [case(EXTENDED_ERROR_PARAM_TYPE_UINT32)] uint32 uint32;
490 [case(EXTENDED_ERROR_PARAM_TYPE_UINT16)] uint16 uint16;
491 [case(EXTENDED_ERROR_PARAM_TYPE_UINT64)] hyper uint64;
492 [case(EXTENDED_ERROR_PARAM_TYPE_NONE)];
493 [case(EXTENDED_ERROR_PARAM_TYPE_BLOB)] ExtendedErrorBlob blob;
494 } ExtendedErrorParamU;
496 typedef struct {
497 ExtendedErrorParamType type;
498 [switch_is(type)] ExtendedErrorParamU p;
499 } ExtendedErrorParam;
501 typedef [public] struct {
502 ExtendedErrorInfo *next;
503 ExtendedErrorComputerName computer_name;
504 hyper pid;
505 NTTIME time;
506 uint32 generating_component;
507 WERROR status;
508 uint16 detection_location;
509 uint16 flags;
510 uint16 num_params;
511 [size_is(num_params)] ExtendedErrorParam params[];
512 } ExtendedErrorInfo;
514 typedef struct {
515 [unique] ExtendedErrorInfo *info;
516 } ExtendedErrorInfoPtr;
518 void decode_ExtendedErrorInfo (
519 [in,subcontext(0xFFFFFC01)] ExtendedErrorInfoPtr ptr