packaging(RHEL-CTDB): don't "make proto" any more.
[Samba/fernandojvsilva.git] / librpc / idl / drsblobs.idl
blob97f3b2de0b601b6f0180ae8d140199a0dd372302
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 helper("../librpc/ndr/ndr_drsblobs.h"),
10 helpstring("Active Directory Replication LDAP Blobs")
12 interface drsblobs {
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
19 * w2k uses version 1
20 * w2k3 uses version 1
22 typedef struct {
23 drsuapi_DsAttributeId attid;
24 uint32 version;
25 NTTIME_1sec originating_change_time;
26 GUID originating_invocation_id;
27 hyper originating_usn;
28 hyper local_usn;
29 } replPropertyMetaData1;
31 typedef struct {
32 uint32 count;
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 {
42 uint32 version;
43 [value(0)] uint32 reserved;
44 [switch_is(version)] replPropertyMetaDataCtr ctr;
45 } replPropertyMetaDataBlob;
47 void decode_replPropertyMetaData(
48 [in] replPropertyMetaDataBlob blob
52 * replUpToDateVector
53 * w2k uses version 1
54 * w2k3 uses version 2
56 typedef struct {
57 uint32 count;
58 [value(0)] uint32 reserved;
59 drsuapi_DsReplicaCursor cursors[count];
60 } replUpToDateVectorCtr1;
62 typedef struct {
63 uint32 count;
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 {
74 uint32 version;
75 [value(0)] uint32 reserved;
76 [switch_is(version)] replUpToDateVectorCtr ctr;
77 } replUpToDateVectorBlob;
79 void decode_replUpToDateVector(
80 [in] replUpToDateVectorBlob blob
84 * repsFrom/repsTo
85 * w2k uses version 1
86 * w2k3 uses version 1
87 * w2k8 uses version 2
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;
104 uint8 schedule[84];
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 */
109 GUID transport_guid;
110 } repsFromTo1;
112 typedef [public,relative_base,gensize] struct {
113 [value(ndr_size_repsFromTo2OtherInfo(this,ndr->iconv_convenience, ndr->flags))]
114 uint32 __ndr_size;
115 [relative] nstring *dns_name1;
116 uint32 unknown1;
117 [relative] nstring *dns_name2;
118 hyper unknown2;
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;
131 uint8 schedule[84];
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 */
136 GUID transport_guid;
137 hyper unknown1;
138 } repsFromTo2;
140 typedef [nodiscriminant] union {
141 [case(1)] repsFromTo1 ctr1;
142 [case(2)] repsFromTo2 ctr2;
143 } repsFromTo;
145 typedef [public] struct {
146 uint32 version;
147 [value(0)] uint32 reserved;
148 [switch_is(version)] repsFromTo ctr;
149 } repsFromToBlob;
151 void decode_repsFromTo(
152 [in] repsFromToBlob blob
156 * partialAttributeSet
157 * w2k uses version 1
158 * w2k3 uses version 1
160 typedef struct {
161 uint32 count;
162 drsuapi_DsAttributeId array[count];
163 } partialAttributeSetCtr1;
165 typedef [nodiscriminant] union {
166 [case(1)] partialAttributeSetCtr1 ctr1;
167 } partialAttributeSetCtr;
169 typedef [public] struct {
170 uint32 version;
171 [value(0)] uint32 reserved;
172 [switch_is(version)] partialAttributeSetCtr ctr;
173 } partialAttributeSetBlob;
175 void decode_partialAttributeSet(
176 [in] partialAttributeSetBlob blob
180 * prefixMap
181 * w2k unknown
182 * w2k3 unknown
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
191 } prefixMapVersion;
193 typedef [nodiscriminant] union {
194 [case(PREFIX_MAP_VERSION_DSDB)] drsuapi_DsReplicaOIDMapping_Ctr dsdb;
195 } prefixMapCtr;
197 typedef [public] struct {
198 prefixMapVersion version;
199 [value(0)] uint32 reserved;
200 [switch_is(version)] prefixMapCtr ctr;
201 } prefixMapBlob;
203 void decode_prefixMap(
204 [in] prefixMapBlob blob
209 * the cookie for the LDAP dirsync control
211 typedef [nodiscriminant,gensize] union {
212 [case(0)];
213 [default] replUpToDateVectorBlob uptodateness_vector;
214 } ldapControlDirSyncExtra;
216 typedef struct {
217 [value(3)] uint32 u1;
218 NTTIME time;
219 uint32 u2;
220 uint32 u3;
221 [value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, ndr->iconv_convenience, 0))]
222 uint32 extra_length;
223 drsuapi_DsReplicaHighWaterMark highwatermark;
224 GUID guid1;
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
237 typedef struct {
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
245 * 'Packages':
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':
251 * ...
253 * 'Primary:Kerberos':
254 * ...
256 * 'Primary:WDigest':
257 * ...
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;
276 uint16 num_packages;
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
300 typedef struct {
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;
306 typedef struct {
307 [value(0)] uint16 reserved1;
308 [value(0)] uint16 reserved2;
309 [value(0)] uint32 reserved3;
310 uint32 keytype;
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;
315 typedef struct {
316 uint16 num_keys;
317 uint16 num_old_keys;
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;
328 typedef struct {
329 [value(0)] uint16 reserved1;
330 [value(0)] uint16 reserved2;
331 [value(0)] uint32 reserved3;
332 uint32 iteration_count;
333 uint32 keytype;
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;
338 typedef struct {
339 uint16 num_keys;
340 [value(0)] uint16 num_service_keys;
341 uint16 num_old_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 {
357 uint16 version;
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 {
375 uint8 hash[16];
376 } package_PrimaryWDigestHash;
378 typedef [public] struct {
379 [value(0x31)] uint16 unknown1;
380 [value(0x01)] uint8 unknown2;
381 uint8 num_hashes;
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
391 typedef struct {
392 [value(0)] uint32 size;
393 } AuthInfoNone;
395 typedef struct {
396 [value(16)] uint32 size;
397 samr_Password password;
398 } AuthInfoNT4Owf;
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
403 * mayfail...
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:
410 * uint32 value_len;
411 * [charset(UTF16)] uint8 value[value_len];
414 typedef struct {
415 uint32 size;
416 uint8 password[size];
417 } AuthInfoClear;
419 typedef struct {
420 [value(4)] uint32 size;
421 uint32 version;
422 } AuthInfoVersion;
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;
429 } AuthInfo;
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 {
447 uint32 count;
448 [relative] AuthenticationInformationArray *current;
449 [relative] AuthenticationInformationArray *previous;
450 } trustAuthInOutBlob;
452 void decode_trustAuthInOut(
453 [in] trustAuthInOutBlob blob
456 typedef [public,gensize] struct {
457 uint32 count;
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 {
474 uint32 marker;
475 DATA_BLOB data;
476 } DsCompressedChunk;
478 typedef struct {
479 uint16 __size;
480 [size_is(__size),charset(DOS)] uint8 *string;
481 } ExtendedErrorAString;
483 typedef struct {
484 uint16 __size;
485 [size_is(__size),charset(UTF16)] uint16 *string;
486 } ExtendedErrorUString;
488 typedef struct {
489 uint16 length;
490 [size_is(length)] uint8 *data;
491 } ExtendedErrorBlob;
493 typedef enum {
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;
503 typedef struct {
504 ExtendedErrorComputerNamePresent present;
505 [switch_is(present)] ExtendedErrorComputerNameU n;
506 } ExtendedErrorComputerName;
508 typedef enum {
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;
528 typedef struct {
529 ExtendedErrorParamType type;
530 [switch_is(type)] ExtendedErrorParamU p;
531 } ExtendedErrorParam;
533 typedef [public] struct {
534 ExtendedErrorInfo *next;
535 ExtendedErrorComputerName computer_name;
536 hyper pid;
537 NTTIME time;
538 uint32 generating_component;
539 WERROR status;
540 uint16 detection_location;
541 uint16 flags;
542 uint16 num_params;
543 [size_is(num_params)] ExtendedErrorParam params[];
544 } ExtendedErrorInfo;
546 typedef struct {
547 [unique] ExtendedErrorInfo *info;
548 } ExtendedErrorInfoPtr;
550 void decode_ExtendedErrorInfo (
551 [in,subcontext(0xFFFFFC01)] ExtendedErrorInfoPtr ptr