Fix breakage for connect function after API change (connect -> connect_fn)
[Samba.git] / librpc / idl / drsblobs.idl
blobfb37500fea2cc62810c2aacdcdb77fd623fa71a3
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 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 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 uint32 reserved;
59 drsuapi_DsReplicaCursor cursors[count];
60 } replUpToDateVectorCtr1;
62 typedef struct {
63 uint32 count;
64 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 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
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;
103 uint8 schedule[84];
104 uint32 reserved;
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 */
108 GUID transport_guid;
109 } repsFromTo1;
111 typedef [nodiscriminant] union {
112 [case(1)] repsFromTo1 ctr1;
113 } repsFromTo;
115 typedef [public] struct {
116 uint32 version;
117 uint32 reserved;
118 [switch_is(version)] repsFromTo ctr;
119 } repsFromToBlob;
121 void decode_repsFromTo(
122 [in] repsFromToBlob blob
126 * partialAttributeSet
127 * w2k uses version 1
128 * w2k3 uses version 1
130 typedef struct {
131 uint32 count;
132 drsuapi_DsAttributeId array[count];
133 } partialAttributeSetCtr1;
135 typedef [nodiscriminant] union {
136 [case(1)] partialAttributeSetCtr1 ctr1;
137 } partialAttributeSetCtr;
139 typedef [public] struct {
140 uint32 version;
141 uint32 reserved;
142 [switch_is(version)] partialAttributeSetCtr ctr;
143 } partialAttributeSetBlob;
145 void decode_partialAttributeSet(
146 [in] partialAttributeSetBlob blob
150 * prefixMap
151 * w2k unknown
152 * w2k3 unknown
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
161 } prefixMapVersion;
163 typedef [nodiscriminant] union {
164 [case(PREFIX_MAP_VERSION_DSDB)] drsuapi_DsReplicaOIDMapping_Ctr dsdb;
165 } prefixMapCtr;
167 typedef [public] struct {
168 prefixMapVersion version;
169 uint32 reserved;
170 [switch_is(version)] prefixMapCtr ctr;
171 } prefixMapBlob;
173 void decode_prefixMap(
174 [in] prefixMapBlob blob
178 * the cookie for the LDAP dirsync control
180 typedef [nodiscriminant,gensize] union {
181 [case(0)];
182 [default] replUpToDateVectorBlob uptodateness_vector;
183 } ldapControlDirSyncExtra;
185 typedef struct {
186 [value(3)] uint32 u1;
187 NTTIME time;
188 uint32 u2;
189 uint32 u3;
190 [value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, ndr->iconv_convenience, 0))]
191 uint32 extra_length;
192 drsuapi_DsReplicaHighWaterMark highwatermark;
193 GUID guid1;
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
206 typedef struct {
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
214 * 'Packages':
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':
220 * ...
222 * 'Primary:Kerberos':
223 * ...
225 * 'Primary:WDigest':
226 * ...
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;
245 uint16 num_packages;
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
269 typedef struct {
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;
275 typedef struct {
276 [value(0)] uint16 reserved1;
277 [value(0)] uint16 reserved2;
278 [value(0)] uint32 reserved3;
279 uint32 keytype;
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;
284 typedef struct {
285 uint16 num_keys;
286 uint16 num_old_keys;
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;
297 typedef struct {
298 [value(0)] uint16 reserved1;
299 [value(0)] uint16 reserved2;
300 [value(0)] uint32 reserved3;
301 uint32 iteration_count;
302 uint32 keytype;
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;
307 typedef struct {
308 uint16 num_keys;
309 [value(0)] uint16 num_service_keys;
310 uint16 num_old_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 {
326 uint16 version;
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 {
344 uint8 hash[16];
345 } package_PrimaryWDigestHash;
347 typedef [public] struct {
348 [value(0x31)] uint16 unknown1;
349 [value(0x01)] uint8 unknown2;
350 uint8 num_hashes;
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
360 typedef struct {
361 [value(0)] uint32 size;
362 } AuthInfoNone;
364 typedef struct {
365 [value(16)] uint32 size;
366 samr_Password password;
367 } AuthInfoNT4Owf;
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
372 * mayfail...
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:
379 * uint32 value_len;
380 * [charset(UTF16)] uint8 value[value_len];
383 typedef struct {
384 uint32 size;
385 uint8 password[size];
386 } AuthInfoClear;
388 typedef struct {
389 [value(4)] uint32 size;
390 uint32 version;
391 } AuthInfoVersion;
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;
398 } AuthInfo;
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 {
416 uint32 count;
417 [relative] AuthenticationInformationArray *current;
418 [relative] AuthenticationInformationArray *previous;
419 } trustAuthInOutBlob;
421 void decode_trustAuthInOut(
422 [in] trustAuthInOutBlob blob
425 typedef [public,gensize] struct {
426 uint32 count;
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 {
443 uint32 marker;
444 DATA_BLOB data;
445 } DsCompressedChunk;
447 typedef struct {
448 uint16 __size;
449 [size_is(__size),charset(DOS)] uint8 *string;
450 } ExtendedErrorAString;
452 typedef struct {
453 uint16 __size;
454 [size_is(__size),charset(UTF16)] uint16 *string;
455 } ExtendedErrorUString;
457 typedef struct {
458 uint16 length;
459 [size_is(length)] uint8 *data;
460 } ExtendedErrorBlob;
462 typedef enum {
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;
472 typedef struct {
473 ExtendedErrorComputerNamePresent present;
474 [switch_is(present)] ExtendedErrorComputerNameU n;
475 } ExtendedErrorComputerName;
477 typedef enum {
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;
497 typedef struct {
498 ExtendedErrorParamType type;
499 [switch_is(type)] ExtendedErrorParamU p;
500 } ExtendedErrorParam;
502 typedef [public] struct {
503 ExtendedErrorInfo *next;
504 ExtendedErrorComputerName computer_name;
505 hyper pid;
506 NTTIME time;
507 uint32 generating_component;
508 WERROR status;
509 uint16 detection_location;
510 uint16 flags;
511 uint16 num_params;
512 [size_is(num_params)] ExtendedErrorParam params[];
513 } ExtendedErrorInfo;
515 typedef struct {
516 [unique] ExtendedErrorInfo *info;
517 } ExtendedErrorInfoPtr;
519 void decode_ExtendedErrorInfo (
520 [in,subcontext(0xFFFFFC01)] ExtendedErrorInfoPtr ptr