s4/asn1: fixed typo in torture messages
[Samba/ekacnet.git] / librpc / gen_ndr / ndr_drsuapi.c
blob089ec3d5947beed9c7289da56e207bfcfbec3290
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_drsuapi.h"
6 #include "librpc/gen_ndr/ndr_security.h"
7 #include "librpc/gen_ndr/ndr_misc.h"
8 #include "librpc/gen_ndr/ndr_samr.h"
9 #include "librpc/ndr/ndr_compression.h"
10 static enum ndr_err_code ndr_push_drsuapi_SupportedExtensions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
12 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
13 return NDR_ERR_SUCCESS;
16 static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
18 uint32_t v;
19 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
20 *r = v;
21 return NDR_ERR_SUCCESS;
24 _PUBLIC_ void ndr_print_drsuapi_SupportedExtensions(struct ndr_print *ndr, const char *name, uint32_t r)
26 ndr_print_uint32(ndr, name, r);
27 ndr->depth++;
28 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_BASE", DRSUAPI_SUPPORTED_EXTENSION_BASE, r);
29 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION", DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION, r);
30 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI", DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI, r);
31 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2", DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2, r);
32 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS", DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS, r);
33 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1, r);
34 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION", DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION, r);
35 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_00000080", DRSUAPI_SUPPORTED_EXTENSION_00000080, r);
36 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE", DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE, r);
37 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2", DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2, r);
38 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION", DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION, r);
39 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2, r);
40 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD", DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD, r);
41 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND", DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND, r);
42 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO", DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO, r);
43 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION", DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION, r);
44 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01, r);
45 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP", DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP, r);
46 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY", DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY, r);
47 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3", DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3, r);
48 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_00100000", DRSUAPI_SUPPORTED_EXTENSION_00100000, r);
49 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2", DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2, r);
50 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6, r);
51 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS", DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS, r);
52 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8, r);
53 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5, r);
54 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6, r);
55 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3", DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3, r);
56 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7, r);
57 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT", DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT, r);
58 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS", DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS, r);
59 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_20000000", DRSUAPI_SUPPORTED_EXTENSION_20000000, r);
60 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_40000000", DRSUAPI_SUPPORTED_EXTENSION_40000000, r);
61 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_80000000", DRSUAPI_SUPPORTED_EXTENSION_80000000, r);
62 ndr->depth--;
65 static enum ndr_err_code ndr_push_drsuapi_SupportedExtensionsExt(struct ndr_push *ndr, int ndr_flags, uint32_t r)
67 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
68 return NDR_ERR_SUCCESS;
71 static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensionsExt(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
73 uint32_t v;
74 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
75 *r = v;
76 return NDR_ERR_SUCCESS;
79 _PUBLIC_ void ndr_print_drsuapi_SupportedExtensionsExt(struct ndr_print *ndr, const char *name, uint32_t r)
81 ndr_print_uint32(ndr, name, r);
82 ndr->depth++;
83 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADAM", DRSUAPI_SUPPORTED_EXTENSION_ADAM, r);
84 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2", DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2, r);
85 ndr->depth--;
88 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo24(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo24 *r)
90 if (ndr_flags & NDR_SCALARS) {
91 NDR_CHECK(ndr_push_align(ndr, 4));
92 NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions));
93 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
94 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid));
96 if (ndr_flags & NDR_BUFFERS) {
98 return NDR_ERR_SUCCESS;
101 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo24(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo24 *r)
103 if (ndr_flags & NDR_SCALARS) {
104 NDR_CHECK(ndr_pull_align(ndr, 4));
105 NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions));
106 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
107 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid));
109 if (ndr_flags & NDR_BUFFERS) {
111 return NDR_ERR_SUCCESS;
114 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo24(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo24 *r)
116 ndr_print_struct(ndr, name, "drsuapi_DsBindInfo24");
117 ndr->depth++;
118 ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions);
119 ndr_print_GUID(ndr, "site_guid", &r->site_guid);
120 ndr_print_uint32(ndr, "pid", r->pid);
121 ndr->depth--;
124 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo28(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo28 *r)
126 if (ndr_flags & NDR_SCALARS) {
127 NDR_CHECK(ndr_push_align(ndr, 4));
128 NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions));
129 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
130 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid));
131 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->repl_epoch));
133 if (ndr_flags & NDR_BUFFERS) {
135 return NDR_ERR_SUCCESS;
138 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo28(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo28 *r)
140 if (ndr_flags & NDR_SCALARS) {
141 NDR_CHECK(ndr_pull_align(ndr, 4));
142 NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions));
143 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
144 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid));
145 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->repl_epoch));
147 if (ndr_flags & NDR_BUFFERS) {
149 return NDR_ERR_SUCCESS;
152 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo28(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo28 *r)
154 ndr_print_struct(ndr, name, "drsuapi_DsBindInfo28");
155 ndr->depth++;
156 ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions);
157 ndr_print_GUID(ndr, "site_guid", &r->site_guid);
158 ndr_print_uint32(ndr, "pid", r->pid);
159 ndr_print_uint32(ndr, "repl_epoch", r->repl_epoch);
160 ndr->depth--;
163 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo48(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo48 *r)
165 if (ndr_flags & NDR_SCALARS) {
166 NDR_CHECK(ndr_push_align(ndr, 4));
167 NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions));
168 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
169 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid));
170 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->repl_epoch));
171 NDR_CHECK(ndr_push_drsuapi_SupportedExtensionsExt(ndr, NDR_SCALARS, r->supported_extensions_ext));
172 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->config_dn_guid));
174 if (ndr_flags & NDR_BUFFERS) {
176 return NDR_ERR_SUCCESS;
179 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo48(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo48 *r)
181 if (ndr_flags & NDR_SCALARS) {
182 NDR_CHECK(ndr_pull_align(ndr, 4));
183 NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions));
184 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
185 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid));
186 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->repl_epoch));
187 NDR_CHECK(ndr_pull_drsuapi_SupportedExtensionsExt(ndr, NDR_SCALARS, &r->supported_extensions_ext));
188 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->config_dn_guid));
190 if (ndr_flags & NDR_BUFFERS) {
192 return NDR_ERR_SUCCESS;
195 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo48(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo48 *r)
197 ndr_print_struct(ndr, name, "drsuapi_DsBindInfo48");
198 ndr->depth++;
199 ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions);
200 ndr_print_GUID(ndr, "site_guid", &r->site_guid);
201 ndr_print_uint32(ndr, "pid", r->pid);
202 ndr_print_uint32(ndr, "repl_epoch", r->repl_epoch);
203 ndr_print_drsuapi_SupportedExtensionsExt(ndr, "supported_extensions_ext", r->supported_extensions_ext);
204 ndr_print_GUID(ndr, "config_dn_guid", &r->config_dn_guid);
205 ndr->depth--;
208 static enum ndr_err_code ndr_push_drsuapi_DsBindInfoFallBack(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoFallBack *r)
210 if (ndr_flags & NDR_SCALARS) {
211 NDR_CHECK(ndr_push_align(ndr, 4));
213 uint32_t _flags_save_DATA_BLOB = ndr->flags;
214 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
215 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->info));
216 ndr->flags = _flags_save_DATA_BLOB;
219 if (ndr_flags & NDR_BUFFERS) {
221 return NDR_ERR_SUCCESS;
224 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoFallBack(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoFallBack *r)
226 if (ndr_flags & NDR_SCALARS) {
227 NDR_CHECK(ndr_pull_align(ndr, 4));
229 uint32_t _flags_save_DATA_BLOB = ndr->flags;
230 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
231 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->info));
232 ndr->flags = _flags_save_DATA_BLOB;
235 if (ndr_flags & NDR_BUFFERS) {
237 return NDR_ERR_SUCCESS;
240 _PUBLIC_ void ndr_print_drsuapi_DsBindInfoFallBack(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoFallBack *r)
242 ndr_print_struct(ndr, name, "drsuapi_DsBindInfoFallBack");
243 ndr->depth++;
244 ndr_print_DATA_BLOB(ndr, "info", r->info);
245 ndr->depth--;
248 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsBindInfo *r)
250 if (ndr_flags & NDR_SCALARS) {
251 int level = ndr_push_get_switch_value(ndr, r);
252 NDR_CHECK(ndr_push_union_align(ndr, 1));
253 switch (level) {
254 case 24: {
256 struct ndr_push *_ndr_info24;
257 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info24, 4, -1));
258 NDR_CHECK(ndr_push_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
259 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info24, 4, -1));
261 break; }
263 case 28: {
265 struct ndr_push *_ndr_info28;
266 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info28, 4, -1));
267 NDR_CHECK(ndr_push_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
268 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info28, 4, -1));
270 break; }
272 case 48: {
274 struct ndr_push *_ndr_info48;
275 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info48, 4, -1));
276 NDR_CHECK(ndr_push_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
277 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info48, 4, -1));
279 break; }
281 default: {
283 struct ndr_push *_ndr_FallBack;
284 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_FallBack, 4, -1));
285 NDR_CHECK(ndr_push_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack));
286 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_FallBack, 4, -1));
288 break; }
292 if (ndr_flags & NDR_BUFFERS) {
293 int level = ndr_push_get_switch_value(ndr, r);
294 switch (level) {
295 case 24:
296 break;
298 case 28:
299 break;
301 case 48:
302 break;
304 default:
305 break;
309 return NDR_ERR_SUCCESS;
312 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsBindInfo *r)
314 int level;
315 level = ndr_pull_get_switch_value(ndr, r);
316 if (ndr_flags & NDR_SCALARS) {
317 NDR_CHECK(ndr_pull_union_align(ndr, 1));
318 switch (level) {
319 case 24: {
321 struct ndr_pull *_ndr_info24;
322 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info24, 4, -1));
323 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
324 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info24, 4, -1));
326 break; }
328 case 28: {
330 struct ndr_pull *_ndr_info28;
331 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info28, 4, -1));
332 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
333 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info28, 4, -1));
335 break; }
337 case 48: {
339 struct ndr_pull *_ndr_info48;
340 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info48, 4, -1));
341 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
342 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info48, 4, -1));
344 break; }
346 default: {
348 struct ndr_pull *_ndr_FallBack;
349 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_FallBack, 4, -1));
350 NDR_CHECK(ndr_pull_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack));
351 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_FallBack, 4, -1));
353 break; }
357 if (ndr_flags & NDR_BUFFERS) {
358 switch (level) {
359 case 24:
360 break;
362 case 28:
363 break;
365 case 48:
366 break;
368 default:
369 break;
373 return NDR_ERR_SUCCESS;
376 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r)
378 int level;
379 level = ndr_print_get_switch_value(ndr, r);
380 ndr_print_union(ndr, name, level, "drsuapi_DsBindInfo");
381 switch (level) {
382 case 24:
383 ndr_print_drsuapi_DsBindInfo24(ndr, "info24", &r->info24);
384 break;
386 case 28:
387 ndr_print_drsuapi_DsBindInfo28(ndr, "info28", &r->info28);
388 break;
390 case 48:
391 ndr_print_drsuapi_DsBindInfo48(ndr, "info48", &r->info48);
392 break;
394 default:
395 ndr_print_drsuapi_DsBindInfoFallBack(ndr, "FallBack", &r->FallBack);
396 break;
401 static enum ndr_err_code ndr_push_drsuapi_DsBindInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoCtr *r)
403 if (ndr_flags & NDR_SCALARS) {
404 NDR_CHECK(ndr_push_align(ndr, 4));
405 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
406 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->length));
407 NDR_CHECK(ndr_push_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info));
409 if (ndr_flags & NDR_BUFFERS) {
411 return NDR_ERR_SUCCESS;
414 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoCtr *r)
416 if (ndr_flags & NDR_SCALARS) {
417 NDR_CHECK(ndr_pull_align(ndr, 4));
418 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
419 if (r->length < 1 || r->length > 10000) {
420 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
422 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->length));
423 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info));
425 if (ndr_flags & NDR_BUFFERS) {
427 return NDR_ERR_SUCCESS;
430 _PUBLIC_ void ndr_print_drsuapi_DsBindInfoCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoCtr *r)
432 ndr_print_struct(ndr, name, "drsuapi_DsBindInfoCtr");
433 ndr->depth++;
434 ndr_print_uint32(ndr, "length", r->length);
435 ndr_print_set_switch_value(ndr, &r->info, r->length);
436 ndr_print_drsuapi_DsBindInfo(ndr, "info", &r->info);
437 ndr->depth--;
440 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier *r)
442 if (ndr_flags & NDR_SCALARS) {
443 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, strlen_m(r->dn) + 1));
444 NDR_CHECK(ndr_push_align(ndr, 4));
445 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, ndr->flags) - 4));
446 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
447 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
448 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
449 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
450 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
452 if (ndr_flags & NDR_BUFFERS) {
453 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
455 return NDR_ERR_SUCCESS;
458 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier *r)
460 if (ndr_flags & NDR_SCALARS) {
461 NDR_CHECK(ndr_pull_array_size(ndr, &r->dn));
462 NDR_CHECK(ndr_pull_align(ndr, 4));
463 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
464 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
465 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
466 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
467 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
468 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, ndr_get_array_size(ndr, &r->dn), sizeof(uint16_t), CH_UTF16));
469 if (r->dn) {
470 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->dn, r->__ndr_size_dn + 1));
473 if (ndr_flags & NDR_BUFFERS) {
474 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
476 return NDR_ERR_SUCCESS;
479 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier *r)
481 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier");
482 ndr->depth++;
483 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, ndr->flags) - 4:r->__ndr_size);
484 ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid);
485 ndr_print_GUID(ndr, "guid", &r->guid);
486 ndr_print_dom_sid28(ndr, "sid", &r->sid);
487 ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
488 ndr_print_string(ndr, "dn", r->dn);
489 ndr->depth--;
492 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier(const struct drsuapi_DsReplicaObjectIdentifier *r, struct smb_iconv_convenience *ic, int flags)
494 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier, ic);
497 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
499 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
500 return NDR_ERR_SUCCESS;
503 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
505 uint32_t v;
506 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
507 *r = v;
508 return NDR_ERR_SUCCESS;
511 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncOptions(struct ndr_print *ndr, const char *name, uint32_t r)
513 ndr_print_uint32(ndr, name, r);
514 ndr->depth++;
515 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION, r);
516 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_WRITEABLE", DRSUAPI_DS_REPLICA_SYNC_WRITEABLE, r);
517 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PERIODIC", DRSUAPI_DS_REPLICA_SYNC_PERIODIC, r);
518 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING", DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING, r);
519 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES", DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES, r);
520 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL", DRSUAPI_DS_REPLICA_SYNC_FULL, r);
521 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_URGENT", DRSUAPI_DS_REPLICA_SYNC_URGENT, r);
522 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD", DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD, r);
523 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FORCE", DRSUAPI_DS_REPLICA_SYNC_FORCE, r);
524 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE", DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE, r);
525 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED", DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED, r);
526 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_TWO_WAY", DRSUAPI_DS_REPLICA_SYNC_TWO_WAY, r);
527 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY", DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY, r);
528 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL", DRSUAPI_DS_REPLICA_SYNC_INITIAL, r);
529 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION", DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION, r);
530 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ABANDONED", DRSUAPI_DS_REPLICA_SYNC_ABANDONED, r);
531 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS, r);
532 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET, r);
533 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_REQUEUE", DRSUAPI_DS_REPLICA_SYNC_REQUEUE, r);
534 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION", DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION, r);
535 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA, r);
536 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_CRITICAL", DRSUAPI_DS_REPLICA_SYNC_CRITICAL, r);
537 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS, r);
538 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PREEMPTED", DRSUAPI_DS_REPLICA_SYNC_PREEMPTED, r);
539 ndr->depth--;
542 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaSyncRequest1 *r)
544 if (ndr_flags & NDR_SCALARS) {
545 NDR_CHECK(ndr_push_align(ndr, 5));
546 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
547 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
549 uint32_t _flags_save_string = ndr->flags;
550 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
551 NDR_CHECK(ndr_push_unique_ptr(ndr, r->other_info));
552 ndr->flags = _flags_save_string;
554 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->options));
556 if (ndr_flags & NDR_BUFFERS) {
557 if (r->naming_context) {
558 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
561 uint32_t _flags_save_string = ndr->flags;
562 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
563 if (r->other_info) {
564 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->other_info));
566 ndr->flags = _flags_save_string;
569 return NDR_ERR_SUCCESS;
572 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaSyncRequest1 *r)
574 uint32_t _ptr_naming_context;
575 TALLOC_CTX *_mem_save_naming_context_0;
576 uint32_t _ptr_other_info;
577 TALLOC_CTX *_mem_save_other_info_0;
578 if (ndr_flags & NDR_SCALARS) {
579 NDR_CHECK(ndr_pull_align(ndr, 5));
580 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
581 if (_ptr_naming_context) {
582 NDR_PULL_ALLOC(ndr, r->naming_context);
583 } else {
584 r->naming_context = NULL;
586 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
588 uint32_t _flags_save_string = ndr->flags;
589 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
590 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_info));
591 if (_ptr_other_info) {
592 NDR_PULL_ALLOC(ndr, r->other_info);
593 } else {
594 r->other_info = NULL;
596 ndr->flags = _flags_save_string;
598 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->options));
600 if (ndr_flags & NDR_BUFFERS) {
601 if (r->naming_context) {
602 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
603 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
604 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
605 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
608 uint32_t _flags_save_string = ndr->flags;
609 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
610 if (r->other_info) {
611 _mem_save_other_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
612 NDR_PULL_SET_MEM_CTX(ndr, r->other_info, 0);
613 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->other_info));
614 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_info_0, 0);
616 ndr->flags = _flags_save_string;
619 return NDR_ERR_SUCCESS;
622 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaSyncRequest1 *r)
624 ndr_print_struct(ndr, name, "drsuapi_DsReplicaSyncRequest1");
625 ndr->depth++;
626 ndr_print_ptr(ndr, "naming_context", r->naming_context);
627 ndr->depth++;
628 if (r->naming_context) {
629 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
631 ndr->depth--;
632 ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
633 ndr_print_ptr(ndr, "other_info", r->other_info);
634 ndr->depth++;
635 if (r->other_info) {
636 ndr_print_string(ndr, "other_info", r->other_info);
638 ndr->depth--;
639 ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "options", r->options);
640 ndr->depth--;
643 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaSyncRequest *r)
645 if (ndr_flags & NDR_SCALARS) {
646 int level = ndr_push_get_switch_value(ndr, r);
647 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
648 NDR_CHECK(ndr_push_union_align(ndr, 5));
649 switch (level) {
650 case 1: {
651 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1));
652 break; }
654 default:
655 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
658 if (ndr_flags & NDR_BUFFERS) {
659 int level = ndr_push_get_switch_value(ndr, r);
660 switch (level) {
661 case 1:
662 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1));
663 break;
665 default:
666 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
669 return NDR_ERR_SUCCESS;
672 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaSyncRequest *r)
674 int level;
675 int32_t _level;
676 level = ndr_pull_get_switch_value(ndr, r);
677 if (ndr_flags & NDR_SCALARS) {
678 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
679 if (_level != level) {
680 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
682 NDR_CHECK(ndr_pull_union_align(ndr, 5));
683 switch (level) {
684 case 1: {
685 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1));
686 break; }
688 default:
689 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
692 if (ndr_flags & NDR_BUFFERS) {
693 switch (level) {
694 case 1:
695 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1));
696 break;
698 default:
699 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
702 return NDR_ERR_SUCCESS;
705 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaSyncRequest *r)
707 int level;
708 level = ndr_print_get_switch_value(ndr, r);
709 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaSyncRequest");
710 switch (level) {
711 case 1:
712 ndr_print_drsuapi_DsReplicaSyncRequest1(ndr, "req1", &r->req1);
713 break;
715 default:
716 ndr_print_bad_level(ndr, name, level);
720 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaHighWaterMark(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaHighWaterMark *r)
722 if (ndr_flags & NDR_SCALARS) {
723 NDR_CHECK(ndr_push_align(ndr, 8));
724 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->tmp_highest_usn));
725 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->reserved_usn));
726 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
728 if (ndr_flags & NDR_BUFFERS) {
730 return NDR_ERR_SUCCESS;
733 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaHighWaterMark(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaHighWaterMark *r)
735 if (ndr_flags & NDR_SCALARS) {
736 NDR_CHECK(ndr_pull_align(ndr, 8));
737 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->tmp_highest_usn));
738 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->reserved_usn));
739 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
741 if (ndr_flags & NDR_BUFFERS) {
743 return NDR_ERR_SUCCESS;
746 _PUBLIC_ void ndr_print_drsuapi_DsReplicaHighWaterMark(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaHighWaterMark *r)
748 ndr_print_struct(ndr, name, "drsuapi_DsReplicaHighWaterMark");
749 ndr->depth++;
750 ndr_print_hyper(ndr, "tmp_highest_usn", r->tmp_highest_usn);
751 ndr_print_hyper(ndr, "reserved_usn", r->reserved_usn);
752 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
753 ndr->depth--;
756 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor *r)
758 if (ndr_flags & NDR_SCALARS) {
759 NDR_CHECK(ndr_push_align(ndr, 8));
760 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
761 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
763 if (ndr_flags & NDR_BUFFERS) {
765 return NDR_ERR_SUCCESS;
768 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor *r)
770 if (ndr_flags & NDR_SCALARS) {
771 NDR_CHECK(ndr_pull_align(ndr, 8));
772 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
773 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
775 if (ndr_flags & NDR_BUFFERS) {
777 return NDR_ERR_SUCCESS;
780 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor *r)
782 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor");
783 ndr->depth++;
784 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
785 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
786 ndr->depth--;
789 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtrEx *r)
791 uint32_t cntr_cursors_0;
792 if (ndr_flags & NDR_SCALARS) {
793 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
794 NDR_CHECK(ndr_push_align(ndr, 8));
795 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
796 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
797 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
798 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
799 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
800 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
803 if (ndr_flags & NDR_BUFFERS) {
805 return NDR_ERR_SUCCESS;
808 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtrEx *r)
810 uint32_t cntr_cursors_0;
811 TALLOC_CTX *_mem_save_cursors_0;
812 if (ndr_flags & NDR_SCALARS) {
813 NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors));
814 NDR_CHECK(ndr_pull_align(ndr, 8));
815 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
816 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
817 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
818 if (r->count > 0x100000) {
819 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
821 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
822 NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors));
823 _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr);
824 NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0);
825 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
826 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
828 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0);
829 if (r->cursors) {
830 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count));
833 if (ndr_flags & NDR_BUFFERS) {
835 return NDR_ERR_SUCCESS;
838 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtrEx *r)
840 uint32_t cntr_cursors_0;
841 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursorCtrEx");
842 ndr->depth++;
843 ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
844 ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
845 ndr_print_uint32(ndr, "count", r->count);
846 ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2);
847 ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count);
848 ndr->depth++;
849 for (cntr_cursors_0=0;cntr_cursors_0<r->count;cntr_cursors_0++) {
850 char *idx_0=NULL;
851 if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) {
852 ndr_print_drsuapi_DsReplicaCursor(ndr, "cursors", &r->cursors[cntr_cursors_0]);
853 free(idx_0);
856 ndr->depth--;
857 ndr->depth--;
860 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
862 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
863 return NDR_ERR_SUCCESS;
866 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
868 uint32_t v;
869 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
870 *r = v;
871 return NDR_ERR_SUCCESS;
874 _PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourFlags(struct ndr_print *ndr, const char *name, uint32_t r)
876 ndr_print_uint32(ndr, name, r);
877 ndr->depth++;
878 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE", DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE, r);
879 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP", DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP, r);
880 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS", DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS, r);
881 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT", DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT, r);
882 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP", DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP, r);
883 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_ERROR", DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_ERROR, r);
884 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC, r);
885 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY", DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY, r);
886 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS", DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS, r);
887 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS, r);
888 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_SYNC_PACKET", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_SYNC_PACKET, r);
889 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED", DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED, r);
890 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_SPECIAL_SECRET_PROCESSING", DRSUAPI_DS_REPLICA_NEIGHBOUR_SPECIAL_SECRET_PROCESSING, r);
891 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED", DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED, r);
892 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS, r);
893 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC, r);
894 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES", DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES, r);
895 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS, r);
896 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET, r);
897 ndr->depth--;
900 static enum ndr_err_code ndr_push_drsuapi_DsExtendedOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation r)
903 uint32_t _flags_save_ENUM = ndr->flags;
904 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
905 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
906 ndr->flags = _flags_save_ENUM;
908 return NDR_ERR_SUCCESS;
911 static enum ndr_err_code ndr_pull_drsuapi_DsExtendedOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation *r)
913 uint32_t v;
915 uint32_t _flags_save_ENUM = ndr->flags;
916 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
917 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
918 *r = v;
919 ndr->flags = _flags_save_ENUM;
921 return NDR_ERR_SUCCESS;
924 _PUBLIC_ void ndr_print_drsuapi_DsExtendedOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedOperation r)
926 const char *val = NULL;
929 uint32_t _flags_save_ENUM = ndr->flags;
930 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
931 switch (r) {
932 case DRSUAPI_EXOP_NONE: val = "DRSUAPI_EXOP_NONE"; break;
933 case DRSUAPI_EXOP_FSMO_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_REQ_ROLE"; break;
934 case DRSUAPI_EXOP_FSMO_RID_ALLOC: val = "DRSUAPI_EXOP_FSMO_RID_ALLOC"; break;
935 case DRSUAPI_EXOP_FSMO_RID_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_RID_REQ_ROLE"; break;
936 case DRSUAPI_EXOP_FSMO_REQ_PDC: val = "DRSUAPI_EXOP_FSMO_REQ_PDC"; break;
937 case DRSUAPI_EXOP_FSMO_ABANDON_ROLE: val = "DRSUAPI_EXOP_FSMO_ABANDON_ROLE"; break;
938 case DRSUAPI_EXOP_REPL_OBJ: val = "DRSUAPI_EXOP_REPL_OBJ"; break;
939 case DRSUAPI_EXOP_REPL_SECRET: val = "DRSUAPI_EXOP_REPL_SECRET"; break;
941 ndr_print_enum(ndr, name, "ENUM", val, r);
942 ndr->flags = _flags_save_ENUM;
946 static enum ndr_err_code ndr_push_drsuapi_DsExtendedError(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedError r)
949 uint32_t _flags_save_ENUM = ndr->flags;
950 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
951 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
952 ndr->flags = _flags_save_ENUM;
954 return NDR_ERR_SUCCESS;
957 static enum ndr_err_code ndr_pull_drsuapi_DsExtendedError(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedError *r)
959 uint32_t v;
961 uint32_t _flags_save_ENUM = ndr->flags;
962 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
963 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
964 *r = v;
965 ndr->flags = _flags_save_ENUM;
967 return NDR_ERR_SUCCESS;
970 _PUBLIC_ void ndr_print_drsuapi_DsExtendedError(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedError r)
972 const char *val = NULL;
975 uint32_t _flags_save_ENUM = ndr->flags;
976 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
977 switch (r) {
978 case DRSUAPI_EXOP_ERR_NONE: val = "DRSUAPI_EXOP_ERR_NONE"; break;
979 case DRSUAPI_EXOP_ERR_SUCCESS: val = "DRSUAPI_EXOP_ERR_SUCCESS"; break;
980 case DRSUAPI_EXOP_ERR_UNKNOWN_OP: val = "DRSUAPI_EXOP_ERR_UNKNOWN_OP"; break;
981 case DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER: val = "DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER"; break;
982 case DRSUAPI_EXOP_ERR_UPDATE_ERR: val = "DRSUAPI_EXOP_ERR_UPDATE_ERR"; break;
983 case DRSUAPI_EXOP_ERR_EXCEPTION: val = "DRSUAPI_EXOP_ERR_EXCEPTION"; break;
984 case DRSUAPI_EXOP_ERR_UNKNOWN_CALLER: val = "DRSUAPI_EXOP_ERR_UNKNOWN_CALLER"; break;
985 case DRSUAPI_EXOP_ERR_RID_ALLOC: val = "DRSUAPI_EXOP_ERR_RID_ALLOC"; break;
986 case DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED: val = "DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED"; break;
987 case DRSUAPI_EXOP_ERR_FMSO_PENDING_OP: val = "DRSUAPI_EXOP_ERR_FMSO_PENDING_OP"; break;
988 case DRSUAPI_EXOP_ERR_MISMATCH: val = "DRSUAPI_EXOP_ERR_MISMATCH"; break;
989 case DRSUAPI_EXOP_ERR_COULDNT_CONTACT: val = "DRSUAPI_EXOP_ERR_COULDNT_CONTACT"; break;
990 case DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES: val = "DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES"; break;
991 case DRSUAPI_EXOP_ERR_DIR_ERROR: val = "DRSUAPI_EXOP_ERR_DIR_ERROR"; break;
992 case DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS: val = "DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS"; break;
993 case DRSUAPI_EXOP_ERR_ACCESS_DENIED: val = "DRSUAPI_EXOP_ERR_ACCESS_DENIED"; break;
994 case DRSUAPI_EXOP_ERR_PARAM_ERROR: val = "DRSUAPI_EXOP_ERR_PARAM_ERROR"; break;
996 ndr_print_enum(ndr, name, "ENUM", val, r);
997 ndr->flags = _flags_save_ENUM;
1001 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest5(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest5 *r)
1003 if (ndr_flags & NDR_SCALARS) {
1004 NDR_CHECK(ndr_push_align(ndr, 8));
1005 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1006 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1007 if (r->naming_context == NULL) {
1008 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1010 NDR_CHECK(ndr_push_ref_ptr(ndr));
1011 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1012 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1013 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1014 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1015 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1016 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1017 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1019 if (ndr_flags & NDR_BUFFERS) {
1020 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1021 if (r->uptodateness_vector) {
1022 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1025 return NDR_ERR_SUCCESS;
1028 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest5(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest5 *r)
1030 uint32_t _ptr_naming_context;
1031 TALLOC_CTX *_mem_save_naming_context_0;
1032 uint32_t _ptr_uptodateness_vector;
1033 TALLOC_CTX *_mem_save_uptodateness_vector_0;
1034 if (ndr_flags & NDR_SCALARS) {
1035 NDR_CHECK(ndr_pull_align(ndr, 8));
1036 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1037 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1038 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1039 if (_ptr_naming_context) {
1040 NDR_PULL_ALLOC(ndr, r->naming_context);
1041 } else {
1042 r->naming_context = NULL;
1044 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1045 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1046 if (_ptr_uptodateness_vector) {
1047 NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1048 } else {
1049 r->uptodateness_vector = NULL;
1051 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1052 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1053 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1054 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1055 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1057 if (ndr_flags & NDR_BUFFERS) {
1058 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1059 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1060 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1061 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1062 if (r->uptodateness_vector) {
1063 _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1064 NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1065 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1066 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1069 return NDR_ERR_SUCCESS;
1072 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest5(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest5 *r)
1074 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest5");
1075 ndr->depth++;
1076 ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1077 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1078 ndr_print_ptr(ndr, "naming_context", r->naming_context);
1079 ndr->depth++;
1080 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1081 ndr->depth--;
1082 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1083 ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1084 ndr->depth++;
1085 if (r->uptodateness_vector) {
1086 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1088 ndr->depth--;
1089 ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1090 ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1091 ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1092 ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1093 ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1094 ndr->depth--;
1097 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r)
1099 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOID");
1100 ndr->depth++;
1101 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaOID_oid(r->oid, 0):r->__ndr_size);
1102 ndr_print_ptr(ndr, "oid", r->oid);
1103 ndr->depth++;
1104 if (r->oid) {
1105 ndr_print_string(ndr, "oid", r->oid);
1107 ndr->depth--;
1108 ndr->depth--;
1111 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping *r)
1113 if (ndr_flags & NDR_SCALARS) {
1114 NDR_CHECK(ndr_push_align(ndr, 5));
1115 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id_prefix));
1116 NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid));
1118 if (ndr_flags & NDR_BUFFERS) {
1119 NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid));
1121 return NDR_ERR_SUCCESS;
1124 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping *r)
1126 if (ndr_flags & NDR_SCALARS) {
1127 NDR_CHECK(ndr_pull_align(ndr, 5));
1128 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id_prefix));
1129 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid));
1131 if (ndr_flags & NDR_BUFFERS) {
1132 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid));
1134 return NDR_ERR_SUCCESS;
1137 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping *r)
1139 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping");
1140 ndr->depth++;
1141 ndr_print_uint32(ndr, "id_prefix", r->id_prefix);
1142 ndr_print_drsuapi_DsReplicaOID(ndr, "oid", &r->oid);
1143 ndr->depth--;
1146 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1148 uint32_t cntr_mappings_1;
1149 if (ndr_flags & NDR_SCALARS) {
1150 NDR_CHECK(ndr_push_align(ndr, 5));
1151 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mappings));
1152 NDR_CHECK(ndr_push_unique_ptr(ndr, r->mappings));
1154 if (ndr_flags & NDR_BUFFERS) {
1155 if (r->mappings) {
1156 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_mappings));
1157 for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1158 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1]));
1160 for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1161 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1]));
1165 return NDR_ERR_SUCCESS;
1168 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1170 uint32_t _ptr_mappings;
1171 uint32_t cntr_mappings_1;
1172 TALLOC_CTX *_mem_save_mappings_0;
1173 TALLOC_CTX *_mem_save_mappings_1;
1174 if (ndr_flags & NDR_SCALARS) {
1175 NDR_CHECK(ndr_pull_align(ndr, 5));
1176 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_mappings));
1177 if (r->num_mappings > 0x100000) {
1178 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1180 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_mappings));
1181 if (_ptr_mappings) {
1182 NDR_PULL_ALLOC(ndr, r->mappings);
1183 } else {
1184 r->mappings = NULL;
1187 if (ndr_flags & NDR_BUFFERS) {
1188 if (r->mappings) {
1189 _mem_save_mappings_0 = NDR_PULL_GET_MEM_CTX(ndr);
1190 NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0);
1191 NDR_CHECK(ndr_pull_array_size(ndr, &r->mappings));
1192 NDR_PULL_ALLOC_N(ndr, r->mappings, ndr_get_array_size(ndr, &r->mappings));
1193 _mem_save_mappings_1 = NDR_PULL_GET_MEM_CTX(ndr);
1194 NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0);
1195 for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1196 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1]));
1198 for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1199 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1]));
1201 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_1, 0);
1202 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_0, 0);
1204 if (r->mappings) {
1205 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->mappings, r->num_mappings));
1208 return NDR_ERR_SUCCESS;
1211 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1213 uint32_t cntr_mappings_1;
1214 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping_Ctr");
1215 ndr->depth++;
1216 ndr_print_uint32(ndr, "num_mappings", r->num_mappings);
1217 ndr_print_ptr(ndr, "mappings", r->mappings);
1218 ndr->depth++;
1219 if (r->mappings) {
1220 ndr->print(ndr, "%s: ARRAY(%d)", "mappings", (int)r->num_mappings);
1221 ndr->depth++;
1222 for (cntr_mappings_1=0;cntr_mappings_1<r->num_mappings;cntr_mappings_1++) {
1223 char *idx_1=NULL;
1224 if (asprintf(&idx_1, "[%d]", cntr_mappings_1) != -1) {
1225 ndr_print_drsuapi_DsReplicaOIDMapping(ndr, "mappings", &r->mappings[cntr_mappings_1]);
1226 free(idx_1);
1229 ndr->depth--;
1231 ndr->depth--;
1232 ndr->depth--;
1235 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAttributeId(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsAttributeId r)
1238 uint32_t _flags_save_ENUM = ndr->flags;
1239 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1240 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
1241 ndr->flags = _flags_save_ENUM;
1243 return NDR_ERR_SUCCESS;
1246 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAttributeId(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsAttributeId *r)
1248 uint32_t v;
1250 uint32_t _flags_save_ENUM = ndr->flags;
1251 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1252 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
1253 *r = v;
1254 ndr->flags = _flags_save_ENUM;
1256 return NDR_ERR_SUCCESS;
1259 _PUBLIC_ void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char *name, enum drsuapi_DsAttributeId r)
1261 const char *val = NULL;
1264 uint32_t _flags_save_ENUM = ndr->flags;
1265 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1266 switch (r) {
1267 case DRSUAPI_ATTRIBUTE_objectClass: val = "DRSUAPI_ATTRIBUTE_objectClass"; break;
1268 case DRSUAPI_ATTRIBUTE_description: val = "DRSUAPI_ATTRIBUTE_description"; break;
1269 case DRSUAPI_ATTRIBUTE_member: val = "DRSUAPI_ATTRIBUTE_member"; break;
1270 case DRSUAPI_ATTRIBUTE_instanceType: val = "DRSUAPI_ATTRIBUTE_instanceType"; break;
1271 case DRSUAPI_ATTRIBUTE_whenCreated: val = "DRSUAPI_ATTRIBUTE_whenCreated"; break;
1272 case DRSUAPI_ATTRIBUTE_possSuperiors: val = "DRSUAPI_ATTRIBUTE_possSuperiors"; break;
1273 case DRSUAPI_ATTRIBUTE_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_hasMasterNCs"; break;
1274 case DRSUAPI_ATTRIBUTE_subClassOf: val = "DRSUAPI_ATTRIBUTE_subClassOf"; break;
1275 case DRSUAPI_ATTRIBUTE_governsID: val = "DRSUAPI_ATTRIBUTE_governsID"; break;
1276 case DRSUAPI_ATTRIBUTE_mustContain: val = "DRSUAPI_ATTRIBUTE_mustContain"; break;
1277 case DRSUAPI_ATTRIBUTE_mayContain: val = "DRSUAPI_ATTRIBUTE_mayContain"; break;
1278 case DRSUAPI_ATTRIBUTE_attributeID: val = "DRSUAPI_ATTRIBUTE_attributeID"; break;
1279 case DRSUAPI_ATTRIBUTE_attributeSyntax: val = "DRSUAPI_ATTRIBUTE_attributeSyntax"; break;
1280 case DRSUAPI_ATTRIBUTE_isSingleValued: val = "DRSUAPI_ATTRIBUTE_isSingleValued"; break;
1281 case DRSUAPI_ATTRIBUTE_rangeLower: val = "DRSUAPI_ATTRIBUTE_rangeLower"; break;
1282 case DRSUAPI_ATTRIBUTE_rangeUpper: val = "DRSUAPI_ATTRIBUTE_rangeUpper"; break;
1283 case DRSUAPI_ATTRIBUTE_dMDLocation: val = "DRSUAPI_ATTRIBUTE_dMDLocation"; break;
1284 case DRSUAPI_ATTRIBUTE_objectVersion: val = "DRSUAPI_ATTRIBUTE_objectVersion"; break;
1285 case DRSUAPI_ATTRIBUTE_invocationId: val = "DRSUAPI_ATTRIBUTE_invocationId"; break;
1286 case DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly: val = "DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly"; break;
1287 case DRSUAPI_ATTRIBUTE_adminDisplayName: val = "DRSUAPI_ATTRIBUTE_adminDisplayName"; break;
1288 case DRSUAPI_ATTRIBUTE_adminDescription: val = "DRSUAPI_ATTRIBUTE_adminDescription"; break;
1289 case DRSUAPI_ATTRIBUTE_oMSyntax: val = "DRSUAPI_ATTRIBUTE_oMSyntax"; break;
1290 case DRSUAPI_ATTRIBUTE_ntSecurityDescriptor: val = "DRSUAPI_ATTRIBUTE_ntSecurityDescriptor"; break;
1291 case DRSUAPI_ATTRIBUTE_searchFlags: val = "DRSUAPI_ATTRIBUTE_searchFlags"; break;
1292 case DRSUAPI_ATTRIBUTE_auxiliaryClass: val = "DRSUAPI_ATTRIBUTE_auxiliaryClass"; break;
1293 case DRSUAPI_ATTRIBUTE_lDAPDisplayName: val = "DRSUAPI_ATTRIBUTE_lDAPDisplayName"; break;
1294 case DRSUAPI_ATTRIBUTE_name: val = "DRSUAPI_ATTRIBUTE_name"; break;
1295 case DRSUAPI_ATTRIBUTE_userAccountControl: val = "DRSUAPI_ATTRIBUTE_userAccountControl"; break;
1296 case DRSUAPI_ATTRIBUTE_currentValue: val = "DRSUAPI_ATTRIBUTE_currentValue"; break;
1297 case DRSUAPI_ATTRIBUTE_homeDirectory: val = "DRSUAPI_ATTRIBUTE_homeDirectory"; break;
1298 case DRSUAPI_ATTRIBUTE_homeDrive: val = "DRSUAPI_ATTRIBUTE_homeDrive"; break;
1299 case DRSUAPI_ATTRIBUTE_scriptPath: val = "DRSUAPI_ATTRIBUTE_scriptPath"; break;
1300 case DRSUAPI_ATTRIBUTE_profilePath: val = "DRSUAPI_ATTRIBUTE_profilePath"; break;
1301 case DRSUAPI_ATTRIBUTE_objectSid: val = "DRSUAPI_ATTRIBUTE_objectSid"; break;
1302 case DRSUAPI_ATTRIBUTE_schemaIDGUID: val = "DRSUAPI_ATTRIBUTE_schemaIDGUID"; break;
1303 case DRSUAPI_ATTRIBUTE_dBCSPwd: val = "DRSUAPI_ATTRIBUTE_dBCSPwd"; break;
1304 case DRSUAPI_ATTRIBUTE_logonHours: val = "DRSUAPI_ATTRIBUTE_logonHours"; break;
1305 case DRSUAPI_ATTRIBUTE_userWorkstations: val = "DRSUAPI_ATTRIBUTE_userWorkstations"; break;
1306 case DRSUAPI_ATTRIBUTE_unicodePwd: val = "DRSUAPI_ATTRIBUTE_unicodePwd"; break;
1307 case DRSUAPI_ATTRIBUTE_ntPwdHistory: val = "DRSUAPI_ATTRIBUTE_ntPwdHistory"; break;
1308 case DRSUAPI_ATTRIBUTE_priorValue: val = "DRSUAPI_ATTRIBUTE_priorValue"; break;
1309 case DRSUAPI_ATTRIBUTE_supplementalCredentials: val = "DRSUAPI_ATTRIBUTE_supplementalCredentials"; break;
1310 case DRSUAPI_ATTRIBUTE_trustAuthIncoming: val = "DRSUAPI_ATTRIBUTE_trustAuthIncoming"; break;
1311 case DRSUAPI_ATTRIBUTE_trustAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_trustAuthOutgoing"; break;
1312 case DRSUAPI_ATTRIBUTE_lmPwdHistory: val = "DRSUAPI_ATTRIBUTE_lmPwdHistory"; break;
1313 case DRSUAPI_ATTRIBUTE_systemPossSuperiors: val = "DRSUAPI_ATTRIBUTE_systemPossSuperiors"; break;
1314 case DRSUAPI_ATTRIBUTE_systemMayContain: val = "DRSUAPI_ATTRIBUTE_systemMayContain"; break;
1315 case DRSUAPI_ATTRIBUTE_systemMustContain: val = "DRSUAPI_ATTRIBUTE_systemMustContain"; break;
1316 case DRSUAPI_ATTRIBUTE_sAMAccountName: val = "DRSUAPI_ATTRIBUTE_sAMAccountName"; break;
1317 case DRSUAPI_ATTRIBUTE_sAMAccountType: val = "DRSUAPI_ATTRIBUTE_sAMAccountType"; break;
1318 case DRSUAPI_ATTRIBUTE_fSMORoleOwner: val = "DRSUAPI_ATTRIBUTE_fSMORoleOwner"; break;
1319 case DRSUAPI_ATTRIBUTE_systemFlags: val = "DRSUAPI_ATTRIBUTE_systemFlags"; break;
1320 case DRSUAPI_ATTRIBUTE_serverReference: val = "DRSUAPI_ATTRIBUTE_serverReference"; break;
1321 case DRSUAPI_ATTRIBUTE_serverReferenceBL: val = "DRSUAPI_ATTRIBUTE_serverReferenceBL"; break;
1322 case DRSUAPI_ATTRIBUTE_initialAuthIncoming: val = "DRSUAPI_ATTRIBUTE_initialAuthIncoming"; break;
1323 case DRSUAPI_ATTRIBUTE_initialAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_initialAuthOutgoing"; break;
1324 case DRSUAPI_ATTRIBUTE_wellKnownObjects: val = "DRSUAPI_ATTRIBUTE_wellKnownObjects"; break;
1325 case DRSUAPI_ATTRIBUTE_dNSHostName: val = "DRSUAPI_ATTRIBUTE_dNSHostName"; break;
1326 case DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet: val = "DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet"; break;
1327 case DRSUAPI_ATTRIBUTE_userPrincipalName: val = "DRSUAPI_ATTRIBUTE_userPrincipalName"; break;
1328 case DRSUAPI_ATTRIBUTE_groupType: val = "DRSUAPI_ATTRIBUTE_groupType"; break;
1329 case DRSUAPI_ATTRIBUTE_servicePrincipalName: val = "DRSUAPI_ATTRIBUTE_servicePrincipalName"; break;
1330 case DRSUAPI_ATTRIBUTE_objectCategory: val = "DRSUAPI_ATTRIBUTE_objectCategory"; break;
1331 case DRSUAPI_ATTRIBUTE_gPLink: val = "DRSUAPI_ATTRIBUTE_gPLink"; break;
1332 case DRSUAPI_ATTRIBUTE_msDS_Behavior_Version: val = "DRSUAPI_ATTRIBUTE_msDS_Behavior_Version"; break;
1333 case DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber: val = "DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber"; break;
1334 case DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs: val = "DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs"; break;
1335 case DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs"; break;
1337 ndr_print_enum(ndr, name, "ENUM", val, r);
1338 ndr->flags = _flags_save_ENUM;
1342 static enum ndr_err_code ndr_push_drsuapi_DsPartialAttributeSet(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsPartialAttributeSet *r)
1344 uint32_t cntr_attids_0;
1345 if (ndr_flags & NDR_SCALARS) {
1346 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_attids));
1347 NDR_CHECK(ndr_push_align(ndr, 4));
1348 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
1349 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1350 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attids));
1351 for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) {
1352 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attids[cntr_attids_0]));
1355 if (ndr_flags & NDR_BUFFERS) {
1357 return NDR_ERR_SUCCESS;
1360 static enum ndr_err_code ndr_pull_drsuapi_DsPartialAttributeSet(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsPartialAttributeSet *r)
1362 uint32_t cntr_attids_0;
1363 TALLOC_CTX *_mem_save_attids_0;
1364 if (ndr_flags & NDR_SCALARS) {
1365 NDR_CHECK(ndr_pull_array_size(ndr, &r->attids));
1366 NDR_CHECK(ndr_pull_align(ndr, 4));
1367 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1368 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
1369 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attids));
1370 if (r->num_attids < 1 || r->num_attids > 0x100000) {
1371 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1373 NDR_PULL_ALLOC_N(ndr, r->attids, ndr_get_array_size(ndr, &r->attids));
1374 _mem_save_attids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1375 NDR_PULL_SET_MEM_CTX(ndr, r->attids, 0);
1376 for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) {
1377 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attids[cntr_attids_0]));
1379 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attids_0, 0);
1380 if (r->attids) {
1381 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attids, r->num_attids));
1384 if (ndr_flags & NDR_BUFFERS) {
1386 return NDR_ERR_SUCCESS;
1389 _PUBLIC_ void ndr_print_drsuapi_DsPartialAttributeSet(struct ndr_print *ndr, const char *name, const struct drsuapi_DsPartialAttributeSet *r)
1391 uint32_t cntr_attids_0;
1392 ndr_print_struct(ndr, name, "drsuapi_DsPartialAttributeSet");
1393 ndr->depth++;
1394 ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
1395 ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
1396 ndr_print_uint32(ndr, "num_attids", r->num_attids);
1397 ndr->print(ndr, "%s: ARRAY(%d)", "attids", (int)r->num_attids);
1398 ndr->depth++;
1399 for (cntr_attids_0=0;cntr_attids_0<r->num_attids;cntr_attids_0++) {
1400 char *idx_0=NULL;
1401 if (asprintf(&idx_0, "[%d]", cntr_attids_0) != -1) {
1402 ndr_print_drsuapi_DsAttributeId(ndr, "attids", r->attids[cntr_attids_0]);
1403 free(idx_0);
1406 ndr->depth--;
1407 ndr->depth--;
1410 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest8(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest8 *r)
1412 if (ndr_flags & NDR_SCALARS) {
1413 NDR_CHECK(ndr_push_align(ndr, 8));
1414 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1415 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1416 if (r->naming_context == NULL) {
1417 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1419 NDR_CHECK(ndr_push_ref_ptr(ndr));
1420 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1421 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1422 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1423 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1424 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1425 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1426 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1427 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set));
1428 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set_ex));
1429 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1431 if (ndr_flags & NDR_BUFFERS) {
1432 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1433 if (r->uptodateness_vector) {
1434 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1436 if (r->partial_attribute_set) {
1437 NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1439 if (r->partial_attribute_set_ex) {
1440 NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1442 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1444 return NDR_ERR_SUCCESS;
1447 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest8(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest8 *r)
1449 uint32_t _ptr_naming_context;
1450 TALLOC_CTX *_mem_save_naming_context_0;
1451 uint32_t _ptr_uptodateness_vector;
1452 TALLOC_CTX *_mem_save_uptodateness_vector_0;
1453 uint32_t _ptr_partial_attribute_set;
1454 TALLOC_CTX *_mem_save_partial_attribute_set_0;
1455 uint32_t _ptr_partial_attribute_set_ex;
1456 TALLOC_CTX *_mem_save_partial_attribute_set_ex_0;
1457 if (ndr_flags & NDR_SCALARS) {
1458 NDR_CHECK(ndr_pull_align(ndr, 8));
1459 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1460 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1461 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1462 if (_ptr_naming_context) {
1463 NDR_PULL_ALLOC(ndr, r->naming_context);
1464 } else {
1465 r->naming_context = NULL;
1467 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1468 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1469 if (_ptr_uptodateness_vector) {
1470 NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1471 } else {
1472 r->uptodateness_vector = NULL;
1474 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1475 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1476 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1477 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1478 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1479 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set));
1480 if (_ptr_partial_attribute_set) {
1481 NDR_PULL_ALLOC(ndr, r->partial_attribute_set);
1482 } else {
1483 r->partial_attribute_set = NULL;
1485 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set_ex));
1486 if (_ptr_partial_attribute_set_ex) {
1487 NDR_PULL_ALLOC(ndr, r->partial_attribute_set_ex);
1488 } else {
1489 r->partial_attribute_set_ex = NULL;
1491 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1493 if (ndr_flags & NDR_BUFFERS) {
1494 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1495 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1496 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1497 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1498 if (r->uptodateness_vector) {
1499 _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1500 NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1501 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1502 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1504 if (r->partial_attribute_set) {
1505 _mem_save_partial_attribute_set_0 = NDR_PULL_GET_MEM_CTX(ndr);
1506 NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set, 0);
1507 NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1508 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_0, 0);
1510 if (r->partial_attribute_set_ex) {
1511 _mem_save_partial_attribute_set_ex_0 = NDR_PULL_GET_MEM_CTX(ndr);
1512 NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set_ex, 0);
1513 NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1514 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_ex_0, 0);
1516 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1518 return NDR_ERR_SUCCESS;
1521 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest8(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest8 *r)
1523 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest8");
1524 ndr->depth++;
1525 ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1526 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1527 ndr_print_ptr(ndr, "naming_context", r->naming_context);
1528 ndr->depth++;
1529 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1530 ndr->depth--;
1531 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1532 ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1533 ndr->depth++;
1534 if (r->uptodateness_vector) {
1535 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1537 ndr->depth--;
1538 ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1539 ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1540 ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1541 ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1542 ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1543 ndr_print_ptr(ndr, "partial_attribute_set", r->partial_attribute_set);
1544 ndr->depth++;
1545 if (r->partial_attribute_set) {
1546 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set", r->partial_attribute_set);
1548 ndr->depth--;
1549 ndr_print_ptr(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1550 ndr->depth++;
1551 if (r->partial_attribute_set_ex) {
1552 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1554 ndr->depth--;
1555 ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
1556 ndr->depth--;
1559 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest10(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest10 *r)
1561 if (ndr_flags & NDR_SCALARS) {
1562 NDR_CHECK(ndr_push_align(ndr, 8));
1563 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1564 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1565 if (r->naming_context == NULL) {
1566 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1568 NDR_CHECK(ndr_push_ref_ptr(ndr));
1569 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1570 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1571 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1572 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1573 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1574 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1575 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1576 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set));
1577 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set_ex));
1578 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1579 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_flags));
1581 if (ndr_flags & NDR_BUFFERS) {
1582 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1583 if (r->uptodateness_vector) {
1584 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1586 if (r->partial_attribute_set) {
1587 NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1589 if (r->partial_attribute_set_ex) {
1590 NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1592 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1594 return NDR_ERR_SUCCESS;
1597 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest10(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest10 *r)
1599 uint32_t _ptr_naming_context;
1600 TALLOC_CTX *_mem_save_naming_context_0;
1601 uint32_t _ptr_uptodateness_vector;
1602 TALLOC_CTX *_mem_save_uptodateness_vector_0;
1603 uint32_t _ptr_partial_attribute_set;
1604 TALLOC_CTX *_mem_save_partial_attribute_set_0;
1605 uint32_t _ptr_partial_attribute_set_ex;
1606 TALLOC_CTX *_mem_save_partial_attribute_set_ex_0;
1607 if (ndr_flags & NDR_SCALARS) {
1608 NDR_CHECK(ndr_pull_align(ndr, 8));
1609 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1610 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1611 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1612 if (_ptr_naming_context) {
1613 NDR_PULL_ALLOC(ndr, r->naming_context);
1614 } else {
1615 r->naming_context = NULL;
1617 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1618 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1619 if (_ptr_uptodateness_vector) {
1620 NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1621 } else {
1622 r->uptodateness_vector = NULL;
1624 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1625 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1626 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1627 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1628 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1629 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set));
1630 if (_ptr_partial_attribute_set) {
1631 NDR_PULL_ALLOC(ndr, r->partial_attribute_set);
1632 } else {
1633 r->partial_attribute_set = NULL;
1635 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set_ex));
1636 if (_ptr_partial_attribute_set_ex) {
1637 NDR_PULL_ALLOC(ndr, r->partial_attribute_set_ex);
1638 } else {
1639 r->partial_attribute_set_ex = NULL;
1641 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1642 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_flags));
1644 if (ndr_flags & NDR_BUFFERS) {
1645 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1646 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1647 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1648 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1649 if (r->uptodateness_vector) {
1650 _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1651 NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1652 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1653 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1655 if (r->partial_attribute_set) {
1656 _mem_save_partial_attribute_set_0 = NDR_PULL_GET_MEM_CTX(ndr);
1657 NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set, 0);
1658 NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1659 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_0, 0);
1661 if (r->partial_attribute_set_ex) {
1662 _mem_save_partial_attribute_set_ex_0 = NDR_PULL_GET_MEM_CTX(ndr);
1663 NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set_ex, 0);
1664 NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1665 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_ex_0, 0);
1667 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1669 return NDR_ERR_SUCCESS;
1672 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest10(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest10 *r)
1674 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest10");
1675 ndr->depth++;
1676 ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1677 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1678 ndr_print_ptr(ndr, "naming_context", r->naming_context);
1679 ndr->depth++;
1680 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1681 ndr->depth--;
1682 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1683 ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1684 ndr->depth++;
1685 if (r->uptodateness_vector) {
1686 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1688 ndr->depth--;
1689 ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1690 ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1691 ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1692 ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1693 ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1694 ndr_print_ptr(ndr, "partial_attribute_set", r->partial_attribute_set);
1695 ndr->depth++;
1696 if (r->partial_attribute_set) {
1697 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set", r->partial_attribute_set);
1699 ndr->depth--;
1700 ndr_print_ptr(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1701 ndr->depth++;
1702 if (r->partial_attribute_set_ex) {
1703 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1705 ndr->depth--;
1706 ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
1707 ndr_print_uint32(ndr, "more_flags", r->more_flags);
1708 ndr->depth--;
1711 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesRequest *r)
1713 if (ndr_flags & NDR_SCALARS) {
1714 int level = ndr_push_get_switch_value(ndr, r);
1715 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
1716 NDR_CHECK(ndr_push_union_align(ndr, 8));
1717 switch (level) {
1718 case 5: {
1719 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5));
1720 break; }
1722 case 8: {
1723 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1724 break; }
1726 case 10: {
1727 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest10(ndr, NDR_SCALARS, &r->req10));
1728 break; }
1730 default:
1731 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1734 if (ndr_flags & NDR_BUFFERS) {
1735 int level = ndr_push_get_switch_value(ndr, r);
1736 switch (level) {
1737 case 5:
1738 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5));
1739 break;
1741 case 8:
1742 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1743 break;
1745 case 10:
1746 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest10(ndr, NDR_BUFFERS, &r->req10));
1747 break;
1749 default:
1750 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1753 return NDR_ERR_SUCCESS;
1756 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesRequest *r)
1758 int level;
1759 int32_t _level;
1760 level = ndr_pull_get_switch_value(ndr, r);
1761 if (ndr_flags & NDR_SCALARS) {
1762 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
1763 if (_level != level) {
1764 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
1766 NDR_CHECK(ndr_pull_union_align(ndr, 8));
1767 switch (level) {
1768 case 5: {
1769 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5));
1770 break; }
1772 case 8: {
1773 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1774 break; }
1776 case 10: {
1777 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest10(ndr, NDR_SCALARS, &r->req10));
1778 break; }
1780 default:
1781 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1784 if (ndr_flags & NDR_BUFFERS) {
1785 switch (level) {
1786 case 5:
1787 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5));
1788 break;
1790 case 8:
1791 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1792 break;
1794 case 10:
1795 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest10(ndr, NDR_BUFFERS, &r->req10));
1796 break;
1798 default:
1799 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1802 return NDR_ERR_SUCCESS;
1805 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesRequest *r)
1807 int level;
1808 level = ndr_print_get_switch_value(ndr, r);
1809 ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesRequest");
1810 switch (level) {
1811 case 5:
1812 ndr_print_drsuapi_DsGetNCChangesRequest5(ndr, "req5", &r->req5);
1813 break;
1815 case 8:
1816 ndr_print_drsuapi_DsGetNCChangesRequest8(ndr, "req8", &r->req8);
1817 break;
1819 case 10:
1820 ndr_print_drsuapi_DsGetNCChangesRequest10(ndr, "req10", &r->req10);
1821 break;
1823 default:
1824 ndr_print_bad_level(ndr, name, level);
1828 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2 *r)
1830 if (ndr_flags & NDR_SCALARS) {
1831 NDR_CHECK(ndr_push_align(ndr, 8));
1832 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1833 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
1834 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success));
1836 if (ndr_flags & NDR_BUFFERS) {
1838 return NDR_ERR_SUCCESS;
1841 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2 *r)
1843 if (ndr_flags & NDR_SCALARS) {
1844 NDR_CHECK(ndr_pull_align(ndr, 8));
1845 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1846 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
1847 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success));
1849 if (ndr_flags & NDR_BUFFERS) {
1851 return NDR_ERR_SUCCESS;
1854 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2 *r)
1856 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2");
1857 ndr->depth++;
1858 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1859 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
1860 ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success);
1861 ndr->depth--;
1864 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2CtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2CtrEx *r)
1866 uint32_t cntr_cursors_0;
1867 if (ndr_flags & NDR_SCALARS) {
1868 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
1869 NDR_CHECK(ndr_push_align(ndr, 8));
1870 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2));
1871 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1872 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1873 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1874 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
1875 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
1878 if (ndr_flags & NDR_BUFFERS) {
1880 return NDR_ERR_SUCCESS;
1883 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2CtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2CtrEx *r)
1885 uint32_t cntr_cursors_0;
1886 TALLOC_CTX *_mem_save_cursors_0;
1887 if (ndr_flags & NDR_SCALARS) {
1888 NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors));
1889 NDR_CHECK(ndr_pull_align(ndr, 8));
1890 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1891 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
1892 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1893 if (r->count > 0x100000) {
1894 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1896 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
1897 NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors));
1898 _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr);
1899 NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0);
1900 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
1901 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
1903 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0);
1904 if (r->cursors) {
1905 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count));
1908 if (ndr_flags & NDR_BUFFERS) {
1910 return NDR_ERR_SUCCESS;
1913 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2CtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2CtrEx *r)
1915 uint32_t cntr_cursors_0;
1916 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2CtrEx");
1917 ndr->depth++;
1918 ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->version);
1919 ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
1920 ndr_print_uint32(ndr, "count", r->count);
1921 ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2);
1922 ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count);
1923 ndr->depth++;
1924 for (cntr_cursors_0=0;cntr_cursors_0<r->count;cntr_cursors_0++) {
1925 char *idx_0=NULL;
1926 if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) {
1927 ndr_print_drsuapi_DsReplicaCursor2(ndr, "cursors", &r->cursors[cntr_cursors_0]);
1928 free(idx_0);
1931 ndr->depth--;
1932 ndr->depth--;
1935 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValue(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValue *r)
1937 if (ndr_flags & NDR_SCALARS) {
1938 NDR_CHECK(ndr_push_align(ndr, 5));
1939 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->blob, 0)));
1940 NDR_CHECK(ndr_push_unique_ptr(ndr, r->blob));
1942 if (ndr_flags & NDR_BUFFERS) {
1943 if (r->blob) {
1944 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->blob));
1947 return NDR_ERR_SUCCESS;
1950 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValue(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValue *r)
1952 uint32_t _ptr_blob;
1953 TALLOC_CTX *_mem_save_blob_0;
1954 if (ndr_flags & NDR_SCALARS) {
1955 NDR_CHECK(ndr_pull_align(ndr, 5));
1956 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
1957 if (r->__ndr_size > 10485760) {
1958 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1960 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_blob));
1961 if (_ptr_blob) {
1962 NDR_PULL_ALLOC(ndr, r->blob);
1963 } else {
1964 r->blob = NULL;
1967 if (ndr_flags & NDR_BUFFERS) {
1968 if (r->blob) {
1969 _mem_save_blob_0 = NDR_PULL_GET_MEM_CTX(ndr);
1970 NDR_PULL_SET_MEM_CTX(ndr, r->blob, 0);
1971 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->blob));
1972 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_blob_0, 0);
1975 return NDR_ERR_SUCCESS;
1978 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValue(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r)
1980 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue");
1981 ndr->depth++;
1982 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->blob, 0):r->__ndr_size);
1983 ndr_print_ptr(ndr, "blob", r->blob);
1984 ndr->depth++;
1985 if (r->blob) {
1986 ndr_print_DATA_BLOB(ndr, "blob", *r->blob);
1988 ndr->depth--;
1989 ndr->depth--;
1992 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValueCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValueCtr *r)
1994 uint32_t cntr_values_1;
1995 if (ndr_flags & NDR_SCALARS) {
1996 NDR_CHECK(ndr_push_align(ndr, 5));
1997 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_values));
1998 NDR_CHECK(ndr_push_unique_ptr(ndr, r->values));
2000 if (ndr_flags & NDR_BUFFERS) {
2001 if (r->values) {
2002 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_values));
2003 for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2004 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1]));
2006 for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2007 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1]));
2011 return NDR_ERR_SUCCESS;
2014 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValueCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValueCtr *r)
2016 uint32_t _ptr_values;
2017 uint32_t cntr_values_1;
2018 TALLOC_CTX *_mem_save_values_0;
2019 TALLOC_CTX *_mem_save_values_1;
2020 if (ndr_flags & NDR_SCALARS) {
2021 NDR_CHECK(ndr_pull_align(ndr, 5));
2022 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_values));
2023 if (r->num_values > 10485760) {
2024 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2026 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_values));
2027 if (_ptr_values) {
2028 NDR_PULL_ALLOC(ndr, r->values);
2029 } else {
2030 r->values = NULL;
2033 if (ndr_flags & NDR_BUFFERS) {
2034 if (r->values) {
2035 _mem_save_values_0 = NDR_PULL_GET_MEM_CTX(ndr);
2036 NDR_PULL_SET_MEM_CTX(ndr, r->values, 0);
2037 NDR_CHECK(ndr_pull_array_size(ndr, &r->values));
2038 NDR_PULL_ALLOC_N(ndr, r->values, ndr_get_array_size(ndr, &r->values));
2039 _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr);
2040 NDR_PULL_SET_MEM_CTX(ndr, r->values, 0);
2041 for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2042 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1]));
2044 for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2045 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1]));
2047 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0);
2048 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_0, 0);
2050 if (r->values) {
2051 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->values, r->num_values));
2054 return NDR_ERR_SUCCESS;
2057 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValueCtr *r)
2059 uint32_t cntr_values_1;
2060 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValueCtr");
2061 ndr->depth++;
2062 ndr_print_uint32(ndr, "num_values", r->num_values);
2063 ndr_print_ptr(ndr, "values", r->values);
2064 ndr->depth++;
2065 if (r->values) {
2066 ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->num_values);
2067 ndr->depth++;
2068 for (cntr_values_1=0;cntr_values_1<r->num_values;cntr_values_1++) {
2069 char *idx_1=NULL;
2070 if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) {
2071 ndr_print_drsuapi_DsAttributeValue(ndr, "values", &r->values[cntr_values_1]);
2072 free(idx_1);
2075 ndr->depth--;
2077 ndr->depth--;
2078 ndr->depth--;
2081 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
2083 if (ndr_flags & NDR_SCALARS) {
2084 NDR_CHECK(ndr_push_align(ndr, 4));
2085 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags)));
2086 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
2087 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
2088 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2089 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
2090 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
2092 if (ndr_flags & NDR_BUFFERS) {
2093 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2095 return NDR_ERR_SUCCESS;
2098 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3 *r)
2100 if (ndr_flags & NDR_SCALARS) {
2101 NDR_CHECK(ndr_pull_align(ndr, 4));
2102 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2103 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
2104 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
2105 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2106 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
2107 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16));
2109 if (ndr_flags & NDR_BUFFERS) {
2110 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2112 return NDR_ERR_SUCCESS;
2115 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
2117 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3");
2118 ndr->depth++;
2119 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags):r->__ndr_size);
2120 ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid);
2121 ndr_print_GUID(ndr, "guid", &r->guid);
2122 ndr_print_dom_sid28(ndr, "sid", &r->sid);
2123 ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
2124 ndr_print_string(ndr, "dn", r->dn);
2125 ndr->depth--;
2128 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplicaObjectIdentifier3 *r, struct smb_iconv_convenience *ic, int flags)
2130 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3, ic);
2133 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
2135 if (ndr_flags & NDR_SCALARS) {
2136 NDR_CHECK(ndr_push_align(ndr, 4));
2137 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags)));
2138 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
2139 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
2140 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2141 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
2142 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
2143 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->binary.length + 4));
2145 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2146 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
2147 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
2148 ndr->flags = _flags_save_DATA_BLOB;
2151 if (ndr_flags & NDR_BUFFERS) {
2152 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2154 return NDR_ERR_SUCCESS;
2157 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
2159 if (ndr_flags & NDR_SCALARS) {
2160 NDR_CHECK(ndr_pull_align(ndr, 4));
2161 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2162 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
2163 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
2164 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2165 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
2166 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16));
2167 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary));
2169 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2170 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
2171 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->binary));
2172 ndr->flags = _flags_save_DATA_BLOB;
2175 if (ndr_flags & NDR_BUFFERS) {
2176 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2178 return NDR_ERR_SUCCESS;
2181 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
2183 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3Binary");
2184 ndr->depth++;
2185 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags):r->__ndr_size);
2186 ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid);
2187 ndr_print_GUID(ndr, "guid", &r->guid);
2188 ndr_print_dom_sid28(ndr, "sid", &r->sid);
2189 ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
2190 ndr_print_string(ndr, "dn", r->dn);
2191 ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->binary.length + 4:r->__ndr_size_binary);
2192 ndr_print_DATA_BLOB(ndr, "binary", r->binary);
2193 ndr->depth--;
2196 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags)
2198 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary, ic);
2201 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r)
2203 if (ndr_flags & NDR_SCALARS) {
2204 NDR_CHECK(ndr_push_align(ndr, 5));
2205 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
2206 NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr));
2208 if (ndr_flags & NDR_BUFFERS) {
2209 NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2211 return NDR_ERR_SUCCESS;
2214 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r)
2216 if (ndr_flags & NDR_SCALARS) {
2217 NDR_CHECK(ndr_pull_align(ndr, 5));
2218 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
2219 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr));
2221 if (ndr_flags & NDR_BUFFERS) {
2222 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2224 return NDR_ERR_SUCCESS;
2227 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r)
2229 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttribute");
2230 ndr->depth++;
2231 ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
2232 ndr_print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr);
2233 ndr->depth--;
2236 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttributeCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttributeCtr *r)
2238 uint32_t cntr_attributes_1;
2239 if (ndr_flags & NDR_SCALARS) {
2240 NDR_CHECK(ndr_push_align(ndr, 5));
2241 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attributes));
2242 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attributes));
2244 if (ndr_flags & NDR_BUFFERS) {
2245 if (r->attributes) {
2246 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_attributes));
2247 for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2248 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1]));
2250 for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2251 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1]));
2255 return NDR_ERR_SUCCESS;
2258 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttributeCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttributeCtr *r)
2260 uint32_t _ptr_attributes;
2261 uint32_t cntr_attributes_1;
2262 TALLOC_CTX *_mem_save_attributes_0;
2263 TALLOC_CTX *_mem_save_attributes_1;
2264 if (ndr_flags & NDR_SCALARS) {
2265 NDR_CHECK(ndr_pull_align(ndr, 5));
2266 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attributes));
2267 if (r->num_attributes > 1048576) {
2268 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2270 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attributes));
2271 if (_ptr_attributes) {
2272 NDR_PULL_ALLOC(ndr, r->attributes);
2273 } else {
2274 r->attributes = NULL;
2277 if (ndr_flags & NDR_BUFFERS) {
2278 if (r->attributes) {
2279 _mem_save_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr);
2280 NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0);
2281 NDR_CHECK(ndr_pull_array_size(ndr, &r->attributes));
2282 NDR_PULL_ALLOC_N(ndr, r->attributes, ndr_get_array_size(ndr, &r->attributes));
2283 _mem_save_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr);
2284 NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0);
2285 for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2286 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1]));
2288 for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2289 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1]));
2291 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_1, 0);
2292 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_0, 0);
2294 if (r->attributes) {
2295 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attributes, r->num_attributes));
2298 return NDR_ERR_SUCCESS;
2301 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttributeCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttributeCtr *r)
2303 uint32_t cntr_attributes_1;
2304 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttributeCtr");
2305 ndr->depth++;
2306 ndr_print_uint32(ndr, "num_attributes", r->num_attributes);
2307 ndr_print_ptr(ndr, "attributes", r->attributes);
2308 ndr->depth++;
2309 if (r->attributes) {
2310 ndr->print(ndr, "%s: ARRAY(%d)", "attributes", (int)r->num_attributes);
2311 ndr->depth++;
2312 for (cntr_attributes_1=0;cntr_attributes_1<r->num_attributes;cntr_attributes_1++) {
2313 char *idx_1=NULL;
2314 if (asprintf(&idx_1, "[%d]", cntr_attributes_1) != -1) {
2315 ndr_print_drsuapi_DsReplicaAttribute(ndr, "attributes", &r->attributes[cntr_attributes_1]);
2316 free(idx_1);
2319 ndr->depth--;
2321 ndr->depth--;
2322 ndr->depth--;
2325 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2327 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2328 return NDR_ERR_SUCCESS;
2331 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2333 uint32_t v;
2334 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2335 *r = v;
2336 return NDR_ERR_SUCCESS;
2339 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2341 ndr_print_uint32(ndr, name, r);
2342 ndr->depth++;
2343 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER", DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER, r);
2344 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC", DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC, r);
2345 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY", DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY, r);
2346 ndr->depth--;
2349 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObject(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObject *r)
2351 if (ndr_flags & NDR_SCALARS) {
2352 NDR_CHECK(ndr_push_align(ndr, 5));
2353 NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier));
2354 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, r->flags));
2355 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr));
2357 if (ndr_flags & NDR_BUFFERS) {
2358 if (r->identifier) {
2359 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2361 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2363 return NDR_ERR_SUCCESS;
2366 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObject(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObject *r)
2368 uint32_t _ptr_identifier;
2369 TALLOC_CTX *_mem_save_identifier_0;
2370 if (ndr_flags & NDR_SCALARS) {
2371 NDR_CHECK(ndr_pull_align(ndr, 5));
2372 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier));
2373 if (_ptr_identifier) {
2374 NDR_PULL_ALLOC(ndr, r->identifier);
2375 } else {
2376 r->identifier = NULL;
2378 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, &r->flags));
2379 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr));
2381 if (ndr_flags & NDR_BUFFERS) {
2382 if (r->identifier) {
2383 _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr);
2384 NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0);
2385 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2386 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0);
2388 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2390 return NDR_ERR_SUCCESS;
2393 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObject(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObject *r)
2395 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObject");
2396 ndr->depth++;
2397 ndr_print_ptr(ndr, "identifier", r->identifier);
2398 ndr->depth++;
2399 if (r->identifier) {
2400 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier);
2402 ndr->depth--;
2403 ndr_print_drsuapi_DsReplicaObjectFlags(ndr, "flags", r->flags);
2404 ndr_print_drsuapi_DsReplicaAttributeCtr(ndr, "attribute_ctr", &r->attribute_ctr);
2405 ndr->depth--;
2408 static enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaData *r)
2410 if (ndr_flags & NDR_SCALARS) {
2411 NDR_CHECK(ndr_push_align(ndr, 8));
2412 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
2413 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_change_time));
2414 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
2415 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
2417 if (ndr_flags & NDR_BUFFERS) {
2419 return NDR_ERR_SUCCESS;
2422 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaData *r)
2424 if (ndr_flags & NDR_SCALARS) {
2425 NDR_CHECK(ndr_pull_align(ndr, 8));
2426 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2427 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_change_time));
2428 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
2429 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
2431 if (ndr_flags & NDR_BUFFERS) {
2433 return NDR_ERR_SUCCESS;
2436 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaData *r)
2438 ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaData");
2439 ndr->depth++;
2440 ndr_print_uint32(ndr, "version", r->version);
2441 ndr_print_NTTIME_1sec(ndr, "originating_change_time", r->originating_change_time);
2442 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
2443 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
2444 ndr->depth--;
2447 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaDataCtr *r)
2449 uint32_t cntr_meta_data_0;
2450 if (ndr_flags & NDR_SCALARS) {
2451 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
2452 NDR_CHECK(ndr_push_align(ndr, 8));
2453 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2454 for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) {
2455 NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0]));
2458 if (ndr_flags & NDR_BUFFERS) {
2460 return NDR_ERR_SUCCESS;
2463 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaDataCtr *r)
2465 uint32_t cntr_meta_data_0;
2466 TALLOC_CTX *_mem_save_meta_data_0;
2467 if (ndr_flags & NDR_SCALARS) {
2468 NDR_CHECK(ndr_pull_array_size(ndr, &r->meta_data));
2469 NDR_CHECK(ndr_pull_align(ndr, 8));
2470 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2471 if (r->count > 1048576) {
2472 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2474 NDR_PULL_ALLOC_N(ndr, r->meta_data, ndr_get_array_size(ndr, &r->meta_data));
2475 _mem_save_meta_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
2476 NDR_PULL_SET_MEM_CTX(ndr, r->meta_data, 0);
2477 for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) {
2478 NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0]));
2480 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_0, 0);
2481 if (r->meta_data) {
2482 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->meta_data, r->count));
2485 if (ndr_flags & NDR_BUFFERS) {
2487 return NDR_ERR_SUCCESS;
2490 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaDataCtr *r)
2492 uint32_t cntr_meta_data_0;
2493 ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaDataCtr");
2494 ndr->depth++;
2495 ndr_print_uint32(ndr, "count", r->count);
2496 ndr->print(ndr, "%s: ARRAY(%d)", "meta_data", (int)r->count);
2497 ndr->depth++;
2498 for (cntr_meta_data_0=0;cntr_meta_data_0<r->count;cntr_meta_data_0++) {
2499 char *idx_0=NULL;
2500 if (asprintf(&idx_0, "[%d]", cntr_meta_data_0) != -1) {
2501 ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data[cntr_meta_data_0]);
2502 free(idx_0);
2505 ndr->depth--;
2506 ndr->depth--;
2509 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItemEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItemEx *r)
2511 if (ndr_flags & NDR_SCALARS) {
2512 NDR_CHECK(ndr_push_align(ndr, 5));
2513 NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object));
2514 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
2515 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_nc_prefix));
2516 NDR_CHECK(ndr_push_unique_ptr(ndr, r->parent_object_guid));
2517 NDR_CHECK(ndr_push_unique_ptr(ndr, r->meta_data_ctr));
2519 if (ndr_flags & NDR_BUFFERS) {
2520 if (r->next_object) {
2521 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
2523 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
2524 if (r->parent_object_guid) {
2525 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->parent_object_guid));
2527 if (r->meta_data_ctr) {
2528 NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr));
2531 return NDR_ERR_SUCCESS;
2534 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItemEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItemEx *r)
2536 uint32_t _ptr_next_object;
2537 TALLOC_CTX *_mem_save_next_object_0;
2538 uint32_t _ptr_parent_object_guid;
2539 TALLOC_CTX *_mem_save_parent_object_guid_0;
2540 uint32_t _ptr_meta_data_ctr;
2541 TALLOC_CTX *_mem_save_meta_data_ctr_0;
2542 if (ndr_flags & NDR_SCALARS) {
2543 NDR_CHECK(ndr_pull_align(ndr, 5));
2544 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object));
2545 if (_ptr_next_object) {
2546 NDR_PULL_ALLOC(ndr, r->next_object);
2547 } else {
2548 r->next_object = NULL;
2550 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
2551 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_nc_prefix));
2552 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parent_object_guid));
2553 if (_ptr_parent_object_guid) {
2554 NDR_PULL_ALLOC(ndr, r->parent_object_guid);
2555 } else {
2556 r->parent_object_guid = NULL;
2558 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_meta_data_ctr));
2559 if (_ptr_meta_data_ctr) {
2560 NDR_PULL_ALLOC(ndr, r->meta_data_ctr);
2561 } else {
2562 r->meta_data_ctr = NULL;
2565 if (ndr_flags & NDR_BUFFERS) {
2566 if (r->next_object) {
2567 _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2568 NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0);
2569 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
2570 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0);
2572 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
2573 if (r->parent_object_guid) {
2574 _mem_save_parent_object_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
2575 NDR_PULL_SET_MEM_CTX(ndr, r->parent_object_guid, 0);
2576 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->parent_object_guid));
2577 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_object_guid_0, 0);
2579 if (r->meta_data_ctr) {
2580 _mem_save_meta_data_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
2581 NDR_PULL_SET_MEM_CTX(ndr, r->meta_data_ctr, 0);
2582 NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr));
2583 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_ctr_0, 0);
2586 return NDR_ERR_SUCCESS;
2589 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1 *r)
2591 if (ndr_flags & NDR_SCALARS) {
2592 NDR_CHECK(ndr_push_align(ndr, 8));
2593 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2594 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2595 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
2596 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2597 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2598 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
2599 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2600 NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret));
2601 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count));
2602 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->iconv_convenience, ndr->flags) + 55));
2603 NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object));
2604 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data));
2606 if (ndr_flags & NDR_BUFFERS) {
2607 if (r->naming_context) {
2608 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2610 if (r->uptodateness_vector) {
2611 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2613 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2614 if (r->first_object) {
2615 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2618 return NDR_ERR_SUCCESS;
2621 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1 *r)
2623 uint32_t _ptr_naming_context;
2624 TALLOC_CTX *_mem_save_naming_context_0;
2625 uint32_t _ptr_uptodateness_vector;
2626 TALLOC_CTX *_mem_save_uptodateness_vector_0;
2627 uint32_t _ptr_first_object;
2628 TALLOC_CTX *_mem_save_first_object_0;
2629 if (ndr_flags & NDR_SCALARS) {
2630 NDR_CHECK(ndr_pull_align(ndr, 8));
2631 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2632 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2633 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
2634 if (_ptr_naming_context) {
2635 NDR_PULL_ALLOC(ndr, r->naming_context);
2636 } else {
2637 r->naming_context = NULL;
2639 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2640 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2641 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
2642 if (_ptr_uptodateness_vector) {
2643 NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
2644 } else {
2645 r->uptodateness_vector = NULL;
2647 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2648 NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret));
2649 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count));
2650 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2651 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object));
2652 if (_ptr_first_object) {
2653 NDR_PULL_ALLOC(ndr, r->first_object);
2654 } else {
2655 r->first_object = NULL;
2657 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data));
2659 if (ndr_flags & NDR_BUFFERS) {
2660 if (r->naming_context) {
2661 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
2662 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
2663 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2664 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
2666 if (r->uptodateness_vector) {
2667 _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
2668 NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
2669 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2670 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
2672 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2673 if (r->first_object) {
2674 _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2675 NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0);
2676 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2677 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0);
2680 return NDR_ERR_SUCCESS;
2683 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1 *r)
2685 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1");
2686 ndr->depth++;
2687 ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
2688 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
2689 ndr_print_ptr(ndr, "naming_context", r->naming_context);
2690 ndr->depth++;
2691 if (r->naming_context) {
2692 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
2694 ndr->depth--;
2695 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark);
2696 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark);
2697 ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
2698 ndr->depth++;
2699 if (r->uptodateness_vector) {
2700 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
2702 ndr->depth--;
2703 ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
2704 ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret);
2705 ndr_print_uint32(ndr, "object_count", r->object_count);
2706 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->iconv_convenience, ndr->flags) + 55:r->__ndr_size);
2707 ndr_print_ptr(ndr, "first_object", r->first_object);
2708 ndr->depth++;
2709 if (r->first_object) {
2710 ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object);
2712 ndr->depth--;
2713 ndr_print_uint32(ndr, "more_data", r->more_data);
2714 ndr->depth--;
2717 _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr1(const struct drsuapi_DsGetNCChangesCtr1 *r, struct smb_iconv_convenience *ic, int flags)
2719 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr1, ic);
2722 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsLinkedAttributeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2724 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2725 return NDR_ERR_SUCCESS;
2728 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsLinkedAttributeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2730 uint32_t v;
2731 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2732 *r = v;
2733 return NDR_ERR_SUCCESS;
2736 _PUBLIC_ void ndr_print_drsuapi_DsLinkedAttributeFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2738 ndr_print_uint32(ndr, name, r);
2739 ndr->depth++;
2740 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE", DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE, r);
2741 ndr->depth--;
2744 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaLinkedAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaLinkedAttribute *r)
2746 if (ndr_flags & NDR_SCALARS) {
2747 NDR_CHECK(ndr_push_align(ndr, 8));
2748 NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier));
2749 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
2750 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value));
2751 NDR_CHECK(ndr_push_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, r->flags));
2752 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_add_time));
2753 NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data));
2755 if (ndr_flags & NDR_BUFFERS) {
2756 if (r->identifier) {
2757 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2759 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2761 return NDR_ERR_SUCCESS;
2764 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaLinkedAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaLinkedAttribute *r)
2766 uint32_t _ptr_identifier;
2767 TALLOC_CTX *_mem_save_identifier_0;
2768 if (ndr_flags & NDR_SCALARS) {
2769 NDR_CHECK(ndr_pull_align(ndr, 8));
2770 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier));
2771 if (_ptr_identifier) {
2772 NDR_PULL_ALLOC(ndr, r->identifier);
2773 } else {
2774 r->identifier = NULL;
2776 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
2777 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value));
2778 NDR_CHECK(ndr_pull_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, &r->flags));
2779 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_add_time));
2780 NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data));
2782 if (ndr_flags & NDR_BUFFERS) {
2783 if (r->identifier) {
2784 _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr);
2785 NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0);
2786 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2787 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0);
2789 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2791 return NDR_ERR_SUCCESS;
2794 _PUBLIC_ void ndr_print_drsuapi_DsReplicaLinkedAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaLinkedAttribute *r)
2796 ndr_print_struct(ndr, name, "drsuapi_DsReplicaLinkedAttribute");
2797 ndr->depth++;
2798 ndr_print_ptr(ndr, "identifier", r->identifier);
2799 ndr->depth++;
2800 if (r->identifier) {
2801 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier);
2803 ndr->depth--;
2804 ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
2805 ndr_print_drsuapi_DsAttributeValue(ndr, "value", &r->value);
2806 ndr_print_drsuapi_DsLinkedAttributeFlags(ndr, "flags", r->flags);
2807 ndr_print_NTTIME_1sec(ndr, "originating_add_time", r->originating_add_time);
2808 ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data);
2809 ndr->depth--;
2812 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6 *r)
2814 uint32_t cntr_linked_attributes_1;
2815 if (ndr_flags & NDR_SCALARS) {
2816 NDR_CHECK(ndr_push_align(ndr, 8));
2817 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2818 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2819 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
2820 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2821 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2822 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
2823 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2824 NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret));
2825 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count));
2826 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr6(r, ndr->iconv_convenience, ndr->flags) + 55));
2827 NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object));
2828 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data));
2829 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_object_count));
2830 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_linked_attributes_count));
2831 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linked_attributes_count));
2832 NDR_CHECK(ndr_push_unique_ptr(ndr, r->linked_attributes));
2833 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->drs_error));
2835 if (ndr_flags & NDR_BUFFERS) {
2836 if (r->naming_context) {
2837 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2839 if (r->uptodateness_vector) {
2840 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2842 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2843 if (r->first_object) {
2844 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2846 if (r->linked_attributes) {
2847 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->linked_attributes_count));
2848 for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2849 NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1]));
2851 for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2852 NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1]));
2856 return NDR_ERR_SUCCESS;
2859 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6 *r)
2861 uint32_t _ptr_naming_context;
2862 TALLOC_CTX *_mem_save_naming_context_0;
2863 uint32_t _ptr_uptodateness_vector;
2864 TALLOC_CTX *_mem_save_uptodateness_vector_0;
2865 uint32_t _ptr_first_object;
2866 TALLOC_CTX *_mem_save_first_object_0;
2867 uint32_t _ptr_linked_attributes;
2868 uint32_t cntr_linked_attributes_1;
2869 TALLOC_CTX *_mem_save_linked_attributes_0;
2870 TALLOC_CTX *_mem_save_linked_attributes_1;
2871 if (ndr_flags & NDR_SCALARS) {
2872 NDR_CHECK(ndr_pull_align(ndr, 8));
2873 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2874 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2875 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
2876 if (_ptr_naming_context) {
2877 NDR_PULL_ALLOC(ndr, r->naming_context);
2878 } else {
2879 r->naming_context = NULL;
2881 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2882 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2883 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
2884 if (_ptr_uptodateness_vector) {
2885 NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
2886 } else {
2887 r->uptodateness_vector = NULL;
2889 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2890 NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret));
2891 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count));
2892 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2893 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object));
2894 if (_ptr_first_object) {
2895 NDR_PULL_ALLOC(ndr, r->first_object);
2896 } else {
2897 r->first_object = NULL;
2899 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data));
2900 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_object_count));
2901 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_linked_attributes_count));
2902 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->linked_attributes_count));
2903 if (r->linked_attributes_count > 1048576) {
2904 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2906 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_linked_attributes));
2907 if (_ptr_linked_attributes) {
2908 NDR_PULL_ALLOC(ndr, r->linked_attributes);
2909 } else {
2910 r->linked_attributes = NULL;
2912 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->drs_error));
2914 if (ndr_flags & NDR_BUFFERS) {
2915 if (r->naming_context) {
2916 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
2917 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
2918 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2919 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
2921 if (r->uptodateness_vector) {
2922 _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
2923 NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
2924 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2925 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
2927 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2928 if (r->first_object) {
2929 _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2930 NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0);
2931 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2932 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0);
2934 if (r->linked_attributes) {
2935 _mem_save_linked_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr);
2936 NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0);
2937 NDR_CHECK(ndr_pull_array_size(ndr, &r->linked_attributes));
2938 NDR_PULL_ALLOC_N(ndr, r->linked_attributes, ndr_get_array_size(ndr, &r->linked_attributes));
2939 _mem_save_linked_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr);
2940 NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0);
2941 for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2942 NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1]));
2944 for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2945 NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1]));
2947 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_1, 0);
2948 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_0, 0);
2950 if (r->linked_attributes) {
2951 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->linked_attributes, r->linked_attributes_count));
2954 return NDR_ERR_SUCCESS;
2957 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6 *r)
2959 uint32_t cntr_linked_attributes_1;
2960 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6");
2961 ndr->depth++;
2962 ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
2963 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
2964 ndr_print_ptr(ndr, "naming_context", r->naming_context);
2965 ndr->depth++;
2966 if (r->naming_context) {
2967 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
2969 ndr->depth--;
2970 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark);
2971 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark);
2972 ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
2973 ndr->depth++;
2974 if (r->uptodateness_vector) {
2975 ndr_print_drsuapi_DsReplicaCursor2CtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
2977 ndr->depth--;
2978 ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
2979 ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret);
2980 ndr_print_uint32(ndr, "object_count", r->object_count);
2981 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsGetNCChangesCtr6(r, ndr->iconv_convenience, ndr->flags) + 55:r->__ndr_size);
2982 ndr_print_ptr(ndr, "first_object", r->first_object);
2983 ndr->depth++;
2984 if (r->first_object) {
2985 ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object);
2987 ndr->depth--;
2988 ndr_print_uint32(ndr, "more_data", r->more_data);
2989 ndr_print_uint32(ndr, "nc_object_count", r->nc_object_count);
2990 ndr_print_uint32(ndr, "nc_linked_attributes_count", r->nc_linked_attributes_count);
2991 ndr_print_uint32(ndr, "linked_attributes_count", r->linked_attributes_count);
2992 ndr_print_ptr(ndr, "linked_attributes", r->linked_attributes);
2993 ndr->depth++;
2994 if (r->linked_attributes) {
2995 ndr->print(ndr, "%s: ARRAY(%d)", "linked_attributes", (int)r->linked_attributes_count);
2996 ndr->depth++;
2997 for (cntr_linked_attributes_1=0;cntr_linked_attributes_1<r->linked_attributes_count;cntr_linked_attributes_1++) {
2998 char *idx_1=NULL;
2999 if (asprintf(&idx_1, "[%d]", cntr_linked_attributes_1) != -1) {
3000 ndr_print_drsuapi_DsReplicaLinkedAttribute(ndr, "linked_attributes", &r->linked_attributes[cntr_linked_attributes_1]);
3001 free(idx_1);
3004 ndr->depth--;
3006 ndr->depth--;
3007 ndr_print_WERROR(ndr, "drs_error", r->drs_error);
3008 ndr->depth--;
3011 _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNCChangesCtr6 *r, struct smb_iconv_convenience *ic, int flags)
3013 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr6, ic);
3016 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r)
3018 if (ndr_flags & NDR_SCALARS) {
3019 NDR_CHECK(ndr_push_align(ndr, 1));
3021 struct ndr_push *_ndr_ctr1;
3022 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1));
3023 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1));
3024 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1));
3027 if (ndr_flags & NDR_BUFFERS) {
3029 return NDR_ERR_SUCCESS;
3032 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1TS *r)
3034 if (ndr_flags & NDR_SCALARS) {
3035 NDR_CHECK(ndr_pull_align(ndr, 1));
3037 struct ndr_pull *_ndr_ctr1;
3038 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1));
3039 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1));
3040 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1));
3043 if (ndr_flags & NDR_BUFFERS) {
3045 return NDR_ERR_SUCCESS;
3048 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1TS *r)
3050 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1TS");
3051 ndr->depth++;
3052 ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1);
3053 ndr->depth--;
3056 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6TS *r)
3058 if (ndr_flags & NDR_SCALARS) {
3059 NDR_CHECK(ndr_push_align(ndr, 1));
3061 struct ndr_push *_ndr_ctr6;
3062 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1));
3063 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6));
3064 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1));
3067 if (ndr_flags & NDR_BUFFERS) {
3069 return NDR_ERR_SUCCESS;
3072 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6TS *r)
3074 if (ndr_flags & NDR_SCALARS) {
3075 NDR_CHECK(ndr_pull_align(ndr, 1));
3077 struct ndr_pull *_ndr_ctr6;
3078 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1));
3079 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6));
3080 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1));
3083 if (ndr_flags & NDR_BUFFERS) {
3085 return NDR_ERR_SUCCESS;
3088 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6TS *r)
3090 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6TS");
3091 ndr->depth++;
3092 ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6);
3093 ndr->depth--;
3096 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
3098 uint32_t _ptr_ts;
3099 TALLOC_CTX *_mem_save_ts_0;
3100 if (ndr_flags & NDR_SCALARS) {
3101 NDR_CHECK(ndr_pull_align(ndr, 5));
3102 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
3103 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
3104 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
3105 if (_ptr_ts) {
3106 NDR_PULL_ALLOC(ndr, r->ts);
3107 } else {
3108 r->ts = NULL;
3111 if (ndr_flags & NDR_BUFFERS) {
3112 if (r->ts) {
3113 _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
3114 NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
3116 struct ndr_pull *_ndr_ts;
3117 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
3119 struct ndr_pull *_ndr_ts_compressed;
3120 NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
3121 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
3122 NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
3124 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
3126 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
3129 return NDR_ERR_SUCCESS;
3132 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
3134 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr1");
3135 ndr->depth++;
3136 ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
3137 ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
3138 ndr_print_ptr(ndr, "ts", r->ts);
3139 ndr->depth++;
3140 if (r->ts) {
3141 ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts);
3143 ndr->depth--;
3144 ndr->depth--;
3147 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
3149 uint32_t _ptr_ts;
3150 TALLOC_CTX *_mem_save_ts_0;
3151 if (ndr_flags & NDR_SCALARS) {
3152 NDR_CHECK(ndr_pull_align(ndr, 5));
3153 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
3154 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
3155 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
3156 if (_ptr_ts) {
3157 NDR_PULL_ALLOC(ndr, r->ts);
3158 } else {
3159 r->ts = NULL;
3162 if (ndr_flags & NDR_BUFFERS) {
3163 if (r->ts) {
3164 _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
3165 NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
3167 struct ndr_pull *_ndr_ts;
3168 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
3170 struct ndr_pull *_ndr_ts_compressed;
3171 NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
3172 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
3173 NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
3175 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
3177 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
3180 return NDR_ERR_SUCCESS;
3183 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
3185 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr6");
3186 ndr->depth++;
3187 ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
3188 ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
3189 ndr_print_ptr(ndr, "ts", r->ts);
3190 ndr->depth++;
3191 if (r->ts) {
3192 ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts);
3194 ndr->depth--;
3195 ndr->depth--;
3198 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr1 *r)
3200 uint32_t _ptr_ts;
3201 TALLOC_CTX *_mem_save_ts_0;
3202 if (ndr_flags & NDR_SCALARS) {
3203 NDR_CHECK(ndr_pull_align(ndr, 5));
3204 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
3205 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
3206 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
3207 if (_ptr_ts) {
3208 NDR_PULL_ALLOC(ndr, r->ts);
3209 } else {
3210 r->ts = NULL;
3213 if (ndr_flags & NDR_BUFFERS) {
3214 if (r->ts) {
3215 _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
3216 NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
3218 struct ndr_pull *_ndr_ts;
3219 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
3221 struct ndr_pull *_ndr_ts_compressed;
3222 NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
3223 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
3224 NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
3226 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
3228 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
3231 return NDR_ERR_SUCCESS;
3234 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r)
3236 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesXPRESSCtr1");
3237 ndr->depth++;
3238 ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
3239 ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
3240 ndr_print_ptr(ndr, "ts", r->ts);
3241 ndr->depth++;
3242 if (r->ts) {
3243 ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts);
3245 ndr->depth--;
3246 ndr->depth--;
3249 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr6 *r)
3251 uint32_t _ptr_ts;
3252 TALLOC_CTX *_mem_save_ts_0;
3253 if (ndr_flags & NDR_SCALARS) {
3254 NDR_CHECK(ndr_pull_align(ndr, 5));
3255 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
3256 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
3257 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
3258 if (_ptr_ts) {
3259 NDR_PULL_ALLOC(ndr, r->ts);
3260 } else {
3261 r->ts = NULL;
3264 if (ndr_flags & NDR_BUFFERS) {
3265 if (r->ts) {
3266 _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
3267 NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
3269 struct ndr_pull *_ndr_ts;
3270 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
3272 struct ndr_pull *_ndr_ts_compressed;
3273 NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
3274 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
3275 NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
3277 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
3279 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
3282 return NDR_ERR_SUCCESS;
3285 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r)
3287 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesXPRESSCtr6");
3288 ndr->depth++;
3289 ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
3290 ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
3291 ndr_print_ptr(ndr, "ts", r->ts);
3292 ndr->depth++;
3293 if (r->ts) {
3294 ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts);
3296 ndr->depth--;
3297 ndr->depth--;
3300 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCompressionType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsGetNCChangesCompressionType r)
3302 NDR_CHECK(ndr_push_enum_uint16(ndr, NDR_SCALARS, r));
3303 return NDR_ERR_SUCCESS;
3306 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCompressionType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsGetNCChangesCompressionType *r)
3308 uint16_t v;
3309 NDR_CHECK(ndr_pull_enum_uint16(ndr, NDR_SCALARS, &v));
3310 *r = v;
3311 return NDR_ERR_SUCCESS;
3314 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCompressionType(struct ndr_print *ndr, const char *name, enum drsuapi_DsGetNCChangesCompressionType r)
3316 const char *val = NULL;
3318 switch (r) {
3319 case DRSUAPI_COMPRESSION_TYPE_MSZIP: val = "DRSUAPI_COMPRESSION_TYPE_MSZIP"; break;
3320 case DRSUAPI_COMPRESSION_TYPE_XPRESS: val = "DRSUAPI_COMPRESSION_TYPE_XPRESS"; break;
3322 ndr_print_enum(ndr, name, "ENUM", val, r);
3325 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesCompressedCtr *r)
3328 uint32_t _flags_save_UNION = ndr->flags;
3329 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3330 if (ndr_flags & NDR_SCALARS) {
3331 int level = ndr_push_get_switch_value(ndr, r);
3332 NDR_CHECK(ndr_push_union_align(ndr, 5));
3333 switch (level) {
3334 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): {
3335 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
3336 break; }
3338 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): {
3339 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_SCALARS, &r->mszip6));
3340 break; }
3342 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): {
3343 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_SCALARS, &r->xpress1));
3344 break; }
3346 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): {
3347 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_SCALARS, &r->xpress6));
3348 break; }
3350 default:
3351 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3354 if (ndr_flags & NDR_BUFFERS) {
3355 int level = ndr_push_get_switch_value(ndr, r);
3356 switch (level) {
3357 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3358 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
3359 break;
3361 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3362 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_BUFFERS, &r->mszip6));
3363 break;
3365 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3366 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_BUFFERS, &r->xpress1));
3367 break;
3369 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3370 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_BUFFERS, &r->xpress6));
3371 break;
3373 default:
3374 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3377 ndr->flags = _flags_save_UNION;
3379 return NDR_ERR_SUCCESS;
3382 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesCompressedCtr *r)
3384 int level;
3386 uint32_t _flags_save_UNION = ndr->flags;
3387 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3388 level = ndr_pull_get_switch_value(ndr, r);
3389 if (ndr_flags & NDR_SCALARS) {
3390 NDR_CHECK(ndr_pull_union_align(ndr, 5));
3391 switch (level) {
3392 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): {
3393 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
3394 break; }
3396 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): {
3397 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_SCALARS, &r->mszip6));
3398 break; }
3400 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): {
3401 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_SCALARS, &r->xpress1));
3402 break; }
3404 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): {
3405 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_SCALARS, &r->xpress6));
3406 break; }
3408 default:
3409 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3412 if (ndr_flags & NDR_BUFFERS) {
3413 switch (level) {
3414 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3415 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
3416 break;
3418 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3419 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_BUFFERS, &r->mszip6));
3420 break;
3422 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3423 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_BUFFERS, &r->xpress1));
3424 break;
3426 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3427 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_BUFFERS, &r->xpress6));
3428 break;
3430 default:
3431 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3434 ndr->flags = _flags_save_UNION;
3436 return NDR_ERR_SUCCESS;
3439 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCompressedCtr *r)
3441 int level;
3443 uint32_t _flags_save_UNION = ndr->flags;
3444 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3445 level = ndr_print_get_switch_value(ndr, r);
3446 ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesCompressedCtr");
3447 switch (level) {
3448 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3449 ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, "mszip1", &r->mszip1);
3450 break;
3452 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3453 ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, "mszip6", &r->mszip6);
3454 break;
3456 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3457 ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, "xpress1", &r->xpress1);
3458 break;
3460 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3461 ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, "xpress6", &r->xpress6);
3462 break;
3464 default:
3465 ndr_print_bad_level(ndr, name, level);
3467 ndr->flags = _flags_save_UNION;
3471 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr2 *r)
3473 if (ndr_flags & NDR_SCALARS) {
3474 NDR_CHECK(ndr_push_align(ndr, 5));
3475 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
3477 if (ndr_flags & NDR_BUFFERS) {
3478 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
3480 return NDR_ERR_SUCCESS;
3483 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr2 *r)
3485 if (ndr_flags & NDR_SCALARS) {
3486 NDR_CHECK(ndr_pull_align(ndr, 5));
3487 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
3489 if (ndr_flags & NDR_BUFFERS) {
3490 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
3492 return NDR_ERR_SUCCESS;
3495 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr2 *r)
3497 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr2");
3498 ndr->depth++;
3499 ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, "mszip1", &r->mszip1);
3500 ndr->depth--;
3503 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr7(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr7 *r)
3505 if (ndr_flags & NDR_SCALARS) {
3506 NDR_CHECK(ndr_push_align(ndr, 5));
3507 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->level));
3508 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressionType(ndr, NDR_SCALARS, r->type));
3509 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16)));
3510 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr));
3512 if (ndr_flags & NDR_BUFFERS) {
3513 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr));
3515 return NDR_ERR_SUCCESS;
3518 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr7(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr7 *r)
3520 if (ndr_flags & NDR_SCALARS) {
3521 NDR_CHECK(ndr_pull_align(ndr, 5));
3522 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->level));
3523 if (r->level < 0 || r->level > 6) {
3524 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3526 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressionType(ndr, NDR_SCALARS, &r->type));
3527 if (r->type < 2 || r->type > 3) {
3528 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3530 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16)));
3531 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr));
3533 if (ndr_flags & NDR_BUFFERS) {
3534 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr));
3536 return NDR_ERR_SUCCESS;
3539 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr7(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr7 *r)
3541 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr7");
3542 ndr->depth++;
3543 ndr_print_int32(ndr, "level", r->level);
3544 ndr_print_drsuapi_DsGetNCChangesCompressionType(ndr, "type", r->type);
3545 ndr_print_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16));
3546 ndr_print_drsuapi_DsGetNCChangesCompressedCtr(ndr, "ctr", &r->ctr);
3547 ndr->depth--;
3550 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesCtr *r)
3552 if (ndr_flags & NDR_SCALARS) {
3553 int level = ndr_push_get_switch_value(ndr, r);
3554 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
3555 NDR_CHECK(ndr_push_union_align(ndr, 8));
3556 switch (level) {
3557 case 1: {
3558 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(ndr, NDR_SCALARS, &r->ctr1));
3559 break; }
3561 case 2: {
3562 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr2(ndr, NDR_SCALARS, &r->ctr2));
3563 break; }
3565 case 6: {
3566 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(ndr, NDR_SCALARS, &r->ctr6));
3567 break; }
3569 case 7: {
3570 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr7(ndr, NDR_SCALARS, &r->ctr7));
3571 break; }
3573 default:
3574 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3577 if (ndr_flags & NDR_BUFFERS) {
3578 int level = ndr_push_get_switch_value(ndr, r);
3579 switch (level) {
3580 case 1:
3581 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(ndr, NDR_BUFFERS, &r->ctr1));
3582 break;
3584 case 2:
3585 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr2(ndr, NDR_BUFFERS, &r->ctr2));
3586 break;
3588 case 6:
3589 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(ndr, NDR_BUFFERS, &r->ctr6));
3590 break;
3592 case 7:
3593 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr7(ndr, NDR_BUFFERS, &r->ctr7));
3594 break;
3596 default:
3597 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3600 return NDR_ERR_SUCCESS;
3603 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesCtr *r)
3605 int level;
3606 int32_t _level;
3607 level = ndr_pull_get_switch_value(ndr, r);
3608 if (ndr_flags & NDR_SCALARS) {
3609 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
3610 if (_level != level) {
3611 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
3613 NDR_CHECK(ndr_pull_union_align(ndr, 8));
3614 switch (level) {
3615 case 1: {
3616 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(ndr, NDR_SCALARS, &r->ctr1));
3617 break; }
3619 case 2: {
3620 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr2(ndr, NDR_SCALARS, &r->ctr2));
3621 break; }
3623 case 6: {
3624 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(ndr, NDR_SCALARS, &r->ctr6));
3625 break; }
3627 case 7: {
3628 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr7(ndr, NDR_SCALARS, &r->ctr7));
3629 break; }
3631 default:
3632 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3635 if (ndr_flags & NDR_BUFFERS) {
3636 switch (level) {
3637 case 1:
3638 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(ndr, NDR_BUFFERS, &r->ctr1));
3639 break;
3641 case 2:
3642 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr2(ndr, NDR_BUFFERS, &r->ctr2));
3643 break;
3645 case 6:
3646 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(ndr, NDR_BUFFERS, &r->ctr6));
3647 break;
3649 case 7:
3650 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr7(ndr, NDR_BUFFERS, &r->ctr7));
3651 break;
3653 default:
3654 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3657 return NDR_ERR_SUCCESS;
3660 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCtr *r)
3662 int level;
3663 level = ndr_print_get_switch_value(ndr, r);
3664 ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesCtr");
3665 switch (level) {
3666 case 1:
3667 ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1);
3668 break;
3670 case 2:
3671 ndr_print_drsuapi_DsGetNCChangesCtr2(ndr, "ctr2", &r->ctr2);
3672 break;
3674 case 6:
3675 ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6);
3676 break;
3678 case 7:
3679 ndr_print_drsuapi_DsGetNCChangesCtr7(ndr, "ctr7", &r->ctr7);
3680 break;
3682 default:
3683 ndr_print_bad_level(ndr, name, level);
3687 static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
3689 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
3690 return NDR_ERR_SUCCESS;
3693 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
3695 uint32_t v;
3696 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
3697 *r = v;
3698 return NDR_ERR_SUCCESS;
3701 _PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_print *ndr, const char *name, uint32_t r)
3703 ndr_print_uint32(ndr, name, r);
3704 ndr->depth++;
3705 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION, r);
3706 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_GETCHG_CHECK", DRSUAPI_DS_REPLICA_UPDATE_GETCHG_CHECK, r);
3707 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE", DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE, r);
3708 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE", DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE, r);
3709 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE", DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE, r);
3710 ndr->depth--;
3713 static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r)
3715 if (ndr_flags & NDR_SCALARS) {
3716 NDR_CHECK(ndr_push_align(ndr, 5));
3717 if (r->naming_context == NULL) {
3718 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3720 NDR_CHECK(ndr_push_ref_ptr(ndr));
3721 if (r->dest_dsa_dns_name == NULL) {
3722 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3724 NDR_CHECK(ndr_push_ref_ptr(ndr));
3725 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->dest_dsa_guid));
3726 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, r->options));
3728 if (ndr_flags & NDR_BUFFERS) {
3729 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
3730 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS)));
3731 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3732 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS)));
3733 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dest_dsa_dns_name, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS), sizeof(uint8_t), CH_DOS));
3735 return NDR_ERR_SUCCESS;
3738 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaUpdateRefsRequest1 *r)
3740 uint32_t _ptr_naming_context;
3741 TALLOC_CTX *_mem_save_naming_context_0;
3742 uint32_t _ptr_dest_dsa_dns_name;
3743 if (ndr_flags & NDR_SCALARS) {
3744 NDR_CHECK(ndr_pull_align(ndr, 5));
3745 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
3746 if (_ptr_naming_context) {
3747 NDR_PULL_ALLOC(ndr, r->naming_context);
3748 } else {
3749 r->naming_context = NULL;
3751 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_dest_dsa_dns_name));
3752 if (_ptr_dest_dsa_dns_name) {
3753 NDR_PULL_ALLOC(ndr, r->dest_dsa_dns_name);
3754 } else {
3755 r->dest_dsa_dns_name = NULL;
3757 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->dest_dsa_guid));
3758 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, &r->options));
3760 if (ndr_flags & NDR_BUFFERS) {
3761 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
3762 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
3763 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
3764 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
3765 NDR_CHECK(ndr_pull_array_size(ndr, &r->dest_dsa_dns_name));
3766 NDR_CHECK(ndr_pull_array_length(ndr, &r->dest_dsa_dns_name));
3767 if (ndr_get_array_length(ndr, &r->dest_dsa_dns_name) > ndr_get_array_size(ndr, &r->dest_dsa_dns_name)) {
3768 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dest_dsa_dns_name), ndr_get_array_length(ndr, &r->dest_dsa_dns_name));
3770 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dest_dsa_dns_name), sizeof(uint8_t)));
3771 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dest_dsa_dns_name, ndr_get_array_length(ndr, &r->dest_dsa_dns_name), sizeof(uint8_t), CH_DOS));
3773 return NDR_ERR_SUCCESS;
3776 _PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r)
3778 ndr_print_struct(ndr, name, "drsuapi_DsReplicaUpdateRefsRequest1");
3779 ndr->depth++;
3780 ndr_print_ptr(ndr, "naming_context", r->naming_context);
3781 ndr->depth++;
3782 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
3783 ndr->depth--;
3784 ndr_print_ptr(ndr, "dest_dsa_dns_name", r->dest_dsa_dns_name);
3785 ndr->depth++;
3786 ndr_print_string(ndr, "dest_dsa_dns_name", r->dest_dsa_dns_name);
3787 ndr->depth--;
3788 ndr_print_GUID(ndr, "dest_dsa_guid", &r->dest_dsa_guid);
3789 ndr_print_drsuapi_DsReplicaUpdateRefsOptions(ndr, "options", r->options);
3790 ndr->depth--;
3793 static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaUpdateRefsRequest *r)
3795 if (ndr_flags & NDR_SCALARS) {
3796 int level = ndr_push_get_switch_value(ndr, r);
3797 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
3798 NDR_CHECK(ndr_push_union_align(ndr, 5));
3799 switch (level) {
3800 case 1: {
3801 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_SCALARS, &r->req1));
3802 break; }
3804 default:
3805 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3808 if (ndr_flags & NDR_BUFFERS) {
3809 int level = ndr_push_get_switch_value(ndr, r);
3810 switch (level) {
3811 case 1:
3812 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_BUFFERS, &r->req1));
3813 break;
3815 default:
3816 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3819 return NDR_ERR_SUCCESS;
3822 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaUpdateRefsRequest *r)
3824 int level;
3825 int32_t _level;
3826 level = ndr_pull_get_switch_value(ndr, r);
3827 if (ndr_flags & NDR_SCALARS) {
3828 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
3829 if (_level != level) {
3830 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
3832 NDR_CHECK(ndr_pull_union_align(ndr, 5));
3833 switch (level) {
3834 case 1: {
3835 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_SCALARS, &r->req1));
3836 break; }
3838 default:
3839 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3842 if (ndr_flags & NDR_BUFFERS) {
3843 switch (level) {
3844 case 1:
3845 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_BUFFERS, &r->req1));
3846 break;
3848 default:
3849 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3852 return NDR_ERR_SUCCESS;
3855 _PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaUpdateRefsRequest *r)
3857 int level;
3858 level = ndr_print_get_switch_value(ndr, r);
3859 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaUpdateRefsRequest");
3860 switch (level) {
3861 case 1:
3862 ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(ndr, "req1", &r->req1);
3863 break;
3865 default:
3866 ndr_print_bad_level(ndr, name, level);
3870 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAddOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
3872 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
3873 return NDR_ERR_SUCCESS;
3876 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAddOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
3878 uint32_t v;
3879 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
3880 *r = v;
3881 return NDR_ERR_SUCCESS;
3884 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAddOptions(struct ndr_print *ndr, const char *name, uint32_t r)
3886 ndr_print_uint32(ndr, name, r);
3887 ndr->depth++;
3888 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION, r);
3889 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_WRITEABLE", DRSUAPI_DS_REPLICA_ADD_WRITEABLE, r);
3890 ndr->depth--;
3893 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAddRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAddRequest1 *r)
3895 if (ndr_flags & NDR_SCALARS) {
3896 NDR_CHECK(ndr_push_align(ndr, 5));
3897 if (r->naming_context == NULL) {
3898 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3900 NDR_CHECK(ndr_push_ref_ptr(ndr));
3901 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_address));
3902 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->schedule, 84));
3903 NDR_CHECK(ndr_push_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, r->options));
3905 if (ndr_flags & NDR_BUFFERS) {
3906 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
3907 if (r->source_dsa_address) {
3908 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
3909 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3910 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
3911 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_address, ndr_charset_length(r->source_dsa_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3914 return NDR_ERR_SUCCESS;
3917 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAddRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAddRequest1 *r)
3919 uint32_t _ptr_naming_context;
3920 TALLOC_CTX *_mem_save_naming_context_0;
3921 uint32_t _ptr_source_dsa_address;
3922 TALLOC_CTX *_mem_save_source_dsa_address_0;
3923 if (ndr_flags & NDR_SCALARS) {
3924 NDR_CHECK(ndr_pull_align(ndr, 5));
3925 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
3926 if (_ptr_naming_context) {
3927 NDR_PULL_ALLOC(ndr, r->naming_context);
3928 } else {
3929 r->naming_context = NULL;
3931 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_address));
3932 if (_ptr_source_dsa_address) {
3933 NDR_PULL_ALLOC(ndr, r->source_dsa_address);
3934 } else {
3935 r->source_dsa_address = NULL;
3937 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->schedule, 84));
3938 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, &r->options));
3940 if (ndr_flags & NDR_BUFFERS) {
3941 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
3942 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
3943 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
3944 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
3945 if (r->source_dsa_address) {
3946 _mem_save_source_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
3947 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_address, 0);
3948 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_address));
3949 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_address));
3950 if (ndr_get_array_length(ndr, &r->source_dsa_address) > ndr_get_array_size(ndr, &r->source_dsa_address)) {
3951 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_address), ndr_get_array_length(ndr, &r->source_dsa_address));
3953 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t)));
3954 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_address, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t), CH_UTF16));
3955 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_address_0, 0);
3958 return NDR_ERR_SUCCESS;
3961 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAddRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAddRequest1 *r)
3963 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAddRequest1");
3964 ndr->depth++;
3965 ndr_print_ptr(ndr, "naming_context", r->naming_context);
3966 ndr->depth++;
3967 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
3968 ndr->depth--;
3969 ndr_print_ptr(ndr, "source_dsa_address", r->source_dsa_address);
3970 ndr->depth++;
3971 if (r->source_dsa_address) {
3972 ndr_print_string(ndr, "source_dsa_address", r->source_dsa_address);
3974 ndr->depth--;
3975 ndr_print_array_uint8(ndr, "schedule", r->schedule, 84);
3976 ndr_print_drsuapi_DsReplicaAddOptions(ndr, "options", r->options);
3977 ndr->depth--;
3980 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAddRequest2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAddRequest2 *r)
3982 if (ndr_flags & NDR_SCALARS) {
3983 NDR_CHECK(ndr_push_align(ndr, 5));
3984 if (r->naming_context == NULL) {
3985 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3987 NDR_CHECK(ndr_push_ref_ptr(ndr));
3988 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_dn));
3989 NDR_CHECK(ndr_push_unique_ptr(ndr, r->transport_dn));
3990 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_address));
3991 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->schedule, 84));
3992 NDR_CHECK(ndr_push_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, r->options));
3994 if (ndr_flags & NDR_BUFFERS) {
3995 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
3996 if (r->source_dsa_dn) {
3997 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->source_dsa_dn));
3999 if (r->transport_dn) {
4000 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->transport_dn));
4002 if (r->source_dsa_address) {
4003 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
4004 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4005 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
4006 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_address, ndr_charset_length(r->source_dsa_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4009 return NDR_ERR_SUCCESS;
4012 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAddRequest2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAddRequest2 *r)
4014 uint32_t _ptr_naming_context;
4015 TALLOC_CTX *_mem_save_naming_context_0;
4016 uint32_t _ptr_source_dsa_dn;
4017 TALLOC_CTX *_mem_save_source_dsa_dn_0;
4018 uint32_t _ptr_transport_dn;
4019 TALLOC_CTX *_mem_save_transport_dn_0;
4020 uint32_t _ptr_source_dsa_address;
4021 TALLOC_CTX *_mem_save_source_dsa_address_0;
4022 if (ndr_flags & NDR_SCALARS) {
4023 NDR_CHECK(ndr_pull_align(ndr, 5));
4024 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
4025 if (_ptr_naming_context) {
4026 NDR_PULL_ALLOC(ndr, r->naming_context);
4027 } else {
4028 r->naming_context = NULL;
4030 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_dn));
4031 if (_ptr_source_dsa_dn) {
4032 NDR_PULL_ALLOC(ndr, r->source_dsa_dn);
4033 } else {
4034 r->source_dsa_dn = NULL;
4036 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport_dn));
4037 if (_ptr_transport_dn) {
4038 NDR_PULL_ALLOC(ndr, r->transport_dn);
4039 } else {
4040 r->transport_dn = NULL;
4042 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_address));
4043 if (_ptr_source_dsa_address) {
4044 NDR_PULL_ALLOC(ndr, r->source_dsa_address);
4045 } else {
4046 r->source_dsa_address = NULL;
4048 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->schedule, 84));
4049 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, &r->options));
4051 if (ndr_flags & NDR_BUFFERS) {
4052 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
4053 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
4054 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
4055 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
4056 if (r->source_dsa_dn) {
4057 _mem_save_source_dsa_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
4058 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_dn, 0);
4059 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->source_dsa_dn));
4060 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_dn_0, 0);
4062 if (r->transport_dn) {
4063 _mem_save_transport_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
4064 NDR_PULL_SET_MEM_CTX(ndr, r->transport_dn, 0);
4065 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->transport_dn));
4066 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_dn_0, 0);
4068 if (r->source_dsa_address) {
4069 _mem_save_source_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
4070 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_address, 0);
4071 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_address));
4072 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_address));
4073 if (ndr_get_array_length(ndr, &r->source_dsa_address) > ndr_get_array_size(ndr, &r->source_dsa_address)) {
4074 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_address), ndr_get_array_length(ndr, &r->source_dsa_address));
4076 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t)));
4077 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_address, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t), CH_UTF16));
4078 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_address_0, 0);
4081 return NDR_ERR_SUCCESS;
4084 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAddRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAddRequest2 *r)
4086 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAddRequest2");
4087 ndr->depth++;
4088 ndr_print_ptr(ndr, "naming_context", r->naming_context);
4089 ndr->depth++;
4090 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
4091 ndr->depth--;
4092 ndr_print_ptr(ndr, "source_dsa_dn", r->source_dsa_dn);
4093 ndr->depth++;
4094 if (r->source_dsa_dn) {
4095 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "source_dsa_dn", r->source_dsa_dn);
4097 ndr->depth--;
4098 ndr_print_ptr(ndr, "transport_dn", r->transport_dn);
4099 ndr->depth++;
4100 if (r->transport_dn) {
4101 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "transport_dn", r->transport_dn);
4103 ndr->depth--;
4104 ndr_print_ptr(ndr, "source_dsa_address", r->source_dsa_address);
4105 ndr->depth++;
4106 if (r->source_dsa_address) {
4107 ndr_print_string(ndr, "source_dsa_address", r->source_dsa_address);
4109 ndr->depth--;
4110 ndr_print_array_uint8(ndr, "schedule", r->schedule, 84);
4111 ndr_print_drsuapi_DsReplicaAddOptions(ndr, "options", r->options);
4112 ndr->depth--;
4115 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAddRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaAddRequest *r)
4117 if (ndr_flags & NDR_SCALARS) {
4118 int level = ndr_push_get_switch_value(ndr, r);
4119 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
4120 NDR_CHECK(ndr_push_union_align(ndr, 5));
4121 switch (level) {
4122 case 1: {
4123 NDR_CHECK(ndr_push_drsuapi_DsReplicaAddRequest1(ndr, NDR_SCALARS, &r->req1));
4124 break; }
4126 case 2: {
4127 NDR_CHECK(ndr_push_drsuapi_DsReplicaAddRequest2(ndr, NDR_SCALARS, &r->req2));
4128 break; }
4130 default:
4131 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4134 if (ndr_flags & NDR_BUFFERS) {
4135 int level = ndr_push_get_switch_value(ndr, r);
4136 switch (level) {
4137 case 1:
4138 NDR_CHECK(ndr_push_drsuapi_DsReplicaAddRequest1(ndr, NDR_BUFFERS, &r->req1));
4139 break;
4141 case 2:
4142 NDR_CHECK(ndr_push_drsuapi_DsReplicaAddRequest2(ndr, NDR_BUFFERS, &r->req2));
4143 break;
4145 default:
4146 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4149 return NDR_ERR_SUCCESS;
4152 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAddRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaAddRequest *r)
4154 int level;
4155 int32_t _level;
4156 level = ndr_pull_get_switch_value(ndr, r);
4157 if (ndr_flags & NDR_SCALARS) {
4158 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
4159 if (_level != level) {
4160 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
4162 NDR_CHECK(ndr_pull_union_align(ndr, 5));
4163 switch (level) {
4164 case 1: {
4165 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddRequest1(ndr, NDR_SCALARS, &r->req1));
4166 break; }
4168 case 2: {
4169 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddRequest2(ndr, NDR_SCALARS, &r->req2));
4170 break; }
4172 default:
4173 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4176 if (ndr_flags & NDR_BUFFERS) {
4177 switch (level) {
4178 case 1:
4179 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddRequest1(ndr, NDR_BUFFERS, &r->req1));
4180 break;
4182 case 2:
4183 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddRequest2(ndr, NDR_BUFFERS, &r->req2));
4184 break;
4186 default:
4187 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4190 return NDR_ERR_SUCCESS;
4193 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAddRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaAddRequest *r)
4195 int level;
4196 level = ndr_print_get_switch_value(ndr, r);
4197 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaAddRequest");
4198 switch (level) {
4199 case 1:
4200 ndr_print_drsuapi_DsReplicaAddRequest1(ndr, "req1", &r->req1);
4201 break;
4203 case 2:
4204 ndr_print_drsuapi_DsReplicaAddRequest2(ndr, "req2", &r->req2);
4205 break;
4207 default:
4208 ndr_print_bad_level(ndr, name, level);
4212 static enum ndr_err_code ndr_push_drsuapi_DsReplicaDeleteOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
4214 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
4215 return NDR_ERR_SUCCESS;
4218 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaDeleteOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
4220 uint32_t v;
4221 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
4222 *r = v;
4223 return NDR_ERR_SUCCESS;
4226 _PUBLIC_ void ndr_print_drsuapi_DsReplicaDeleteOptions(struct ndr_print *ndr, const char *name, uint32_t r)
4228 ndr_print_uint32(ndr, name, r);
4229 ndr->depth++;
4230 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION, r);
4231 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_WRITEABLE", DRSUAPI_DS_REPLICA_ADD_WRITEABLE, r);
4232 ndr->depth--;
4235 static enum ndr_err_code ndr_push_drsuapi_DsReplicaDelRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaDelRequest1 *r)
4237 if (ndr_flags & NDR_SCALARS) {
4238 NDR_CHECK(ndr_push_align(ndr, 5));
4239 if (r->naming_context == NULL) {
4240 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4242 NDR_CHECK(ndr_push_ref_ptr(ndr));
4243 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_address));
4244 NDR_CHECK(ndr_push_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, r->options));
4246 if (ndr_flags & NDR_BUFFERS) {
4247 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
4248 if (r->source_dsa_address) {
4249 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
4250 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4251 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
4252 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_address, ndr_charset_length(r->source_dsa_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4255 return NDR_ERR_SUCCESS;
4258 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaDelRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaDelRequest1 *r)
4260 uint32_t _ptr_naming_context;
4261 TALLOC_CTX *_mem_save_naming_context_0;
4262 uint32_t _ptr_source_dsa_address;
4263 TALLOC_CTX *_mem_save_source_dsa_address_0;
4264 if (ndr_flags & NDR_SCALARS) {
4265 NDR_CHECK(ndr_pull_align(ndr, 5));
4266 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
4267 if (_ptr_naming_context) {
4268 NDR_PULL_ALLOC(ndr, r->naming_context);
4269 } else {
4270 r->naming_context = NULL;
4272 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_address));
4273 if (_ptr_source_dsa_address) {
4274 NDR_PULL_ALLOC(ndr, r->source_dsa_address);
4275 } else {
4276 r->source_dsa_address = NULL;
4278 NDR_CHECK(ndr_pull_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, &r->options));
4280 if (ndr_flags & NDR_BUFFERS) {
4281 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
4282 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
4283 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
4284 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
4285 if (r->source_dsa_address) {
4286 _mem_save_source_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
4287 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_address, 0);
4288 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_address));
4289 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_address));
4290 if (ndr_get_array_length(ndr, &r->source_dsa_address) > ndr_get_array_size(ndr, &r->source_dsa_address)) {
4291 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_address), ndr_get_array_length(ndr, &r->source_dsa_address));
4293 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t)));
4294 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_address, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t), CH_UTF16));
4295 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_address_0, 0);
4298 return NDR_ERR_SUCCESS;
4301 _PUBLIC_ void ndr_print_drsuapi_DsReplicaDelRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaDelRequest1 *r)
4303 ndr_print_struct(ndr, name, "drsuapi_DsReplicaDelRequest1");
4304 ndr->depth++;
4305 ndr_print_ptr(ndr, "naming_context", r->naming_context);
4306 ndr->depth++;
4307 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
4308 ndr->depth--;
4309 ndr_print_ptr(ndr, "source_dsa_address", r->source_dsa_address);
4310 ndr->depth++;
4311 if (r->source_dsa_address) {
4312 ndr_print_string(ndr, "source_dsa_address", r->source_dsa_address);
4314 ndr->depth--;
4315 ndr_print_drsuapi_DsReplicaDeleteOptions(ndr, "options", r->options);
4316 ndr->depth--;
4319 static enum ndr_err_code ndr_push_drsuapi_DsReplicaDelRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaDelRequest *r)
4321 if (ndr_flags & NDR_SCALARS) {
4322 int level = ndr_push_get_switch_value(ndr, r);
4323 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
4324 NDR_CHECK(ndr_push_union_align(ndr, 5));
4325 switch (level) {
4326 case 1: {
4327 NDR_CHECK(ndr_push_drsuapi_DsReplicaDelRequest1(ndr, NDR_SCALARS, &r->req1));
4328 break; }
4330 default:
4331 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4334 if (ndr_flags & NDR_BUFFERS) {
4335 int level = ndr_push_get_switch_value(ndr, r);
4336 switch (level) {
4337 case 1:
4338 NDR_CHECK(ndr_push_drsuapi_DsReplicaDelRequest1(ndr, NDR_BUFFERS, &r->req1));
4339 break;
4341 default:
4342 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4345 return NDR_ERR_SUCCESS;
4348 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaDelRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaDelRequest *r)
4350 int level;
4351 int32_t _level;
4352 level = ndr_pull_get_switch_value(ndr, r);
4353 if (ndr_flags & NDR_SCALARS) {
4354 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
4355 if (_level != level) {
4356 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
4358 NDR_CHECK(ndr_pull_union_align(ndr, 5));
4359 switch (level) {
4360 case 1: {
4361 NDR_CHECK(ndr_pull_drsuapi_DsReplicaDelRequest1(ndr, NDR_SCALARS, &r->req1));
4362 break; }
4364 default:
4365 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4368 if (ndr_flags & NDR_BUFFERS) {
4369 switch (level) {
4370 case 1:
4371 NDR_CHECK(ndr_pull_drsuapi_DsReplicaDelRequest1(ndr, NDR_BUFFERS, &r->req1));
4372 break;
4374 default:
4375 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4378 return NDR_ERR_SUCCESS;
4381 _PUBLIC_ void ndr_print_drsuapi_DsReplicaDelRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaDelRequest *r)
4383 int level;
4384 level = ndr_print_get_switch_value(ndr, r);
4385 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaDelRequest");
4386 switch (level) {
4387 case 1:
4388 ndr_print_drsuapi_DsReplicaDelRequest1(ndr, "req1", &r->req1);
4389 break;
4391 default:
4392 ndr_print_bad_level(ndr, name, level);
4396 static enum ndr_err_code ndr_push_drsuapi_DsReplicaModifyOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
4398 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
4399 return NDR_ERR_SUCCESS;
4402 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaModifyOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
4404 uint32_t v;
4405 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
4406 *r = v;
4407 return NDR_ERR_SUCCESS;
4410 _PUBLIC_ void ndr_print_drsuapi_DsReplicaModifyOptions(struct ndr_print *ndr, const char *name, uint32_t r)
4412 ndr_print_uint32(ndr, name, r);
4413 ndr->depth++;
4414 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION, r);
4415 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_WRITEABLE", DRSUAPI_DS_REPLICA_ADD_WRITEABLE, r);
4416 ndr->depth--;
4419 static enum ndr_err_code ndr_push_drsuapi_DsReplicaModRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaModRequest1 *r)
4421 if (ndr_flags & NDR_SCALARS) {
4422 NDR_CHECK(ndr_push_align(ndr, 5));
4423 if (r->naming_context == NULL) {
4424 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4426 NDR_CHECK(ndr_push_ref_ptr(ndr));
4427 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dra));
4428 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dra_address));
4429 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->schedule, 84));
4430 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->replica_flags));
4431 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->modify_fields));
4432 NDR_CHECK(ndr_push_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, r->options));
4434 if (ndr_flags & NDR_BUFFERS) {
4435 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
4436 if (r->source_dra_address) {
4437 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dra_address, CH_UTF16)));
4438 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4439 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dra_address, CH_UTF16)));
4440 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dra_address, ndr_charset_length(r->source_dra_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4443 return NDR_ERR_SUCCESS;
4446 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaModRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaModRequest1 *r)
4448 uint32_t _ptr_naming_context;
4449 TALLOC_CTX *_mem_save_naming_context_0;
4450 uint32_t _ptr_source_dra_address;
4451 TALLOC_CTX *_mem_save_source_dra_address_0;
4452 if (ndr_flags & NDR_SCALARS) {
4453 NDR_CHECK(ndr_pull_align(ndr, 5));
4454 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
4455 if (_ptr_naming_context) {
4456 NDR_PULL_ALLOC(ndr, r->naming_context);
4457 } else {
4458 r->naming_context = NULL;
4460 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dra));
4461 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dra_address));
4462 if (_ptr_source_dra_address) {
4463 NDR_PULL_ALLOC(ndr, r->source_dra_address);
4464 } else {
4465 r->source_dra_address = NULL;
4467 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->schedule, 84));
4468 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->replica_flags));
4469 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->modify_fields));
4470 NDR_CHECK(ndr_pull_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, &r->options));
4472 if (ndr_flags & NDR_BUFFERS) {
4473 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
4474 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
4475 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
4476 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
4477 if (r->source_dra_address) {
4478 _mem_save_source_dra_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
4479 NDR_PULL_SET_MEM_CTX(ndr, r->source_dra_address, 0);
4480 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dra_address));
4481 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dra_address));
4482 if (ndr_get_array_length(ndr, &r->source_dra_address) > ndr_get_array_size(ndr, &r->source_dra_address)) {
4483 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dra_address), ndr_get_array_length(ndr, &r->source_dra_address));
4485 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dra_address), sizeof(uint16_t)));
4486 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dra_address, ndr_get_array_length(ndr, &r->source_dra_address), sizeof(uint16_t), CH_UTF16));
4487 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dra_address_0, 0);
4490 return NDR_ERR_SUCCESS;
4493 _PUBLIC_ void ndr_print_drsuapi_DsReplicaModRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaModRequest1 *r)
4495 ndr_print_struct(ndr, name, "drsuapi_DsReplicaModRequest1");
4496 ndr->depth++;
4497 ndr_print_ptr(ndr, "naming_context", r->naming_context);
4498 ndr->depth++;
4499 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
4500 ndr->depth--;
4501 ndr_print_GUID(ndr, "source_dra", &r->source_dra);
4502 ndr_print_ptr(ndr, "source_dra_address", r->source_dra_address);
4503 ndr->depth++;
4504 if (r->source_dra_address) {
4505 ndr_print_string(ndr, "source_dra_address", r->source_dra_address);
4507 ndr->depth--;
4508 ndr_print_array_uint8(ndr, "schedule", r->schedule, 84);
4509 ndr_print_uint32(ndr, "replica_flags", r->replica_flags);
4510 ndr_print_uint32(ndr, "modify_fields", r->modify_fields);
4511 ndr_print_drsuapi_DsReplicaModifyOptions(ndr, "options", r->options);
4512 ndr->depth--;
4515 static enum ndr_err_code ndr_push_drsuapi_DsReplicaModRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaModRequest *r)
4517 if (ndr_flags & NDR_SCALARS) {
4518 int level = ndr_push_get_switch_value(ndr, r);
4519 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
4520 NDR_CHECK(ndr_push_union_align(ndr, 5));
4521 switch (level) {
4522 case 1: {
4523 NDR_CHECK(ndr_push_drsuapi_DsReplicaModRequest1(ndr, NDR_SCALARS, &r->req1));
4524 break; }
4526 default:
4527 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4530 if (ndr_flags & NDR_BUFFERS) {
4531 int level = ndr_push_get_switch_value(ndr, r);
4532 switch (level) {
4533 case 1:
4534 NDR_CHECK(ndr_push_drsuapi_DsReplicaModRequest1(ndr, NDR_BUFFERS, &r->req1));
4535 break;
4537 default:
4538 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4541 return NDR_ERR_SUCCESS;
4544 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaModRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaModRequest *r)
4546 int level;
4547 int32_t _level;
4548 level = ndr_pull_get_switch_value(ndr, r);
4549 if (ndr_flags & NDR_SCALARS) {
4550 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
4551 if (_level != level) {
4552 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
4554 NDR_CHECK(ndr_pull_union_align(ndr, 5));
4555 switch (level) {
4556 case 1: {
4557 NDR_CHECK(ndr_pull_drsuapi_DsReplicaModRequest1(ndr, NDR_SCALARS, &r->req1));
4558 break; }
4560 default:
4561 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4564 if (ndr_flags & NDR_BUFFERS) {
4565 switch (level) {
4566 case 1:
4567 NDR_CHECK(ndr_pull_drsuapi_DsReplicaModRequest1(ndr, NDR_BUFFERS, &r->req1));
4568 break;
4570 default:
4571 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4574 return NDR_ERR_SUCCESS;
4577 _PUBLIC_ void ndr_print_drsuapi_DsReplicaModRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaModRequest *r)
4579 int level;
4580 level = ndr_print_get_switch_value(ndr, r);
4581 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaModRequest");
4582 switch (level) {
4583 case 1:
4584 ndr_print_drsuapi_DsReplicaModRequest1(ndr, "req1", &r->req1);
4585 break;
4587 default:
4588 ndr_print_bad_level(ndr, name, level);
4592 static enum ndr_err_code ndr_push_drsuapi_DsMembershipType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsMembershipType r)
4594 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
4595 return NDR_ERR_SUCCESS;
4598 static enum ndr_err_code ndr_pull_drsuapi_DsMembershipType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsMembershipType *r)
4600 uint32_t v;
4601 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
4602 *r = v;
4603 return NDR_ERR_SUCCESS;
4606 _PUBLIC_ void ndr_print_drsuapi_DsMembershipType(struct ndr_print *ndr, const char *name, enum drsuapi_DsMembershipType r)
4608 const char *val = NULL;
4610 switch (r) {
4611 case DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS"; break;
4612 case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS"; break;
4613 case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS"; break;
4614 case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2"; break;
4615 case DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS"; break;
4616 case DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS"; break;
4617 case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2"; break;
4619 ndr_print_enum(ndr, name, "ENUM", val, r);
4622 static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMembershipsCtr1 *r)
4624 uint32_t cntr_info_array_1;
4625 uint32_t cntr_group_attrs_1;
4626 uint32_t cntr_sids_1;
4627 if (ndr_flags & NDR_SCALARS) {
4628 NDR_CHECK(ndr_push_align(ndr, 5));
4629 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
4630 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships));
4631 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
4632 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array));
4633 NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_attrs));
4634 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
4636 if (ndr_flags & NDR_BUFFERS) {
4637 if (r->info_array) {
4638 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_memberships));
4639 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) {
4640 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array[cntr_info_array_1]));
4642 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) {
4643 if (r->info_array[cntr_info_array_1]) {
4644 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1]));
4648 if (r->group_attrs) {
4649 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_memberships));
4650 for (cntr_group_attrs_1 = 0; cntr_group_attrs_1 < r->num_memberships; cntr_group_attrs_1++) {
4651 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->group_attrs[cntr_group_attrs_1]));
4654 if (r->sids) {
4655 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_sids));
4656 for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
4657 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids[cntr_sids_1]));
4659 for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
4660 if (r->sids[cntr_sids_1]) {
4661 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_1]));
4666 return NDR_ERR_SUCCESS;
4669 static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMembershipsCtr1 *r)
4671 uint32_t _ptr_info_array;
4672 uint32_t cntr_info_array_1;
4673 TALLOC_CTX *_mem_save_info_array_0;
4674 TALLOC_CTX *_mem_save_info_array_1;
4675 TALLOC_CTX *_mem_save_info_array_2;
4676 uint32_t _ptr_group_attrs;
4677 uint32_t cntr_group_attrs_1;
4678 TALLOC_CTX *_mem_save_group_attrs_0;
4679 TALLOC_CTX *_mem_save_group_attrs_1;
4680 uint32_t _ptr_sids;
4681 uint32_t cntr_sids_1;
4682 TALLOC_CTX *_mem_save_sids_0;
4683 TALLOC_CTX *_mem_save_sids_1;
4684 TALLOC_CTX *_mem_save_sids_2;
4685 if (ndr_flags & NDR_SCALARS) {
4686 NDR_CHECK(ndr_pull_align(ndr, 5));
4687 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
4688 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_memberships));
4689 if (r->num_memberships > 10000) {
4690 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
4692 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids));
4693 if (r->num_sids > 10000) {
4694 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
4696 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array));
4697 if (_ptr_info_array) {
4698 NDR_PULL_ALLOC(ndr, r->info_array);
4699 } else {
4700 r->info_array = NULL;
4702 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_attrs));
4703 if (_ptr_group_attrs) {
4704 NDR_PULL_ALLOC(ndr, r->group_attrs);
4705 } else {
4706 r->group_attrs = NULL;
4708 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
4709 if (_ptr_sids) {
4710 NDR_PULL_ALLOC(ndr, r->sids);
4711 } else {
4712 r->sids = NULL;
4715 if (ndr_flags & NDR_BUFFERS) {
4716 if (r->info_array) {
4717 _mem_save_info_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
4718 NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0);
4719 NDR_CHECK(ndr_pull_array_size(ndr, &r->info_array));
4720 NDR_PULL_ALLOC_N(ndr, r->info_array, ndr_get_array_size(ndr, &r->info_array));
4721 _mem_save_info_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
4722 NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0);
4723 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) {
4724 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array));
4725 if (_ptr_info_array) {
4726 NDR_PULL_ALLOC(ndr, r->info_array[cntr_info_array_1]);
4727 } else {
4728 r->info_array[cntr_info_array_1] = NULL;
4731 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) {
4732 if (r->info_array[cntr_info_array_1]) {
4733 _mem_save_info_array_2 = NDR_PULL_GET_MEM_CTX(ndr);
4734 NDR_PULL_SET_MEM_CTX(ndr, r->info_array[cntr_info_array_1], 0);
4735 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1]));
4736 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_2, 0);
4739 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_1, 0);
4740 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_0, 0);
4742 if (r->group_attrs) {
4743 _mem_save_group_attrs_0 = NDR_PULL_GET_MEM_CTX(ndr);
4744 NDR_PULL_SET_MEM_CTX(ndr, r->group_attrs, 0);
4745 NDR_CHECK(ndr_pull_array_size(ndr, &r->group_attrs));
4746 NDR_PULL_ALLOC_N(ndr, r->group_attrs, ndr_get_array_size(ndr, &r->group_attrs));
4747 _mem_save_group_attrs_1 = NDR_PULL_GET_MEM_CTX(ndr);
4748 NDR_PULL_SET_MEM_CTX(ndr, r->group_attrs, 0);
4749 for (cntr_group_attrs_1 = 0; cntr_group_attrs_1 < r->num_memberships; cntr_group_attrs_1++) {
4750 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->group_attrs[cntr_group_attrs_1]));
4752 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_attrs_1, 0);
4753 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_attrs_0, 0);
4755 if (r->sids) {
4756 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
4757 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
4758 NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
4759 NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
4760 _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
4761 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
4762 for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
4763 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
4764 if (_ptr_sids) {
4765 NDR_PULL_ALLOC(ndr, r->sids[cntr_sids_1]);
4766 } else {
4767 r->sids[cntr_sids_1] = NULL;
4770 for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
4771 if (r->sids[cntr_sids_1]) {
4772 _mem_save_sids_2 = NDR_PULL_GET_MEM_CTX(ndr);
4773 NDR_PULL_SET_MEM_CTX(ndr, r->sids[cntr_sids_1], 0);
4774 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_1]));
4775 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_2, 0);
4778 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
4779 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
4781 if (r->info_array) {
4782 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info_array, r->num_memberships));
4784 if (r->group_attrs) {
4785 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->group_attrs, r->num_memberships));
4787 if (r->sids) {
4788 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids));
4791 return NDR_ERR_SUCCESS;
4794 _PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsCtr1 *r)
4796 uint32_t cntr_info_array_1;
4797 uint32_t cntr_group_attrs_1;
4798 uint32_t cntr_sids_1;
4799 ndr_print_struct(ndr, name, "drsuapi_DsGetMembershipsCtr1");
4800 ndr->depth++;
4801 ndr_print_NTSTATUS(ndr, "status", r->status);
4802 ndr_print_uint32(ndr, "num_memberships", r->num_memberships);
4803 ndr_print_uint32(ndr, "num_sids", r->num_sids);
4804 ndr_print_ptr(ndr, "info_array", r->info_array);
4805 ndr->depth++;
4806 if (r->info_array) {
4807 ndr->print(ndr, "%s: ARRAY(%d)", "info_array", (int)r->num_memberships);
4808 ndr->depth++;
4809 for (cntr_info_array_1=0;cntr_info_array_1<r->num_memberships;cntr_info_array_1++) {
4810 char *idx_1=NULL;
4811 if (asprintf(&idx_1, "[%d]", cntr_info_array_1) != -1) {
4812 ndr_print_ptr(ndr, "info_array", r->info_array[cntr_info_array_1]);
4813 ndr->depth++;
4814 if (r->info_array[cntr_info_array_1]) {
4815 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "info_array", r->info_array[cntr_info_array_1]);
4817 ndr->depth--;
4818 free(idx_1);
4821 ndr->depth--;
4823 ndr->depth--;
4824 ndr_print_ptr(ndr, "group_attrs", r->group_attrs);
4825 ndr->depth++;
4826 if (r->group_attrs) {
4827 ndr->print(ndr, "%s: ARRAY(%d)", "group_attrs", (int)r->num_memberships);
4828 ndr->depth++;
4829 for (cntr_group_attrs_1=0;cntr_group_attrs_1<r->num_memberships;cntr_group_attrs_1++) {
4830 char *idx_1=NULL;
4831 if (asprintf(&idx_1, "[%d]", cntr_group_attrs_1) != -1) {
4832 ndr_print_samr_GroupAttrs(ndr, "group_attrs", r->group_attrs[cntr_group_attrs_1]);
4833 free(idx_1);
4836 ndr->depth--;
4838 ndr->depth--;
4839 ndr_print_ptr(ndr, "sids", r->sids);
4840 ndr->depth++;
4841 if (r->sids) {
4842 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids);
4843 ndr->depth++;
4844 for (cntr_sids_1=0;cntr_sids_1<r->num_sids;cntr_sids_1++) {
4845 char *idx_1=NULL;
4846 if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
4847 ndr_print_ptr(ndr, "sids", r->sids[cntr_sids_1]);
4848 ndr->depth++;
4849 if (r->sids[cntr_sids_1]) {
4850 ndr_print_dom_sid28(ndr, "sids", r->sids[cntr_sids_1]);
4852 ndr->depth--;
4853 free(idx_1);
4856 ndr->depth--;
4858 ndr->depth--;
4859 ndr->depth--;
4862 static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMembershipsCtr *r)
4864 if (ndr_flags & NDR_SCALARS) {
4865 int level = ndr_push_get_switch_value(ndr, r);
4866 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
4867 NDR_CHECK(ndr_push_union_align(ndr, 5));
4868 switch (level) {
4869 case 1: {
4870 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1));
4871 break; }
4873 default:
4874 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4877 if (ndr_flags & NDR_BUFFERS) {
4878 int level = ndr_push_get_switch_value(ndr, r);
4879 switch (level) {
4880 case 1:
4881 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1));
4882 break;
4884 default:
4885 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4888 return NDR_ERR_SUCCESS;
4891 static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMembershipsCtr *r)
4893 int level;
4894 int32_t _level;
4895 level = ndr_pull_get_switch_value(ndr, r);
4896 if (ndr_flags & NDR_SCALARS) {
4897 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
4898 if (_level != level) {
4899 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
4901 NDR_CHECK(ndr_pull_union_align(ndr, 5));
4902 switch (level) {
4903 case 1: {
4904 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1));
4905 break; }
4907 default:
4908 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4911 if (ndr_flags & NDR_BUFFERS) {
4912 switch (level) {
4913 case 1:
4914 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1));
4915 break;
4917 default:
4918 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
4921 return NDR_ERR_SUCCESS;
4924 _PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsCtr *r)
4926 int level;
4927 level = ndr_print_get_switch_value(ndr, r);
4928 ndr_print_union(ndr, name, level, "drsuapi_DsGetMembershipsCtr");
4929 switch (level) {
4930 case 1:
4931 ndr_print_drsuapi_DsGetMembershipsCtr1(ndr, "ctr1", &r->ctr1);
4932 break;
4934 default:
4935 ndr_print_bad_level(ndr, name, level);
4939 static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMembershipsRequest1 *r)
4941 uint32_t cntr_info_array_1;
4942 if (ndr_flags & NDR_SCALARS) {
4943 NDR_CHECK(ndr_push_align(ndr, 5));
4944 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
4945 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array));
4946 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
4947 NDR_CHECK(ndr_push_drsuapi_DsMembershipType(ndr, NDR_SCALARS, r->type));
4948 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
4950 if (ndr_flags & NDR_BUFFERS) {
4951 if (r->info_array) {
4952 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
4953 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) {
4954 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array[cntr_info_array_1]));
4956 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) {
4957 if (r->info_array[cntr_info_array_1]) {
4958 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1]));
4962 if (r->domain) {
4963 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain));
4966 return NDR_ERR_SUCCESS;
4969 static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMembershipsRequest1 *r)
4971 uint32_t _ptr_info_array;
4972 uint32_t cntr_info_array_1;
4973 TALLOC_CTX *_mem_save_info_array_0;
4974 TALLOC_CTX *_mem_save_info_array_1;
4975 TALLOC_CTX *_mem_save_info_array_2;
4976 uint32_t _ptr_domain;
4977 TALLOC_CTX *_mem_save_domain_0;
4978 if (ndr_flags & NDR_SCALARS) {
4979 NDR_CHECK(ndr_pull_align(ndr, 5));
4980 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
4981 if (r->count < 1 || r->count > 10000) {
4982 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
4984 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array));
4985 if (_ptr_info_array) {
4986 NDR_PULL_ALLOC(ndr, r->info_array);
4987 } else {
4988 r->info_array = NULL;
4990 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
4991 NDR_CHECK(ndr_pull_drsuapi_DsMembershipType(ndr, NDR_SCALARS, &r->type));
4992 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
4993 if (_ptr_domain) {
4994 NDR_PULL_ALLOC(ndr, r->domain);
4995 } else {
4996 r->domain = NULL;
4999 if (ndr_flags & NDR_BUFFERS) {
5000 if (r->info_array) {
5001 _mem_save_info_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
5002 NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0);
5003 NDR_CHECK(ndr_pull_array_size(ndr, &r->info_array));
5004 NDR_PULL_ALLOC_N(ndr, r->info_array, ndr_get_array_size(ndr, &r->info_array));
5005 _mem_save_info_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
5006 NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0);
5007 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) {
5008 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array));
5009 if (_ptr_info_array) {
5010 NDR_PULL_ALLOC(ndr, r->info_array[cntr_info_array_1]);
5011 } else {
5012 r->info_array[cntr_info_array_1] = NULL;
5015 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) {
5016 if (r->info_array[cntr_info_array_1]) {
5017 _mem_save_info_array_2 = NDR_PULL_GET_MEM_CTX(ndr);
5018 NDR_PULL_SET_MEM_CTX(ndr, r->info_array[cntr_info_array_1], 0);
5019 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1]));
5020 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_2, 0);
5023 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_1, 0);
5024 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_0, 0);
5026 if (r->domain) {
5027 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
5028 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
5029 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain));
5030 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
5032 if (r->info_array) {
5033 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info_array, r->count));
5036 return NDR_ERR_SUCCESS;
5039 _PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsRequest1 *r)
5041 uint32_t cntr_info_array_1;
5042 ndr_print_struct(ndr, name, "drsuapi_DsGetMembershipsRequest1");
5043 ndr->depth++;
5044 ndr_print_uint32(ndr, "count", r->count);
5045 ndr_print_ptr(ndr, "info_array", r->info_array);
5046 ndr->depth++;
5047 if (r->info_array) {
5048 ndr->print(ndr, "%s: ARRAY(%d)", "info_array", (int)r->count);
5049 ndr->depth++;
5050 for (cntr_info_array_1=0;cntr_info_array_1<r->count;cntr_info_array_1++) {
5051 char *idx_1=NULL;
5052 if (asprintf(&idx_1, "[%d]", cntr_info_array_1) != -1) {
5053 ndr_print_ptr(ndr, "info_array", r->info_array[cntr_info_array_1]);
5054 ndr->depth++;
5055 if (r->info_array[cntr_info_array_1]) {
5056 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "info_array", r->info_array[cntr_info_array_1]);
5058 ndr->depth--;
5059 free(idx_1);
5062 ndr->depth--;
5064 ndr->depth--;
5065 ndr_print_uint32(ndr, "flags", r->flags);
5066 ndr_print_drsuapi_DsMembershipType(ndr, "type", r->type);
5067 ndr_print_ptr(ndr, "domain", r->domain);
5068 ndr->depth++;
5069 if (r->domain) {
5070 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "domain", r->domain);
5072 ndr->depth--;
5073 ndr->depth--;
5076 static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMembershipsRequest *r)
5078 if (ndr_flags & NDR_SCALARS) {
5079 int level = ndr_push_get_switch_value(ndr, r);
5080 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
5081 NDR_CHECK(ndr_push_union_align(ndr, 5));
5082 switch (level) {
5083 case 1: {
5084 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS, &r->req1));
5085 break; }
5087 default:
5088 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5091 if (ndr_flags & NDR_BUFFERS) {
5092 int level = ndr_push_get_switch_value(ndr, r);
5093 switch (level) {
5094 case 1:
5095 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_BUFFERS, &r->req1));
5096 break;
5098 default:
5099 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5102 return NDR_ERR_SUCCESS;
5105 static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMembershipsRequest *r)
5107 int level;
5108 int32_t _level;
5109 level = ndr_pull_get_switch_value(ndr, r);
5110 if (ndr_flags & NDR_SCALARS) {
5111 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
5112 if (_level != level) {
5113 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
5115 NDR_CHECK(ndr_pull_union_align(ndr, 5));
5116 switch (level) {
5117 case 1: {
5118 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS, &r->req1));
5119 break; }
5121 default:
5122 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5125 if (ndr_flags & NDR_BUFFERS) {
5126 switch (level) {
5127 case 1:
5128 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_BUFFERS, &r->req1));
5129 break;
5131 default:
5132 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5135 return NDR_ERR_SUCCESS;
5138 _PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsRequest *r)
5140 int level;
5141 level = ndr_print_get_switch_value(ndr, r);
5142 ndr_print_union(ndr, name, level, "drsuapi_DsGetMembershipsRequest");
5143 switch (level) {
5144 case 1:
5145 ndr_print_drsuapi_DsGetMembershipsRequest1(ndr, "req1", &r->req1);
5146 break;
5148 default:
5149 ndr_print_bad_level(ndr, name, level);
5153 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r)
5155 if (ndr_flags & NDR_SCALARS) {
5156 NDR_CHECK(ndr_push_align(ndr, 5));
5157 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
5158 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
5159 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
5160 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
5162 if (ndr_flags & NDR_BUFFERS) {
5163 if (r->data) {
5164 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
5165 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
5168 return NDR_ERR_SUCCESS;
5171 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNT4ChangeLogRequest1 *r)
5173 uint32_t _ptr_data;
5174 TALLOC_CTX *_mem_save_data_0;
5175 if (ndr_flags & NDR_SCALARS) {
5176 NDR_CHECK(ndr_pull_align(ndr, 5));
5177 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
5178 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
5179 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
5180 if (r->length > 0x00A00000) {
5181 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
5183 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
5184 if (_ptr_data) {
5185 NDR_PULL_ALLOC(ndr, r->data);
5186 } else {
5187 r->data = NULL;
5190 if (ndr_flags & NDR_BUFFERS) {
5191 if (r->data) {
5192 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
5193 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
5194 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
5195 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
5196 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
5197 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
5199 if (r->data) {
5200 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
5203 return NDR_ERR_SUCCESS;
5206 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r)
5208 ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLogRequest1");
5209 ndr->depth++;
5210 ndr_print_uint32(ndr, "unknown1", r->unknown1);
5211 ndr_print_uint32(ndr, "unknown2", r->unknown2);
5212 ndr_print_uint32(ndr, "length", r->length);
5213 ndr_print_ptr(ndr, "data", r->data);
5214 ndr->depth++;
5215 if (r->data) {
5216 ndr_print_array_uint8(ndr, "data", r->data, r->length);
5218 ndr->depth--;
5219 ndr->depth--;
5222 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNT4ChangeLogRequest *r)
5224 if (ndr_flags & NDR_SCALARS) {
5225 int level = ndr_push_get_switch_value(ndr, r);
5226 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
5227 NDR_CHECK(ndr_push_union_align(ndr, 5));
5228 switch (level) {
5229 case 1: {
5230 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_SCALARS, &r->req1));
5231 break; }
5233 default:
5234 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5237 if (ndr_flags & NDR_BUFFERS) {
5238 int level = ndr_push_get_switch_value(ndr, r);
5239 switch (level) {
5240 case 1:
5241 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_BUFFERS, &r->req1));
5242 break;
5244 default:
5245 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5248 return NDR_ERR_SUCCESS;
5251 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNT4ChangeLogRequest *r)
5253 int level;
5254 uint32_t _level;
5255 level = ndr_pull_get_switch_value(ndr, r);
5256 if (ndr_flags & NDR_SCALARS) {
5257 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
5258 if (_level != level) {
5259 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
5261 NDR_CHECK(ndr_pull_union_align(ndr, 5));
5262 switch (level) {
5263 case 1: {
5264 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_SCALARS, &r->req1));
5265 break; }
5267 default:
5268 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5271 if (ndr_flags & NDR_BUFFERS) {
5272 switch (level) {
5273 case 1:
5274 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_BUFFERS, &r->req1));
5275 break;
5277 default:
5278 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5281 return NDR_ERR_SUCCESS;
5284 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogRequest *r)
5286 int level;
5287 level = ndr_print_get_switch_value(ndr, r);
5288 ndr_print_union(ndr, name, level, "drsuapi_DsGetNT4ChangeLogRequest");
5289 switch (level) {
5290 case 1:
5291 ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(ndr, "req1", &r->req1);
5292 break;
5294 default:
5295 ndr_print_bad_level(ndr, name, level);
5299 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r)
5301 if (ndr_flags & NDR_SCALARS) {
5302 NDR_CHECK(ndr_push_align(ndr, 8));
5303 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length1));
5304 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length2));
5305 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown1));
5306 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time2));
5307 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown3));
5308 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time4));
5309 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown5));
5310 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time6));
5311 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
5312 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data1));
5313 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data2));
5315 if (ndr_flags & NDR_BUFFERS) {
5316 if (r->data1) {
5317 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length1));
5318 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data1, r->length1));
5320 if (r->data2) {
5321 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length2));
5322 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data2, r->length2));
5325 return NDR_ERR_SUCCESS;
5328 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNT4ChangeLogInfo1 *r)
5330 uint32_t _ptr_data1;
5331 TALLOC_CTX *_mem_save_data1_0;
5332 uint32_t _ptr_data2;
5333 TALLOC_CTX *_mem_save_data2_0;
5334 if (ndr_flags & NDR_SCALARS) {
5335 NDR_CHECK(ndr_pull_align(ndr, 8));
5336 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length1));
5337 if (r->length1 > 0x00A00000) {
5338 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
5340 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length2));
5341 if (r->length2 > 0x00A00000) {
5342 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
5344 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown1));
5345 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time2));
5346 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown3));
5347 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time4));
5348 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown5));
5349 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time6));
5350 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
5351 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data1));
5352 if (_ptr_data1) {
5353 NDR_PULL_ALLOC(ndr, r->data1);
5354 } else {
5355 r->data1 = NULL;
5357 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data2));
5358 if (_ptr_data2) {
5359 NDR_PULL_ALLOC(ndr, r->data2);
5360 } else {
5361 r->data2 = NULL;
5364 if (ndr_flags & NDR_BUFFERS) {
5365 if (r->data1) {
5366 _mem_save_data1_0 = NDR_PULL_GET_MEM_CTX(ndr);
5367 NDR_PULL_SET_MEM_CTX(ndr, r->data1, 0);
5368 NDR_CHECK(ndr_pull_array_size(ndr, &r->data1));
5369 NDR_PULL_ALLOC_N(ndr, r->data1, ndr_get_array_size(ndr, &r->data1));
5370 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data1, ndr_get_array_size(ndr, &r->data1)));
5371 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data1_0, 0);
5373 if (r->data2) {
5374 _mem_save_data2_0 = NDR_PULL_GET_MEM_CTX(ndr);
5375 NDR_PULL_SET_MEM_CTX(ndr, r->data2, 0);
5376 NDR_CHECK(ndr_pull_array_size(ndr, &r->data2));
5377 NDR_PULL_ALLOC_N(ndr, r->data2, ndr_get_array_size(ndr, &r->data2));
5378 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data2, ndr_get_array_size(ndr, &r->data2)));
5379 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data2_0, 0);
5381 if (r->data1) {
5382 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data1, r->length1));
5384 if (r->data2) {
5385 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data2, r->length2));
5388 return NDR_ERR_SUCCESS;
5391 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r)
5393 ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLogInfo1");
5394 ndr->depth++;
5395 ndr_print_uint32(ndr, "length1", r->length1);
5396 ndr_print_uint32(ndr, "length2", r->length2);
5397 ndr_print_hyper(ndr, "unknown1", r->unknown1);
5398 ndr_print_NTTIME(ndr, "time2", r->time2);
5399 ndr_print_hyper(ndr, "unknown3", r->unknown3);
5400 ndr_print_NTTIME(ndr, "time4", r->time4);
5401 ndr_print_hyper(ndr, "unknown5", r->unknown5);
5402 ndr_print_NTTIME(ndr, "time6", r->time6);
5403 ndr_print_NTSTATUS(ndr, "status", r->status);
5404 ndr_print_ptr(ndr, "data1", r->data1);
5405 ndr->depth++;
5406 if (r->data1) {
5407 ndr_print_array_uint8(ndr, "data1", r->data1, r->length1);
5409 ndr->depth--;
5410 ndr_print_ptr(ndr, "data2", r->data2);
5411 ndr->depth++;
5412 if (r->data2) {
5413 ndr_print_array_uint8(ndr, "data2", r->data2, r->length2);
5415 ndr->depth--;
5416 ndr->depth--;
5419 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNT4ChangeLogInfo *r)
5421 if (ndr_flags & NDR_SCALARS) {
5422 int level = ndr_push_get_switch_value(ndr, r);
5423 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
5424 NDR_CHECK(ndr_push_union_align(ndr, 8));
5425 switch (level) {
5426 case 1: {
5427 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_SCALARS, &r->info1));
5428 break; }
5430 default:
5431 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5434 if (ndr_flags & NDR_BUFFERS) {
5435 int level = ndr_push_get_switch_value(ndr, r);
5436 switch (level) {
5437 case 1:
5438 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_BUFFERS, &r->info1));
5439 break;
5441 default:
5442 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5445 return NDR_ERR_SUCCESS;
5448 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNT4ChangeLogInfo *r)
5450 int level;
5451 uint32_t _level;
5452 level = ndr_pull_get_switch_value(ndr, r);
5453 if (ndr_flags & NDR_SCALARS) {
5454 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
5455 if (_level != level) {
5456 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
5458 NDR_CHECK(ndr_pull_union_align(ndr, 8));
5459 switch (level) {
5460 case 1: {
5461 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_SCALARS, &r->info1));
5462 break; }
5464 default:
5465 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5468 if (ndr_flags & NDR_BUFFERS) {
5469 switch (level) {
5470 case 1:
5471 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_BUFFERS, &r->info1));
5472 break;
5474 default:
5475 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5478 return NDR_ERR_SUCCESS;
5481 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogInfo *r)
5483 int level;
5484 level = ndr_print_get_switch_value(ndr, r);
5485 ndr_print_union(ndr, name, level, "drsuapi_DsGetNT4ChangeLogInfo");
5486 switch (level) {
5487 case 1:
5488 ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(ndr, "info1", &r->info1);
5489 break;
5491 default:
5492 ndr_print_bad_level(ndr, name, level);
5496 static enum ndr_err_code ndr_push_drsuapi_DsNameStatus(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameStatus r)
5498 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
5499 return NDR_ERR_SUCCESS;
5502 static enum ndr_err_code ndr_pull_drsuapi_DsNameStatus(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameStatus *r)
5504 uint32_t v;
5505 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
5506 *r = v;
5507 return NDR_ERR_SUCCESS;
5510 _PUBLIC_ void ndr_print_drsuapi_DsNameStatus(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameStatus r)
5512 const char *val = NULL;
5514 switch (r) {
5515 case DRSUAPI_DS_NAME_STATUS_OK: val = "DRSUAPI_DS_NAME_STATUS_OK"; break;
5516 case DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR: val = "DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR"; break;
5517 case DRSUAPI_DS_NAME_STATUS_NOT_FOUND: val = "DRSUAPI_DS_NAME_STATUS_NOT_FOUND"; break;
5518 case DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE: val = "DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE"; break;
5519 case DRSUAPI_DS_NAME_STATUS_NO_MAPPING: val = "DRSUAPI_DS_NAME_STATUS_NO_MAPPING"; break;
5520 case DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY: val = "DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY"; break;
5521 case DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING: val = "DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING"; break;
5522 case DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL: val = "DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL"; break;
5524 ndr_print_enum(ndr, name, "ENUM", val, r);
5527 static enum ndr_err_code ndr_push_drsuapi_DsNameFlags(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameFlags r)
5529 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
5530 return NDR_ERR_SUCCESS;
5533 static enum ndr_err_code ndr_pull_drsuapi_DsNameFlags(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameFlags *r)
5535 uint32_t v;
5536 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
5537 *r = v;
5538 return NDR_ERR_SUCCESS;
5541 _PUBLIC_ void ndr_print_drsuapi_DsNameFlags(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFlags r)
5543 const char *val = NULL;
5545 switch (r) {
5546 case DRSUAPI_DS_NAME_FLAG_NO_FLAGS: val = "DRSUAPI_DS_NAME_FLAG_NO_FLAGS"; break;
5547 case DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY: val = "DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY"; break;
5548 case DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC: val = "DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC"; break;
5549 case DRSUAPI_DS_NAME_FLAG_GCVERIFY: val = "DRSUAPI_DS_NAME_FLAG_GCVERIFY"; break;
5550 case DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL: val = "DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL"; break;
5552 ndr_print_enum(ndr, name, "ENUM", val, r);
5555 static enum ndr_err_code ndr_push_drsuapi_DsNameFormat(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameFormat r)
5557 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
5558 return NDR_ERR_SUCCESS;
5561 static enum ndr_err_code ndr_pull_drsuapi_DsNameFormat(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameFormat *r)
5563 uint32_t v;
5564 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
5565 *r = v;
5566 return NDR_ERR_SUCCESS;
5569 _PUBLIC_ void ndr_print_drsuapi_DsNameFormat(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFormat r)
5571 const char *val = NULL;
5573 switch (r) {
5574 case DRSUAPI_DS_NAME_FORMAT_UNKNOWN: val = "DRSUAPI_DS_NAME_FORMAT_UNKNOWN"; break;
5575 case DRSUAPI_DS_NAME_FORMAT_FQDN_1779: val = "DRSUAPI_DS_NAME_FORMAT_FQDN_1779"; break;
5576 case DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT: val = "DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT"; break;
5577 case DRSUAPI_DS_NAME_FORMAT_DISPLAY: val = "DRSUAPI_DS_NAME_FORMAT_DISPLAY"; break;
5578 case DRSUAPI_DS_NAME_FORMAT_GUID: val = "DRSUAPI_DS_NAME_FORMAT_GUID"; break;
5579 case DRSUAPI_DS_NAME_FORMAT_CANONICAL: val = "DRSUAPI_DS_NAME_FORMAT_CANONICAL"; break;
5580 case DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL: val = "DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL"; break;
5581 case DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX: val = "DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX"; break;
5582 case DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL: val = "DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL"; break;
5583 case DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY: val = "DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY"; break;
5584 case DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN: val = "DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN"; break;
5586 ndr_print_enum(ndr, name, "ENUM", val, r);
5589 static enum ndr_err_code ndr_push_drsuapi_DsNameString(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameString *r)
5591 if (ndr_flags & NDR_SCALARS) {
5592 NDR_CHECK(ndr_push_align(ndr, 5));
5593 NDR_CHECK(ndr_push_unique_ptr(ndr, r->str));
5595 if (ndr_flags & NDR_BUFFERS) {
5596 if (r->str) {
5597 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->str, CH_UTF16)));
5598 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5599 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->str, CH_UTF16)));
5600 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->str, ndr_charset_length(r->str, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5603 return NDR_ERR_SUCCESS;
5606 static enum ndr_err_code ndr_pull_drsuapi_DsNameString(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameString *r)
5608 uint32_t _ptr_str;
5609 TALLOC_CTX *_mem_save_str_0;
5610 if (ndr_flags & NDR_SCALARS) {
5611 NDR_CHECK(ndr_pull_align(ndr, 5));
5612 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_str));
5613 if (_ptr_str) {
5614 NDR_PULL_ALLOC(ndr, r->str);
5615 } else {
5616 r->str = NULL;
5619 if (ndr_flags & NDR_BUFFERS) {
5620 if (r->str) {
5621 _mem_save_str_0 = NDR_PULL_GET_MEM_CTX(ndr);
5622 NDR_PULL_SET_MEM_CTX(ndr, r->str, 0);
5623 NDR_CHECK(ndr_pull_array_size(ndr, &r->str));
5624 NDR_CHECK(ndr_pull_array_length(ndr, &r->str));
5625 if (ndr_get_array_length(ndr, &r->str) > ndr_get_array_size(ndr, &r->str)) {
5626 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->str), ndr_get_array_length(ndr, &r->str));
5628 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->str), sizeof(uint16_t)));
5629 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->str, ndr_get_array_length(ndr, &r->str), sizeof(uint16_t), CH_UTF16));
5630 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_str_0, 0);
5633 return NDR_ERR_SUCCESS;
5636 _PUBLIC_ void ndr_print_drsuapi_DsNameString(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameString *r)
5638 ndr_print_struct(ndr, name, "drsuapi_DsNameString");
5639 ndr->depth++;
5640 ndr_print_ptr(ndr, "str", r->str);
5641 ndr->depth++;
5642 if (r->str) {
5643 ndr_print_string(ndr, "str", r->str);
5645 ndr->depth--;
5646 ndr->depth--;
5649 static enum ndr_err_code ndr_push_drsuapi_DsNameRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameRequest1 *r)
5651 uint32_t cntr_names_1;
5652 if (ndr_flags & NDR_SCALARS) {
5653 NDR_CHECK(ndr_push_align(ndr, 5));
5654 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->codepage));
5655 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->language));
5656 NDR_CHECK(ndr_push_drsuapi_DsNameFlags(ndr, NDR_SCALARS, r->format_flags));
5657 NDR_CHECK(ndr_push_drsuapi_DsNameFormat(ndr, NDR_SCALARS, r->format_offered));
5658 NDR_CHECK(ndr_push_drsuapi_DsNameFormat(ndr, NDR_SCALARS, r->format_desired));
5659 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
5660 NDR_CHECK(ndr_push_unique_ptr(ndr, r->names));
5662 if (ndr_flags & NDR_BUFFERS) {
5663 if (r->names) {
5664 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
5665 for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
5666 NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->names[cntr_names_1]));
5668 for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
5669 NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->names[cntr_names_1]));
5673 return NDR_ERR_SUCCESS;
5676 static enum ndr_err_code ndr_pull_drsuapi_DsNameRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameRequest1 *r)
5678 uint32_t _ptr_names;
5679 uint32_t cntr_names_1;
5680 TALLOC_CTX *_mem_save_names_0;
5681 TALLOC_CTX *_mem_save_names_1;
5682 if (ndr_flags & NDR_SCALARS) {
5683 NDR_CHECK(ndr_pull_align(ndr, 5));
5684 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->codepage));
5685 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->language));
5686 NDR_CHECK(ndr_pull_drsuapi_DsNameFlags(ndr, NDR_SCALARS, &r->format_flags));
5687 NDR_CHECK(ndr_pull_drsuapi_DsNameFormat(ndr, NDR_SCALARS, &r->format_offered));
5688 NDR_CHECK(ndr_pull_drsuapi_DsNameFormat(ndr, NDR_SCALARS, &r->format_desired));
5689 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
5690 if (r->count < 1 || r->count > 10000) {
5691 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
5693 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names));
5694 if (_ptr_names) {
5695 NDR_PULL_ALLOC(ndr, r->names);
5696 } else {
5697 r->names = NULL;
5700 if (ndr_flags & NDR_BUFFERS) {
5701 if (r->names) {
5702 _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
5703 NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
5704 NDR_CHECK(ndr_pull_array_size(ndr, &r->names));
5705 NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names));
5706 _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
5707 NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
5708 for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
5709 NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->names[cntr_names_1]));
5711 for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
5712 NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->names[cntr_names_1]));
5714 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0);
5715 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0);
5717 if (r->names) {
5718 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count));
5721 return NDR_ERR_SUCCESS;
5724 _PUBLIC_ void ndr_print_drsuapi_DsNameRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameRequest1 *r)
5726 uint32_t cntr_names_1;
5727 ndr_print_struct(ndr, name, "drsuapi_DsNameRequest1");
5728 ndr->depth++;
5729 ndr_print_uint32(ndr, "codepage", r->codepage);
5730 ndr_print_uint32(ndr, "language", r->language);
5731 ndr_print_drsuapi_DsNameFlags(ndr, "format_flags", r->format_flags);
5732 ndr_print_drsuapi_DsNameFormat(ndr, "format_offered", r->format_offered);
5733 ndr_print_drsuapi_DsNameFormat(ndr, "format_desired", r->format_desired);
5734 ndr_print_uint32(ndr, "count", r->count);
5735 ndr_print_ptr(ndr, "names", r->names);
5736 ndr->depth++;
5737 if (r->names) {
5738 ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count);
5739 ndr->depth++;
5740 for (cntr_names_1=0;cntr_names_1<r->count;cntr_names_1++) {
5741 char *idx_1=NULL;
5742 if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) {
5743 ndr_print_drsuapi_DsNameString(ndr, "names", &r->names[cntr_names_1]);
5744 free(idx_1);
5747 ndr->depth--;
5749 ndr->depth--;
5750 ndr->depth--;
5753 static enum ndr_err_code ndr_push_drsuapi_DsNameRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsNameRequest *r)
5755 if (ndr_flags & NDR_SCALARS) {
5756 int level = ndr_push_get_switch_value(ndr, r);
5757 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
5758 NDR_CHECK(ndr_push_union_align(ndr, 5));
5759 switch (level) {
5760 case 1: {
5761 NDR_CHECK(ndr_push_drsuapi_DsNameRequest1(ndr, NDR_SCALARS, &r->req1));
5762 break; }
5764 default:
5765 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5768 if (ndr_flags & NDR_BUFFERS) {
5769 int level = ndr_push_get_switch_value(ndr, r);
5770 switch (level) {
5771 case 1:
5772 NDR_CHECK(ndr_push_drsuapi_DsNameRequest1(ndr, NDR_BUFFERS, &r->req1));
5773 break;
5775 default:
5776 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5779 return NDR_ERR_SUCCESS;
5782 static enum ndr_err_code ndr_pull_drsuapi_DsNameRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsNameRequest *r)
5784 int level;
5785 int32_t _level;
5786 level = ndr_pull_get_switch_value(ndr, r);
5787 if (ndr_flags & NDR_SCALARS) {
5788 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
5789 if (_level != level) {
5790 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
5792 NDR_CHECK(ndr_pull_union_align(ndr, 5));
5793 switch (level) {
5794 case 1: {
5795 NDR_CHECK(ndr_pull_drsuapi_DsNameRequest1(ndr, NDR_SCALARS, &r->req1));
5796 break; }
5798 default:
5799 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5802 if (ndr_flags & NDR_BUFFERS) {
5803 switch (level) {
5804 case 1:
5805 NDR_CHECK(ndr_pull_drsuapi_DsNameRequest1(ndr, NDR_BUFFERS, &r->req1));
5806 break;
5808 default:
5809 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
5812 return NDR_ERR_SUCCESS;
5815 _PUBLIC_ void ndr_print_drsuapi_DsNameRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameRequest *r)
5817 int level;
5818 level = ndr_print_get_switch_value(ndr, r);
5819 ndr_print_union(ndr, name, level, "drsuapi_DsNameRequest");
5820 switch (level) {
5821 case 1:
5822 ndr_print_drsuapi_DsNameRequest1(ndr, "req1", &r->req1);
5823 break;
5825 default:
5826 ndr_print_bad_level(ndr, name, level);
5830 static enum ndr_err_code ndr_push_drsuapi_DsNameInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameInfo1 *r)
5832 if (ndr_flags & NDR_SCALARS) {
5833 NDR_CHECK(ndr_push_align(ndr, 5));
5834 NDR_CHECK(ndr_push_drsuapi_DsNameStatus(ndr, NDR_SCALARS, r->status));
5835 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_domain_name));
5836 NDR_CHECK(ndr_push_unique_ptr(ndr, r->result_name));
5838 if (ndr_flags & NDR_BUFFERS) {
5839 if (r->dns_domain_name) {
5840 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain_name, CH_UTF16)));
5841 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5842 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain_name, CH_UTF16)));
5843 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_domain_name, ndr_charset_length(r->dns_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5845 if (r->result_name) {
5846 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->result_name, CH_UTF16)));
5847 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5848 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->result_name, CH_UTF16)));
5849 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->result_name, ndr_charset_length(r->result_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5852 return NDR_ERR_SUCCESS;
5855 static enum ndr_err_code ndr_pull_drsuapi_DsNameInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameInfo1 *r)
5857 uint32_t _ptr_dns_domain_name;
5858 TALLOC_CTX *_mem_save_dns_domain_name_0;
5859 uint32_t _ptr_result_name;
5860 TALLOC_CTX *_mem_save_result_name_0;
5861 if (ndr_flags & NDR_SCALARS) {
5862 NDR_CHECK(ndr_pull_align(ndr, 5));
5863 NDR_CHECK(ndr_pull_drsuapi_DsNameStatus(ndr, NDR_SCALARS, &r->status));
5864 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_domain_name));
5865 if (_ptr_dns_domain_name) {
5866 NDR_PULL_ALLOC(ndr, r->dns_domain_name);
5867 } else {
5868 r->dns_domain_name = NULL;
5870 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_result_name));
5871 if (_ptr_result_name) {
5872 NDR_PULL_ALLOC(ndr, r->result_name);
5873 } else {
5874 r->result_name = NULL;
5877 if (ndr_flags & NDR_BUFFERS) {
5878 if (r->dns_domain_name) {
5879 _mem_save_dns_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5880 NDR_PULL_SET_MEM_CTX(ndr, r->dns_domain_name, 0);
5881 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_domain_name));
5882 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_domain_name));
5883 if (ndr_get_array_length(ndr, &r->dns_domain_name) > ndr_get_array_size(ndr, &r->dns_domain_name)) {
5884 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_domain_name), ndr_get_array_length(ndr, &r->dns_domain_name));
5886 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_domain_name), sizeof(uint16_t)));
5887 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_domain_name, ndr_get_array_length(ndr, &r->dns_domain_name), sizeof(uint16_t), CH_UTF16));
5888 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_domain_name_0, 0);
5890 if (r->result_name) {
5891 _mem_save_result_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5892 NDR_PULL_SET_MEM_CTX(ndr, r->result_name, 0);
5893 NDR_CHECK(ndr_pull_array_size(ndr, &r->result_name));
5894 NDR_CHECK(ndr_pull_array_length(ndr, &r->result_name));
5895 if (ndr_get_array_length(ndr, &r->result_name) > ndr_get_array_size(ndr, &r->result_name)) {
5896 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->result_name), ndr_get_array_length(ndr, &r->result_name));
5898 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->result_name), sizeof(uint16_t)));
5899 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->result_name, ndr_get_array_length(ndr, &r->result_name), sizeof(uint16_t), CH_UTF16));
5900 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_result_name_0, 0);
5903 return NDR_ERR_SUCCESS;
5906 _PUBLIC_ void ndr_print_drsuapi_DsNameInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameInfo1 *r)
5908 ndr_print_struct(ndr, name, "drsuapi_DsNameInfo1");
5909 ndr->depth++;
5910 ndr_print_drsuapi_DsNameStatus(ndr, "status", r->status);
5911 ndr_print_ptr(ndr, "dns_domain_name", r->dns_domain_name);
5912 ndr->depth++;
5913 if (r->dns_domain_name) {
5914 ndr_print_string(ndr, "dns_domain_name", r->dns_domain_name);
5916 ndr->depth--;
5917 ndr_print_ptr(ndr, "result_name", r->result_name);
5918 ndr->depth++;
5919 if (r->result_name) {
5920 ndr_print_string(ndr, "result_name", r->result_name);
5922 ndr->depth--;
5923 ndr->depth--;
5926 static enum ndr_err_code ndr_push_drsuapi_DsNameCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameCtr1 *r)
5928 uint32_t cntr_array_1;
5929 if (ndr_flags & NDR_SCALARS) {
5930 NDR_CHECK(ndr_push_align(ndr, 5));
5931 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
5932 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
5934 if (ndr_flags & NDR_BUFFERS) {
5935 if (r->array) {
5936 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
5937 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
5938 NDR_CHECK(ndr_push_drsuapi_DsNameInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
5940 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
5941 NDR_CHECK(ndr_push_drsuapi_DsNameInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
5945 return NDR_ERR_SUCCESS;
5948 static enum ndr_err_code ndr_pull_drsuapi_DsNameCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameCtr1 *r)
5950 uint32_t _ptr_array;
5951 uint32_t cntr_array_1;
5952 TALLOC_CTX *_mem_save_array_0;
5953 TALLOC_CTX *_mem_save_array_1;
5954 if (ndr_flags & NDR_SCALARS) {
5955 NDR_CHECK(ndr_pull_align(ndr, 5));
5956 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
5957 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
5958 if (_ptr_array) {
5959 NDR_PULL_ALLOC(ndr, r->array);
5960 } else {
5961 r->array = NULL;
5964 if (ndr_flags & NDR_BUFFERS) {
5965 if (r->array) {
5966 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
5967 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
5968 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
5969 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
5970 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
5971 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
5972 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
5973 NDR_CHECK(ndr_pull_drsuapi_DsNameInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
5975 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
5976 NDR_CHECK(ndr_pull_drsuapi_DsNameInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
5978 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
5979 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
5981 if (r->array) {
5982 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
5985 return NDR_ERR_SUCCESS;
5988 _PUBLIC_ void ndr_print_drsuapi_DsNameCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameCtr1 *r)
5990 uint32_t cntr_array_1;
5991 ndr_print_struct(ndr, name, "drsuapi_DsNameCtr1");
5992 ndr->depth++;
5993 ndr_print_uint32(ndr, "count", r->count);
5994 ndr_print_ptr(ndr, "array", r->array);
5995 ndr->depth++;
5996 if (r->array) {
5997 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
5998 ndr->depth++;
5999 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
6000 char *idx_1=NULL;
6001 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
6002 ndr_print_drsuapi_DsNameInfo1(ndr, "array", &r->array[cntr_array_1]);
6003 free(idx_1);
6006 ndr->depth--;
6008 ndr->depth--;
6009 ndr->depth--;
6012 static enum ndr_err_code ndr_push_drsuapi_DsNameCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsNameCtr *r)
6014 if (ndr_flags & NDR_SCALARS) {
6015 int level = ndr_push_get_switch_value(ndr, r);
6016 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
6017 NDR_CHECK(ndr_push_union_align(ndr, 5));
6018 switch (level) {
6019 case 1: {
6020 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1));
6021 break; }
6023 default:
6024 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6027 if (ndr_flags & NDR_BUFFERS) {
6028 int level = ndr_push_get_switch_value(ndr, r);
6029 switch (level) {
6030 case 1:
6031 if (r->ctr1) {
6032 NDR_CHECK(ndr_push_drsuapi_DsNameCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
6034 break;
6036 default:
6037 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6040 return NDR_ERR_SUCCESS;
6043 static enum ndr_err_code ndr_pull_drsuapi_DsNameCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsNameCtr *r)
6045 int level;
6046 int32_t _level;
6047 TALLOC_CTX *_mem_save_ctr1_0;
6048 level = ndr_pull_get_switch_value(ndr, r);
6049 if (ndr_flags & NDR_SCALARS) {
6050 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
6051 if (_level != level) {
6052 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6054 NDR_CHECK(ndr_pull_union_align(ndr, 5));
6055 switch (level) {
6056 case 1: {
6057 uint32_t _ptr_ctr1;
6058 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1));
6059 if (_ptr_ctr1) {
6060 NDR_PULL_ALLOC(ndr, r->ctr1);
6061 } else {
6062 r->ctr1 = NULL;
6064 break; }
6066 default:
6067 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6070 if (ndr_flags & NDR_BUFFERS) {
6071 switch (level) {
6072 case 1:
6073 if (r->ctr1) {
6074 _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr);
6075 NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0);
6076 NDR_CHECK(ndr_pull_drsuapi_DsNameCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
6077 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0);
6079 break;
6081 default:
6082 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6085 return NDR_ERR_SUCCESS;
6088 _PUBLIC_ void ndr_print_drsuapi_DsNameCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameCtr *r)
6090 int level;
6091 level = ndr_print_get_switch_value(ndr, r);
6092 ndr_print_union(ndr, name, level, "drsuapi_DsNameCtr");
6093 switch (level) {
6094 case 1:
6095 ndr_print_ptr(ndr, "ctr1", r->ctr1);
6096 ndr->depth++;
6097 if (r->ctr1) {
6098 ndr_print_drsuapi_DsNameCtr1(ndr, "ctr1", r->ctr1);
6100 ndr->depth--;
6101 break;
6103 default:
6104 ndr_print_bad_level(ndr, name, level);
6108 static enum ndr_err_code ndr_push_drsuapi_DsSpnOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsSpnOperation r)
6110 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
6111 return NDR_ERR_SUCCESS;
6114 static enum ndr_err_code ndr_pull_drsuapi_DsSpnOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsSpnOperation *r)
6116 uint32_t v;
6117 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
6118 *r = v;
6119 return NDR_ERR_SUCCESS;
6122 _PUBLIC_ void ndr_print_drsuapi_DsSpnOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsSpnOperation r)
6124 const char *val = NULL;
6126 switch (r) {
6127 case DRSUAPI_DS_SPN_OPERATION_ADD: val = "DRSUAPI_DS_SPN_OPERATION_ADD"; break;
6128 case DRSUAPI_DS_SPN_OPERATION_REPLACE: val = "DRSUAPI_DS_SPN_OPERATION_REPLACE"; break;
6129 case DRSUAPI_DS_SPN_OPERATION_DELETE: val = "DRSUAPI_DS_SPN_OPERATION_DELETE"; break;
6131 ndr_print_enum(ndr, name, "ENUM", val, r);
6134 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsWriteAccountSpnRequest1 *r)
6136 uint32_t cntr_spn_names_1;
6137 if (ndr_flags & NDR_SCALARS) {
6138 NDR_CHECK(ndr_push_align(ndr, 5));
6139 NDR_CHECK(ndr_push_drsuapi_DsSpnOperation(ndr, NDR_SCALARS, r->operation));
6140 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
6141 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
6142 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
6143 NDR_CHECK(ndr_push_unique_ptr(ndr, r->spn_names));
6145 if (ndr_flags & NDR_BUFFERS) {
6146 if (r->object_dn) {
6147 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
6148 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6149 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
6150 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6152 if (r->spn_names) {
6153 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
6154 for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) {
6155 NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->spn_names[cntr_spn_names_1]));
6157 for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) {
6158 NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->spn_names[cntr_spn_names_1]));
6162 return NDR_ERR_SUCCESS;
6165 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsWriteAccountSpnRequest1 *r)
6167 uint32_t _ptr_object_dn;
6168 TALLOC_CTX *_mem_save_object_dn_0;
6169 uint32_t _ptr_spn_names;
6170 uint32_t cntr_spn_names_1;
6171 TALLOC_CTX *_mem_save_spn_names_0;
6172 TALLOC_CTX *_mem_save_spn_names_1;
6173 if (ndr_flags & NDR_SCALARS) {
6174 NDR_CHECK(ndr_pull_align(ndr, 5));
6175 NDR_CHECK(ndr_pull_drsuapi_DsSpnOperation(ndr, NDR_SCALARS, &r->operation));
6176 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
6177 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
6178 if (_ptr_object_dn) {
6179 NDR_PULL_ALLOC(ndr, r->object_dn);
6180 } else {
6181 r->object_dn = NULL;
6183 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
6184 if (r->count > 10000) {
6185 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6187 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_spn_names));
6188 if (_ptr_spn_names) {
6189 NDR_PULL_ALLOC(ndr, r->spn_names);
6190 } else {
6191 r->spn_names = NULL;
6194 if (ndr_flags & NDR_BUFFERS) {
6195 if (r->object_dn) {
6196 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6197 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
6198 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
6199 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
6200 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
6201 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn));
6203 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
6204 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
6205 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
6207 if (r->spn_names) {
6208 _mem_save_spn_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
6209 NDR_PULL_SET_MEM_CTX(ndr, r->spn_names, 0);
6210 NDR_CHECK(ndr_pull_array_size(ndr, &r->spn_names));
6211 NDR_PULL_ALLOC_N(ndr, r->spn_names, ndr_get_array_size(ndr, &r->spn_names));
6212 _mem_save_spn_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
6213 NDR_PULL_SET_MEM_CTX(ndr, r->spn_names, 0);
6214 for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) {
6215 NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->spn_names[cntr_spn_names_1]));
6217 for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) {
6218 NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->spn_names[cntr_spn_names_1]));
6220 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_spn_names_1, 0);
6221 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_spn_names_0, 0);
6223 if (r->spn_names) {
6224 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->spn_names, r->count));
6227 return NDR_ERR_SUCCESS;
6230 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnRequest1 *r)
6232 uint32_t cntr_spn_names_1;
6233 ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpnRequest1");
6234 ndr->depth++;
6235 ndr_print_drsuapi_DsSpnOperation(ndr, "operation", r->operation);
6236 ndr_print_uint32(ndr, "unknown1", r->unknown1);
6237 ndr_print_ptr(ndr, "object_dn", r->object_dn);
6238 ndr->depth++;
6239 if (r->object_dn) {
6240 ndr_print_string(ndr, "object_dn", r->object_dn);
6242 ndr->depth--;
6243 ndr_print_uint32(ndr, "count", r->count);
6244 ndr_print_ptr(ndr, "spn_names", r->spn_names);
6245 ndr->depth++;
6246 if (r->spn_names) {
6247 ndr->print(ndr, "%s: ARRAY(%d)", "spn_names", (int)r->count);
6248 ndr->depth++;
6249 for (cntr_spn_names_1=0;cntr_spn_names_1<r->count;cntr_spn_names_1++) {
6250 char *idx_1=NULL;
6251 if (asprintf(&idx_1, "[%d]", cntr_spn_names_1) != -1) {
6252 ndr_print_drsuapi_DsNameString(ndr, "spn_names", &r->spn_names[cntr_spn_names_1]);
6253 free(idx_1);
6256 ndr->depth--;
6258 ndr->depth--;
6259 ndr->depth--;
6262 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsWriteAccountSpnRequest *r)
6264 if (ndr_flags & NDR_SCALARS) {
6265 int level = ndr_push_get_switch_value(ndr, r);
6266 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
6267 NDR_CHECK(ndr_push_union_align(ndr, 5));
6268 switch (level) {
6269 case 1: {
6270 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_SCALARS, &r->req1));
6271 break; }
6273 default:
6274 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6277 if (ndr_flags & NDR_BUFFERS) {
6278 int level = ndr_push_get_switch_value(ndr, r);
6279 switch (level) {
6280 case 1:
6281 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_BUFFERS, &r->req1));
6282 break;
6284 default:
6285 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6288 return NDR_ERR_SUCCESS;
6291 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsWriteAccountSpnRequest *r)
6293 int level;
6294 int32_t _level;
6295 level = ndr_pull_get_switch_value(ndr, r);
6296 if (ndr_flags & NDR_SCALARS) {
6297 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
6298 if (_level != level) {
6299 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6301 NDR_CHECK(ndr_pull_union_align(ndr, 5));
6302 switch (level) {
6303 case 1: {
6304 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_SCALARS, &r->req1));
6305 break; }
6307 default:
6308 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6311 if (ndr_flags & NDR_BUFFERS) {
6312 switch (level) {
6313 case 1:
6314 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_BUFFERS, &r->req1));
6315 break;
6317 default:
6318 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6321 return NDR_ERR_SUCCESS;
6324 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnRequest *r)
6326 int level;
6327 level = ndr_print_get_switch_value(ndr, r);
6328 ndr_print_union(ndr, name, level, "drsuapi_DsWriteAccountSpnRequest");
6329 switch (level) {
6330 case 1:
6331 ndr_print_drsuapi_DsWriteAccountSpnRequest1(ndr, "req1", &r->req1);
6332 break;
6334 default:
6335 ndr_print_bad_level(ndr, name, level);
6339 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnResult1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsWriteAccountSpnResult1 *r)
6341 if (ndr_flags & NDR_SCALARS) {
6342 NDR_CHECK(ndr_push_align(ndr, 4));
6343 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
6345 if (ndr_flags & NDR_BUFFERS) {
6347 return NDR_ERR_SUCCESS;
6350 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnResult1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsWriteAccountSpnResult1 *r)
6352 if (ndr_flags & NDR_SCALARS) {
6353 NDR_CHECK(ndr_pull_align(ndr, 4));
6354 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
6356 if (ndr_flags & NDR_BUFFERS) {
6358 return NDR_ERR_SUCCESS;
6361 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnResult1 *r)
6363 ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpnResult1");
6364 ndr->depth++;
6365 ndr_print_WERROR(ndr, "status", r->status);
6366 ndr->depth--;
6369 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnResult(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsWriteAccountSpnResult *r)
6371 if (ndr_flags & NDR_SCALARS) {
6372 int level = ndr_push_get_switch_value(ndr, r);
6373 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
6374 NDR_CHECK(ndr_push_union_align(ndr, 4));
6375 switch (level) {
6376 case 1: {
6377 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnResult1(ndr, NDR_SCALARS, &r->res1));
6378 break; }
6380 default:
6381 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6384 if (ndr_flags & NDR_BUFFERS) {
6385 int level = ndr_push_get_switch_value(ndr, r);
6386 switch (level) {
6387 case 1:
6388 break;
6390 default:
6391 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6394 return NDR_ERR_SUCCESS;
6397 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnResult(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsWriteAccountSpnResult *r)
6399 int level;
6400 int32_t _level;
6401 level = ndr_pull_get_switch_value(ndr, r);
6402 if (ndr_flags & NDR_SCALARS) {
6403 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
6404 if (_level != level) {
6405 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6407 NDR_CHECK(ndr_pull_union_align(ndr, 4));
6408 switch (level) {
6409 case 1: {
6410 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnResult1(ndr, NDR_SCALARS, &r->res1));
6411 break; }
6413 default:
6414 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6417 if (ndr_flags & NDR_BUFFERS) {
6418 switch (level) {
6419 case 1:
6420 break;
6422 default:
6423 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6426 return NDR_ERR_SUCCESS;
6429 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnResult *r)
6431 int level;
6432 level = ndr_print_get_switch_value(ndr, r);
6433 ndr_print_union(ndr, name, level, "drsuapi_DsWriteAccountSpnResult");
6434 switch (level) {
6435 case 1:
6436 ndr_print_drsuapi_DsWriteAccountSpnResult1(ndr, "res1", &r->res1);
6437 break;
6439 default:
6440 ndr_print_bad_level(ndr, name, level);
6444 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsRemoveDSServerRequest1 *r)
6446 if (ndr_flags & NDR_SCALARS) {
6447 NDR_CHECK(ndr_push_align(ndr, 5));
6448 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn));
6449 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_dn));
6450 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->commit));
6452 if (ndr_flags & NDR_BUFFERS) {
6453 if (r->server_dn) {
6454 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6455 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6456 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6457 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6459 if (r->domain_dn) {
6460 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain_dn, CH_UTF16)));
6461 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6462 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain_dn, CH_UTF16)));
6463 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_dn, ndr_charset_length(r->domain_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6466 return NDR_ERR_SUCCESS;
6469 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsRemoveDSServerRequest1 *r)
6471 uint32_t _ptr_server_dn;
6472 TALLOC_CTX *_mem_save_server_dn_0;
6473 uint32_t _ptr_domain_dn;
6474 TALLOC_CTX *_mem_save_domain_dn_0;
6475 if (ndr_flags & NDR_SCALARS) {
6476 NDR_CHECK(ndr_pull_align(ndr, 5));
6477 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn));
6478 if (_ptr_server_dn) {
6479 NDR_PULL_ALLOC(ndr, r->server_dn);
6480 } else {
6481 r->server_dn = NULL;
6483 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_dn));
6484 if (_ptr_domain_dn) {
6485 NDR_PULL_ALLOC(ndr, r->domain_dn);
6486 } else {
6487 r->domain_dn = NULL;
6489 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->commit));
6491 if (ndr_flags & NDR_BUFFERS) {
6492 if (r->server_dn) {
6493 _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6494 NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0);
6495 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn));
6496 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn));
6497 if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) {
6498 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn));
6500 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t)));
6501 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16));
6502 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0);
6504 if (r->domain_dn) {
6505 _mem_save_domain_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6506 NDR_PULL_SET_MEM_CTX(ndr, r->domain_dn, 0);
6507 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_dn));
6508 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_dn));
6509 if (ndr_get_array_length(ndr, &r->domain_dn) > ndr_get_array_size(ndr, &r->domain_dn)) {
6510 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_dn), ndr_get_array_length(ndr, &r->domain_dn));
6512 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_dn), sizeof(uint16_t)));
6513 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_dn, ndr_get_array_length(ndr, &r->domain_dn), sizeof(uint16_t), CH_UTF16));
6514 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_dn_0, 0);
6517 return NDR_ERR_SUCCESS;
6520 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerRequest1 *r)
6522 ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServerRequest1");
6523 ndr->depth++;
6524 ndr_print_ptr(ndr, "server_dn", r->server_dn);
6525 ndr->depth++;
6526 if (r->server_dn) {
6527 ndr_print_string(ndr, "server_dn", r->server_dn);
6529 ndr->depth--;
6530 ndr_print_ptr(ndr, "domain_dn", r->domain_dn);
6531 ndr->depth++;
6532 if (r->domain_dn) {
6533 ndr_print_string(ndr, "domain_dn", r->domain_dn);
6535 ndr->depth--;
6536 ndr_print_uint32(ndr, "commit", r->commit);
6537 ndr->depth--;
6540 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRemoveDSServerRequest *r)
6542 if (ndr_flags & NDR_SCALARS) {
6543 int level = ndr_push_get_switch_value(ndr, r);
6544 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
6545 NDR_CHECK(ndr_push_union_align(ndr, 5));
6546 switch (level) {
6547 case 1: {
6548 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_SCALARS, &r->req1));
6549 break; }
6551 default:
6552 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6555 if (ndr_flags & NDR_BUFFERS) {
6556 int level = ndr_push_get_switch_value(ndr, r);
6557 switch (level) {
6558 case 1:
6559 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_BUFFERS, &r->req1));
6560 break;
6562 default:
6563 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6566 return NDR_ERR_SUCCESS;
6569 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRemoveDSServerRequest *r)
6571 int level;
6572 int32_t _level;
6573 level = ndr_pull_get_switch_value(ndr, r);
6574 if (ndr_flags & NDR_SCALARS) {
6575 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
6576 if (_level != level) {
6577 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6579 NDR_CHECK(ndr_pull_union_align(ndr, 5));
6580 switch (level) {
6581 case 1: {
6582 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_SCALARS, &r->req1));
6583 break; }
6585 default:
6586 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6589 if (ndr_flags & NDR_BUFFERS) {
6590 switch (level) {
6591 case 1:
6592 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_BUFFERS, &r->req1));
6593 break;
6595 default:
6596 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6599 return NDR_ERR_SUCCESS;
6602 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerRequest *r)
6604 int level;
6605 level = ndr_print_get_switch_value(ndr, r);
6606 ndr_print_union(ndr, name, level, "drsuapi_DsRemoveDSServerRequest");
6607 switch (level) {
6608 case 1:
6609 ndr_print_drsuapi_DsRemoveDSServerRequest1(ndr, "req1", &r->req1);
6610 break;
6612 default:
6613 ndr_print_bad_level(ndr, name, level);
6617 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerResult1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsRemoveDSServerResult1 *r)
6619 if (ndr_flags & NDR_SCALARS) {
6620 NDR_CHECK(ndr_push_align(ndr, 4));
6621 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->last_dc_in_domain));
6623 if (ndr_flags & NDR_BUFFERS) {
6625 return NDR_ERR_SUCCESS;
6628 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerResult1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsRemoveDSServerResult1 *r)
6630 if (ndr_flags & NDR_SCALARS) {
6631 NDR_CHECK(ndr_pull_align(ndr, 4));
6632 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->last_dc_in_domain));
6634 if (ndr_flags & NDR_BUFFERS) {
6636 return NDR_ERR_SUCCESS;
6639 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerResult1 *r)
6641 ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServerResult1");
6642 ndr->depth++;
6643 ndr_print_uint32(ndr, "last_dc_in_domain", r->last_dc_in_domain);
6644 ndr->depth--;
6647 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerResult(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRemoveDSServerResult *r)
6649 if (ndr_flags & NDR_SCALARS) {
6650 int level = ndr_push_get_switch_value(ndr, r);
6651 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
6652 NDR_CHECK(ndr_push_union_align(ndr, 4));
6653 switch (level) {
6654 case 1: {
6655 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerResult1(ndr, NDR_SCALARS, &r->res1));
6656 break; }
6658 default:
6659 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6662 if (ndr_flags & NDR_BUFFERS) {
6663 int level = ndr_push_get_switch_value(ndr, r);
6664 switch (level) {
6665 case 1:
6666 break;
6668 default:
6669 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6672 return NDR_ERR_SUCCESS;
6675 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerResult(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRemoveDSServerResult *r)
6677 int level;
6678 int32_t _level;
6679 level = ndr_pull_get_switch_value(ndr, r);
6680 if (ndr_flags & NDR_SCALARS) {
6681 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
6682 if (_level != level) {
6683 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6685 NDR_CHECK(ndr_pull_union_align(ndr, 4));
6686 switch (level) {
6687 case 1: {
6688 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerResult1(ndr, NDR_SCALARS, &r->res1));
6689 break; }
6691 default:
6692 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6695 if (ndr_flags & NDR_BUFFERS) {
6696 switch (level) {
6697 case 1:
6698 break;
6700 default:
6701 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6704 return NDR_ERR_SUCCESS;
6707 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerResult *r)
6709 int level;
6710 level = ndr_print_get_switch_value(ndr, r);
6711 ndr_print_union(ndr, name, level, "drsuapi_DsRemoveDSServerResult");
6712 switch (level) {
6713 case 1:
6714 ndr_print_drsuapi_DsRemoveDSServerResult1(ndr, "res1", &r->res1);
6715 break;
6717 default:
6718 ndr_print_bad_level(ndr, name, level);
6722 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoRequest1 *r)
6724 if (ndr_flags & NDR_SCALARS) {
6725 NDR_CHECK(ndr_push_align(ndr, 5));
6726 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name));
6727 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->level));
6729 if (ndr_flags & NDR_BUFFERS) {
6730 if (r->domain_name) {
6731 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF16)));
6732 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6733 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF16)));
6734 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6737 return NDR_ERR_SUCCESS;
6740 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoRequest1 *r)
6742 uint32_t _ptr_domain_name;
6743 TALLOC_CTX *_mem_save_domain_name_0;
6744 if (ndr_flags & NDR_SCALARS) {
6745 NDR_CHECK(ndr_pull_align(ndr, 5));
6746 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
6747 if (_ptr_domain_name) {
6748 NDR_PULL_ALLOC(ndr, r->domain_name);
6749 } else {
6750 r->domain_name = NULL;
6752 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->level));
6754 if (ndr_flags & NDR_BUFFERS) {
6755 if (r->domain_name) {
6756 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6757 NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0);
6758 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name));
6759 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name));
6760 if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) {
6761 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name));
6763 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t)));
6764 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16));
6765 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
6768 return NDR_ERR_SUCCESS;
6771 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoRequest1 *r)
6773 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoRequest1");
6774 ndr->depth++;
6775 ndr_print_ptr(ndr, "domain_name", r->domain_name);
6776 ndr->depth++;
6777 if (r->domain_name) {
6778 ndr_print_string(ndr, "domain_name", r->domain_name);
6780 ndr->depth--;
6781 ndr_print_int32(ndr, "level", r->level);
6782 ndr->depth--;
6785 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetDCInfoRequest *r)
6787 if (ndr_flags & NDR_SCALARS) {
6788 int level = ndr_push_get_switch_value(ndr, r);
6789 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
6790 NDR_CHECK(ndr_push_union_align(ndr, 5));
6791 switch (level) {
6792 case 1: {
6793 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest1(ndr, NDR_SCALARS, &r->req1));
6794 break; }
6796 default:
6797 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6800 if (ndr_flags & NDR_BUFFERS) {
6801 int level = ndr_push_get_switch_value(ndr, r);
6802 switch (level) {
6803 case 1:
6804 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest1(ndr, NDR_BUFFERS, &r->req1));
6805 break;
6807 default:
6808 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6811 return NDR_ERR_SUCCESS;
6814 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetDCInfoRequest *r)
6816 int level;
6817 int32_t _level;
6818 level = ndr_pull_get_switch_value(ndr, r);
6819 if (ndr_flags & NDR_SCALARS) {
6820 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
6821 if (_level != level) {
6822 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
6824 NDR_CHECK(ndr_pull_union_align(ndr, 5));
6825 switch (level) {
6826 case 1: {
6827 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest1(ndr, NDR_SCALARS, &r->req1));
6828 break; }
6830 default:
6831 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6834 if (ndr_flags & NDR_BUFFERS) {
6835 switch (level) {
6836 case 1:
6837 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest1(ndr, NDR_BUFFERS, &r->req1));
6838 break;
6840 default:
6841 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
6844 return NDR_ERR_SUCCESS;
6847 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoRequest *r)
6849 int level;
6850 level = ndr_print_get_switch_value(ndr, r);
6851 ndr_print_union(ndr, name, level, "drsuapi_DsGetDCInfoRequest");
6852 switch (level) {
6853 case 1:
6854 ndr_print_drsuapi_DsGetDCInfoRequest1(ndr, "req1", &r->req1);
6855 break;
6857 default:
6858 ndr_print_bad_level(ndr, name, level);
6862 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo1 *r)
6864 if (ndr_flags & NDR_SCALARS) {
6865 NDR_CHECK(ndr_push_align(ndr, 5));
6866 NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name));
6867 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name));
6868 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name));
6869 NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn));
6870 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn));
6871 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc));
6872 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled));
6874 if (ndr_flags & NDR_BUFFERS) {
6875 if (r->netbios_name) {
6876 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
6877 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6878 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
6879 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6881 if (r->dns_name) {
6882 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
6883 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6884 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
6885 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6887 if (r->site_name) {
6888 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
6889 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6890 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
6891 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6893 if (r->computer_dn) {
6894 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
6895 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6896 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
6897 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6899 if (r->server_dn) {
6900 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6901 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6902 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6903 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6906 return NDR_ERR_SUCCESS;
6909 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo1 *r)
6911 uint32_t _ptr_netbios_name;
6912 TALLOC_CTX *_mem_save_netbios_name_0;
6913 uint32_t _ptr_dns_name;
6914 TALLOC_CTX *_mem_save_dns_name_0;
6915 uint32_t _ptr_site_name;
6916 TALLOC_CTX *_mem_save_site_name_0;
6917 uint32_t _ptr_computer_dn;
6918 TALLOC_CTX *_mem_save_computer_dn_0;
6919 uint32_t _ptr_server_dn;
6920 TALLOC_CTX *_mem_save_server_dn_0;
6921 if (ndr_flags & NDR_SCALARS) {
6922 NDR_CHECK(ndr_pull_align(ndr, 5));
6923 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name));
6924 if (_ptr_netbios_name) {
6925 NDR_PULL_ALLOC(ndr, r->netbios_name);
6926 } else {
6927 r->netbios_name = NULL;
6929 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name));
6930 if (_ptr_dns_name) {
6931 NDR_PULL_ALLOC(ndr, r->dns_name);
6932 } else {
6933 r->dns_name = NULL;
6935 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
6936 if (_ptr_site_name) {
6937 NDR_PULL_ALLOC(ndr, r->site_name);
6938 } else {
6939 r->site_name = NULL;
6941 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn));
6942 if (_ptr_computer_dn) {
6943 NDR_PULL_ALLOC(ndr, r->computer_dn);
6944 } else {
6945 r->computer_dn = NULL;
6947 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn));
6948 if (_ptr_server_dn) {
6949 NDR_PULL_ALLOC(ndr, r->server_dn);
6950 } else {
6951 r->server_dn = NULL;
6953 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc));
6954 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled));
6956 if (ndr_flags & NDR_BUFFERS) {
6957 if (r->netbios_name) {
6958 _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6959 NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0);
6960 NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name));
6961 NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name));
6962 if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) {
6963 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name));
6965 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t)));
6966 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16));
6967 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0);
6969 if (r->dns_name) {
6970 _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6971 NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0);
6972 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name));
6973 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name));
6974 if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) {
6975 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name));
6977 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t)));
6978 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16));
6979 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0);
6981 if (r->site_name) {
6982 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6983 NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0);
6984 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name));
6985 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name));
6986 if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) {
6987 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_name), ndr_get_array_length(ndr, &r->site_name));
6989 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t)));
6990 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16));
6991 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
6993 if (r->computer_dn) {
6994 _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6995 NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0);
6996 NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn));
6997 NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn));
6998 if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) {
6999 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer_dn), ndr_get_array_length(ndr, &r->computer_dn));
7001 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t)));
7002 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16));
7003 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0);
7005 if (r->server_dn) {
7006 _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
7007 NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0);
7008 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn));
7009 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn));
7010 if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) {
7011 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn));
7013 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t)));
7014 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16));
7015 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0);
7018 return NDR_ERR_SUCCESS;
7021 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo1 *r)
7023 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo1");
7024 ndr->depth++;
7025 ndr_print_ptr(ndr, "netbios_name", r->netbios_name);
7026 ndr->depth++;
7027 if (r->netbios_name) {
7028 ndr_print_string(ndr, "netbios_name", r->netbios_name);
7030 ndr->depth--;
7031 ndr_print_ptr(ndr, "dns_name", r->dns_name);
7032 ndr->depth++;
7033 if (r->dns_name) {
7034 ndr_print_string(ndr, "dns_name", r->dns_name);
7036 ndr->depth--;
7037 ndr_print_ptr(ndr, "site_name", r->site_name);
7038 ndr->depth++;
7039 if (r->site_name) {
7040 ndr_print_string(ndr, "site_name", r->site_name);
7042 ndr->depth--;
7043 ndr_print_ptr(ndr, "computer_dn", r->computer_dn);
7044 ndr->depth++;
7045 if (r->computer_dn) {
7046 ndr_print_string(ndr, "computer_dn", r->computer_dn);
7048 ndr->depth--;
7049 ndr_print_ptr(ndr, "server_dn", r->server_dn);
7050 ndr->depth++;
7051 if (r->server_dn) {
7052 ndr_print_string(ndr, "server_dn", r->server_dn);
7054 ndr->depth--;
7055 ndr_print_uint32(ndr, "is_pdc", r->is_pdc);
7056 ndr_print_uint32(ndr, "is_enabled", r->is_enabled);
7057 ndr->depth--;
7060 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr1 *r)
7062 uint32_t cntr_array_1;
7063 if (ndr_flags & NDR_SCALARS) {
7064 NDR_CHECK(ndr_push_align(ndr, 5));
7065 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
7066 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
7068 if (ndr_flags & NDR_BUFFERS) {
7069 if (r->array) {
7070 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
7071 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7072 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
7074 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7075 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
7079 return NDR_ERR_SUCCESS;
7082 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr1 *r)
7084 uint32_t _ptr_array;
7085 uint32_t cntr_array_1;
7086 TALLOC_CTX *_mem_save_array_0;
7087 TALLOC_CTX *_mem_save_array_1;
7088 if (ndr_flags & NDR_SCALARS) {
7089 NDR_CHECK(ndr_pull_align(ndr, 5));
7090 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
7091 if (r->count > 10000) {
7092 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
7094 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
7095 if (_ptr_array) {
7096 NDR_PULL_ALLOC(ndr, r->array);
7097 } else {
7098 r->array = NULL;
7101 if (ndr_flags & NDR_BUFFERS) {
7102 if (r->array) {
7103 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
7104 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
7105 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
7106 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
7107 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
7108 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
7109 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7110 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
7112 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7113 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
7115 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
7116 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
7118 if (r->array) {
7119 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
7122 return NDR_ERR_SUCCESS;
7125 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr1 *r)
7127 uint32_t cntr_array_1;
7128 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr1");
7129 ndr->depth++;
7130 ndr_print_uint32(ndr, "count", r->count);
7131 ndr_print_ptr(ndr, "array", r->array);
7132 ndr->depth++;
7133 if (r->array) {
7134 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
7135 ndr->depth++;
7136 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
7137 char *idx_1=NULL;
7138 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
7139 ndr_print_drsuapi_DsGetDCInfo1(ndr, "array", &r->array[cntr_array_1]);
7140 free(idx_1);
7143 ndr->depth--;
7145 ndr->depth--;
7146 ndr->depth--;
7149 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo2 *r)
7151 if (ndr_flags & NDR_SCALARS) {
7152 NDR_CHECK(ndr_push_align(ndr, 5));
7153 NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name));
7154 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name));
7155 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name));
7156 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_dn));
7157 NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn));
7158 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn));
7159 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ntds_dn));
7160 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc));
7161 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled));
7162 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_gc));
7163 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
7164 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->computer_guid));
7165 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->server_guid));
7166 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->ntds_guid));
7168 if (ndr_flags & NDR_BUFFERS) {
7169 if (r->netbios_name) {
7170 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
7171 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7172 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
7173 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7175 if (r->dns_name) {
7176 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
7177 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7178 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
7179 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7181 if (r->site_name) {
7182 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
7183 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7184 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
7185 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7187 if (r->site_dn) {
7188 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16)));
7189 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7190 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16)));
7191 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_dn, ndr_charset_length(r->site_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7193 if (r->computer_dn) {
7194 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
7195 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7196 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
7197 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7199 if (r->server_dn) {
7200 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
7201 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7202 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
7203 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7205 if (r->ntds_dn) {
7206 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16)));
7207 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7208 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16)));
7209 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ntds_dn, ndr_charset_length(r->ntds_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7212 return NDR_ERR_SUCCESS;
7215 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo2 *r)
7217 uint32_t _ptr_netbios_name;
7218 TALLOC_CTX *_mem_save_netbios_name_0;
7219 uint32_t _ptr_dns_name;
7220 TALLOC_CTX *_mem_save_dns_name_0;
7221 uint32_t _ptr_site_name;
7222 TALLOC_CTX *_mem_save_site_name_0;
7223 uint32_t _ptr_site_dn;
7224 TALLOC_CTX *_mem_save_site_dn_0;
7225 uint32_t _ptr_computer_dn;
7226 TALLOC_CTX *_mem_save_computer_dn_0;
7227 uint32_t _ptr_server_dn;
7228 TALLOC_CTX *_mem_save_server_dn_0;
7229 uint32_t _ptr_ntds_dn;
7230 TALLOC_CTX *_mem_save_ntds_dn_0;
7231 if (ndr_flags & NDR_SCALARS) {
7232 NDR_CHECK(ndr_pull_align(ndr, 5));
7233 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name));
7234 if (_ptr_netbios_name) {
7235 NDR_PULL_ALLOC(ndr, r->netbios_name);
7236 } else {
7237 r->netbios_name = NULL;
7239 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name));
7240 if (_ptr_dns_name) {
7241 NDR_PULL_ALLOC(ndr, r->dns_name);
7242 } else {
7243 r->dns_name = NULL;
7245 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
7246 if (_ptr_site_name) {
7247 NDR_PULL_ALLOC(ndr, r->site_name);
7248 } else {
7249 r->site_name = NULL;
7251 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_dn));
7252 if (_ptr_site_dn) {
7253 NDR_PULL_ALLOC(ndr, r->site_dn);
7254 } else {
7255 r->site_dn = NULL;
7257 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn));
7258 if (_ptr_computer_dn) {
7259 NDR_PULL_ALLOC(ndr, r->computer_dn);
7260 } else {
7261 r->computer_dn = NULL;
7263 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn));
7264 if (_ptr_server_dn) {
7265 NDR_PULL_ALLOC(ndr, r->server_dn);
7266 } else {
7267 r->server_dn = NULL;
7269 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ntds_dn));
7270 if (_ptr_ntds_dn) {
7271 NDR_PULL_ALLOC(ndr, r->ntds_dn);
7272 } else {
7273 r->ntds_dn = NULL;
7275 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc));
7276 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled));
7277 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_gc));
7278 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
7279 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->computer_guid));
7280 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->server_guid));
7281 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->ntds_guid));
7283 if (ndr_flags & NDR_BUFFERS) {
7284 if (r->netbios_name) {
7285 _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7286 NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0);
7287 NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name));
7288 NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name));
7289 if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) {
7290 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name));
7292 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t)));
7293 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16));
7294 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0);
7296 if (r->dns_name) {
7297 _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7298 NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0);
7299 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name));
7300 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name));
7301 if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) {
7302 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name));
7304 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t)));
7305 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16));
7306 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0);
7308 if (r->site_name) {
7309 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7310 NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0);
7311 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name));
7312 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name));
7313 if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) {
7314 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_name), ndr_get_array_length(ndr, &r->site_name));
7316 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t)));
7317 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16));
7318 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
7320 if (r->site_dn) {
7321 _mem_save_site_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
7322 NDR_PULL_SET_MEM_CTX(ndr, r->site_dn, 0);
7323 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_dn));
7324 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_dn));
7325 if (ndr_get_array_length(ndr, &r->site_dn) > ndr_get_array_size(ndr, &r->site_dn)) {
7326 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_dn), ndr_get_array_length(ndr, &r->site_dn));
7328 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t)));
7329 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_dn, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t), CH_UTF16));
7330 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_dn_0, 0);
7332 if (r->computer_dn) {
7333 _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
7334 NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0);
7335 NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn));
7336 NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn));
7337 if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) {
7338 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer_dn), ndr_get_array_length(ndr, &r->computer_dn));
7340 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t)));
7341 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16));
7342 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0);
7344 if (r->server_dn) {
7345 _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
7346 NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0);
7347 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn));
7348 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn));
7349 if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) {
7350 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn));
7352 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t)));
7353 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16));
7354 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0);
7356 if (r->ntds_dn) {
7357 _mem_save_ntds_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
7358 NDR_PULL_SET_MEM_CTX(ndr, r->ntds_dn, 0);
7359 NDR_CHECK(ndr_pull_array_size(ndr, &r->ntds_dn));
7360 NDR_CHECK(ndr_pull_array_length(ndr, &r->ntds_dn));
7361 if (ndr_get_array_length(ndr, &r->ntds_dn) > ndr_get_array_size(ndr, &r->ntds_dn)) {
7362 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->ntds_dn), ndr_get_array_length(ndr, &r->ntds_dn));
7364 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t)));
7365 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ntds_dn, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t), CH_UTF16));
7366 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ntds_dn_0, 0);
7369 return NDR_ERR_SUCCESS;
7372 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo2 *r)
7374 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo2");
7375 ndr->depth++;
7376 ndr_print_ptr(ndr, "netbios_name", r->netbios_name);
7377 ndr->depth++;
7378 if (r->netbios_name) {
7379 ndr_print_string(ndr, "netbios_name", r->netbios_name);
7381 ndr->depth--;
7382 ndr_print_ptr(ndr, "dns_name", r->dns_name);
7383 ndr->depth++;
7384 if (r->dns_name) {
7385 ndr_print_string(ndr, "dns_name", r->dns_name);
7387 ndr->depth--;
7388 ndr_print_ptr(ndr, "site_name", r->site_name);
7389 ndr->depth++;
7390 if (r->site_name) {
7391 ndr_print_string(ndr, "site_name", r->site_name);
7393 ndr->depth--;
7394 ndr_print_ptr(ndr, "site_dn", r->site_dn);
7395 ndr->depth++;
7396 if (r->site_dn) {
7397 ndr_print_string(ndr, "site_dn", r->site_dn);
7399 ndr->depth--;
7400 ndr_print_ptr(ndr, "computer_dn", r->computer_dn);
7401 ndr->depth++;
7402 if (r->computer_dn) {
7403 ndr_print_string(ndr, "computer_dn", r->computer_dn);
7405 ndr->depth--;
7406 ndr_print_ptr(ndr, "server_dn", r->server_dn);
7407 ndr->depth++;
7408 if (r->server_dn) {
7409 ndr_print_string(ndr, "server_dn", r->server_dn);
7411 ndr->depth--;
7412 ndr_print_ptr(ndr, "ntds_dn", r->ntds_dn);
7413 ndr->depth++;
7414 if (r->ntds_dn) {
7415 ndr_print_string(ndr, "ntds_dn", r->ntds_dn);
7417 ndr->depth--;
7418 ndr_print_uint32(ndr, "is_pdc", r->is_pdc);
7419 ndr_print_uint32(ndr, "is_enabled", r->is_enabled);
7420 ndr_print_uint32(ndr, "is_gc", r->is_gc);
7421 ndr_print_GUID(ndr, "site_guid", &r->site_guid);
7422 ndr_print_GUID(ndr, "computer_guid", &r->computer_guid);
7423 ndr_print_GUID(ndr, "server_guid", &r->server_guid);
7424 ndr_print_GUID(ndr, "ntds_guid", &r->ntds_guid);
7425 ndr->depth--;
7428 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr2 *r)
7430 uint32_t cntr_array_1;
7431 if (ndr_flags & NDR_SCALARS) {
7432 NDR_CHECK(ndr_push_align(ndr, 5));
7433 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
7434 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
7436 if (ndr_flags & NDR_BUFFERS) {
7437 if (r->array) {
7438 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
7439 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7440 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
7442 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7443 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
7447 return NDR_ERR_SUCCESS;
7450 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr2 *r)
7452 uint32_t _ptr_array;
7453 uint32_t cntr_array_1;
7454 TALLOC_CTX *_mem_save_array_0;
7455 TALLOC_CTX *_mem_save_array_1;
7456 if (ndr_flags & NDR_SCALARS) {
7457 NDR_CHECK(ndr_pull_align(ndr, 5));
7458 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
7459 if (r->count > 10000) {
7460 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
7462 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
7463 if (_ptr_array) {
7464 NDR_PULL_ALLOC(ndr, r->array);
7465 } else {
7466 r->array = NULL;
7469 if (ndr_flags & NDR_BUFFERS) {
7470 if (r->array) {
7471 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
7472 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
7473 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
7474 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
7475 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
7476 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
7477 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7478 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
7480 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7481 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
7483 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
7484 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
7486 if (r->array) {
7487 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
7490 return NDR_ERR_SUCCESS;
7493 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr2 *r)
7495 uint32_t cntr_array_1;
7496 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr2");
7497 ndr->depth++;
7498 ndr_print_uint32(ndr, "count", r->count);
7499 ndr_print_ptr(ndr, "array", r->array);
7500 ndr->depth++;
7501 if (r->array) {
7502 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
7503 ndr->depth++;
7504 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
7505 char *idx_1=NULL;
7506 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
7507 ndr_print_drsuapi_DsGetDCInfo2(ndr, "array", &r->array[cntr_array_1]);
7508 free(idx_1);
7511 ndr->depth--;
7513 ndr->depth--;
7514 ndr->depth--;
7517 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo3 *r)
7519 if (ndr_flags & NDR_SCALARS) {
7520 NDR_CHECK(ndr_push_align(ndr, 5));
7521 NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name));
7522 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name));
7523 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name));
7524 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_dn));
7525 NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn));
7526 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn));
7527 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ntds_dn));
7528 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc));
7529 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled));
7530 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_gc));
7531 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_rodc));
7532 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
7533 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->computer_guid));
7534 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->server_guid));
7535 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->ntds_guid));
7537 if (ndr_flags & NDR_BUFFERS) {
7538 if (r->netbios_name) {
7539 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
7540 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7541 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
7542 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7544 if (r->dns_name) {
7545 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
7546 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7547 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
7548 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7550 if (r->site_name) {
7551 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
7552 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7553 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
7554 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7556 if (r->site_dn) {
7557 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16)));
7558 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7559 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16)));
7560 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_dn, ndr_charset_length(r->site_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7562 if (r->computer_dn) {
7563 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
7564 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7565 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
7566 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7568 if (r->server_dn) {
7569 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
7570 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7571 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
7572 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7574 if (r->ntds_dn) {
7575 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16)));
7576 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7577 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16)));
7578 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ntds_dn, ndr_charset_length(r->ntds_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7581 return NDR_ERR_SUCCESS;
7584 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo3 *r)
7586 uint32_t _ptr_netbios_name;
7587 TALLOC_CTX *_mem_save_netbios_name_0;
7588 uint32_t _ptr_dns_name;
7589 TALLOC_CTX *_mem_save_dns_name_0;
7590 uint32_t _ptr_site_name;
7591 TALLOC_CTX *_mem_save_site_name_0;
7592 uint32_t _ptr_site_dn;
7593 TALLOC_CTX *_mem_save_site_dn_0;
7594 uint32_t _ptr_computer_dn;
7595 TALLOC_CTX *_mem_save_computer_dn_0;
7596 uint32_t _ptr_server_dn;
7597 TALLOC_CTX *_mem_save_server_dn_0;
7598 uint32_t _ptr_ntds_dn;
7599 TALLOC_CTX *_mem_save_ntds_dn_0;
7600 if (ndr_flags & NDR_SCALARS) {
7601 NDR_CHECK(ndr_pull_align(ndr, 5));
7602 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name));
7603 if (_ptr_netbios_name) {
7604 NDR_PULL_ALLOC(ndr, r->netbios_name);
7605 } else {
7606 r->netbios_name = NULL;
7608 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name));
7609 if (_ptr_dns_name) {
7610 NDR_PULL_ALLOC(ndr, r->dns_name);
7611 } else {
7612 r->dns_name = NULL;
7614 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
7615 if (_ptr_site_name) {
7616 NDR_PULL_ALLOC(ndr, r->site_name);
7617 } else {
7618 r->site_name = NULL;
7620 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_dn));
7621 if (_ptr_site_dn) {
7622 NDR_PULL_ALLOC(ndr, r->site_dn);
7623 } else {
7624 r->site_dn = NULL;
7626 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn));
7627 if (_ptr_computer_dn) {
7628 NDR_PULL_ALLOC(ndr, r->computer_dn);
7629 } else {
7630 r->computer_dn = NULL;
7632 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn));
7633 if (_ptr_server_dn) {
7634 NDR_PULL_ALLOC(ndr, r->server_dn);
7635 } else {
7636 r->server_dn = NULL;
7638 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ntds_dn));
7639 if (_ptr_ntds_dn) {
7640 NDR_PULL_ALLOC(ndr, r->ntds_dn);
7641 } else {
7642 r->ntds_dn = NULL;
7644 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc));
7645 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled));
7646 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_gc));
7647 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_rodc));
7648 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
7649 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->computer_guid));
7650 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->server_guid));
7651 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->ntds_guid));
7653 if (ndr_flags & NDR_BUFFERS) {
7654 if (r->netbios_name) {
7655 _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7656 NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0);
7657 NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name));
7658 NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name));
7659 if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) {
7660 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name));
7662 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t)));
7663 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16));
7664 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0);
7666 if (r->dns_name) {
7667 _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7668 NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0);
7669 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name));
7670 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name));
7671 if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) {
7672 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name));
7674 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t)));
7675 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16));
7676 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0);
7678 if (r->site_name) {
7679 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
7680 NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0);
7681 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name));
7682 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name));
7683 if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) {
7684 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_name), ndr_get_array_length(ndr, &r->site_name));
7686 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t)));
7687 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16));
7688 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
7690 if (r->site_dn) {
7691 _mem_save_site_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
7692 NDR_PULL_SET_MEM_CTX(ndr, r->site_dn, 0);
7693 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_dn));
7694 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_dn));
7695 if (ndr_get_array_length(ndr, &r->site_dn) > ndr_get_array_size(ndr, &r->site_dn)) {
7696 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_dn), ndr_get_array_length(ndr, &r->site_dn));
7698 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t)));
7699 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_dn, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t), CH_UTF16));
7700 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_dn_0, 0);
7702 if (r->computer_dn) {
7703 _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
7704 NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0);
7705 NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn));
7706 NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn));
7707 if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) {
7708 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer_dn), ndr_get_array_length(ndr, &r->computer_dn));
7710 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t)));
7711 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16));
7712 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0);
7714 if (r->server_dn) {
7715 _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
7716 NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0);
7717 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn));
7718 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn));
7719 if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) {
7720 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn));
7722 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t)));
7723 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16));
7724 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0);
7726 if (r->ntds_dn) {
7727 _mem_save_ntds_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
7728 NDR_PULL_SET_MEM_CTX(ndr, r->ntds_dn, 0);
7729 NDR_CHECK(ndr_pull_array_size(ndr, &r->ntds_dn));
7730 NDR_CHECK(ndr_pull_array_length(ndr, &r->ntds_dn));
7731 if (ndr_get_array_length(ndr, &r->ntds_dn) > ndr_get_array_size(ndr, &r->ntds_dn)) {
7732 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->ntds_dn), ndr_get_array_length(ndr, &r->ntds_dn));
7734 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t)));
7735 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ntds_dn, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t), CH_UTF16));
7736 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ntds_dn_0, 0);
7739 return NDR_ERR_SUCCESS;
7742 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo3 *r)
7744 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo3");
7745 ndr->depth++;
7746 ndr_print_ptr(ndr, "netbios_name", r->netbios_name);
7747 ndr->depth++;
7748 if (r->netbios_name) {
7749 ndr_print_string(ndr, "netbios_name", r->netbios_name);
7751 ndr->depth--;
7752 ndr_print_ptr(ndr, "dns_name", r->dns_name);
7753 ndr->depth++;
7754 if (r->dns_name) {
7755 ndr_print_string(ndr, "dns_name", r->dns_name);
7757 ndr->depth--;
7758 ndr_print_ptr(ndr, "site_name", r->site_name);
7759 ndr->depth++;
7760 if (r->site_name) {
7761 ndr_print_string(ndr, "site_name", r->site_name);
7763 ndr->depth--;
7764 ndr_print_ptr(ndr, "site_dn", r->site_dn);
7765 ndr->depth++;
7766 if (r->site_dn) {
7767 ndr_print_string(ndr, "site_dn", r->site_dn);
7769 ndr->depth--;
7770 ndr_print_ptr(ndr, "computer_dn", r->computer_dn);
7771 ndr->depth++;
7772 if (r->computer_dn) {
7773 ndr_print_string(ndr, "computer_dn", r->computer_dn);
7775 ndr->depth--;
7776 ndr_print_ptr(ndr, "server_dn", r->server_dn);
7777 ndr->depth++;
7778 if (r->server_dn) {
7779 ndr_print_string(ndr, "server_dn", r->server_dn);
7781 ndr->depth--;
7782 ndr_print_ptr(ndr, "ntds_dn", r->ntds_dn);
7783 ndr->depth++;
7784 if (r->ntds_dn) {
7785 ndr_print_string(ndr, "ntds_dn", r->ntds_dn);
7787 ndr->depth--;
7788 ndr_print_uint32(ndr, "is_pdc", r->is_pdc);
7789 ndr_print_uint32(ndr, "is_enabled", r->is_enabled);
7790 ndr_print_uint32(ndr, "is_gc", r->is_gc);
7791 ndr_print_uint32(ndr, "is_rodc", r->is_rodc);
7792 ndr_print_GUID(ndr, "site_guid", &r->site_guid);
7793 ndr_print_GUID(ndr, "computer_guid", &r->computer_guid);
7794 ndr_print_GUID(ndr, "server_guid", &r->server_guid);
7795 ndr_print_GUID(ndr, "ntds_guid", &r->ntds_guid);
7796 ndr->depth--;
7799 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr3 *r)
7801 uint32_t cntr_array_1;
7802 if (ndr_flags & NDR_SCALARS) {
7803 NDR_CHECK(ndr_push_align(ndr, 5));
7804 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
7805 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
7807 if (ndr_flags & NDR_BUFFERS) {
7808 if (r->array) {
7809 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
7810 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7811 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
7813 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7814 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
7818 return NDR_ERR_SUCCESS;
7821 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr3 *r)
7823 uint32_t _ptr_array;
7824 uint32_t cntr_array_1;
7825 TALLOC_CTX *_mem_save_array_0;
7826 TALLOC_CTX *_mem_save_array_1;
7827 if (ndr_flags & NDR_SCALARS) {
7828 NDR_CHECK(ndr_pull_align(ndr, 5));
7829 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
7830 if (r->count > 10000) {
7831 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
7833 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
7834 if (_ptr_array) {
7835 NDR_PULL_ALLOC(ndr, r->array);
7836 } else {
7837 r->array = NULL;
7840 if (ndr_flags & NDR_BUFFERS) {
7841 if (r->array) {
7842 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
7843 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
7844 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
7845 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
7846 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
7847 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
7848 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7849 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
7851 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7852 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
7854 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
7855 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
7857 if (r->array) {
7858 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
7861 return NDR_ERR_SUCCESS;
7864 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr3 *r)
7866 uint32_t cntr_array_1;
7867 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr3");
7868 ndr->depth++;
7869 ndr_print_uint32(ndr, "count", r->count);
7870 ndr_print_ptr(ndr, "array", r->array);
7871 ndr->depth++;
7872 if (r->array) {
7873 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
7874 ndr->depth++;
7875 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
7876 char *idx_1=NULL;
7877 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
7878 ndr_print_drsuapi_DsGetDCInfo3(ndr, "array", &r->array[cntr_array_1]);
7879 free(idx_1);
7882 ndr->depth--;
7884 ndr->depth--;
7885 ndr->depth--;
7888 static enum ndr_err_code ndr_push_drsuapi_DsGetDCConnection01(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCConnection01 *r)
7890 if (ndr_flags & NDR_SCALARS) {
7891 NDR_CHECK(ndr_push_align(ndr, 5));
7893 uint32_t _flags_save_ipv4address = ndr->flags;
7894 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
7895 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->client_ip_address));
7896 ndr->flags = _flags_save_ipv4address;
7898 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
7899 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->connection_time));
7900 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
7901 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
7902 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
7903 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_account));
7905 if (ndr_flags & NDR_BUFFERS) {
7906 if (r->client_account) {
7907 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_account, CH_UTF16)));
7908 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
7909 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_account, CH_UTF16)));
7910 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_account, ndr_charset_length(r->client_account, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7913 return NDR_ERR_SUCCESS;
7916 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCConnection01(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCConnection01 *r)
7918 uint32_t _ptr_client_account;
7919 TALLOC_CTX *_mem_save_client_account_0;
7920 if (ndr_flags & NDR_SCALARS) {
7921 NDR_CHECK(ndr_pull_align(ndr, 5));
7923 uint32_t _flags_save_ipv4address = ndr->flags;
7924 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
7925 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->client_ip_address));
7926 ndr->flags = _flags_save_ipv4address;
7928 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
7929 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->connection_time));
7930 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
7931 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
7932 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
7933 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_account));
7934 if (_ptr_client_account) {
7935 NDR_PULL_ALLOC(ndr, r->client_account);
7936 } else {
7937 r->client_account = NULL;
7940 if (ndr_flags & NDR_BUFFERS) {
7941 if (r->client_account) {
7942 _mem_save_client_account_0 = NDR_PULL_GET_MEM_CTX(ndr);
7943 NDR_PULL_SET_MEM_CTX(ndr, r->client_account, 0);
7944 NDR_CHECK(ndr_pull_array_size(ndr, &r->client_account));
7945 NDR_CHECK(ndr_pull_array_length(ndr, &r->client_account));
7946 if (ndr_get_array_length(ndr, &r->client_account) > ndr_get_array_size(ndr, &r->client_account)) {
7947 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_account), ndr_get_array_length(ndr, &r->client_account));
7949 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_account), sizeof(uint16_t)));
7950 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_account, ndr_get_array_length(ndr, &r->client_account), sizeof(uint16_t), CH_UTF16));
7951 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0);
7954 return NDR_ERR_SUCCESS;
7957 _PUBLIC_ void ndr_print_drsuapi_DsGetDCConnection01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnection01 *r)
7959 ndr_print_struct(ndr, name, "drsuapi_DsGetDCConnection01");
7960 ndr->depth++;
7961 ndr_print_ipv4address(ndr, "client_ip_address", r->client_ip_address);
7962 ndr_print_uint32(ndr, "unknown2", r->unknown2);
7963 ndr_print_uint32(ndr, "connection_time", r->connection_time);
7964 ndr_print_uint32(ndr, "unknown4", r->unknown4);
7965 ndr_print_uint32(ndr, "unknown5", r->unknown5);
7966 ndr_print_uint32(ndr, "unknown6", r->unknown6);
7967 ndr_print_ptr(ndr, "client_account", r->client_account);
7968 ndr->depth++;
7969 if (r->client_account) {
7970 ndr_print_string(ndr, "client_account", r->client_account);
7972 ndr->depth--;
7973 ndr->depth--;
7976 static enum ndr_err_code ndr_push_drsuapi_DsGetDCConnectionCtr01(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCConnectionCtr01 *r)
7978 uint32_t cntr_array_1;
7979 if (ndr_flags & NDR_SCALARS) {
7980 NDR_CHECK(ndr_push_align(ndr, 5));
7981 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
7982 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
7984 if (ndr_flags & NDR_BUFFERS) {
7985 if (r->array) {
7986 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
7987 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7988 NDR_CHECK(ndr_push_drsuapi_DsGetDCConnection01(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
7990 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7991 NDR_CHECK(ndr_push_drsuapi_DsGetDCConnection01(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
7995 return NDR_ERR_SUCCESS;
7998 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCConnectionCtr01(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCConnectionCtr01 *r)
8000 uint32_t _ptr_array;
8001 uint32_t cntr_array_1;
8002 TALLOC_CTX *_mem_save_array_0;
8003 TALLOC_CTX *_mem_save_array_1;
8004 if (ndr_flags & NDR_SCALARS) {
8005 NDR_CHECK(ndr_pull_align(ndr, 5));
8006 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
8007 if (r->count > 10000) {
8008 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
8010 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
8011 if (_ptr_array) {
8012 NDR_PULL_ALLOC(ndr, r->array);
8013 } else {
8014 r->array = NULL;
8017 if (ndr_flags & NDR_BUFFERS) {
8018 if (r->array) {
8019 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
8020 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
8021 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
8022 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
8023 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
8024 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
8025 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
8026 NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnection01(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
8028 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
8029 NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnection01(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
8031 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
8032 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
8034 if (r->array) {
8035 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
8038 return NDR_ERR_SUCCESS;
8041 _PUBLIC_ void ndr_print_drsuapi_DsGetDCConnectionCtr01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnectionCtr01 *r)
8043 uint32_t cntr_array_1;
8044 ndr_print_struct(ndr, name, "drsuapi_DsGetDCConnectionCtr01");
8045 ndr->depth++;
8046 ndr_print_uint32(ndr, "count", r->count);
8047 ndr_print_ptr(ndr, "array", r->array);
8048 ndr->depth++;
8049 if (r->array) {
8050 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
8051 ndr->depth++;
8052 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
8053 char *idx_1=NULL;
8054 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
8055 ndr_print_drsuapi_DsGetDCConnection01(ndr, "array", &r->array[cntr_array_1]);
8056 free(idx_1);
8059 ndr->depth--;
8061 ndr->depth--;
8062 ndr->depth--;
8065 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetDCInfoCtr *r)
8067 if (ndr_flags & NDR_SCALARS) {
8068 int level = ndr_push_get_switch_value(ndr, r);
8069 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
8070 NDR_CHECK(ndr_push_union_align(ndr, 5));
8071 switch (level) {
8072 case DRSUAPI_DC_INFO_CTR_1: {
8073 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr1(ndr, NDR_SCALARS, &r->ctr1));
8074 break; }
8076 case DRSUAPI_DC_INFO_CTR_2: {
8077 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr2(ndr, NDR_SCALARS, &r->ctr2));
8078 break; }
8080 case DRSUAPI_DC_INFO_CTR_3: {
8081 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr3(ndr, NDR_SCALARS, &r->ctr3));
8082 break; }
8084 case DRSUAPI_DC_CONNECTION_CTR_01: {
8085 NDR_CHECK(ndr_push_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_SCALARS, &r->ctr01));
8086 break; }
8088 default:
8089 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8092 if (ndr_flags & NDR_BUFFERS) {
8093 int level = ndr_push_get_switch_value(ndr, r);
8094 switch (level) {
8095 case DRSUAPI_DC_INFO_CTR_1:
8096 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr1(ndr, NDR_BUFFERS, &r->ctr1));
8097 break;
8099 case DRSUAPI_DC_INFO_CTR_2:
8100 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr2(ndr, NDR_BUFFERS, &r->ctr2));
8101 break;
8103 case DRSUAPI_DC_INFO_CTR_3:
8104 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr3(ndr, NDR_BUFFERS, &r->ctr3));
8105 break;
8107 case DRSUAPI_DC_CONNECTION_CTR_01:
8108 NDR_CHECK(ndr_push_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_BUFFERS, &r->ctr01));
8109 break;
8111 default:
8112 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8115 return NDR_ERR_SUCCESS;
8118 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetDCInfoCtr *r)
8120 int level;
8121 int32_t _level;
8122 level = ndr_pull_get_switch_value(ndr, r);
8123 if (ndr_flags & NDR_SCALARS) {
8124 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
8125 if (_level != level) {
8126 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
8128 NDR_CHECK(ndr_pull_union_align(ndr, 5));
8129 switch (level) {
8130 case DRSUAPI_DC_INFO_CTR_1: {
8131 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr1(ndr, NDR_SCALARS, &r->ctr1));
8132 break; }
8134 case DRSUAPI_DC_INFO_CTR_2: {
8135 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr2(ndr, NDR_SCALARS, &r->ctr2));
8136 break; }
8138 case DRSUAPI_DC_INFO_CTR_3: {
8139 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr3(ndr, NDR_SCALARS, &r->ctr3));
8140 break; }
8142 case DRSUAPI_DC_CONNECTION_CTR_01: {
8143 NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_SCALARS, &r->ctr01));
8144 break; }
8146 default:
8147 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8150 if (ndr_flags & NDR_BUFFERS) {
8151 switch (level) {
8152 case DRSUAPI_DC_INFO_CTR_1:
8153 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr1(ndr, NDR_BUFFERS, &r->ctr1));
8154 break;
8156 case DRSUAPI_DC_INFO_CTR_2:
8157 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr2(ndr, NDR_BUFFERS, &r->ctr2));
8158 break;
8160 case DRSUAPI_DC_INFO_CTR_3:
8161 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr3(ndr, NDR_BUFFERS, &r->ctr3));
8162 break;
8164 case DRSUAPI_DC_CONNECTION_CTR_01:
8165 NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_BUFFERS, &r->ctr01));
8166 break;
8168 default:
8169 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8172 return NDR_ERR_SUCCESS;
8175 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoCtr *r)
8177 int level;
8178 level = ndr_print_get_switch_value(ndr, r);
8179 ndr_print_union(ndr, name, level, "drsuapi_DsGetDCInfoCtr");
8180 switch (level) {
8181 case DRSUAPI_DC_INFO_CTR_1:
8182 ndr_print_drsuapi_DsGetDCInfoCtr1(ndr, "ctr1", &r->ctr1);
8183 break;
8185 case DRSUAPI_DC_INFO_CTR_2:
8186 ndr_print_drsuapi_DsGetDCInfoCtr2(ndr, "ctr2", &r->ctr2);
8187 break;
8189 case DRSUAPI_DC_INFO_CTR_3:
8190 ndr_print_drsuapi_DsGetDCInfoCtr3(ndr, "ctr3", &r->ctr3);
8191 break;
8193 case DRSUAPI_DC_CONNECTION_CTR_01:
8194 ndr_print_drsuapi_DsGetDCConnectionCtr01(ndr, "ctr01", &r->ctr01);
8195 break;
8197 default:
8198 ndr_print_bad_level(ndr, name, level);
8202 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItem(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItem *r)
8204 if (ndr_flags & NDR_SCALARS) {
8205 NDR_CHECK(ndr_push_align(ndr, 5));
8206 NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object));
8207 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
8209 if (ndr_flags & NDR_BUFFERS) {
8210 if (r->next_object) {
8211 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
8213 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
8215 return NDR_ERR_SUCCESS;
8218 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItem(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItem *r)
8220 uint32_t _ptr_next_object;
8221 TALLOC_CTX *_mem_save_next_object_0;
8222 if (ndr_flags & NDR_SCALARS) {
8223 NDR_CHECK(ndr_pull_align(ndr, 5));
8224 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object));
8225 if (_ptr_next_object) {
8226 NDR_PULL_ALLOC(ndr, r->next_object);
8227 } else {
8228 r->next_object = NULL;
8230 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
8232 if (ndr_flags & NDR_BUFFERS) {
8233 if (r->next_object) {
8234 _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
8235 NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0);
8236 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
8237 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0);
8239 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
8241 return NDR_ERR_SUCCESS;
8244 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryRequest2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryRequest2 *r)
8246 if (ndr_flags & NDR_SCALARS) {
8247 NDR_CHECK(ndr_push_align(ndr, 5));
8248 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS, &r->first_object));
8250 if (ndr_flags & NDR_BUFFERS) {
8251 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_BUFFERS, &r->first_object));
8253 return NDR_ERR_SUCCESS;
8256 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryRequest2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryRequest2 *r)
8258 if (ndr_flags & NDR_SCALARS) {
8259 NDR_CHECK(ndr_pull_align(ndr, 5));
8260 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS, &r->first_object));
8262 if (ndr_flags & NDR_BUFFERS) {
8263 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_BUFFERS, &r->first_object));
8265 return NDR_ERR_SUCCESS;
8268 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryRequest2 *r)
8270 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryRequest2");
8271 ndr->depth++;
8272 ndr_print_drsuapi_DsReplicaObjectListItem(ndr, "first_object", &r->first_object);
8273 ndr->depth--;
8276 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryRequest *r)
8278 if (ndr_flags & NDR_SCALARS) {
8279 int level = ndr_push_get_switch_value(ndr, r);
8280 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
8281 NDR_CHECK(ndr_push_union_align(ndr, 5));
8282 switch (level) {
8283 case 2: {
8284 NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest2(ndr, NDR_SCALARS, &r->req2));
8285 break; }
8287 default:
8288 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8291 if (ndr_flags & NDR_BUFFERS) {
8292 int level = ndr_push_get_switch_value(ndr, r);
8293 switch (level) {
8294 case 2:
8295 NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest2(ndr, NDR_BUFFERS, &r->req2));
8296 break;
8298 default:
8299 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8302 return NDR_ERR_SUCCESS;
8305 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryRequest *r)
8307 int level;
8308 int32_t _level;
8309 level = ndr_pull_get_switch_value(ndr, r);
8310 if (ndr_flags & NDR_SCALARS) {
8311 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
8312 if (_level != level) {
8313 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
8315 NDR_CHECK(ndr_pull_union_align(ndr, 5));
8316 switch (level) {
8317 case 2: {
8318 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest2(ndr, NDR_SCALARS, &r->req2));
8319 break; }
8321 default:
8322 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8325 if (ndr_flags & NDR_BUFFERS) {
8326 switch (level) {
8327 case 2:
8328 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest2(ndr, NDR_BUFFERS, &r->req2));
8329 break;
8331 default:
8332 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8335 return NDR_ERR_SUCCESS;
8338 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryRequest *r)
8340 int level;
8341 level = ndr_print_get_switch_value(ndr, r);
8342 ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryRequest");
8343 switch (level) {
8344 case 2:
8345 ndr_print_drsuapi_DsAddEntryRequest2(ndr, "req2", &r->req2);
8346 break;
8348 default:
8349 ndr_print_bad_level(ndr, name, level);
8353 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfoX(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorInfoX *r)
8355 if (ndr_flags & NDR_SCALARS) {
8356 NDR_CHECK(ndr_push_align(ndr, 4));
8357 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
8358 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
8359 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
8360 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown3));
8362 if (ndr_flags & NDR_BUFFERS) {
8364 return NDR_ERR_SUCCESS;
8367 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfoX(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorInfoX *r)
8369 if (ndr_flags & NDR_SCALARS) {
8370 NDR_CHECK(ndr_pull_align(ndr, 4));
8371 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
8372 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
8373 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
8374 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown3));
8376 if (ndr_flags & NDR_BUFFERS) {
8378 return NDR_ERR_SUCCESS;
8381 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfoX(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfoX *r)
8383 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorInfoX");
8384 ndr->depth++;
8385 ndr_print_uint32(ndr, "unknown1", r->unknown1);
8386 ndr_print_WERROR(ndr, "status", r->status);
8387 ndr_print_uint32(ndr, "unknown2", r->unknown2);
8388 ndr_print_uint16(ndr, "unknown3", r->unknown3);
8389 ndr->depth--;
8392 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryExtraErrorBuffer *r)
8394 if (ndr_flags & NDR_SCALARS) {
8395 NDR_CHECK(ndr_push_align(ndr, 5));
8396 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
8397 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
8399 if (ndr_flags & NDR_BUFFERS) {
8400 if (r->data) {
8401 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->size));
8402 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->size));
8405 return NDR_ERR_SUCCESS;
8408 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryExtraErrorBuffer *r)
8410 uint32_t _ptr_data;
8411 TALLOC_CTX *_mem_save_data_0;
8412 if (ndr_flags & NDR_SCALARS) {
8413 NDR_CHECK(ndr_pull_align(ndr, 5));
8414 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
8415 if (r->size > 10485760) {
8416 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
8418 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
8419 if (_ptr_data) {
8420 NDR_PULL_ALLOC(ndr, r->data);
8421 } else {
8422 r->data = NULL;
8425 if (ndr_flags & NDR_BUFFERS) {
8426 if (r->data) {
8427 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
8428 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
8429 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
8430 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
8431 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
8432 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
8434 if (r->data) {
8435 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size));
8438 return NDR_ERR_SUCCESS;
8441 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraErrorBuffer *r)
8443 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryExtraErrorBuffer");
8444 ndr->depth++;
8445 ndr_print_uint32(ndr, "size", r->size);
8446 ndr_print_ptr(ndr, "data", r->data);
8447 ndr->depth++;
8448 if (r->data) {
8449 ndr_print_array_uint8(ndr, "data", r->data, r->size);
8451 ndr->depth--;
8452 ndr->depth--;
8455 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryExtraError1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryExtraError1 *r)
8457 if (ndr_flags & NDR_SCALARS) {
8458 NDR_CHECK(ndr_push_align(ndr, 5));
8459 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error));
8460 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
8461 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
8462 NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_SCALARS, &r->buffer));
8464 if (ndr_flags & NDR_BUFFERS) {
8465 NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_BUFFERS, &r->buffer));
8467 return NDR_ERR_SUCCESS;
8470 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryExtraError1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryExtraError1 *r)
8472 if (ndr_flags & NDR_SCALARS) {
8473 NDR_CHECK(ndr_pull_align(ndr, 5));
8474 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error));
8475 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
8476 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
8477 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_SCALARS, &r->buffer));
8479 if (ndr_flags & NDR_BUFFERS) {
8480 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_BUFFERS, &r->buffer));
8482 return NDR_ERR_SUCCESS;
8485 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryExtraError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraError1 *r)
8487 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryExtraError1");
8488 ndr->depth++;
8489 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "error", &r->error);
8490 ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
8491 ndr_print_uint32(ndr, "unknown2", r->unknown2);
8492 ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(ndr, "buffer", &r->buffer);
8493 ndr->depth--;
8496 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorListItem1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorListItem1 *r)
8498 if (ndr_flags & NDR_SCALARS) {
8499 NDR_CHECK(ndr_push_align(ndr, 5));
8500 NDR_CHECK(ndr_push_unique_ptr(ndr, r->next));
8501 NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraError1(ndr, NDR_SCALARS, &r->error));
8503 if (ndr_flags & NDR_BUFFERS) {
8504 if (r->next) {
8505 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS|NDR_BUFFERS, r->next));
8507 NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraError1(ndr, NDR_BUFFERS, &r->error));
8509 return NDR_ERR_SUCCESS;
8512 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorListItem1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorListItem1 *r)
8514 uint32_t _ptr_next;
8515 TALLOC_CTX *_mem_save_next_0;
8516 if (ndr_flags & NDR_SCALARS) {
8517 NDR_CHECK(ndr_pull_align(ndr, 5));
8518 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next));
8519 if (_ptr_next) {
8520 NDR_PULL_ALLOC(ndr, r->next);
8521 } else {
8522 r->next = NULL;
8524 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraError1(ndr, NDR_SCALARS, &r->error));
8526 if (ndr_flags & NDR_BUFFERS) {
8527 if (r->next) {
8528 _mem_save_next_0 = NDR_PULL_GET_MEM_CTX(ndr);
8529 NDR_PULL_SET_MEM_CTX(ndr, r->next, 0);
8530 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS|NDR_BUFFERS, r->next));
8531 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_0, 0);
8533 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraError1(ndr, NDR_BUFFERS, &r->error));
8535 return NDR_ERR_SUCCESS;
8538 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorListItem1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorListItem1 *r)
8540 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorListItem1");
8541 ndr->depth++;
8542 ndr_print_ptr(ndr, "next", r->next);
8543 ndr->depth++;
8544 if (r->next) {
8545 ndr_print_drsuapi_DsAddEntryErrorListItem1(ndr, "next", r->next);
8547 ndr->depth--;
8548 ndr_print_drsuapi_DsAddEntryExtraError1(ndr, "error", &r->error);
8549 ndr->depth--;
8552 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorInfo1 *r)
8554 if (ndr_flags & NDR_SCALARS) {
8555 NDR_CHECK(ndr_push_align(ndr, 5));
8556 NDR_CHECK(ndr_push_unique_ptr(ndr, r->id));
8557 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
8558 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS, &r->first));
8560 if (ndr_flags & NDR_BUFFERS) {
8561 if (r->id) {
8562 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
8564 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_BUFFERS, &r->first));
8566 return NDR_ERR_SUCCESS;
8569 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorInfo1 *r)
8571 uint32_t _ptr_id;
8572 TALLOC_CTX *_mem_save_id_0;
8573 if (ndr_flags & NDR_SCALARS) {
8574 NDR_CHECK(ndr_pull_align(ndr, 5));
8575 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id));
8576 if (_ptr_id) {
8577 NDR_PULL_ALLOC(ndr, r->id);
8578 } else {
8579 r->id = NULL;
8581 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
8582 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS, &r->first));
8584 if (ndr_flags & NDR_BUFFERS) {
8585 if (r->id) {
8586 _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
8587 NDR_PULL_SET_MEM_CTX(ndr, r->id, 0);
8588 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
8589 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0);
8591 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_BUFFERS, &r->first));
8593 return NDR_ERR_SUCCESS;
8596 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfo1 *r)
8598 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorInfo1");
8599 ndr->depth++;
8600 ndr_print_ptr(ndr, "id", r->id);
8601 ndr->depth++;
8602 if (r->id) {
8603 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id);
8605 ndr->depth--;
8606 ndr_print_WERROR(ndr, "status", r->status);
8607 ndr_print_drsuapi_DsAddEntryErrorListItem1(ndr, "first", &r->first);
8608 ndr->depth--;
8611 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryErrorInfo *r)
8613 if (ndr_flags & NDR_SCALARS) {
8614 int level = ndr_push_get_switch_value(ndr, r);
8615 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
8616 NDR_CHECK(ndr_push_union_align(ndr, 5));
8617 switch (level) {
8618 case 1: {
8619 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_SCALARS, &r->error1));
8620 break; }
8622 case 4: {
8623 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
8624 break; }
8626 case 5: {
8627 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
8628 break; }
8630 case 6: {
8631 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
8632 break; }
8634 case 7: {
8635 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
8636 break; }
8638 default:
8639 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8642 if (ndr_flags & NDR_BUFFERS) {
8643 int level = ndr_push_get_switch_value(ndr, r);
8644 switch (level) {
8645 case 1:
8646 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_BUFFERS, &r->error1));
8647 break;
8649 case 4:
8650 break;
8652 case 5:
8653 break;
8655 case 6:
8656 break;
8658 case 7:
8659 break;
8661 default:
8662 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8665 return NDR_ERR_SUCCESS;
8668 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryErrorInfo *r)
8670 int level;
8671 uint32_t _level;
8672 level = ndr_pull_get_switch_value(ndr, r);
8673 if (ndr_flags & NDR_SCALARS) {
8674 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
8675 if (_level != level) {
8676 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
8678 NDR_CHECK(ndr_pull_union_align(ndr, 5));
8679 switch (level) {
8680 case 1: {
8681 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_SCALARS, &r->error1));
8682 break; }
8684 case 4: {
8685 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
8686 break; }
8688 case 5: {
8689 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
8690 break; }
8692 case 6: {
8693 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
8694 break; }
8696 case 7: {
8697 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
8698 break; }
8700 default:
8701 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8704 if (ndr_flags & NDR_BUFFERS) {
8705 switch (level) {
8706 case 1:
8707 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_BUFFERS, &r->error1));
8708 break;
8710 case 4:
8711 break;
8713 case 5:
8714 break;
8716 case 6:
8717 break;
8719 case 7:
8720 break;
8722 default:
8723 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8726 return NDR_ERR_SUCCESS;
8729 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryErrorInfo *r)
8731 int level;
8732 level = ndr_print_get_switch_value(ndr, r);
8733 ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryErrorInfo");
8734 switch (level) {
8735 case 1:
8736 ndr_print_drsuapi_DsAddEntryErrorInfo1(ndr, "error1", &r->error1);
8737 break;
8739 case 4:
8740 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX);
8741 break;
8743 case 5:
8744 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX);
8745 break;
8747 case 6:
8748 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX);
8749 break;
8751 case 7:
8752 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX);
8753 break;
8755 default:
8756 ndr_print_bad_level(ndr, name, level);
8760 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryError1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryError1 *r)
8762 if (ndr_flags & NDR_SCALARS) {
8763 NDR_CHECK(ndr_push_align(ndr, 5));
8764 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
8765 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
8766 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
8768 if (ndr_flags & NDR_BUFFERS) {
8769 if (r->info) {
8770 NDR_CHECK(ndr_push_set_switch_value(ndr, r->info, r->level));
8771 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
8774 return NDR_ERR_SUCCESS;
8777 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryError1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryError1 *r)
8779 uint32_t _ptr_info;
8780 TALLOC_CTX *_mem_save_info_0;
8781 if (ndr_flags & NDR_SCALARS) {
8782 NDR_CHECK(ndr_pull_align(ndr, 5));
8783 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
8784 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
8785 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
8786 if (_ptr_info) {
8787 NDR_PULL_ALLOC(ndr, r->info);
8788 } else {
8789 r->info = NULL;
8792 if (ndr_flags & NDR_BUFFERS) {
8793 if (r->info) {
8794 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
8795 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
8796 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->info, r->level));
8797 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
8798 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
8801 return NDR_ERR_SUCCESS;
8804 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryError1 *r)
8806 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryError1");
8807 ndr->depth++;
8808 ndr_print_WERROR(ndr, "status", r->status);
8809 ndr_print_uint32(ndr, "level", r->level);
8810 ndr_print_ptr(ndr, "info", r->info);
8811 ndr->depth++;
8812 if (r->info) {
8813 ndr_print_set_switch_value(ndr, r->info, r->level);
8814 ndr_print_drsuapi_DsAddEntryErrorInfo(ndr, "info", r->info);
8816 ndr->depth--;
8817 ndr->depth--;
8820 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryError(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryError *r)
8822 if (ndr_flags & NDR_SCALARS) {
8823 int level = ndr_push_get_switch_value(ndr, r);
8824 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
8825 NDR_CHECK(ndr_push_union_align(ndr, 5));
8826 switch (level) {
8827 case 1: {
8828 NDR_CHECK(ndr_push_drsuapi_DsAddEntryError1(ndr, NDR_SCALARS, &r->info1));
8829 break; }
8831 default:
8832 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8835 if (ndr_flags & NDR_BUFFERS) {
8836 int level = ndr_push_get_switch_value(ndr, r);
8837 switch (level) {
8838 case 1:
8839 NDR_CHECK(ndr_push_drsuapi_DsAddEntryError1(ndr, NDR_BUFFERS, &r->info1));
8840 break;
8842 default:
8843 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8846 return NDR_ERR_SUCCESS;
8849 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryError(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryError *r)
8851 int level;
8852 uint32_t _level;
8853 level = ndr_pull_get_switch_value(ndr, r);
8854 if (ndr_flags & NDR_SCALARS) {
8855 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
8856 if (_level != level) {
8857 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
8859 NDR_CHECK(ndr_pull_union_align(ndr, 5));
8860 switch (level) {
8861 case 1: {
8862 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError1(ndr, NDR_SCALARS, &r->info1));
8863 break; }
8865 default:
8866 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8869 if (ndr_flags & NDR_BUFFERS) {
8870 switch (level) {
8871 case 1:
8872 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError1(ndr, NDR_BUFFERS, &r->info1));
8873 break;
8875 default:
8876 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
8879 return NDR_ERR_SUCCESS;
8882 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryError(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryError *r)
8884 int level;
8885 level = ndr_print_get_switch_value(ndr, r);
8886 ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryError");
8887 switch (level) {
8888 case 1:
8889 ndr_print_drsuapi_DsAddEntryError1(ndr, "info1", &r->info1);
8890 break;
8892 default:
8893 ndr_print_bad_level(ndr, name, level);
8897 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier2 *r)
8899 if (ndr_flags & NDR_SCALARS) {
8900 NDR_CHECK(ndr_push_align(ndr, 4));
8901 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
8902 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
8904 if (ndr_flags & NDR_BUFFERS) {
8905 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
8907 return NDR_ERR_SUCCESS;
8910 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier2 *r)
8912 if (ndr_flags & NDR_SCALARS) {
8913 NDR_CHECK(ndr_pull_align(ndr, 4));
8914 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
8915 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
8917 if (ndr_flags & NDR_BUFFERS) {
8918 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
8920 return NDR_ERR_SUCCESS;
8923 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier2 *r)
8925 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier2");
8926 ndr->depth++;
8927 ndr_print_GUID(ndr, "guid", &r->guid);
8928 ndr_print_dom_sid28(ndr, "sid", &r->sid);
8929 ndr->depth--;
8932 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryCtr2 *r)
8934 uint32_t cntr_objects_1;
8935 if (ndr_flags & NDR_SCALARS) {
8936 NDR_CHECK(ndr_push_align(ndr, 5));
8937 NDR_CHECK(ndr_push_unique_ptr(ndr, r->id));
8938 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
8939 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error));
8940 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8941 NDR_CHECK(ndr_push_unique_ptr(ndr, r->objects));
8943 if (ndr_flags & NDR_BUFFERS) {
8944 if (r->id) {
8945 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
8947 if (r->objects) {
8948 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
8949 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8950 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1]));
8952 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8953 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1]));
8957 return NDR_ERR_SUCCESS;
8960 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryCtr2 *r)
8962 uint32_t _ptr_id;
8963 TALLOC_CTX *_mem_save_id_0;
8964 uint32_t _ptr_objects;
8965 uint32_t cntr_objects_1;
8966 TALLOC_CTX *_mem_save_objects_0;
8967 TALLOC_CTX *_mem_save_objects_1;
8968 if (ndr_flags & NDR_SCALARS) {
8969 NDR_CHECK(ndr_pull_align(ndr, 5));
8970 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id));
8971 if (_ptr_id) {
8972 NDR_PULL_ALLOC(ndr, r->id);
8973 } else {
8974 r->id = NULL;
8976 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
8977 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error));
8978 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
8979 if (r->count > 10000) {
8980 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
8982 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objects));
8983 if (_ptr_objects) {
8984 NDR_PULL_ALLOC(ndr, r->objects);
8985 } else {
8986 r->objects = NULL;
8989 if (ndr_flags & NDR_BUFFERS) {
8990 if (r->id) {
8991 _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
8992 NDR_PULL_SET_MEM_CTX(ndr, r->id, 0);
8993 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
8994 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0);
8996 if (r->objects) {
8997 _mem_save_objects_0 = NDR_PULL_GET_MEM_CTX(ndr);
8998 NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0);
8999 NDR_CHECK(ndr_pull_array_size(ndr, &r->objects));
9000 NDR_PULL_ALLOC_N(ndr, r->objects, ndr_get_array_size(ndr, &r->objects));
9001 _mem_save_objects_1 = NDR_PULL_GET_MEM_CTX(ndr);
9002 NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0);
9003 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
9004 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1]));
9006 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
9007 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1]));
9009 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_1, 0);
9010 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_0, 0);
9012 if (r->objects) {
9013 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->objects, r->count));
9016 return NDR_ERR_SUCCESS;
9019 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr2 *r)
9021 uint32_t cntr_objects_1;
9022 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryCtr2");
9023 ndr->depth++;
9024 ndr_print_ptr(ndr, "id", r->id);
9025 ndr->depth++;
9026 if (r->id) {
9027 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id);
9029 ndr->depth--;
9030 ndr_print_uint32(ndr, "unknown1", r->unknown1);
9031 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "error", &r->error);
9032 ndr_print_uint32(ndr, "count", r->count);
9033 ndr_print_ptr(ndr, "objects", r->objects);
9034 ndr->depth++;
9035 if (r->objects) {
9036 ndr->print(ndr, "%s: ARRAY(%d)", "objects", (int)r->count);
9037 ndr->depth++;
9038 for (cntr_objects_1=0;cntr_objects_1<r->count;cntr_objects_1++) {
9039 char *idx_1=NULL;
9040 if (asprintf(&idx_1, "[%d]", cntr_objects_1) != -1) {
9041 ndr_print_drsuapi_DsReplicaObjectIdentifier2(ndr, "objects", &r->objects[cntr_objects_1]);
9042 free(idx_1);
9045 ndr->depth--;
9047 ndr->depth--;
9048 ndr->depth--;
9051 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryCtr3 *r)
9053 uint32_t cntr_objects_1;
9054 if (ndr_flags & NDR_SCALARS) {
9055 NDR_CHECK(ndr_push_align(ndr, 5));
9056 NDR_CHECK(ndr_push_unique_ptr(ndr, r->id));
9057 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
9058 NDR_CHECK(ndr_push_unique_ptr(ndr, r->error));
9059 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9060 NDR_CHECK(ndr_push_unique_ptr(ndr, r->objects));
9062 if (ndr_flags & NDR_BUFFERS) {
9063 if (r->id) {
9064 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
9066 if (r->error) {
9067 NDR_CHECK(ndr_push_set_switch_value(ndr, r->error, r->level));
9068 NDR_CHECK(ndr_push_drsuapi_DsAddEntryError(ndr, NDR_SCALARS|NDR_BUFFERS, r->error));
9070 if (r->objects) {
9071 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9072 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
9073 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1]));
9075 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
9076 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1]));
9080 return NDR_ERR_SUCCESS;
9083 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryCtr3 *r)
9085 uint32_t _ptr_id;
9086 TALLOC_CTX *_mem_save_id_0;
9087 uint32_t _ptr_error;
9088 TALLOC_CTX *_mem_save_error_0;
9089 uint32_t _ptr_objects;
9090 uint32_t cntr_objects_1;
9091 TALLOC_CTX *_mem_save_objects_0;
9092 TALLOC_CTX *_mem_save_objects_1;
9093 if (ndr_flags & NDR_SCALARS) {
9094 NDR_CHECK(ndr_pull_align(ndr, 5));
9095 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id));
9096 if (_ptr_id) {
9097 NDR_PULL_ALLOC(ndr, r->id);
9098 } else {
9099 r->id = NULL;
9101 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
9102 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_error));
9103 if (_ptr_error) {
9104 NDR_PULL_ALLOC(ndr, r->error);
9105 } else {
9106 r->error = NULL;
9108 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9109 if (r->count > 10000) {
9110 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
9112 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objects));
9113 if (_ptr_objects) {
9114 NDR_PULL_ALLOC(ndr, r->objects);
9115 } else {
9116 r->objects = NULL;
9119 if (ndr_flags & NDR_BUFFERS) {
9120 if (r->id) {
9121 _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
9122 NDR_PULL_SET_MEM_CTX(ndr, r->id, 0);
9123 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
9124 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0);
9126 if (r->error) {
9127 _mem_save_error_0 = NDR_PULL_GET_MEM_CTX(ndr);
9128 NDR_PULL_SET_MEM_CTX(ndr, r->error, 0);
9129 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->error, r->level));
9130 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError(ndr, NDR_SCALARS|NDR_BUFFERS, r->error));
9131 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_error_0, 0);
9133 if (r->objects) {
9134 _mem_save_objects_0 = NDR_PULL_GET_MEM_CTX(ndr);
9135 NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0);
9136 NDR_CHECK(ndr_pull_array_size(ndr, &r->objects));
9137 NDR_PULL_ALLOC_N(ndr, r->objects, ndr_get_array_size(ndr, &r->objects));
9138 _mem_save_objects_1 = NDR_PULL_GET_MEM_CTX(ndr);
9139 NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0);
9140 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
9141 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1]));
9143 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
9144 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1]));
9146 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_1, 0);
9147 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_0, 0);
9149 if (r->objects) {
9150 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->objects, r->count));
9153 return NDR_ERR_SUCCESS;
9156 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr3 *r)
9158 uint32_t cntr_objects_1;
9159 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryCtr3");
9160 ndr->depth++;
9161 ndr_print_ptr(ndr, "id", r->id);
9162 ndr->depth++;
9163 if (r->id) {
9164 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id);
9166 ndr->depth--;
9167 ndr_print_uint32(ndr, "level", r->level);
9168 ndr_print_ptr(ndr, "error", r->error);
9169 ndr->depth++;
9170 if (r->error) {
9171 ndr_print_set_switch_value(ndr, r->error, r->level);
9172 ndr_print_drsuapi_DsAddEntryError(ndr, "error", r->error);
9174 ndr->depth--;
9175 ndr_print_uint32(ndr, "count", r->count);
9176 ndr_print_ptr(ndr, "objects", r->objects);
9177 ndr->depth++;
9178 if (r->objects) {
9179 ndr->print(ndr, "%s: ARRAY(%d)", "objects", (int)r->count);
9180 ndr->depth++;
9181 for (cntr_objects_1=0;cntr_objects_1<r->count;cntr_objects_1++) {
9182 char *idx_1=NULL;
9183 if (asprintf(&idx_1, "[%d]", cntr_objects_1) != -1) {
9184 ndr_print_drsuapi_DsReplicaObjectIdentifier2(ndr, "objects", &r->objects[cntr_objects_1]);
9185 free(idx_1);
9188 ndr->depth--;
9190 ndr->depth--;
9191 ndr->depth--;
9194 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryCtr *r)
9196 if (ndr_flags & NDR_SCALARS) {
9197 int level = ndr_push_get_switch_value(ndr, r);
9198 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
9199 NDR_CHECK(ndr_push_union_align(ndr, 5));
9200 switch (level) {
9201 case 2: {
9202 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr2(ndr, NDR_SCALARS, &r->ctr2));
9203 break; }
9205 case 3: {
9206 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr3(ndr, NDR_SCALARS, &r->ctr3));
9207 break; }
9209 default:
9210 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9213 if (ndr_flags & NDR_BUFFERS) {
9214 int level = ndr_push_get_switch_value(ndr, r);
9215 switch (level) {
9216 case 2:
9217 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr2(ndr, NDR_BUFFERS, &r->ctr2));
9218 break;
9220 case 3:
9221 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr3(ndr, NDR_BUFFERS, &r->ctr3));
9222 break;
9224 default:
9225 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9228 return NDR_ERR_SUCCESS;
9231 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryCtr *r)
9233 int level;
9234 int32_t _level;
9235 level = ndr_pull_get_switch_value(ndr, r);
9236 if (ndr_flags & NDR_SCALARS) {
9237 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
9238 if (_level != level) {
9239 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
9241 NDR_CHECK(ndr_pull_union_align(ndr, 5));
9242 switch (level) {
9243 case 2: {
9244 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr2(ndr, NDR_SCALARS, &r->ctr2));
9245 break; }
9247 case 3: {
9248 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr3(ndr, NDR_SCALARS, &r->ctr3));
9249 break; }
9251 default:
9252 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9255 if (ndr_flags & NDR_BUFFERS) {
9256 switch (level) {
9257 case 2:
9258 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr2(ndr, NDR_BUFFERS, &r->ctr2));
9259 break;
9261 case 3:
9262 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr3(ndr, NDR_BUFFERS, &r->ctr3));
9263 break;
9265 default:
9266 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9269 return NDR_ERR_SUCCESS;
9272 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryCtr *r)
9274 int level;
9275 level = ndr_print_get_switch_value(ndr, r);
9276 ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryCtr");
9277 switch (level) {
9278 case 2:
9279 ndr_print_drsuapi_DsAddEntryCtr2(ndr, "ctr2", &r->ctr2);
9280 break;
9282 case 3:
9283 ndr_print_drsuapi_DsAddEntryCtr3(ndr, "ctr3", &r->ctr3);
9284 break;
9286 default:
9287 ndr_print_bad_level(ndr, name, level);
9291 static enum ndr_err_code ndr_push_drsuapi_DsExecuteKCCFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
9293 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
9294 return NDR_ERR_SUCCESS;
9297 static enum ndr_err_code ndr_pull_drsuapi_DsExecuteKCCFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
9299 uint32_t v;
9300 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
9301 *r = v;
9302 return NDR_ERR_SUCCESS;
9305 _PUBLIC_ void ndr_print_drsuapi_DsExecuteKCCFlags(struct ndr_print *ndr, const char *name, uint32_t r)
9307 ndr_print_uint32(ndr, name, r);
9308 ndr->depth++;
9309 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_EXECUTE_KCC_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_EXECUTE_KCC_ASYNCHRONOUS_OPERATION, r);
9310 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_EXECUTE_KCC_DAMPED", DRSUAPI_DS_EXECUTE_KCC_DAMPED, r);
9311 ndr->depth--;
9314 static enum ndr_err_code ndr_push_drsuapi_DsExecuteKCC1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsExecuteKCC1 *r)
9316 if (ndr_flags & NDR_SCALARS) {
9317 NDR_CHECK(ndr_push_align(ndr, 4));
9318 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->taskID));
9319 NDR_CHECK(ndr_push_drsuapi_DsExecuteKCCFlags(ndr, NDR_SCALARS, r->flags));
9321 if (ndr_flags & NDR_BUFFERS) {
9323 return NDR_ERR_SUCCESS;
9326 static enum ndr_err_code ndr_pull_drsuapi_DsExecuteKCC1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsExecuteKCC1 *r)
9328 if (ndr_flags & NDR_SCALARS) {
9329 NDR_CHECK(ndr_pull_align(ndr, 4));
9330 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->taskID));
9331 NDR_CHECK(ndr_pull_drsuapi_DsExecuteKCCFlags(ndr, NDR_SCALARS, &r->flags));
9333 if (ndr_flags & NDR_BUFFERS) {
9335 return NDR_ERR_SUCCESS;
9338 _PUBLIC_ void ndr_print_drsuapi_DsExecuteKCC1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsExecuteKCC1 *r)
9340 ndr_print_struct(ndr, name, "drsuapi_DsExecuteKCC1");
9341 ndr->depth++;
9342 ndr_print_uint32(ndr, "taskID", r->taskID);
9343 ndr_print_drsuapi_DsExecuteKCCFlags(ndr, "flags", r->flags);
9344 ndr->depth--;
9347 static enum ndr_err_code ndr_push_drsuapi_DsExecuteKCCRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsExecuteKCCRequest *r)
9349 if (ndr_flags & NDR_SCALARS) {
9350 int level = ndr_push_get_switch_value(ndr, r);
9351 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
9352 NDR_CHECK(ndr_push_union_align(ndr, 4));
9353 switch (level) {
9354 case 1: {
9355 NDR_CHECK(ndr_push_drsuapi_DsExecuteKCC1(ndr, NDR_SCALARS, &r->ctr1));
9356 break; }
9358 default:
9359 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9362 if (ndr_flags & NDR_BUFFERS) {
9363 int level = ndr_push_get_switch_value(ndr, r);
9364 switch (level) {
9365 case 1:
9366 break;
9368 default:
9369 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9372 return NDR_ERR_SUCCESS;
9375 static enum ndr_err_code ndr_pull_drsuapi_DsExecuteKCCRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsExecuteKCCRequest *r)
9377 int level;
9378 uint32_t _level;
9379 level = ndr_pull_get_switch_value(ndr, r);
9380 if (ndr_flags & NDR_SCALARS) {
9381 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
9382 if (_level != level) {
9383 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
9385 NDR_CHECK(ndr_pull_union_align(ndr, 4));
9386 switch (level) {
9387 case 1: {
9388 NDR_CHECK(ndr_pull_drsuapi_DsExecuteKCC1(ndr, NDR_SCALARS, &r->ctr1));
9389 break; }
9391 default:
9392 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9395 if (ndr_flags & NDR_BUFFERS) {
9396 switch (level) {
9397 case 1:
9398 break;
9400 default:
9401 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9404 return NDR_ERR_SUCCESS;
9407 _PUBLIC_ void ndr_print_drsuapi_DsExecuteKCCRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsExecuteKCCRequest *r)
9409 int level;
9410 level = ndr_print_get_switch_value(ndr, r);
9411 ndr_print_union(ndr, name, level, "drsuapi_DsExecuteKCCRequest");
9412 switch (level) {
9413 case 1:
9414 ndr_print_drsuapi_DsExecuteKCC1(ndr, "ctr1", &r->ctr1);
9415 break;
9417 default:
9418 ndr_print_bad_level(ndr, name, level);
9422 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoLevel(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaGetInfoLevel r)
9424 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
9425 return NDR_ERR_SUCCESS;
9428 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoLevel(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaGetInfoLevel *r)
9430 uint32_t v;
9431 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
9432 *r = v;
9433 return NDR_ERR_SUCCESS;
9436 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoLevel(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaGetInfoLevel r)
9438 const char *val = NULL;
9440 switch (r) {
9441 case DRSUAPI_DS_REPLICA_GET_INFO: val = "DRSUAPI_DS_REPLICA_GET_INFO"; break;
9442 case DRSUAPI_DS_REPLICA_GET_INFO2: val = "DRSUAPI_DS_REPLICA_GET_INFO2"; break;
9444 ndr_print_enum(ndr, name, "ENUM", val, r);
9447 static enum ndr_err_code ndr_push_drsuapi_DsReplicaInfoType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaInfoType r)
9449 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
9450 return NDR_ERR_SUCCESS;
9453 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaInfoType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaInfoType *r)
9455 uint32_t v;
9456 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
9457 *r = v;
9458 return NDR_ERR_SUCCESS;
9461 _PUBLIC_ void ndr_print_drsuapi_DsReplicaInfoType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaInfoType r)
9463 const char *val = NULL;
9465 switch (r) {
9466 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: val = "DRSUAPI_DS_REPLICA_INFO_NEIGHBORS"; break;
9467 case DRSUAPI_DS_REPLICA_INFO_CURSORS: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS"; break;
9468 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: val = "DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA"; break;
9469 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: val = "DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES"; break;
9470 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: val = "DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES"; break;
9471 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: val = "DRSUAPI_DS_REPLICA_INFO_PENDING_OPS"; break;
9472 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: val = "DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA"; break;
9473 case DRSUAPI_DS_REPLICA_INFO_CURSORS2: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS2"; break;
9474 case DRSUAPI_DS_REPLICA_INFO_CURSORS3: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS3"; break;
9475 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: val = "DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2"; break;
9476 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: val = "DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2"; break;
9477 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: val = "DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02"; break;
9478 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: val = "DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04"; break;
9479 case DRSUAPI_DS_REPLICA_INFO_CURSORS05: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS05"; break;
9480 case DRSUAPI_DS_REPLICA_INFO_06: val = "DRSUAPI_DS_REPLICA_INFO_06"; break;
9482 ndr_print_enum(ndr, name, "ENUM", val, r);
9485 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaGetInfoRequest1 *r)
9487 if (ndr_flags & NDR_SCALARS) {
9488 NDR_CHECK(ndr_push_align(ndr, 5));
9489 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->info_type));
9490 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
9491 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1));
9493 if (ndr_flags & NDR_BUFFERS) {
9494 if (r->object_dn) {
9495 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
9496 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9497 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
9498 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9501 return NDR_ERR_SUCCESS;
9504 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaGetInfoRequest1 *r)
9506 uint32_t _ptr_object_dn;
9507 TALLOC_CTX *_mem_save_object_dn_0;
9508 if (ndr_flags & NDR_SCALARS) {
9509 NDR_CHECK(ndr_pull_align(ndr, 5));
9510 NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, &r->info_type));
9511 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
9512 if (_ptr_object_dn) {
9513 NDR_PULL_ALLOC(ndr, r->object_dn);
9514 } else {
9515 r->object_dn = NULL;
9517 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1));
9519 if (ndr_flags & NDR_BUFFERS) {
9520 if (r->object_dn) {
9521 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
9522 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
9523 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
9524 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
9525 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
9526 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn));
9528 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
9529 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
9530 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
9533 return NDR_ERR_SUCCESS;
9536 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest1 *r)
9538 ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfoRequest1");
9539 ndr->depth++;
9540 ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", r->info_type);
9541 ndr_print_ptr(ndr, "object_dn", r->object_dn);
9542 ndr->depth++;
9543 if (r->object_dn) {
9544 ndr_print_string(ndr, "object_dn", r->object_dn);
9546 ndr->depth--;
9547 ndr_print_GUID(ndr, "guid1", &r->guid1);
9548 ndr->depth--;
9551 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaGetInfoRequest2 *r)
9553 if (ndr_flags & NDR_SCALARS) {
9554 NDR_CHECK(ndr_push_align(ndr, 5));
9555 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->info_type));
9556 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
9557 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1));
9558 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
9559 NDR_CHECK(ndr_push_unique_ptr(ndr, r->string1));
9560 NDR_CHECK(ndr_push_unique_ptr(ndr, r->string2));
9561 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
9563 if (ndr_flags & NDR_BUFFERS) {
9564 if (r->object_dn) {
9565 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
9566 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9567 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
9568 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9570 if (r->string1) {
9571 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->string1, CH_UTF16)));
9572 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9573 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->string1, CH_UTF16)));
9574 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string1, ndr_charset_length(r->string1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9576 if (r->string2) {
9577 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->string2, CH_UTF16)));
9578 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9579 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->string2, CH_UTF16)));
9580 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string2, ndr_charset_length(r->string2, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9583 return NDR_ERR_SUCCESS;
9586 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaGetInfoRequest2 *r)
9588 uint32_t _ptr_object_dn;
9589 TALLOC_CTX *_mem_save_object_dn_0;
9590 uint32_t _ptr_string1;
9591 TALLOC_CTX *_mem_save_string1_0;
9592 uint32_t _ptr_string2;
9593 TALLOC_CTX *_mem_save_string2_0;
9594 if (ndr_flags & NDR_SCALARS) {
9595 NDR_CHECK(ndr_pull_align(ndr, 5));
9596 NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, &r->info_type));
9597 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
9598 if (_ptr_object_dn) {
9599 NDR_PULL_ALLOC(ndr, r->object_dn);
9600 } else {
9601 r->object_dn = NULL;
9603 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1));
9604 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
9605 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string1));
9606 if (_ptr_string1) {
9607 NDR_PULL_ALLOC(ndr, r->string1);
9608 } else {
9609 r->string1 = NULL;
9611 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string2));
9612 if (_ptr_string2) {
9613 NDR_PULL_ALLOC(ndr, r->string2);
9614 } else {
9615 r->string2 = NULL;
9617 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
9619 if (ndr_flags & NDR_BUFFERS) {
9620 if (r->object_dn) {
9621 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
9622 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
9623 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
9624 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
9625 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
9626 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn));
9628 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
9629 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
9630 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
9632 if (r->string1) {
9633 _mem_save_string1_0 = NDR_PULL_GET_MEM_CTX(ndr);
9634 NDR_PULL_SET_MEM_CTX(ndr, r->string1, 0);
9635 NDR_CHECK(ndr_pull_array_size(ndr, &r->string1));
9636 NDR_CHECK(ndr_pull_array_length(ndr, &r->string1));
9637 if (ndr_get_array_length(ndr, &r->string1) > ndr_get_array_size(ndr, &r->string1)) {
9638 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string1), ndr_get_array_length(ndr, &r->string1));
9640 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->string1), sizeof(uint16_t)));
9641 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string1, ndr_get_array_length(ndr, &r->string1), sizeof(uint16_t), CH_UTF16));
9642 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string1_0, 0);
9644 if (r->string2) {
9645 _mem_save_string2_0 = NDR_PULL_GET_MEM_CTX(ndr);
9646 NDR_PULL_SET_MEM_CTX(ndr, r->string2, 0);
9647 NDR_CHECK(ndr_pull_array_size(ndr, &r->string2));
9648 NDR_CHECK(ndr_pull_array_length(ndr, &r->string2));
9649 if (ndr_get_array_length(ndr, &r->string2) > ndr_get_array_size(ndr, &r->string2)) {
9650 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string2), ndr_get_array_length(ndr, &r->string2));
9652 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->string2), sizeof(uint16_t)));
9653 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string2, ndr_get_array_length(ndr, &r->string2), sizeof(uint16_t), CH_UTF16));
9654 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string2_0, 0);
9657 return NDR_ERR_SUCCESS;
9660 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest2 *r)
9662 ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfoRequest2");
9663 ndr->depth++;
9664 ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", r->info_type);
9665 ndr_print_ptr(ndr, "object_dn", r->object_dn);
9666 ndr->depth++;
9667 if (r->object_dn) {
9668 ndr_print_string(ndr, "object_dn", r->object_dn);
9670 ndr->depth--;
9671 ndr_print_GUID(ndr, "guid1", &r->guid1);
9672 ndr_print_uint32(ndr, "unknown1", r->unknown1);
9673 ndr_print_ptr(ndr, "string1", r->string1);
9674 ndr->depth++;
9675 if (r->string1) {
9676 ndr_print_string(ndr, "string1", r->string1);
9678 ndr->depth--;
9679 ndr_print_ptr(ndr, "string2", r->string2);
9680 ndr->depth++;
9681 if (r->string2) {
9682 ndr_print_string(ndr, "string2", r->string2);
9684 ndr->depth--;
9685 ndr_print_uint32(ndr, "unknown2", r->unknown2);
9686 ndr->depth--;
9689 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaGetInfoRequest *r)
9691 if (ndr_flags & NDR_SCALARS) {
9692 int level = ndr_push_get_switch_value(ndr, r);
9693 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, level));
9694 NDR_CHECK(ndr_push_union_align(ndr, 5));
9695 switch (level) {
9696 case DRSUAPI_DS_REPLICA_GET_INFO: {
9697 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_SCALARS, &r->req1));
9698 break; }
9700 case DRSUAPI_DS_REPLICA_GET_INFO2: {
9701 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_SCALARS, &r->req2));
9702 break; }
9704 default:
9705 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9708 if (ndr_flags & NDR_BUFFERS) {
9709 int level = ndr_push_get_switch_value(ndr, r);
9710 switch (level) {
9711 case DRSUAPI_DS_REPLICA_GET_INFO:
9712 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_BUFFERS, &r->req1));
9713 break;
9715 case DRSUAPI_DS_REPLICA_GET_INFO2:
9716 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_BUFFERS, &r->req2));
9717 break;
9719 default:
9720 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9723 return NDR_ERR_SUCCESS;
9726 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaGetInfoRequest *r)
9728 int level;
9729 uint32_t _level;
9730 level = ndr_pull_get_switch_value(ndr, r);
9731 if (ndr_flags & NDR_SCALARS) {
9732 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
9733 if (_level != level) {
9734 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
9736 NDR_CHECK(ndr_pull_union_align(ndr, 5));
9737 switch (level) {
9738 case DRSUAPI_DS_REPLICA_GET_INFO: {
9739 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_SCALARS, &r->req1));
9740 break; }
9742 case DRSUAPI_DS_REPLICA_GET_INFO2: {
9743 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_SCALARS, &r->req2));
9744 break; }
9746 default:
9747 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9750 if (ndr_flags & NDR_BUFFERS) {
9751 switch (level) {
9752 case DRSUAPI_DS_REPLICA_GET_INFO:
9753 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_BUFFERS, &r->req1));
9754 break;
9756 case DRSUAPI_DS_REPLICA_GET_INFO2:
9757 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_BUFFERS, &r->req2));
9758 break;
9760 default:
9761 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
9764 return NDR_ERR_SUCCESS;
9767 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaGetInfoRequest *r)
9769 int level;
9770 level = ndr_print_get_switch_value(ndr, r);
9771 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaGetInfoRequest");
9772 switch (level) {
9773 case DRSUAPI_DS_REPLICA_GET_INFO:
9774 ndr_print_drsuapi_DsReplicaGetInfoRequest1(ndr, "req1", &r->req1);
9775 break;
9777 case DRSUAPI_DS_REPLICA_GET_INFO2:
9778 ndr_print_drsuapi_DsReplicaGetInfoRequest2(ndr, "req2", &r->req2);
9779 break;
9781 default:
9782 ndr_print_bad_level(ndr, name, level);
9786 static enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbour(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaNeighbour *r)
9788 if (ndr_flags & NDR_SCALARS) {
9789 NDR_CHECK(ndr_push_align(ndr, 8));
9790 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context_dn));
9791 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_obj_dn));
9792 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_address));
9793 NDR_CHECK(ndr_push_unique_ptr(ndr, r->transport_obj_dn));
9794 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
9795 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
9796 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->naming_context_obj_guid));
9797 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid));
9798 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
9799 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->transport_obj_guid));
9800 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->tmp_highest_usn));
9801 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
9802 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_success));
9803 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_attempt));
9804 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->result_last_attempt));
9805 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->consecutive_sync_failures));
9807 if (ndr_flags & NDR_BUFFERS) {
9808 if (r->naming_context_dn) {
9809 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->naming_context_dn, CH_UTF16)));
9810 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9811 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->naming_context_dn, CH_UTF16)));
9812 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->naming_context_dn, ndr_charset_length(r->naming_context_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9814 if (r->source_dsa_obj_dn) {
9815 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16)));
9816 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9817 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16)));
9818 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_obj_dn, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9820 if (r->source_dsa_address) {
9821 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
9822 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9823 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
9824 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_address, ndr_charset_length(r->source_dsa_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9826 if (r->transport_obj_dn) {
9827 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->transport_obj_dn, CH_UTF16)));
9828 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
9829 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->transport_obj_dn, CH_UTF16)));
9830 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->transport_obj_dn, ndr_charset_length(r->transport_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9833 return NDR_ERR_SUCCESS;
9836 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbour(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaNeighbour *r)
9838 uint32_t _ptr_naming_context_dn;
9839 TALLOC_CTX *_mem_save_naming_context_dn_0;
9840 uint32_t _ptr_source_dsa_obj_dn;
9841 TALLOC_CTX *_mem_save_source_dsa_obj_dn_0;
9842 uint32_t _ptr_source_dsa_address;
9843 TALLOC_CTX *_mem_save_source_dsa_address_0;
9844 uint32_t _ptr_transport_obj_dn;
9845 TALLOC_CTX *_mem_save_transport_obj_dn_0;
9846 if (ndr_flags & NDR_SCALARS) {
9847 NDR_CHECK(ndr_pull_align(ndr, 8));
9848 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context_dn));
9849 if (_ptr_naming_context_dn) {
9850 NDR_PULL_ALLOC(ndr, r->naming_context_dn);
9851 } else {
9852 r->naming_context_dn = NULL;
9854 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_obj_dn));
9855 if (_ptr_source_dsa_obj_dn) {
9856 NDR_PULL_ALLOC(ndr, r->source_dsa_obj_dn);
9857 } else {
9858 r->source_dsa_obj_dn = NULL;
9860 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_address));
9861 if (_ptr_source_dsa_address) {
9862 NDR_PULL_ALLOC(ndr, r->source_dsa_address);
9863 } else {
9864 r->source_dsa_address = NULL;
9866 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport_obj_dn));
9867 if (_ptr_transport_obj_dn) {
9868 NDR_PULL_ALLOC(ndr, r->transport_obj_dn);
9869 } else {
9870 r->transport_obj_dn = NULL;
9872 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
9873 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
9874 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->naming_context_obj_guid));
9875 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid));
9876 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
9877 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->transport_obj_guid));
9878 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->tmp_highest_usn));
9879 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
9880 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_success));
9881 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_attempt));
9882 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->result_last_attempt));
9883 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->consecutive_sync_failures));
9885 if (ndr_flags & NDR_BUFFERS) {
9886 if (r->naming_context_dn) {
9887 _mem_save_naming_context_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
9888 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context_dn, 0);
9889 NDR_CHECK(ndr_pull_array_size(ndr, &r->naming_context_dn));
9890 NDR_CHECK(ndr_pull_array_length(ndr, &r->naming_context_dn));
9891 if (ndr_get_array_length(ndr, &r->naming_context_dn) > ndr_get_array_size(ndr, &r->naming_context_dn)) {
9892 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->naming_context_dn), ndr_get_array_length(ndr, &r->naming_context_dn));
9894 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->naming_context_dn), sizeof(uint16_t)));
9895 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->naming_context_dn, ndr_get_array_length(ndr, &r->naming_context_dn), sizeof(uint16_t), CH_UTF16));
9896 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_dn_0, 0);
9898 if (r->source_dsa_obj_dn) {
9899 _mem_save_source_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
9900 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_obj_dn, 0);
9901 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_obj_dn));
9902 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_obj_dn));
9903 if (ndr_get_array_length(ndr, &r->source_dsa_obj_dn) > ndr_get_array_size(ndr, &r->source_dsa_obj_dn)) {
9904 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_obj_dn), ndr_get_array_length(ndr, &r->source_dsa_obj_dn));
9906 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t)));
9907 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_obj_dn, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t), CH_UTF16));
9908 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_obj_dn_0, 0);
9910 if (r->source_dsa_address) {
9911 _mem_save_source_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
9912 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_address, 0);
9913 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_address));
9914 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_address));
9915 if (ndr_get_array_length(ndr, &r->source_dsa_address) > ndr_get_array_size(ndr, &r->source_dsa_address)) {
9916 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_address), ndr_get_array_length(ndr, &r->source_dsa_address));
9918 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t)));
9919 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_address, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t), CH_UTF16));
9920 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_address_0, 0);
9922 if (r->transport_obj_dn) {
9923 _mem_save_transport_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
9924 NDR_PULL_SET_MEM_CTX(ndr, r->transport_obj_dn, 0);
9925 NDR_CHECK(ndr_pull_array_size(ndr, &r->transport_obj_dn));
9926 NDR_CHECK(ndr_pull_array_length(ndr, &r->transport_obj_dn));
9927 if (ndr_get_array_length(ndr, &r->transport_obj_dn) > ndr_get_array_size(ndr, &r->transport_obj_dn)) {
9928 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->transport_obj_dn), ndr_get_array_length(ndr, &r->transport_obj_dn));
9930 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->transport_obj_dn), sizeof(uint16_t)));
9931 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->transport_obj_dn, ndr_get_array_length(ndr, &r->transport_obj_dn), sizeof(uint16_t), CH_UTF16));
9932 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_obj_dn_0, 0);
9935 return NDR_ERR_SUCCESS;
9938 _PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbour(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbour *r)
9940 ndr_print_struct(ndr, name, "drsuapi_DsReplicaNeighbour");
9941 ndr->depth++;
9942 ndr_print_ptr(ndr, "naming_context_dn", r->naming_context_dn);
9943 ndr->depth++;
9944 if (r->naming_context_dn) {
9945 ndr_print_string(ndr, "naming_context_dn", r->naming_context_dn);
9947 ndr->depth--;
9948 ndr_print_ptr(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn);
9949 ndr->depth++;
9950 if (r->source_dsa_obj_dn) {
9951 ndr_print_string(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn);
9953 ndr->depth--;
9954 ndr_print_ptr(ndr, "source_dsa_address", r->source_dsa_address);
9955 ndr->depth++;
9956 if (r->source_dsa_address) {
9957 ndr_print_string(ndr, "source_dsa_address", r->source_dsa_address);
9959 ndr->depth--;
9960 ndr_print_ptr(ndr, "transport_obj_dn", r->transport_obj_dn);
9961 ndr->depth++;
9962 if (r->transport_obj_dn) {
9963 ndr_print_string(ndr, "transport_obj_dn", r->transport_obj_dn);
9965 ndr->depth--;
9966 ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
9967 ndr_print_uint32(ndr, "reserved", r->reserved);
9968 ndr_print_GUID(ndr, "naming_context_obj_guid", &r->naming_context_obj_guid);
9969 ndr_print_GUID(ndr, "source_dsa_obj_guid", &r->source_dsa_obj_guid);
9970 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
9971 ndr_print_GUID(ndr, "transport_obj_guid", &r->transport_obj_guid);
9972 ndr_print_hyper(ndr, "tmp_highest_usn", r->tmp_highest_usn);
9973 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
9974 ndr_print_NTTIME(ndr, "last_success", r->last_success);
9975 ndr_print_NTTIME(ndr, "last_attempt", r->last_attempt);
9976 ndr_print_WERROR(ndr, "result_last_attempt", r->result_last_attempt);
9977 ndr_print_uint32(ndr, "consecutive_sync_failures", r->consecutive_sync_failures);
9978 ndr->depth--;
9981 static enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaNeighbourCtr *r)
9983 uint32_t cntr_array_0;
9984 if (ndr_flags & NDR_SCALARS) {
9985 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
9986 NDR_CHECK(ndr_push_align(ndr, 8));
9987 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9988 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
9989 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9990 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbour(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9993 if (ndr_flags & NDR_BUFFERS) {
9994 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9995 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbour(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9998 return NDR_ERR_SUCCESS;
10001 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaNeighbourCtr *r)
10003 uint32_t cntr_array_0;
10004 TALLOC_CTX *_mem_save_array_0;
10005 if (ndr_flags & NDR_SCALARS) {
10006 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10007 NDR_CHECK(ndr_pull_align(ndr, 8));
10008 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10009 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
10010 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10011 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10012 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10013 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10014 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbour(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10016 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10017 if (r->array) {
10018 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10021 if (ndr_flags & NDR_BUFFERS) {
10022 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10023 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10024 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10025 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbour(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10027 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10029 return NDR_ERR_SUCCESS;
10032 _PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbourCtr *r)
10034 uint32_t cntr_array_0;
10035 ndr_print_struct(ndr, name, "drsuapi_DsReplicaNeighbourCtr");
10036 ndr->depth++;
10037 ndr_print_uint32(ndr, "count", r->count);
10038 ndr_print_uint32(ndr, "reserved", r->reserved);
10039 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10040 ndr->depth++;
10041 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10042 char *idx_0=NULL;
10043 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10044 ndr_print_drsuapi_DsReplicaNeighbour(ndr, "array", &r->array[cntr_array_0]);
10045 free(idx_0);
10048 ndr->depth--;
10049 ndr->depth--;
10052 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtr *r)
10054 uint32_t cntr_array_0;
10055 if (ndr_flags & NDR_SCALARS) {
10056 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
10057 NDR_CHECK(ndr_push_align(ndr, 8));
10058 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10059 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
10060 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10061 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10064 if (ndr_flags & NDR_BUFFERS) {
10066 return NDR_ERR_SUCCESS;
10069 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtr *r)
10071 uint32_t cntr_array_0;
10072 TALLOC_CTX *_mem_save_array_0;
10073 if (ndr_flags & NDR_SCALARS) {
10074 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10075 NDR_CHECK(ndr_pull_align(ndr, 8));
10076 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10077 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
10078 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10079 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10080 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10081 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10082 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10084 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10085 if (r->array) {
10086 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10089 if (ndr_flags & NDR_BUFFERS) {
10091 return NDR_ERR_SUCCESS;
10094 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtr *r)
10096 uint32_t cntr_array_0;
10097 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursorCtr");
10098 ndr->depth++;
10099 ndr_print_uint32(ndr, "count", r->count);
10100 ndr_print_uint32(ndr, "reserved", r->reserved);
10101 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10102 ndr->depth++;
10103 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10104 char *idx_0=NULL;
10105 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10106 ndr_print_drsuapi_DsReplicaCursor(ndr, "array", &r->array[cntr_array_0]);
10107 free(idx_0);
10110 ndr->depth--;
10111 ndr->depth--;
10114 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData *r)
10116 if (ndr_flags & NDR_SCALARS) {
10117 NDR_CHECK(ndr_push_align(ndr, 8));
10118 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name));
10119 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
10120 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time));
10121 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
10122 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
10123 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn));
10125 if (ndr_flags & NDR_BUFFERS) {
10126 if (r->attribute_name) {
10127 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
10128 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10129 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
10130 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10133 return NDR_ERR_SUCCESS;
10136 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData *r)
10138 uint32_t _ptr_attribute_name;
10139 TALLOC_CTX *_mem_save_attribute_name_0;
10140 if (ndr_flags & NDR_SCALARS) {
10141 NDR_CHECK(ndr_pull_align(ndr, 8));
10142 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name));
10143 if (_ptr_attribute_name) {
10144 NDR_PULL_ALLOC(ndr, r->attribute_name);
10145 } else {
10146 r->attribute_name = NULL;
10148 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
10149 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time));
10150 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
10151 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
10152 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn));
10154 if (ndr_flags & NDR_BUFFERS) {
10155 if (r->attribute_name) {
10156 _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10157 NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0);
10158 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name));
10159 NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name));
10160 if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) {
10161 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name));
10163 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t)));
10164 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16));
10165 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0);
10168 return NDR_ERR_SUCCESS;
10171 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData *r)
10173 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData");
10174 ndr->depth++;
10175 ndr_print_ptr(ndr, "attribute_name", r->attribute_name);
10176 ndr->depth++;
10177 if (r->attribute_name) {
10178 ndr_print_string(ndr, "attribute_name", r->attribute_name);
10180 ndr->depth--;
10181 ndr_print_uint32(ndr, "version", r->version);
10182 ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time);
10183 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
10184 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
10185 ndr_print_hyper(ndr, "local_usn", r->local_usn);
10186 ndr->depth--;
10189 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaDataCtr *r)
10191 uint32_t cntr_array_0;
10192 if (ndr_flags & NDR_SCALARS) {
10193 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
10194 NDR_CHECK(ndr_push_align(ndr, 8));
10195 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10196 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
10197 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10198 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10201 if (ndr_flags & NDR_BUFFERS) {
10202 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10203 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10206 return NDR_ERR_SUCCESS;
10209 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaDataCtr *r)
10211 uint32_t cntr_array_0;
10212 TALLOC_CTX *_mem_save_array_0;
10213 if (ndr_flags & NDR_SCALARS) {
10214 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10215 NDR_CHECK(ndr_pull_align(ndr, 8));
10216 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10217 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
10218 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10219 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10220 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10221 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10222 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10224 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10225 if (r->array) {
10226 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10229 if (ndr_flags & NDR_BUFFERS) {
10230 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10231 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10232 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10233 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10235 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10237 return NDR_ERR_SUCCESS;
10240 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaDataCtr *r)
10242 uint32_t cntr_array_0;
10243 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaDataCtr");
10244 ndr->depth++;
10245 ndr_print_uint32(ndr, "count", r->count);
10246 ndr_print_uint32(ndr, "reserved", r->reserved);
10247 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10248 ndr->depth++;
10249 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10250 char *idx_0=NULL;
10251 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10252 ndr_print_drsuapi_DsReplicaObjMetaData(ndr, "array", &r->array[cntr_array_0]);
10253 free(idx_0);
10256 ndr->depth--;
10257 ndr->depth--;
10260 static enum ndr_err_code ndr_push_drsuapi_DsReplicaKccDsaFailure(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaKccDsaFailure *r)
10262 if (ndr_flags & NDR_SCALARS) {
10263 NDR_CHECK(ndr_push_align(ndr, 5));
10264 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dsa_obj_dn));
10265 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->dsa_obj_guid));
10266 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->first_failure));
10267 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_failures));
10268 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->last_result));
10270 if (ndr_flags & NDR_BUFFERS) {
10271 if (r->dsa_obj_dn) {
10272 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dsa_obj_dn, CH_UTF16)));
10273 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10274 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dsa_obj_dn, CH_UTF16)));
10275 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dsa_obj_dn, ndr_charset_length(r->dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10278 return NDR_ERR_SUCCESS;
10281 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaKccDsaFailure(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaKccDsaFailure *r)
10283 uint32_t _ptr_dsa_obj_dn;
10284 TALLOC_CTX *_mem_save_dsa_obj_dn_0;
10285 if (ndr_flags & NDR_SCALARS) {
10286 NDR_CHECK(ndr_pull_align(ndr, 5));
10287 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_obj_dn));
10288 if (_ptr_dsa_obj_dn) {
10289 NDR_PULL_ALLOC(ndr, r->dsa_obj_dn);
10290 } else {
10291 r->dsa_obj_dn = NULL;
10293 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->dsa_obj_guid));
10294 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->first_failure));
10295 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_failures));
10296 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->last_result));
10298 if (ndr_flags & NDR_BUFFERS) {
10299 if (r->dsa_obj_dn) {
10300 _mem_save_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
10301 NDR_PULL_SET_MEM_CTX(ndr, r->dsa_obj_dn, 0);
10302 NDR_CHECK(ndr_pull_array_size(ndr, &r->dsa_obj_dn));
10303 NDR_CHECK(ndr_pull_array_length(ndr, &r->dsa_obj_dn));
10304 if (ndr_get_array_length(ndr, &r->dsa_obj_dn) > ndr_get_array_size(ndr, &r->dsa_obj_dn)) {
10305 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dsa_obj_dn), ndr_get_array_length(ndr, &r->dsa_obj_dn));
10307 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dsa_obj_dn), sizeof(uint16_t)));
10308 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dsa_obj_dn, ndr_get_array_length(ndr, &r->dsa_obj_dn), sizeof(uint16_t), CH_UTF16));
10309 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_obj_dn_0, 0);
10312 return NDR_ERR_SUCCESS;
10315 _PUBLIC_ void ndr_print_drsuapi_DsReplicaKccDsaFailure(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailure *r)
10317 ndr_print_struct(ndr, name, "drsuapi_DsReplicaKccDsaFailure");
10318 ndr->depth++;
10319 ndr_print_ptr(ndr, "dsa_obj_dn", r->dsa_obj_dn);
10320 ndr->depth++;
10321 if (r->dsa_obj_dn) {
10322 ndr_print_string(ndr, "dsa_obj_dn", r->dsa_obj_dn);
10324 ndr->depth--;
10325 ndr_print_GUID(ndr, "dsa_obj_guid", &r->dsa_obj_guid);
10326 ndr_print_NTTIME(ndr, "first_failure", r->first_failure);
10327 ndr_print_uint32(ndr, "num_failures", r->num_failures);
10328 ndr_print_WERROR(ndr, "last_result", r->last_result);
10329 ndr->depth--;
10332 static enum ndr_err_code ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r)
10334 uint32_t cntr_array_0;
10335 if (ndr_flags & NDR_SCALARS) {
10336 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
10337 NDR_CHECK(ndr_push_align(ndr, 5));
10338 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10339 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
10340 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10341 NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10344 if (ndr_flags & NDR_BUFFERS) {
10345 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10346 NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10349 return NDR_ERR_SUCCESS;
10352 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaKccDsaFailuresCtr *r)
10354 uint32_t cntr_array_0;
10355 TALLOC_CTX *_mem_save_array_0;
10356 if (ndr_flags & NDR_SCALARS) {
10357 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10358 NDR_CHECK(ndr_pull_align(ndr, 5));
10359 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10360 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
10361 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10362 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10363 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10364 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10365 NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10367 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10368 if (r->array) {
10369 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10372 if (ndr_flags & NDR_BUFFERS) {
10373 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10374 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10375 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10376 NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10378 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10380 return NDR_ERR_SUCCESS;
10383 _PUBLIC_ void ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r)
10385 uint32_t cntr_array_0;
10386 ndr_print_struct(ndr, name, "drsuapi_DsReplicaKccDsaFailuresCtr");
10387 ndr->depth++;
10388 ndr_print_uint32(ndr, "count", r->count);
10389 ndr_print_uint32(ndr, "reserved", r->reserved);
10390 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10391 ndr->depth++;
10392 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10393 char *idx_0=NULL;
10394 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10395 ndr_print_drsuapi_DsReplicaKccDsaFailure(ndr, "array", &r->array[cntr_array_0]);
10396 free(idx_0);
10399 ndr->depth--;
10400 ndr->depth--;
10403 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOpType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaOpType r)
10405 NDR_CHECK(ndr_push_enum_uint16(ndr, NDR_SCALARS, r));
10406 return NDR_ERR_SUCCESS;
10409 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOpType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaOpType *r)
10411 uint16_t v;
10412 NDR_CHECK(ndr_pull_enum_uint16(ndr, NDR_SCALARS, &v));
10413 *r = v;
10414 return NDR_ERR_SUCCESS;
10417 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOpType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaOpType r)
10419 const char *val = NULL;
10421 switch (r) {
10422 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: val = "DRSUAPI_DS_REPLICA_OP_TYPE_SYNC"; break;
10423 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: val = "DRSUAPI_DS_REPLICA_OP_TYPE_ADD"; break;
10424 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: val = "DRSUAPI_DS_REPLICA_OP_TYPE_DELETE"; break;
10425 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: val = "DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY"; break;
10426 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: val = "DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS"; break;
10428 ndr_print_enum(ndr, name, "ENUM", val, r);
10431 static enum ndr_err_code ndr_push_drsuapi_DsRplicaOpOptions(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRplicaOpOptions *r)
10433 if (ndr_flags & NDR_SCALARS) {
10434 int level = ndr_push_get_switch_value(ndr, r);
10435 NDR_CHECK(ndr_push_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, level));
10436 NDR_CHECK(ndr_push_union_align(ndr, 4));
10437 switch (level) {
10438 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: {
10439 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->sync));
10440 break; }
10442 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: {
10443 NDR_CHECK(ndr_push_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, r->add));
10444 break; }
10446 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: {
10447 NDR_CHECK(ndr_push_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, r->op_delete));
10448 break; }
10450 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: {
10451 NDR_CHECK(ndr_push_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, r->modify));
10452 break; }
10454 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: {
10455 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, r->update_refs));
10456 break; }
10458 default: {
10459 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown));
10460 break; }
10464 if (ndr_flags & NDR_BUFFERS) {
10465 int level = ndr_push_get_switch_value(ndr, r);
10466 switch (level) {
10467 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC:
10468 break;
10470 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD:
10471 break;
10473 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE:
10474 break;
10476 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY:
10477 break;
10479 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS:
10480 break;
10482 default:
10483 break;
10487 return NDR_ERR_SUCCESS;
10490 static enum ndr_err_code ndr_pull_drsuapi_DsRplicaOpOptions(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRplicaOpOptions *r)
10492 int level;
10493 uint16_t _level;
10494 level = ndr_pull_get_switch_value(ndr, r);
10495 if (ndr_flags & NDR_SCALARS) {
10496 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
10497 if (_level != level) {
10498 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
10500 NDR_CHECK(ndr_pull_union_align(ndr, 4));
10501 switch (level) {
10502 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: {
10503 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->sync));
10504 break; }
10506 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: {
10507 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, &r->add));
10508 break; }
10510 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: {
10511 NDR_CHECK(ndr_pull_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, &r->op_delete));
10512 break; }
10514 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: {
10515 NDR_CHECK(ndr_pull_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, &r->modify));
10516 break; }
10518 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: {
10519 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, &r->update_refs));
10520 break; }
10522 default: {
10523 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
10524 break; }
10528 if (ndr_flags & NDR_BUFFERS) {
10529 switch (level) {
10530 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC:
10531 break;
10533 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD:
10534 break;
10536 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE:
10537 break;
10539 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY:
10540 break;
10542 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS:
10543 break;
10545 default:
10546 break;
10550 return NDR_ERR_SUCCESS;
10553 _PUBLIC_ void ndr_print_drsuapi_DsRplicaOpOptions(struct ndr_print *ndr, const char *name, const union drsuapi_DsRplicaOpOptions *r)
10555 int level;
10556 level = ndr_print_get_switch_value(ndr, r);
10557 ndr_print_union(ndr, name, level, "drsuapi_DsRplicaOpOptions");
10558 switch (level) {
10559 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC:
10560 ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "sync", r->sync);
10561 break;
10563 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD:
10564 ndr_print_drsuapi_DsReplicaAddOptions(ndr, "add", r->add);
10565 break;
10567 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE:
10568 ndr_print_drsuapi_DsReplicaDeleteOptions(ndr, "op_delete", r->op_delete);
10569 break;
10571 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY:
10572 ndr_print_drsuapi_DsReplicaModifyOptions(ndr, "modify", r->modify);
10573 break;
10575 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS:
10576 ndr_print_drsuapi_DsReplicaUpdateRefsOptions(ndr, "update_refs", r->update_refs);
10577 break;
10579 default:
10580 ndr_print_uint32(ndr, "unknown", r->unknown);
10581 break;
10586 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOp(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOp *r)
10588 if (ndr_flags & NDR_SCALARS) {
10589 NDR_CHECK(ndr_push_align(ndr, 5));
10590 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->operation_start));
10591 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_num));
10592 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
10593 NDR_CHECK(ndr_push_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, r->operation_type));
10594 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->options, r->operation_type));
10595 NDR_CHECK(ndr_push_drsuapi_DsRplicaOpOptions(ndr, NDR_SCALARS, &r->options));
10596 NDR_CHECK(ndr_push_unique_ptr(ndr, r->nc_dn));
10597 NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_dsa_obj_dn));
10598 NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_dsa_address));
10599 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->nc_obj_guid));
10600 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->remote_dsa_obj_guid));
10602 if (ndr_flags & NDR_BUFFERS) {
10603 if (r->nc_dn) {
10604 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->nc_dn, CH_UTF16)));
10605 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10606 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->nc_dn, CH_UTF16)));
10607 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->nc_dn, ndr_charset_length(r->nc_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10609 if (r->remote_dsa_obj_dn) {
10610 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16)));
10611 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10612 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16)));
10613 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote_dsa_obj_dn, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10615 if (r->remote_dsa_address) {
10616 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_address, CH_UTF16)));
10617 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10618 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_address, CH_UTF16)));
10619 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote_dsa_address, ndr_charset_length(r->remote_dsa_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10622 return NDR_ERR_SUCCESS;
10625 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOp(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOp *r)
10627 uint32_t _ptr_nc_dn;
10628 TALLOC_CTX *_mem_save_nc_dn_0;
10629 uint32_t _ptr_remote_dsa_obj_dn;
10630 TALLOC_CTX *_mem_save_remote_dsa_obj_dn_0;
10631 uint32_t _ptr_remote_dsa_address;
10632 TALLOC_CTX *_mem_save_remote_dsa_address_0;
10633 if (ndr_flags & NDR_SCALARS) {
10634 NDR_CHECK(ndr_pull_align(ndr, 5));
10635 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->operation_start));
10636 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_num));
10637 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
10638 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, &r->operation_type));
10639 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->options, r->operation_type));
10640 NDR_CHECK(ndr_pull_drsuapi_DsRplicaOpOptions(ndr, NDR_SCALARS, &r->options));
10641 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nc_dn));
10642 if (_ptr_nc_dn) {
10643 NDR_PULL_ALLOC(ndr, r->nc_dn);
10644 } else {
10645 r->nc_dn = NULL;
10647 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_dsa_obj_dn));
10648 if (_ptr_remote_dsa_obj_dn) {
10649 NDR_PULL_ALLOC(ndr, r->remote_dsa_obj_dn);
10650 } else {
10651 r->remote_dsa_obj_dn = NULL;
10653 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_dsa_address));
10654 if (_ptr_remote_dsa_address) {
10655 NDR_PULL_ALLOC(ndr, r->remote_dsa_address);
10656 } else {
10657 r->remote_dsa_address = NULL;
10659 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->nc_obj_guid));
10660 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->remote_dsa_obj_guid));
10662 if (ndr_flags & NDR_BUFFERS) {
10663 if (r->nc_dn) {
10664 _mem_save_nc_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
10665 NDR_PULL_SET_MEM_CTX(ndr, r->nc_dn, 0);
10666 NDR_CHECK(ndr_pull_array_size(ndr, &r->nc_dn));
10667 NDR_CHECK(ndr_pull_array_length(ndr, &r->nc_dn));
10668 if (ndr_get_array_length(ndr, &r->nc_dn) > ndr_get_array_size(ndr, &r->nc_dn)) {
10669 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->nc_dn), ndr_get_array_length(ndr, &r->nc_dn));
10671 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->nc_dn), sizeof(uint16_t)));
10672 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->nc_dn, ndr_get_array_length(ndr, &r->nc_dn), sizeof(uint16_t), CH_UTF16));
10673 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nc_dn_0, 0);
10675 if (r->remote_dsa_obj_dn) {
10676 _mem_save_remote_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
10677 NDR_PULL_SET_MEM_CTX(ndr, r->remote_dsa_obj_dn, 0);
10678 NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_dsa_obj_dn));
10679 NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_dsa_obj_dn));
10680 if (ndr_get_array_length(ndr, &r->remote_dsa_obj_dn) > ndr_get_array_size(ndr, &r->remote_dsa_obj_dn)) {
10681 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote_dsa_obj_dn), ndr_get_array_length(ndr, &r->remote_dsa_obj_dn));
10683 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote_dsa_obj_dn), sizeof(uint16_t)));
10684 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_dsa_obj_dn, ndr_get_array_length(ndr, &r->remote_dsa_obj_dn), sizeof(uint16_t), CH_UTF16));
10685 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_dsa_obj_dn_0, 0);
10687 if (r->remote_dsa_address) {
10688 _mem_save_remote_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
10689 NDR_PULL_SET_MEM_CTX(ndr, r->remote_dsa_address, 0);
10690 NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_dsa_address));
10691 NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_dsa_address));
10692 if (ndr_get_array_length(ndr, &r->remote_dsa_address) > ndr_get_array_size(ndr, &r->remote_dsa_address)) {
10693 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote_dsa_address), ndr_get_array_length(ndr, &r->remote_dsa_address));
10695 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote_dsa_address), sizeof(uint16_t)));
10696 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_dsa_address, ndr_get_array_length(ndr, &r->remote_dsa_address), sizeof(uint16_t), CH_UTF16));
10697 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_dsa_address_0, 0);
10700 return NDR_ERR_SUCCESS;
10703 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOp(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOp *r)
10705 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOp");
10706 ndr->depth++;
10707 ndr_print_NTTIME(ndr, "operation_start", r->operation_start);
10708 ndr_print_uint32(ndr, "serial_num", r->serial_num);
10709 ndr_print_uint32(ndr, "priority", r->priority);
10710 ndr_print_drsuapi_DsReplicaOpType(ndr, "operation_type", r->operation_type);
10711 ndr_print_set_switch_value(ndr, &r->options, r->operation_type);
10712 ndr_print_drsuapi_DsRplicaOpOptions(ndr, "options", &r->options);
10713 ndr_print_ptr(ndr, "nc_dn", r->nc_dn);
10714 ndr->depth++;
10715 if (r->nc_dn) {
10716 ndr_print_string(ndr, "nc_dn", r->nc_dn);
10718 ndr->depth--;
10719 ndr_print_ptr(ndr, "remote_dsa_obj_dn", r->remote_dsa_obj_dn);
10720 ndr->depth++;
10721 if (r->remote_dsa_obj_dn) {
10722 ndr_print_string(ndr, "remote_dsa_obj_dn", r->remote_dsa_obj_dn);
10724 ndr->depth--;
10725 ndr_print_ptr(ndr, "remote_dsa_address", r->remote_dsa_address);
10726 ndr->depth++;
10727 if (r->remote_dsa_address) {
10728 ndr_print_string(ndr, "remote_dsa_address", r->remote_dsa_address);
10730 ndr->depth--;
10731 ndr_print_GUID(ndr, "nc_obj_guid", &r->nc_obj_guid);
10732 ndr_print_GUID(ndr, "remote_dsa_obj_guid", &r->remote_dsa_obj_guid);
10733 ndr->depth--;
10736 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOpCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOpCtr *r)
10738 uint32_t cntr_array_0;
10739 if (ndr_flags & NDR_SCALARS) {
10740 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
10741 NDR_CHECK(ndr_push_align(ndr, 5));
10742 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time));
10743 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10744 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10745 NDR_CHECK(ndr_push_drsuapi_DsReplicaOp(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10748 if (ndr_flags & NDR_BUFFERS) {
10749 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10750 NDR_CHECK(ndr_push_drsuapi_DsReplicaOp(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10753 return NDR_ERR_SUCCESS;
10756 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOpCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOpCtr *r)
10758 uint32_t cntr_array_0;
10759 TALLOC_CTX *_mem_save_array_0;
10760 if (ndr_flags & NDR_SCALARS) {
10761 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10762 NDR_CHECK(ndr_pull_align(ndr, 5));
10763 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time));
10764 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10765 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10766 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10767 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10768 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10769 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOp(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10771 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10772 if (r->array) {
10773 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10776 if (ndr_flags & NDR_BUFFERS) {
10777 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10778 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10779 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10780 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOp(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10782 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10784 return NDR_ERR_SUCCESS;
10787 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOpCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOpCtr *r)
10789 uint32_t cntr_array_0;
10790 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOpCtr");
10791 ndr->depth++;
10792 ndr_print_NTTIME(ndr, "time", r->time);
10793 ndr_print_uint32(ndr, "count", r->count);
10794 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10795 ndr->depth++;
10796 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10797 char *idx_0=NULL;
10798 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10799 ndr_print_drsuapi_DsReplicaOp(ndr, "array", &r->array[cntr_array_0]);
10800 free(idx_0);
10803 ndr->depth--;
10804 ndr->depth--;
10807 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData *r)
10809 if (ndr_flags & NDR_SCALARS) {
10810 NDR_CHECK(ndr_push_align(ndr, 8));
10811 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name));
10812 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
10813 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->binary, 0)));
10814 NDR_CHECK(ndr_push_unique_ptr(ndr, r->binary));
10815 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->deleted));
10816 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->created));
10817 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
10818 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time));
10819 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
10820 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
10821 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn));
10823 if (ndr_flags & NDR_BUFFERS) {
10824 if (r->attribute_name) {
10825 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
10826 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10827 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
10828 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10830 if (r->object_dn) {
10831 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
10832 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
10833 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
10834 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10836 if (r->binary) {
10837 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->binary));
10840 return NDR_ERR_SUCCESS;
10843 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData *r)
10845 uint32_t _ptr_attribute_name;
10846 TALLOC_CTX *_mem_save_attribute_name_0;
10847 uint32_t _ptr_object_dn;
10848 TALLOC_CTX *_mem_save_object_dn_0;
10849 uint32_t _ptr_binary;
10850 TALLOC_CTX *_mem_save_binary_0;
10851 if (ndr_flags & NDR_SCALARS) {
10852 NDR_CHECK(ndr_pull_align(ndr, 8));
10853 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name));
10854 if (_ptr_attribute_name) {
10855 NDR_PULL_ALLOC(ndr, r->attribute_name);
10856 } else {
10857 r->attribute_name = NULL;
10859 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
10860 if (_ptr_object_dn) {
10861 NDR_PULL_ALLOC(ndr, r->object_dn);
10862 } else {
10863 r->object_dn = NULL;
10865 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary));
10866 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary));
10867 if (_ptr_binary) {
10868 NDR_PULL_ALLOC(ndr, r->binary);
10869 } else {
10870 r->binary = NULL;
10872 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->deleted));
10873 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->created));
10874 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
10875 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time));
10876 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
10877 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
10878 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn));
10880 if (ndr_flags & NDR_BUFFERS) {
10881 if (r->attribute_name) {
10882 _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10883 NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0);
10884 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name));
10885 NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name));
10886 if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) {
10887 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name));
10889 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t)));
10890 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16));
10891 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0);
10893 if (r->object_dn) {
10894 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
10895 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
10896 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
10897 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
10898 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
10899 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn));
10901 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
10902 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
10903 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
10905 if (r->binary) {
10906 _mem_save_binary_0 = NDR_PULL_GET_MEM_CTX(ndr);
10907 NDR_PULL_SET_MEM_CTX(ndr, r->binary, 0);
10908 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
10909 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_0, 0);
10912 return NDR_ERR_SUCCESS;
10915 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData *r)
10917 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData");
10918 ndr->depth++;
10919 ndr_print_ptr(ndr, "attribute_name", r->attribute_name);
10920 ndr->depth++;
10921 if (r->attribute_name) {
10922 ndr_print_string(ndr, "attribute_name", r->attribute_name);
10924 ndr->depth--;
10925 ndr_print_ptr(ndr, "object_dn", r->object_dn);
10926 ndr->depth++;
10927 if (r->object_dn) {
10928 ndr_print_string(ndr, "object_dn", r->object_dn);
10930 ndr->depth--;
10931 ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->binary, 0):r->__ndr_size_binary);
10932 ndr_print_ptr(ndr, "binary", r->binary);
10933 ndr->depth++;
10934 if (r->binary) {
10935 ndr_print_DATA_BLOB(ndr, "binary", *r->binary);
10937 ndr->depth--;
10938 ndr_print_NTTIME(ndr, "deleted", r->deleted);
10939 ndr_print_NTTIME(ndr, "created", r->created);
10940 ndr_print_uint32(ndr, "version", r->version);
10941 ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time);
10942 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
10943 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
10944 ndr_print_hyper(ndr, "local_usn", r->local_usn);
10945 ndr->depth--;
10948 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r)
10950 uint32_t cntr_array_0;
10951 if (ndr_flags & NDR_SCALARS) {
10952 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
10953 NDR_CHECK(ndr_push_align(ndr, 8));
10954 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10955 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
10956 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10957 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10960 if (ndr_flags & NDR_BUFFERS) {
10961 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10962 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10965 return NDR_ERR_SUCCESS;
10968 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaDataCtr *r)
10970 uint32_t cntr_array_0;
10971 TALLOC_CTX *_mem_save_array_0;
10972 if (ndr_flags & NDR_SCALARS) {
10973 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10974 NDR_CHECK(ndr_pull_align(ndr, 8));
10975 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10976 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
10977 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10978 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10979 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10980 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10981 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10983 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10984 if (r->array) {
10985 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10988 if (ndr_flags & NDR_BUFFERS) {
10989 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10990 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10991 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10992 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10994 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10996 return NDR_ERR_SUCCESS;
10999 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r)
11001 uint32_t cntr_array_0;
11002 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaDataCtr");
11003 ndr->depth++;
11004 ndr_print_uint32(ndr, "count", r->count);
11005 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
11006 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
11007 ndr->depth++;
11008 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
11009 char *idx_0=NULL;
11010 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
11011 ndr_print_drsuapi_DsReplicaAttrValMetaData(ndr, "array", &r->array[cntr_array_0]);
11012 free(idx_0);
11015 ndr->depth--;
11016 ndr->depth--;
11019 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2Ctr *r)
11021 uint32_t cntr_array_0;
11022 if (ndr_flags & NDR_SCALARS) {
11023 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
11024 NDR_CHECK(ndr_push_align(ndr, 8));
11025 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
11026 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
11027 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11028 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11031 if (ndr_flags & NDR_BUFFERS) {
11033 return NDR_ERR_SUCCESS;
11036 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2Ctr *r)
11038 uint32_t cntr_array_0;
11039 TALLOC_CTX *_mem_save_array_0;
11040 if (ndr_flags & NDR_SCALARS) {
11041 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
11042 NDR_CHECK(ndr_pull_align(ndr, 8));
11043 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
11044 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
11045 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
11046 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11047 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11048 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11049 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11051 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11052 if (r->array) {
11053 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
11056 if (ndr_flags & NDR_BUFFERS) {
11058 return NDR_ERR_SUCCESS;
11061 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2Ctr *r)
11063 uint32_t cntr_array_0;
11064 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2Ctr");
11065 ndr->depth++;
11066 ndr_print_uint32(ndr, "count", r->count);
11067 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
11068 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
11069 ndr->depth++;
11070 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
11071 char *idx_0=NULL;
11072 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
11073 ndr_print_drsuapi_DsReplicaCursor2(ndr, "array", &r->array[cntr_array_0]);
11074 free(idx_0);
11077 ndr->depth--;
11078 ndr->depth--;
11081 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor3 *r)
11083 if (ndr_flags & NDR_SCALARS) {
11084 NDR_CHECK(ndr_push_align(ndr, 8));
11085 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
11086 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
11087 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success));
11088 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_obj_dn));
11090 if (ndr_flags & NDR_BUFFERS) {
11091 if (r->source_dsa_obj_dn) {
11092 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16)));
11093 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11094 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16)));
11095 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_obj_dn, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11098 return NDR_ERR_SUCCESS;
11101 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor3 *r)
11103 uint32_t _ptr_source_dsa_obj_dn;
11104 TALLOC_CTX *_mem_save_source_dsa_obj_dn_0;
11105 if (ndr_flags & NDR_SCALARS) {
11106 NDR_CHECK(ndr_pull_align(ndr, 8));
11107 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
11108 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
11109 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success));
11110 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_obj_dn));
11111 if (_ptr_source_dsa_obj_dn) {
11112 NDR_PULL_ALLOC(ndr, r->source_dsa_obj_dn);
11113 } else {
11114 r->source_dsa_obj_dn = NULL;
11117 if (ndr_flags & NDR_BUFFERS) {
11118 if (r->source_dsa_obj_dn) {
11119 _mem_save_source_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
11120 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_obj_dn, 0);
11121 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_obj_dn));
11122 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_obj_dn));
11123 if (ndr_get_array_length(ndr, &r->source_dsa_obj_dn) > ndr_get_array_size(ndr, &r->source_dsa_obj_dn)) {
11124 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_obj_dn), ndr_get_array_length(ndr, &r->source_dsa_obj_dn));
11126 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t)));
11127 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_obj_dn, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t), CH_UTF16));
11128 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_obj_dn_0, 0);
11131 return NDR_ERR_SUCCESS;
11134 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3 *r)
11136 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor3");
11137 ndr->depth++;
11138 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
11139 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
11140 ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success);
11141 ndr_print_ptr(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn);
11142 ndr->depth++;
11143 if (r->source_dsa_obj_dn) {
11144 ndr_print_string(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn);
11146 ndr->depth--;
11147 ndr->depth--;
11150 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor3Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor3Ctr *r)
11152 uint32_t cntr_array_0;
11153 if (ndr_flags & NDR_SCALARS) {
11154 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
11155 NDR_CHECK(ndr_push_align(ndr, 8));
11156 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
11157 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
11158 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11159 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11162 if (ndr_flags & NDR_BUFFERS) {
11163 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11164 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
11167 return NDR_ERR_SUCCESS;
11170 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor3Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor3Ctr *r)
11172 uint32_t cntr_array_0;
11173 TALLOC_CTX *_mem_save_array_0;
11174 if (ndr_flags & NDR_SCALARS) {
11175 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
11176 NDR_CHECK(ndr_pull_align(ndr, 8));
11177 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
11178 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
11179 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
11180 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11181 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11182 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11183 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11185 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11186 if (r->array) {
11187 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
11190 if (ndr_flags & NDR_BUFFERS) {
11191 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11192 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11193 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11194 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
11196 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11198 return NDR_ERR_SUCCESS;
11201 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor3Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3Ctr *r)
11203 uint32_t cntr_array_0;
11204 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor3Ctr");
11205 ndr->depth++;
11206 ndr_print_uint32(ndr, "count", r->count);
11207 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
11208 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
11209 ndr->depth++;
11210 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
11211 char *idx_0=NULL;
11212 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
11213 ndr_print_drsuapi_DsReplicaCursor3(ndr, "array", &r->array[cntr_array_0]);
11214 free(idx_0);
11217 ndr->depth--;
11218 ndr->depth--;
11221 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData2 *r)
11223 if (ndr_flags & NDR_SCALARS) {
11224 NDR_CHECK(ndr_push_align(ndr, 8));
11225 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name));
11226 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
11227 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time));
11228 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
11229 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
11230 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn));
11231 NDR_CHECK(ndr_push_unique_ptr(ndr, r->originating_dsa_dn));
11233 if (ndr_flags & NDR_BUFFERS) {
11234 if (r->attribute_name) {
11235 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
11236 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11237 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
11238 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11240 if (r->originating_dsa_dn) {
11241 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16)));
11242 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11243 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16)));
11244 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->originating_dsa_dn, ndr_charset_length(r->originating_dsa_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11247 return NDR_ERR_SUCCESS;
11250 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData2 *r)
11252 uint32_t _ptr_attribute_name;
11253 TALLOC_CTX *_mem_save_attribute_name_0;
11254 uint32_t _ptr_originating_dsa_dn;
11255 TALLOC_CTX *_mem_save_originating_dsa_dn_0;
11256 if (ndr_flags & NDR_SCALARS) {
11257 NDR_CHECK(ndr_pull_align(ndr, 8));
11258 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name));
11259 if (_ptr_attribute_name) {
11260 NDR_PULL_ALLOC(ndr, r->attribute_name);
11261 } else {
11262 r->attribute_name = NULL;
11264 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
11265 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time));
11266 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
11267 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
11268 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn));
11269 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_originating_dsa_dn));
11270 if (_ptr_originating_dsa_dn) {
11271 NDR_PULL_ALLOC(ndr, r->originating_dsa_dn);
11272 } else {
11273 r->originating_dsa_dn = NULL;
11276 if (ndr_flags & NDR_BUFFERS) {
11277 if (r->attribute_name) {
11278 _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
11279 NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0);
11280 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name));
11281 NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name));
11282 if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) {
11283 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name));
11285 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t)));
11286 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16));
11287 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0);
11289 if (r->originating_dsa_dn) {
11290 _mem_save_originating_dsa_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
11291 NDR_PULL_SET_MEM_CTX(ndr, r->originating_dsa_dn, 0);
11292 NDR_CHECK(ndr_pull_array_size(ndr, &r->originating_dsa_dn));
11293 NDR_CHECK(ndr_pull_array_length(ndr, &r->originating_dsa_dn));
11294 if (ndr_get_array_length(ndr, &r->originating_dsa_dn) > ndr_get_array_size(ndr, &r->originating_dsa_dn)) {
11295 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->originating_dsa_dn), ndr_get_array_length(ndr, &r->originating_dsa_dn));
11297 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t)));
11298 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->originating_dsa_dn, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t), CH_UTF16));
11299 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_originating_dsa_dn_0, 0);
11302 return NDR_ERR_SUCCESS;
11305 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2 *r)
11307 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData2");
11308 ndr->depth++;
11309 ndr_print_ptr(ndr, "attribute_name", r->attribute_name);
11310 ndr->depth++;
11311 if (r->attribute_name) {
11312 ndr_print_string(ndr, "attribute_name", r->attribute_name);
11314 ndr->depth--;
11315 ndr_print_uint32(ndr, "version", r->version);
11316 ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time);
11317 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
11318 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
11319 ndr_print_hyper(ndr, "local_usn", r->local_usn);
11320 ndr_print_ptr(ndr, "originating_dsa_dn", r->originating_dsa_dn);
11321 ndr->depth++;
11322 if (r->originating_dsa_dn) {
11323 ndr_print_string(ndr, "originating_dsa_dn", r->originating_dsa_dn);
11325 ndr->depth--;
11326 ndr->depth--;
11329 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData2Ctr *r)
11331 uint32_t cntr_array_0;
11332 if (ndr_flags & NDR_SCALARS) {
11333 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
11334 NDR_CHECK(ndr_push_align(ndr, 8));
11335 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
11336 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
11337 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11338 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11341 if (ndr_flags & NDR_BUFFERS) {
11342 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11343 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
11346 return NDR_ERR_SUCCESS;
11349 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData2Ctr *r)
11351 uint32_t cntr_array_0;
11352 TALLOC_CTX *_mem_save_array_0;
11353 if (ndr_flags & NDR_SCALARS) {
11354 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
11355 NDR_CHECK(ndr_pull_align(ndr, 8));
11356 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
11357 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
11358 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
11359 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11360 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11361 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11362 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11364 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11365 if (r->array) {
11366 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
11369 if (ndr_flags & NDR_BUFFERS) {
11370 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11371 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11372 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11373 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
11375 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11377 return NDR_ERR_SUCCESS;
11380 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2Ctr *r)
11382 uint32_t cntr_array_0;
11383 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData2Ctr");
11384 ndr->depth++;
11385 ndr_print_uint32(ndr, "count", r->count);
11386 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
11387 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
11388 ndr->depth++;
11389 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
11390 char *idx_0=NULL;
11391 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
11392 ndr_print_drsuapi_DsReplicaObjMetaData2(ndr, "array", &r->array[cntr_array_0]);
11393 free(idx_0);
11396 ndr->depth--;
11397 ndr->depth--;
11400 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData2 *r)
11402 if (ndr_flags & NDR_SCALARS) {
11403 NDR_CHECK(ndr_push_align(ndr, 8));
11404 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name));
11405 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
11406 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->binary, 0)));
11407 NDR_CHECK(ndr_push_unique_ptr(ndr, r->binary));
11408 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->deleted));
11409 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->created));
11410 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
11411 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time));
11412 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
11413 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
11414 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn));
11415 NDR_CHECK(ndr_push_unique_ptr(ndr, r->originating_dsa_dn));
11417 if (ndr_flags & NDR_BUFFERS) {
11418 if (r->attribute_name) {
11419 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
11420 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11421 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
11422 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11424 if (r->object_dn) {
11425 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
11426 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11427 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
11428 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11430 if (r->binary) {
11431 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->binary));
11433 if (r->originating_dsa_dn) {
11434 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16)));
11435 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11436 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16)));
11437 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->originating_dsa_dn, ndr_charset_length(r->originating_dsa_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11440 return NDR_ERR_SUCCESS;
11443 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData2 *r)
11445 uint32_t _ptr_attribute_name;
11446 TALLOC_CTX *_mem_save_attribute_name_0;
11447 uint32_t _ptr_object_dn;
11448 TALLOC_CTX *_mem_save_object_dn_0;
11449 uint32_t _ptr_binary;
11450 TALLOC_CTX *_mem_save_binary_0;
11451 uint32_t _ptr_originating_dsa_dn;
11452 TALLOC_CTX *_mem_save_originating_dsa_dn_0;
11453 if (ndr_flags & NDR_SCALARS) {
11454 NDR_CHECK(ndr_pull_align(ndr, 8));
11455 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name));
11456 if (_ptr_attribute_name) {
11457 NDR_PULL_ALLOC(ndr, r->attribute_name);
11458 } else {
11459 r->attribute_name = NULL;
11461 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
11462 if (_ptr_object_dn) {
11463 NDR_PULL_ALLOC(ndr, r->object_dn);
11464 } else {
11465 r->object_dn = NULL;
11467 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary));
11468 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary));
11469 if (_ptr_binary) {
11470 NDR_PULL_ALLOC(ndr, r->binary);
11471 } else {
11472 r->binary = NULL;
11474 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->deleted));
11475 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->created));
11476 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
11477 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time));
11478 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
11479 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
11480 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn));
11481 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_originating_dsa_dn));
11482 if (_ptr_originating_dsa_dn) {
11483 NDR_PULL_ALLOC(ndr, r->originating_dsa_dn);
11484 } else {
11485 r->originating_dsa_dn = NULL;
11488 if (ndr_flags & NDR_BUFFERS) {
11489 if (r->attribute_name) {
11490 _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
11491 NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0);
11492 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name));
11493 NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name));
11494 if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) {
11495 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name));
11497 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t)));
11498 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16));
11499 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0);
11501 if (r->object_dn) {
11502 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
11503 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
11504 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
11505 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
11506 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
11507 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn));
11509 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
11510 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
11511 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
11513 if (r->binary) {
11514 _mem_save_binary_0 = NDR_PULL_GET_MEM_CTX(ndr);
11515 NDR_PULL_SET_MEM_CTX(ndr, r->binary, 0);
11516 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
11517 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_0, 0);
11519 if (r->originating_dsa_dn) {
11520 _mem_save_originating_dsa_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
11521 NDR_PULL_SET_MEM_CTX(ndr, r->originating_dsa_dn, 0);
11522 NDR_CHECK(ndr_pull_array_size(ndr, &r->originating_dsa_dn));
11523 NDR_CHECK(ndr_pull_array_length(ndr, &r->originating_dsa_dn));
11524 if (ndr_get_array_length(ndr, &r->originating_dsa_dn) > ndr_get_array_size(ndr, &r->originating_dsa_dn)) {
11525 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->originating_dsa_dn), ndr_get_array_length(ndr, &r->originating_dsa_dn));
11527 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t)));
11528 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->originating_dsa_dn, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t), CH_UTF16));
11529 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_originating_dsa_dn_0, 0);
11532 return NDR_ERR_SUCCESS;
11535 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2 *r)
11537 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData2");
11538 ndr->depth++;
11539 ndr_print_ptr(ndr, "attribute_name", r->attribute_name);
11540 ndr->depth++;
11541 if (r->attribute_name) {
11542 ndr_print_string(ndr, "attribute_name", r->attribute_name);
11544 ndr->depth--;
11545 ndr_print_ptr(ndr, "object_dn", r->object_dn);
11546 ndr->depth++;
11547 if (r->object_dn) {
11548 ndr_print_string(ndr, "object_dn", r->object_dn);
11550 ndr->depth--;
11551 ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->binary, 0):r->__ndr_size_binary);
11552 ndr_print_ptr(ndr, "binary", r->binary);
11553 ndr->depth++;
11554 if (r->binary) {
11555 ndr_print_DATA_BLOB(ndr, "binary", *r->binary);
11557 ndr->depth--;
11558 ndr_print_NTTIME(ndr, "deleted", r->deleted);
11559 ndr_print_NTTIME(ndr, "created", r->created);
11560 ndr_print_uint32(ndr, "version", r->version);
11561 ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time);
11562 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
11563 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
11564 ndr_print_hyper(ndr, "local_usn", r->local_usn);
11565 ndr_print_ptr(ndr, "originating_dsa_dn", r->originating_dsa_dn);
11566 ndr->depth++;
11567 if (r->originating_dsa_dn) {
11568 ndr_print_string(ndr, "originating_dsa_dn", r->originating_dsa_dn);
11570 ndr->depth--;
11571 ndr->depth--;
11574 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r)
11576 uint32_t cntr_array_0;
11577 if (ndr_flags & NDR_SCALARS) {
11578 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
11579 NDR_CHECK(ndr_push_align(ndr, 8));
11580 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
11581 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
11582 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11583 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11586 if (ndr_flags & NDR_BUFFERS) {
11587 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11588 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
11591 return NDR_ERR_SUCCESS;
11594 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData2Ctr *r)
11596 uint32_t cntr_array_0;
11597 TALLOC_CTX *_mem_save_array_0;
11598 if (ndr_flags & NDR_SCALARS) {
11599 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
11600 NDR_CHECK(ndr_pull_align(ndr, 8));
11601 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
11602 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
11603 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
11604 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11605 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11606 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11607 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11609 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11610 if (r->array) {
11611 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
11614 if (ndr_flags & NDR_BUFFERS) {
11615 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11616 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11617 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11618 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
11620 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11622 return NDR_ERR_SUCCESS;
11625 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r)
11627 uint32_t cntr_array_0;
11628 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData2Ctr");
11629 ndr->depth++;
11630 ndr_print_uint32(ndr, "count", r->count);
11631 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
11632 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
11633 ndr->depth++;
11634 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
11635 char *idx_0=NULL;
11636 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
11637 ndr_print_drsuapi_DsReplicaAttrValMetaData2(ndr, "array", &r->array[cntr_array_0]);
11638 free(idx_0);
11641 ndr->depth--;
11642 ndr->depth--;
11645 static enum ndr_err_code ndr_push_drsuapi_DsReplicaConnection04(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaConnection04 *r)
11647 if (ndr_flags & NDR_SCALARS) {
11648 NDR_CHECK(ndr_push_align(ndr, 8));
11649 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->u1));
11650 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2));
11651 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3));
11652 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->bind_guid));
11653 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->bind_time));
11655 uint32_t _flags_save_ipv4address = ndr->flags;
11656 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
11657 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->client_ip_address));
11658 ndr->flags = _flags_save_ipv4address;
11660 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u5));
11662 if (ndr_flags & NDR_BUFFERS) {
11664 return NDR_ERR_SUCCESS;
11667 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaConnection04(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaConnection04 *r)
11669 if (ndr_flags & NDR_SCALARS) {
11670 NDR_CHECK(ndr_pull_align(ndr, 8));
11671 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->u1));
11672 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2));
11673 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3));
11674 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->bind_guid));
11675 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->bind_time));
11677 uint32_t _flags_save_ipv4address = ndr->flags;
11678 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
11679 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->client_ip_address));
11680 ndr->flags = _flags_save_ipv4address;
11682 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u5));
11684 if (ndr_flags & NDR_BUFFERS) {
11686 return NDR_ERR_SUCCESS;
11689 _PUBLIC_ void ndr_print_drsuapi_DsReplicaConnection04(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04 *r)
11691 ndr_print_struct(ndr, name, "drsuapi_DsReplicaConnection04");
11692 ndr->depth++;
11693 ndr_print_hyper(ndr, "u1", r->u1);
11694 ndr_print_uint32(ndr, "u2", r->u2);
11695 ndr_print_uint32(ndr, "u3", r->u3);
11696 ndr_print_GUID(ndr, "bind_guid", &r->bind_guid);
11697 ndr_print_NTTIME_1sec(ndr, "bind_time", r->bind_time);
11698 ndr_print_ipv4address(ndr, "client_ip_address", r->client_ip_address);
11699 ndr_print_uint32(ndr, "u5", r->u5);
11700 ndr->depth--;
11703 static enum ndr_err_code ndr_push_drsuapi_DsReplicaConnection04Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaConnection04Ctr *r)
11705 uint32_t cntr_array_0;
11706 if (ndr_flags & NDR_SCALARS) {
11707 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
11708 NDR_CHECK(ndr_push_align(ndr, 8));
11709 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
11710 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
11711 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11712 NDR_CHECK(ndr_push_drsuapi_DsReplicaConnection04(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11715 if (ndr_flags & NDR_BUFFERS) {
11717 return NDR_ERR_SUCCESS;
11720 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaConnection04Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaConnection04Ctr *r)
11722 uint32_t cntr_array_0;
11723 TALLOC_CTX *_mem_save_array_0;
11724 if (ndr_flags & NDR_SCALARS) {
11725 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
11726 NDR_CHECK(ndr_pull_align(ndr, 8));
11727 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
11728 if (r->count > 10000) {
11729 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
11731 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
11732 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
11733 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11734 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11735 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11736 NDR_CHECK(ndr_pull_drsuapi_DsReplicaConnection04(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11738 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11739 if (r->array) {
11740 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
11743 if (ndr_flags & NDR_BUFFERS) {
11745 return NDR_ERR_SUCCESS;
11748 _PUBLIC_ void ndr_print_drsuapi_DsReplicaConnection04Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04Ctr *r)
11750 uint32_t cntr_array_0;
11751 ndr_print_struct(ndr, name, "drsuapi_DsReplicaConnection04Ctr");
11752 ndr->depth++;
11753 ndr_print_uint32(ndr, "count", r->count);
11754 ndr_print_uint32(ndr, "reserved", r->reserved);
11755 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
11756 ndr->depth++;
11757 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
11758 char *idx_0=NULL;
11759 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
11760 ndr_print_drsuapi_DsReplicaConnection04(ndr, "array", &r->array[cntr_array_0]);
11761 free(idx_0);
11764 ndr->depth--;
11765 ndr->depth--;
11768 static enum ndr_err_code ndr_push_drsuapi_DsReplica06(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplica06 *r)
11770 if (ndr_flags & NDR_SCALARS) {
11771 NDR_CHECK(ndr_push_align(ndr, 8));
11772 NDR_CHECK(ndr_push_unique_ptr(ndr, r->str1));
11773 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u1));
11774 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2));
11775 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3));
11776 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u4));
11777 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u5));
11778 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->u6));
11779 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u7));
11781 if (ndr_flags & NDR_BUFFERS) {
11782 if (r->str1) {
11783 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->str1, CH_UTF16)));
11784 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
11785 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->str1, CH_UTF16)));
11786 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->str1, ndr_charset_length(r->str1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
11789 return NDR_ERR_SUCCESS;
11792 static enum ndr_err_code ndr_pull_drsuapi_DsReplica06(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplica06 *r)
11794 uint32_t _ptr_str1;
11795 TALLOC_CTX *_mem_save_str1_0;
11796 if (ndr_flags & NDR_SCALARS) {
11797 NDR_CHECK(ndr_pull_align(ndr, 8));
11798 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_str1));
11799 if (_ptr_str1) {
11800 NDR_PULL_ALLOC(ndr, r->str1);
11801 } else {
11802 r->str1 = NULL;
11804 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u1));
11805 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2));
11806 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3));
11807 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u4));
11808 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u5));
11809 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->u6));
11810 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u7));
11812 if (ndr_flags & NDR_BUFFERS) {
11813 if (r->str1) {
11814 _mem_save_str1_0 = NDR_PULL_GET_MEM_CTX(ndr);
11815 NDR_PULL_SET_MEM_CTX(ndr, r->str1, 0);
11816 NDR_CHECK(ndr_pull_array_size(ndr, &r->str1));
11817 NDR_CHECK(ndr_pull_array_length(ndr, &r->str1));
11818 if (ndr_get_array_length(ndr, &r->str1) > ndr_get_array_size(ndr, &r->str1)) {
11819 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->str1), ndr_get_array_length(ndr, &r->str1));
11821 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->str1), sizeof(uint16_t)));
11822 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->str1, ndr_get_array_length(ndr, &r->str1), sizeof(uint16_t), CH_UTF16));
11823 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_str1_0, 0);
11826 return NDR_ERR_SUCCESS;
11829 _PUBLIC_ void ndr_print_drsuapi_DsReplica06(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06 *r)
11831 ndr_print_struct(ndr, name, "drsuapi_DsReplica06");
11832 ndr->depth++;
11833 ndr_print_ptr(ndr, "str1", r->str1);
11834 ndr->depth++;
11835 if (r->str1) {
11836 ndr_print_string(ndr, "str1", r->str1);
11838 ndr->depth--;
11839 ndr_print_uint32(ndr, "u1", r->u1);
11840 ndr_print_uint32(ndr, "u2", r->u2);
11841 ndr_print_uint32(ndr, "u3", r->u3);
11842 ndr_print_uint32(ndr, "u4", r->u4);
11843 ndr_print_uint32(ndr, "u5", r->u5);
11844 ndr_print_hyper(ndr, "u6", r->u6);
11845 ndr_print_uint32(ndr, "u7", r->u7);
11846 ndr->depth--;
11849 static enum ndr_err_code ndr_push_drsuapi_DsReplica06Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplica06Ctr *r)
11851 uint32_t cntr_array_0;
11852 if (ndr_flags & NDR_SCALARS) {
11853 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
11854 NDR_CHECK(ndr_push_align(ndr, 8));
11855 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
11856 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
11857 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11858 NDR_CHECK(ndr_push_drsuapi_DsReplica06(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11861 if (ndr_flags & NDR_BUFFERS) {
11862 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11863 NDR_CHECK(ndr_push_drsuapi_DsReplica06(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
11866 return NDR_ERR_SUCCESS;
11869 static enum ndr_err_code ndr_pull_drsuapi_DsReplica06Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplica06Ctr *r)
11871 uint32_t cntr_array_0;
11872 TALLOC_CTX *_mem_save_array_0;
11873 if (ndr_flags & NDR_SCALARS) {
11874 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
11875 NDR_CHECK(ndr_pull_align(ndr, 8));
11876 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
11877 if (r->count > 256) {
11878 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
11880 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
11881 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
11882 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11883 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11884 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11885 NDR_CHECK(ndr_pull_drsuapi_DsReplica06(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
11887 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11888 if (r->array) {
11889 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
11892 if (ndr_flags & NDR_BUFFERS) {
11893 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11894 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
11895 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
11896 NDR_CHECK(ndr_pull_drsuapi_DsReplica06(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
11898 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
11900 return NDR_ERR_SUCCESS;
11903 _PUBLIC_ void ndr_print_drsuapi_DsReplica06Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06Ctr *r)
11905 uint32_t cntr_array_0;
11906 ndr_print_struct(ndr, name, "drsuapi_DsReplica06Ctr");
11907 ndr->depth++;
11908 ndr_print_uint32(ndr, "count", r->count);
11909 ndr_print_uint32(ndr, "reserved", r->reserved);
11910 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
11911 ndr->depth++;
11912 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
11913 char *idx_0=NULL;
11914 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
11915 ndr_print_drsuapi_DsReplica06(ndr, "array", &r->array[cntr_array_0]);
11916 free(idx_0);
11919 ndr->depth--;
11920 ndr->depth--;
11923 static enum ndr_err_code ndr_push_drsuapi_DsReplicaInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaInfo *r)
11925 if (ndr_flags & NDR_SCALARS) {
11926 int level = ndr_push_get_switch_value(ndr, r);
11927 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, level));
11928 NDR_CHECK(ndr_push_union_align(ndr, 5));
11929 switch (level) {
11930 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: {
11931 NDR_CHECK(ndr_push_unique_ptr(ndr, r->neighbours));
11932 break; }
11934 case DRSUAPI_DS_REPLICA_INFO_CURSORS: {
11935 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors));
11936 break; }
11938 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: {
11939 NDR_CHECK(ndr_push_unique_ptr(ndr, r->objmetadata));
11940 break; }
11942 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: {
11943 NDR_CHECK(ndr_push_unique_ptr(ndr, r->connectfailures));
11944 break; }
11946 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: {
11947 NDR_CHECK(ndr_push_unique_ptr(ndr, r->linkfailures));
11948 break; }
11950 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: {
11951 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pendingops));
11952 break; }
11954 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: {
11955 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attrvalmetadata));
11956 break; }
11958 case DRSUAPI_DS_REPLICA_INFO_CURSORS2: {
11959 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors2));
11960 break; }
11962 case DRSUAPI_DS_REPLICA_INFO_CURSORS3: {
11963 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors3));
11964 break; }
11966 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: {
11967 NDR_CHECK(ndr_push_unique_ptr(ndr, r->objmetadata2));
11968 break; }
11970 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: {
11971 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attrvalmetadata2));
11972 break; }
11974 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: {
11975 NDR_CHECK(ndr_push_unique_ptr(ndr, r->neighbours02));
11976 break; }
11978 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: {
11979 NDR_CHECK(ndr_push_unique_ptr(ndr, r->connections04));
11980 break; }
11982 case DRSUAPI_DS_REPLICA_INFO_CURSORS05: {
11983 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors05));
11984 break; }
11986 case DRSUAPI_DS_REPLICA_INFO_06: {
11987 NDR_CHECK(ndr_push_unique_ptr(ndr, r->i06));
11988 break; }
11990 default:
11991 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
11994 if (ndr_flags & NDR_BUFFERS) {
11995 int level = ndr_push_get_switch_value(ndr, r);
11996 switch (level) {
11997 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS:
11998 if (r->neighbours) {
11999 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours));
12001 break;
12003 case DRSUAPI_DS_REPLICA_INFO_CURSORS:
12004 if (r->cursors) {
12005 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtr(ndr, NDR_SCALARS, r->cursors));
12007 break;
12009 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA:
12010 if (r->objmetadata) {
12011 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata));
12013 break;
12015 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES:
12016 if (r->connectfailures) {
12017 NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->connectfailures));
12019 break;
12021 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES:
12022 if (r->linkfailures) {
12023 NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->linkfailures));
12025 break;
12027 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS:
12028 if (r->pendingops) {
12029 NDR_CHECK(ndr_push_drsuapi_DsReplicaOpCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->pendingops));
12031 break;
12033 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA:
12034 if (r->attrvalmetadata) {
12035 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata));
12037 break;
12039 case DRSUAPI_DS_REPLICA_INFO_CURSORS2:
12040 if (r->cursors2) {
12041 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2Ctr(ndr, NDR_SCALARS, r->cursors2));
12043 break;
12045 case DRSUAPI_DS_REPLICA_INFO_CURSORS3:
12046 if (r->cursors3) {
12047 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->cursors3));
12049 break;
12051 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2:
12052 if (r->objmetadata2) {
12053 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata2));
12055 break;
12057 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2:
12058 if (r->attrvalmetadata2) {
12059 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata2));
12061 break;
12063 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02:
12064 if (r->neighbours02) {
12065 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours02));
12067 break;
12069 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04:
12070 if (r->connections04) {
12071 NDR_CHECK(ndr_push_drsuapi_DsReplicaConnection04Ctr(ndr, NDR_SCALARS, r->connections04));
12073 break;
12075 case DRSUAPI_DS_REPLICA_INFO_CURSORS05:
12076 if (r->cursors05) {
12077 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->cursors05));
12079 break;
12081 case DRSUAPI_DS_REPLICA_INFO_06:
12082 if (r->i06) {
12083 NDR_CHECK(ndr_push_drsuapi_DsReplica06Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->i06));
12085 break;
12087 default:
12088 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12091 return NDR_ERR_SUCCESS;
12094 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaInfo *r)
12096 int level;
12097 uint32_t _level;
12098 TALLOC_CTX *_mem_save_neighbours_0;
12099 TALLOC_CTX *_mem_save_cursors_0;
12100 TALLOC_CTX *_mem_save_objmetadata_0;
12101 TALLOC_CTX *_mem_save_connectfailures_0;
12102 TALLOC_CTX *_mem_save_linkfailures_0;
12103 TALLOC_CTX *_mem_save_pendingops_0;
12104 TALLOC_CTX *_mem_save_attrvalmetadata_0;
12105 TALLOC_CTX *_mem_save_cursors2_0;
12106 TALLOC_CTX *_mem_save_cursors3_0;
12107 TALLOC_CTX *_mem_save_objmetadata2_0;
12108 TALLOC_CTX *_mem_save_attrvalmetadata2_0;
12109 TALLOC_CTX *_mem_save_neighbours02_0;
12110 TALLOC_CTX *_mem_save_connections04_0;
12111 TALLOC_CTX *_mem_save_cursors05_0;
12112 TALLOC_CTX *_mem_save_i06_0;
12113 level = ndr_pull_get_switch_value(ndr, r);
12114 if (ndr_flags & NDR_SCALARS) {
12115 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
12116 if (_level != level) {
12117 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
12119 NDR_CHECK(ndr_pull_union_align(ndr, 5));
12120 switch (level) {
12121 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: {
12122 uint32_t _ptr_neighbours;
12123 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_neighbours));
12124 if (_ptr_neighbours) {
12125 NDR_PULL_ALLOC(ndr, r->neighbours);
12126 } else {
12127 r->neighbours = NULL;
12129 break; }
12131 case DRSUAPI_DS_REPLICA_INFO_CURSORS: {
12132 uint32_t _ptr_cursors;
12133 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors));
12134 if (_ptr_cursors) {
12135 NDR_PULL_ALLOC(ndr, r->cursors);
12136 } else {
12137 r->cursors = NULL;
12139 break; }
12141 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: {
12142 uint32_t _ptr_objmetadata;
12143 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objmetadata));
12144 if (_ptr_objmetadata) {
12145 NDR_PULL_ALLOC(ndr, r->objmetadata);
12146 } else {
12147 r->objmetadata = NULL;
12149 break; }
12151 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: {
12152 uint32_t _ptr_connectfailures;
12153 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_connectfailures));
12154 if (_ptr_connectfailures) {
12155 NDR_PULL_ALLOC(ndr, r->connectfailures);
12156 } else {
12157 r->connectfailures = NULL;
12159 break; }
12161 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: {
12162 uint32_t _ptr_linkfailures;
12163 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_linkfailures));
12164 if (_ptr_linkfailures) {
12165 NDR_PULL_ALLOC(ndr, r->linkfailures);
12166 } else {
12167 r->linkfailures = NULL;
12169 break; }
12171 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: {
12172 uint32_t _ptr_pendingops;
12173 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pendingops));
12174 if (_ptr_pendingops) {
12175 NDR_PULL_ALLOC(ndr, r->pendingops);
12176 } else {
12177 r->pendingops = NULL;
12179 break; }
12181 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: {
12182 uint32_t _ptr_attrvalmetadata;
12183 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attrvalmetadata));
12184 if (_ptr_attrvalmetadata) {
12185 NDR_PULL_ALLOC(ndr, r->attrvalmetadata);
12186 } else {
12187 r->attrvalmetadata = NULL;
12189 break; }
12191 case DRSUAPI_DS_REPLICA_INFO_CURSORS2: {
12192 uint32_t _ptr_cursors2;
12193 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors2));
12194 if (_ptr_cursors2) {
12195 NDR_PULL_ALLOC(ndr, r->cursors2);
12196 } else {
12197 r->cursors2 = NULL;
12199 break; }
12201 case DRSUAPI_DS_REPLICA_INFO_CURSORS3: {
12202 uint32_t _ptr_cursors3;
12203 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors3));
12204 if (_ptr_cursors3) {
12205 NDR_PULL_ALLOC(ndr, r->cursors3);
12206 } else {
12207 r->cursors3 = NULL;
12209 break; }
12211 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: {
12212 uint32_t _ptr_objmetadata2;
12213 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objmetadata2));
12214 if (_ptr_objmetadata2) {
12215 NDR_PULL_ALLOC(ndr, r->objmetadata2);
12216 } else {
12217 r->objmetadata2 = NULL;
12219 break; }
12221 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: {
12222 uint32_t _ptr_attrvalmetadata2;
12223 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attrvalmetadata2));
12224 if (_ptr_attrvalmetadata2) {
12225 NDR_PULL_ALLOC(ndr, r->attrvalmetadata2);
12226 } else {
12227 r->attrvalmetadata2 = NULL;
12229 break; }
12231 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: {
12232 uint32_t _ptr_neighbours02;
12233 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_neighbours02));
12234 if (_ptr_neighbours02) {
12235 NDR_PULL_ALLOC(ndr, r->neighbours02);
12236 } else {
12237 r->neighbours02 = NULL;
12239 break; }
12241 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: {
12242 uint32_t _ptr_connections04;
12243 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_connections04));
12244 if (_ptr_connections04) {
12245 NDR_PULL_ALLOC(ndr, r->connections04);
12246 } else {
12247 r->connections04 = NULL;
12249 break; }
12251 case DRSUAPI_DS_REPLICA_INFO_CURSORS05: {
12252 uint32_t _ptr_cursors05;
12253 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors05));
12254 if (_ptr_cursors05) {
12255 NDR_PULL_ALLOC(ndr, r->cursors05);
12256 } else {
12257 r->cursors05 = NULL;
12259 break; }
12261 case DRSUAPI_DS_REPLICA_INFO_06: {
12262 uint32_t _ptr_i06;
12263 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_i06));
12264 if (_ptr_i06) {
12265 NDR_PULL_ALLOC(ndr, r->i06);
12266 } else {
12267 r->i06 = NULL;
12269 break; }
12271 default:
12272 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12275 if (ndr_flags & NDR_BUFFERS) {
12276 switch (level) {
12277 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS:
12278 if (r->neighbours) {
12279 _mem_save_neighbours_0 = NDR_PULL_GET_MEM_CTX(ndr);
12280 NDR_PULL_SET_MEM_CTX(ndr, r->neighbours, 0);
12281 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours));
12282 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_neighbours_0, 0);
12284 break;
12286 case DRSUAPI_DS_REPLICA_INFO_CURSORS:
12287 if (r->cursors) {
12288 _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr);
12289 NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0);
12290 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtr(ndr, NDR_SCALARS, r->cursors));
12291 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0);
12293 break;
12295 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA:
12296 if (r->objmetadata) {
12297 _mem_save_objmetadata_0 = NDR_PULL_GET_MEM_CTX(ndr);
12298 NDR_PULL_SET_MEM_CTX(ndr, r->objmetadata, 0);
12299 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata));
12300 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objmetadata_0, 0);
12302 break;
12304 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES:
12305 if (r->connectfailures) {
12306 _mem_save_connectfailures_0 = NDR_PULL_GET_MEM_CTX(ndr);
12307 NDR_PULL_SET_MEM_CTX(ndr, r->connectfailures, 0);
12308 NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->connectfailures));
12309 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connectfailures_0, 0);
12311 break;
12313 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES:
12314 if (r->linkfailures) {
12315 _mem_save_linkfailures_0 = NDR_PULL_GET_MEM_CTX(ndr);
12316 NDR_PULL_SET_MEM_CTX(ndr, r->linkfailures, 0);
12317 NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->linkfailures));
12318 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linkfailures_0, 0);
12320 break;
12322 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS:
12323 if (r->pendingops) {
12324 _mem_save_pendingops_0 = NDR_PULL_GET_MEM_CTX(ndr);
12325 NDR_PULL_SET_MEM_CTX(ndr, r->pendingops, 0);
12326 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOpCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->pendingops));
12327 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pendingops_0, 0);
12329 break;
12331 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA:
12332 if (r->attrvalmetadata) {
12333 _mem_save_attrvalmetadata_0 = NDR_PULL_GET_MEM_CTX(ndr);
12334 NDR_PULL_SET_MEM_CTX(ndr, r->attrvalmetadata, 0);
12335 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata));
12336 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attrvalmetadata_0, 0);
12338 break;
12340 case DRSUAPI_DS_REPLICA_INFO_CURSORS2:
12341 if (r->cursors2) {
12342 _mem_save_cursors2_0 = NDR_PULL_GET_MEM_CTX(ndr);
12343 NDR_PULL_SET_MEM_CTX(ndr, r->cursors2, 0);
12344 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2Ctr(ndr, NDR_SCALARS, r->cursors2));
12345 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors2_0, 0);
12347 break;
12349 case DRSUAPI_DS_REPLICA_INFO_CURSORS3:
12350 if (r->cursors3) {
12351 _mem_save_cursors3_0 = NDR_PULL_GET_MEM_CTX(ndr);
12352 NDR_PULL_SET_MEM_CTX(ndr, r->cursors3, 0);
12353 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->cursors3));
12354 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors3_0, 0);
12356 break;
12358 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2:
12359 if (r->objmetadata2) {
12360 _mem_save_objmetadata2_0 = NDR_PULL_GET_MEM_CTX(ndr);
12361 NDR_PULL_SET_MEM_CTX(ndr, r->objmetadata2, 0);
12362 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata2));
12363 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objmetadata2_0, 0);
12365 break;
12367 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2:
12368 if (r->attrvalmetadata2) {
12369 _mem_save_attrvalmetadata2_0 = NDR_PULL_GET_MEM_CTX(ndr);
12370 NDR_PULL_SET_MEM_CTX(ndr, r->attrvalmetadata2, 0);
12371 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata2));
12372 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attrvalmetadata2_0, 0);
12374 break;
12376 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02:
12377 if (r->neighbours02) {
12378 _mem_save_neighbours02_0 = NDR_PULL_GET_MEM_CTX(ndr);
12379 NDR_PULL_SET_MEM_CTX(ndr, r->neighbours02, 0);
12380 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours02));
12381 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_neighbours02_0, 0);
12383 break;
12385 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04:
12386 if (r->connections04) {
12387 _mem_save_connections04_0 = NDR_PULL_GET_MEM_CTX(ndr);
12388 NDR_PULL_SET_MEM_CTX(ndr, r->connections04, 0);
12389 NDR_CHECK(ndr_pull_drsuapi_DsReplicaConnection04Ctr(ndr, NDR_SCALARS, r->connections04));
12390 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connections04_0, 0);
12392 break;
12394 case DRSUAPI_DS_REPLICA_INFO_CURSORS05:
12395 if (r->cursors05) {
12396 _mem_save_cursors05_0 = NDR_PULL_GET_MEM_CTX(ndr);
12397 NDR_PULL_SET_MEM_CTX(ndr, r->cursors05, 0);
12398 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->cursors05));
12399 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors05_0, 0);
12401 break;
12403 case DRSUAPI_DS_REPLICA_INFO_06:
12404 if (r->i06) {
12405 _mem_save_i06_0 = NDR_PULL_GET_MEM_CTX(ndr);
12406 NDR_PULL_SET_MEM_CTX(ndr, r->i06, 0);
12407 NDR_CHECK(ndr_pull_drsuapi_DsReplica06Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->i06));
12408 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_i06_0, 0);
12410 break;
12412 default:
12413 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12416 return NDR_ERR_SUCCESS;
12419 _PUBLIC_ void ndr_print_drsuapi_DsReplicaInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaInfo *r)
12421 int level;
12422 level = ndr_print_get_switch_value(ndr, r);
12423 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaInfo");
12424 switch (level) {
12425 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS:
12426 ndr_print_ptr(ndr, "neighbours", r->neighbours);
12427 ndr->depth++;
12428 if (r->neighbours) {
12429 ndr_print_drsuapi_DsReplicaNeighbourCtr(ndr, "neighbours", r->neighbours);
12431 ndr->depth--;
12432 break;
12434 case DRSUAPI_DS_REPLICA_INFO_CURSORS:
12435 ndr_print_ptr(ndr, "cursors", r->cursors);
12436 ndr->depth++;
12437 if (r->cursors) {
12438 ndr_print_drsuapi_DsReplicaCursorCtr(ndr, "cursors", r->cursors);
12440 ndr->depth--;
12441 break;
12443 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA:
12444 ndr_print_ptr(ndr, "objmetadata", r->objmetadata);
12445 ndr->depth++;
12446 if (r->objmetadata) {
12447 ndr_print_drsuapi_DsReplicaObjMetaDataCtr(ndr, "objmetadata", r->objmetadata);
12449 ndr->depth--;
12450 break;
12452 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES:
12453 ndr_print_ptr(ndr, "connectfailures", r->connectfailures);
12454 ndr->depth++;
12455 if (r->connectfailures) {
12456 ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, "connectfailures", r->connectfailures);
12458 ndr->depth--;
12459 break;
12461 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES:
12462 ndr_print_ptr(ndr, "linkfailures", r->linkfailures);
12463 ndr->depth++;
12464 if (r->linkfailures) {
12465 ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, "linkfailures", r->linkfailures);
12467 ndr->depth--;
12468 break;
12470 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS:
12471 ndr_print_ptr(ndr, "pendingops", r->pendingops);
12472 ndr->depth++;
12473 if (r->pendingops) {
12474 ndr_print_drsuapi_DsReplicaOpCtr(ndr, "pendingops", r->pendingops);
12476 ndr->depth--;
12477 break;
12479 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA:
12480 ndr_print_ptr(ndr, "attrvalmetadata", r->attrvalmetadata);
12481 ndr->depth++;
12482 if (r->attrvalmetadata) {
12483 ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, "attrvalmetadata", r->attrvalmetadata);
12485 ndr->depth--;
12486 break;
12488 case DRSUAPI_DS_REPLICA_INFO_CURSORS2:
12489 ndr_print_ptr(ndr, "cursors2", r->cursors2);
12490 ndr->depth++;
12491 if (r->cursors2) {
12492 ndr_print_drsuapi_DsReplicaCursor2Ctr(ndr, "cursors2", r->cursors2);
12494 ndr->depth--;
12495 break;
12497 case DRSUAPI_DS_REPLICA_INFO_CURSORS3:
12498 ndr_print_ptr(ndr, "cursors3", r->cursors3);
12499 ndr->depth++;
12500 if (r->cursors3) {
12501 ndr_print_drsuapi_DsReplicaCursor3Ctr(ndr, "cursors3", r->cursors3);
12503 ndr->depth--;
12504 break;
12506 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2:
12507 ndr_print_ptr(ndr, "objmetadata2", r->objmetadata2);
12508 ndr->depth++;
12509 if (r->objmetadata2) {
12510 ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(ndr, "objmetadata2", r->objmetadata2);
12512 ndr->depth--;
12513 break;
12515 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2:
12516 ndr_print_ptr(ndr, "attrvalmetadata2", r->attrvalmetadata2);
12517 ndr->depth++;
12518 if (r->attrvalmetadata2) {
12519 ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, "attrvalmetadata2", r->attrvalmetadata2);
12521 ndr->depth--;
12522 break;
12524 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02:
12525 ndr_print_ptr(ndr, "neighbours02", r->neighbours02);
12526 ndr->depth++;
12527 if (r->neighbours02) {
12528 ndr_print_drsuapi_DsReplicaNeighbourCtr(ndr, "neighbours02", r->neighbours02);
12530 ndr->depth--;
12531 break;
12533 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04:
12534 ndr_print_ptr(ndr, "connections04", r->connections04);
12535 ndr->depth++;
12536 if (r->connections04) {
12537 ndr_print_drsuapi_DsReplicaConnection04Ctr(ndr, "connections04", r->connections04);
12539 ndr->depth--;
12540 break;
12542 case DRSUAPI_DS_REPLICA_INFO_CURSORS05:
12543 ndr_print_ptr(ndr, "cursors05", r->cursors05);
12544 ndr->depth++;
12545 if (r->cursors05) {
12546 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "cursors05", r->cursors05);
12548 ndr->depth--;
12549 break;
12551 case DRSUAPI_DS_REPLICA_INFO_06:
12552 ndr_print_ptr(ndr, "i06", r->i06);
12553 ndr->depth++;
12554 if (r->i06) {
12555 ndr_print_drsuapi_DsReplica06Ctr(ndr, "i06", r->i06);
12557 ndr->depth--;
12558 break;
12560 default:
12561 ndr_print_bad_level(ndr, name, level);
12565 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Ctr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMemberships2Ctr *r)
12567 if (ndr_flags & NDR_SCALARS) {
12568 int level = ndr_push_get_switch_value(ndr, r);
12569 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
12570 NDR_CHECK(ndr_push_union_align(ndr, 5));
12571 switch (level) {
12572 case 1: {
12573 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1));
12574 break; }
12576 default:
12577 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12580 if (ndr_flags & NDR_BUFFERS) {
12581 int level = ndr_push_get_switch_value(ndr, r);
12582 switch (level) {
12583 case 1:
12584 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1));
12585 break;
12587 default:
12588 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12591 return NDR_ERR_SUCCESS;
12594 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Ctr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMemberships2Ctr *r)
12596 int level;
12597 int32_t _level;
12598 level = ndr_pull_get_switch_value(ndr, r);
12599 if (ndr_flags & NDR_SCALARS) {
12600 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
12601 if (_level != level) {
12602 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
12604 NDR_CHECK(ndr_pull_union_align(ndr, 5));
12605 switch (level) {
12606 case 1: {
12607 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1));
12608 break; }
12610 default:
12611 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12614 if (ndr_flags & NDR_BUFFERS) {
12615 switch (level) {
12616 case 1:
12617 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1));
12618 break;
12620 default:
12621 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12624 return NDR_ERR_SUCCESS;
12627 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Ctr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Ctr *r)
12629 int level;
12630 level = ndr_print_get_switch_value(ndr, r);
12631 ndr_print_union(ndr, name, level, "drsuapi_DsGetMemberships2Ctr");
12632 switch (level) {
12633 case 1:
12634 ndr_print_drsuapi_DsGetMembershipsCtr1(ndr, "ctr1", &r->ctr1);
12635 break;
12637 default:
12638 ndr_print_bad_level(ndr, name, level);
12642 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Request1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMemberships2Request1 *r)
12644 uint32_t cntr_req_array_1;
12645 if (ndr_flags & NDR_SCALARS) {
12646 NDR_CHECK(ndr_push_align(ndr, 5));
12647 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req));
12648 NDR_CHECK(ndr_push_unique_ptr(ndr, r->req_array));
12650 if (ndr_flags & NDR_BUFFERS) {
12651 if (r->req_array) {
12652 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_req));
12653 for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) {
12654 NDR_CHECK(ndr_push_unique_ptr(ndr, r->req_array[cntr_req_array_1]));
12656 for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) {
12657 if (r->req_array[cntr_req_array_1]) {
12658 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS|NDR_BUFFERS, r->req_array[cntr_req_array_1]));
12663 return NDR_ERR_SUCCESS;
12666 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Request1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMemberships2Request1 *r)
12668 uint32_t _ptr_req_array;
12669 uint32_t cntr_req_array_1;
12670 TALLOC_CTX *_mem_save_req_array_0;
12671 TALLOC_CTX *_mem_save_req_array_1;
12672 TALLOC_CTX *_mem_save_req_array_2;
12673 if (ndr_flags & NDR_SCALARS) {
12674 NDR_CHECK(ndr_pull_align(ndr, 5));
12675 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_req));
12676 if (r->num_req < 1 || r->num_req > 10000) {
12677 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
12679 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_req_array));
12680 if (_ptr_req_array) {
12681 NDR_PULL_ALLOC(ndr, r->req_array);
12682 } else {
12683 r->req_array = NULL;
12686 if (ndr_flags & NDR_BUFFERS) {
12687 if (r->req_array) {
12688 _mem_save_req_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
12689 NDR_PULL_SET_MEM_CTX(ndr, r->req_array, 0);
12690 NDR_CHECK(ndr_pull_array_size(ndr, &r->req_array));
12691 NDR_PULL_ALLOC_N(ndr, r->req_array, ndr_get_array_size(ndr, &r->req_array));
12692 _mem_save_req_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
12693 NDR_PULL_SET_MEM_CTX(ndr, r->req_array, 0);
12694 for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) {
12695 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_req_array));
12696 if (_ptr_req_array) {
12697 NDR_PULL_ALLOC(ndr, r->req_array[cntr_req_array_1]);
12698 } else {
12699 r->req_array[cntr_req_array_1] = NULL;
12702 for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) {
12703 if (r->req_array[cntr_req_array_1]) {
12704 _mem_save_req_array_2 = NDR_PULL_GET_MEM_CTX(ndr);
12705 NDR_PULL_SET_MEM_CTX(ndr, r->req_array[cntr_req_array_1], 0);
12706 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS|NDR_BUFFERS, r->req_array[cntr_req_array_1]));
12707 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_2, 0);
12710 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_1, 0);
12711 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_0, 0);
12713 if (r->req_array) {
12714 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->req_array, r->num_req));
12717 return NDR_ERR_SUCCESS;
12720 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Request1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMemberships2Request1 *r)
12722 uint32_t cntr_req_array_1;
12723 ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships2Request1");
12724 ndr->depth++;
12725 ndr_print_uint32(ndr, "num_req", r->num_req);
12726 ndr_print_ptr(ndr, "req_array", r->req_array);
12727 ndr->depth++;
12728 if (r->req_array) {
12729 ndr->print(ndr, "%s: ARRAY(%d)", "req_array", (int)r->num_req);
12730 ndr->depth++;
12731 for (cntr_req_array_1=0;cntr_req_array_1<r->num_req;cntr_req_array_1++) {
12732 char *idx_1=NULL;
12733 if (asprintf(&idx_1, "[%d]", cntr_req_array_1) != -1) {
12734 ndr_print_ptr(ndr, "req_array", r->req_array[cntr_req_array_1]);
12735 ndr->depth++;
12736 if (r->req_array[cntr_req_array_1]) {
12737 ndr_print_drsuapi_DsGetMembershipsRequest1(ndr, "req_array", r->req_array[cntr_req_array_1]);
12739 ndr->depth--;
12740 free(idx_1);
12743 ndr->depth--;
12745 ndr->depth--;
12746 ndr->depth--;
12749 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Request(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMemberships2Request *r)
12751 if (ndr_flags & NDR_SCALARS) {
12752 int level = ndr_push_get_switch_value(ndr, r);
12753 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
12754 NDR_CHECK(ndr_push_union_align(ndr, 5));
12755 switch (level) {
12756 case 1: {
12757 NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request1(ndr, NDR_SCALARS, &r->req1));
12758 break; }
12760 default:
12761 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12764 if (ndr_flags & NDR_BUFFERS) {
12765 int level = ndr_push_get_switch_value(ndr, r);
12766 switch (level) {
12767 case 1:
12768 NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request1(ndr, NDR_BUFFERS, &r->req1));
12769 break;
12771 default:
12772 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12775 return NDR_ERR_SUCCESS;
12778 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Request(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMemberships2Request *r)
12780 int level;
12781 int32_t _level;
12782 level = ndr_pull_get_switch_value(ndr, r);
12783 if (ndr_flags & NDR_SCALARS) {
12784 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
12785 if (_level != level) {
12786 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
12788 NDR_CHECK(ndr_pull_union_align(ndr, 5));
12789 switch (level) {
12790 case 1: {
12791 NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request1(ndr, NDR_SCALARS, &r->req1));
12792 break; }
12794 default:
12795 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12798 if (ndr_flags & NDR_BUFFERS) {
12799 switch (level) {
12800 case 1:
12801 NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request1(ndr, NDR_BUFFERS, &r->req1));
12802 break;
12804 default:
12805 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12808 return NDR_ERR_SUCCESS;
12811 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Request(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Request *r)
12813 int level;
12814 level = ndr_print_get_switch_value(ndr, r);
12815 ndr_print_union(ndr, name, level, "drsuapi_DsGetMemberships2Request");
12816 switch (level) {
12817 case 1:
12818 ndr_print_drsuapi_DsGetMemberships2Request1(ndr, "req1", &r->req1);
12819 break;
12821 default:
12822 ndr_print_bad_level(ndr, name, level);
12826 static enum ndr_err_code ndr_push_drsuapi_DsSiteCostInfo(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsSiteCostInfo *r)
12828 if (ndr_flags & NDR_SCALARS) {
12829 NDR_CHECK(ndr_push_align(ndr, 4));
12830 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->error_code));
12831 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->site_cost));
12833 if (ndr_flags & NDR_BUFFERS) {
12835 return NDR_ERR_SUCCESS;
12838 static enum ndr_err_code ndr_pull_drsuapi_DsSiteCostInfo(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsSiteCostInfo *r)
12840 if (ndr_flags & NDR_SCALARS) {
12841 NDR_CHECK(ndr_pull_align(ndr, 4));
12842 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->error_code));
12843 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->site_cost));
12845 if (ndr_flags & NDR_BUFFERS) {
12847 return NDR_ERR_SUCCESS;
12850 _PUBLIC_ void ndr_print_drsuapi_DsSiteCostInfo(struct ndr_print *ndr, const char *name, const struct drsuapi_DsSiteCostInfo *r)
12852 ndr_print_struct(ndr, name, "drsuapi_DsSiteCostInfo");
12853 ndr->depth++;
12854 ndr_print_WERROR(ndr, "error_code", r->error_code);
12855 ndr_print_uint32(ndr, "site_cost", r->site_cost);
12856 ndr->depth--;
12859 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_QuerySitesByCostCtr1 *r)
12861 uint32_t cntr_info_1;
12862 if (ndr_flags & NDR_SCALARS) {
12863 NDR_CHECK(ndr_push_align(ndr, 5));
12864 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_info));
12865 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
12866 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown));
12868 if (ndr_flags & NDR_BUFFERS) {
12869 if (r->info) {
12870 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_info));
12871 for (cntr_info_1 = 0; cntr_info_1 < r->num_info; cntr_info_1++) {
12872 NDR_CHECK(ndr_push_drsuapi_DsSiteCostInfo(ndr, NDR_SCALARS, &r->info[cntr_info_1]));
12876 return NDR_ERR_SUCCESS;
12879 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_QuerySitesByCostCtr1 *r)
12881 uint32_t _ptr_info;
12882 uint32_t cntr_info_1;
12883 TALLOC_CTX *_mem_save_info_0;
12884 TALLOC_CTX *_mem_save_info_1;
12885 if (ndr_flags & NDR_SCALARS) {
12886 NDR_CHECK(ndr_pull_align(ndr, 5));
12887 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_info));
12888 if (r->num_info > 10000) {
12889 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
12891 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
12892 if (_ptr_info) {
12893 NDR_PULL_ALLOC(ndr, r->info);
12894 } else {
12895 r->info = NULL;
12897 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
12899 if (ndr_flags & NDR_BUFFERS) {
12900 if (r->info) {
12901 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
12902 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
12903 NDR_CHECK(ndr_pull_array_size(ndr, &r->info));
12904 NDR_PULL_ALLOC_N(ndr, r->info, ndr_get_array_size(ndr, &r->info));
12905 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
12906 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
12907 for (cntr_info_1 = 0; cntr_info_1 < r->num_info; cntr_info_1++) {
12908 NDR_CHECK(ndr_pull_drsuapi_DsSiteCostInfo(ndr, NDR_SCALARS, &r->info[cntr_info_1]));
12910 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
12911 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
12913 if (r->info) {
12914 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info, r->num_info));
12917 return NDR_ERR_SUCCESS;
12920 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostCtr1 *r)
12922 uint32_t cntr_info_1;
12923 ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCostCtr1");
12924 ndr->depth++;
12925 ndr_print_uint32(ndr, "num_info", r->num_info);
12926 ndr_print_ptr(ndr, "info", r->info);
12927 ndr->depth++;
12928 if (r->info) {
12929 ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->num_info);
12930 ndr->depth++;
12931 for (cntr_info_1=0;cntr_info_1<r->num_info;cntr_info_1++) {
12932 char *idx_1=NULL;
12933 if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) {
12934 ndr_print_drsuapi_DsSiteCostInfo(ndr, "info", &r->info[cntr_info_1]);
12935 free(idx_1);
12938 ndr->depth--;
12940 ndr->depth--;
12941 ndr_print_uint32(ndr, "unknown", r->unknown);
12942 ndr->depth--;
12945 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_QuerySitesByCostCtr *r)
12947 if (ndr_flags & NDR_SCALARS) {
12948 int level = ndr_push_get_switch_value(ndr, r);
12949 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
12950 NDR_CHECK(ndr_push_union_align(ndr, 5));
12951 switch (level) {
12952 case 1: {
12953 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr1(ndr, NDR_SCALARS, &r->ctr1));
12954 break; }
12956 default:
12957 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12960 if (ndr_flags & NDR_BUFFERS) {
12961 int level = ndr_push_get_switch_value(ndr, r);
12962 switch (level) {
12963 case 1:
12964 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr1(ndr, NDR_BUFFERS, &r->ctr1));
12965 break;
12967 default:
12968 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12971 return NDR_ERR_SUCCESS;
12974 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_QuerySitesByCostCtr *r)
12976 int level;
12977 int32_t _level;
12978 level = ndr_pull_get_switch_value(ndr, r);
12979 if (ndr_flags & NDR_SCALARS) {
12980 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
12981 if (_level != level) {
12982 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
12984 NDR_CHECK(ndr_pull_union_align(ndr, 5));
12985 switch (level) {
12986 case 1: {
12987 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr1(ndr, NDR_SCALARS, &r->ctr1));
12988 break; }
12990 default:
12991 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
12994 if (ndr_flags & NDR_BUFFERS) {
12995 switch (level) {
12996 case 1:
12997 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr1(ndr, NDR_BUFFERS, &r->ctr1));
12998 break;
13000 default:
13001 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
13004 return NDR_ERR_SUCCESS;
13007 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostCtr(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostCtr *r)
13009 int level;
13010 level = ndr_print_get_switch_value(ndr, r);
13011 ndr_print_union(ndr, name, level, "drsuapi_QuerySitesByCostCtr");
13012 switch (level) {
13013 case 1:
13014 ndr_print_drsuapi_QuerySitesByCostCtr1(ndr, "ctr1", &r->ctr1);
13015 break;
13017 default:
13018 ndr_print_bad_level(ndr, name, level);
13022 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_QuerySitesByCostRequest1 *r)
13024 uint32_t cntr_site_to_1;
13025 if (ndr_flags & NDR_SCALARS) {
13026 NDR_CHECK(ndr_push_align(ndr, 5));
13027 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_from));
13028 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req));
13029 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_to));
13030 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
13032 if (ndr_flags & NDR_BUFFERS) {
13033 if (r->site_from) {
13034 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_from, CH_UTF16)));
13035 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13036 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_from, CH_UTF16)));
13037 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_from, ndr_charset_length(r->site_from, CH_UTF16), sizeof(uint16_t), CH_UTF16));
13039 if (r->site_to) {
13040 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_req));
13041 for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) {
13042 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_to[cntr_site_to_1]));
13044 for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) {
13045 if (r->site_to[cntr_site_to_1]) {
13046 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16)));
13047 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
13048 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16)));
13049 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_to[cntr_site_to_1], ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16), sizeof(uint16_t), CH_UTF16));
13054 return NDR_ERR_SUCCESS;
13057 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_QuerySitesByCostRequest1 *r)
13059 uint32_t _ptr_site_from;
13060 TALLOC_CTX *_mem_save_site_from_0;
13061 uint32_t _ptr_site_to;
13062 uint32_t cntr_site_to_1;
13063 TALLOC_CTX *_mem_save_site_to_0;
13064 TALLOC_CTX *_mem_save_site_to_1;
13065 TALLOC_CTX *_mem_save_site_to_2;
13066 if (ndr_flags & NDR_SCALARS) {
13067 NDR_CHECK(ndr_pull_align(ndr, 5));
13068 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_from));
13069 if (_ptr_site_from) {
13070 NDR_PULL_ALLOC(ndr, r->site_from);
13071 } else {
13072 r->site_from = NULL;
13074 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_req));
13075 if (r->num_req < 1 || r->num_req > 10000) {
13076 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
13078 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_to));
13079 if (_ptr_site_to) {
13080 NDR_PULL_ALLOC(ndr, r->site_to);
13081 } else {
13082 r->site_to = NULL;
13084 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
13086 if (ndr_flags & NDR_BUFFERS) {
13087 if (r->site_from) {
13088 _mem_save_site_from_0 = NDR_PULL_GET_MEM_CTX(ndr);
13089 NDR_PULL_SET_MEM_CTX(ndr, r->site_from, 0);
13090 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_from));
13091 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_from));
13092 if (ndr_get_array_length(ndr, &r->site_from) > ndr_get_array_size(ndr, &r->site_from)) {
13093 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_from), ndr_get_array_length(ndr, &r->site_from));
13095 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_from), sizeof(uint16_t)));
13096 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_from, ndr_get_array_length(ndr, &r->site_from), sizeof(uint16_t), CH_UTF16));
13097 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_from_0, 0);
13099 if (r->site_to) {
13100 _mem_save_site_to_0 = NDR_PULL_GET_MEM_CTX(ndr);
13101 NDR_PULL_SET_MEM_CTX(ndr, r->site_to, 0);
13102 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_to));
13103 NDR_PULL_ALLOC_N(ndr, r->site_to, ndr_get_array_size(ndr, &r->site_to));
13104 _mem_save_site_to_1 = NDR_PULL_GET_MEM_CTX(ndr);
13105 NDR_PULL_SET_MEM_CTX(ndr, r->site_to, 0);
13106 for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) {
13107 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_to));
13108 if (_ptr_site_to) {
13109 NDR_PULL_ALLOC(ndr, r->site_to[cntr_site_to_1]);
13110 } else {
13111 r->site_to[cntr_site_to_1] = NULL;
13114 for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) {
13115 if (r->site_to[cntr_site_to_1]) {
13116 _mem_save_site_to_2 = NDR_PULL_GET_MEM_CTX(ndr);
13117 NDR_PULL_SET_MEM_CTX(ndr, r->site_to[cntr_site_to_1], 0);
13118 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_to[cntr_site_to_1]));
13119 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_to[cntr_site_to_1]));
13120 if (ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]) > ndr_get_array_size(ndr, &r->site_to[cntr_site_to_1])) {
13121 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_to[cntr_site_to_1]), ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]));
13123 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]), sizeof(uint16_t)));
13124 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_to[cntr_site_to_1], ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]), sizeof(uint16_t), CH_UTF16));
13125 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_2, 0);
13128 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_1, 0);
13129 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_0, 0);
13131 if (r->site_to) {
13132 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->site_to, r->num_req));
13135 return NDR_ERR_SUCCESS;
13138 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostRequest1 *r)
13140 uint32_t cntr_site_to_1;
13141 ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCostRequest1");
13142 ndr->depth++;
13143 ndr_print_ptr(ndr, "site_from", r->site_from);
13144 ndr->depth++;
13145 if (r->site_from) {
13146 ndr_print_string(ndr, "site_from", r->site_from);
13148 ndr->depth--;
13149 ndr_print_uint32(ndr, "num_req", r->num_req);
13150 ndr_print_ptr(ndr, "site_to", r->site_to);
13151 ndr->depth++;
13152 if (r->site_to) {
13153 ndr->print(ndr, "%s: ARRAY(%d)", "site_to", (int)r->num_req);
13154 ndr->depth++;
13155 for (cntr_site_to_1=0;cntr_site_to_1<r->num_req;cntr_site_to_1++) {
13156 char *idx_1=NULL;
13157 if (asprintf(&idx_1, "[%d]", cntr_site_to_1) != -1) {
13158 ndr_print_ptr(ndr, "site_to", r->site_to[cntr_site_to_1]);
13159 ndr->depth++;
13160 if (r->site_to[cntr_site_to_1]) {
13161 ndr_print_string(ndr, "site_to", r->site_to[cntr_site_to_1]);
13163 ndr->depth--;
13164 free(idx_1);
13167 ndr->depth--;
13169 ndr->depth--;
13170 ndr_print_uint32(ndr, "flags", r->flags);
13171 ndr->depth--;
13174 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_QuerySitesByCostRequest *r)
13176 if (ndr_flags & NDR_SCALARS) {
13177 int level = ndr_push_get_switch_value(ndr, r);
13178 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
13179 NDR_CHECK(ndr_push_union_align(ndr, 5));
13180 switch (level) {
13181 case 1: {
13182 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest1(ndr, NDR_SCALARS, &r->req1));
13183 break; }
13185 default:
13186 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
13189 if (ndr_flags & NDR_BUFFERS) {
13190 int level = ndr_push_get_switch_value(ndr, r);
13191 switch (level) {
13192 case 1:
13193 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest1(ndr, NDR_BUFFERS, &r->req1));
13194 break;
13196 default:
13197 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
13200 return NDR_ERR_SUCCESS;
13203 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_QuerySitesByCostRequest *r)
13205 int level;
13206 int32_t _level;
13207 level = ndr_pull_get_switch_value(ndr, r);
13208 if (ndr_flags & NDR_SCALARS) {
13209 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
13210 if (_level != level) {
13211 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
13213 NDR_CHECK(ndr_pull_union_align(ndr, 5));
13214 switch (level) {
13215 case 1: {
13216 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest1(ndr, NDR_SCALARS, &r->req1));
13217 break; }
13219 default:
13220 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
13223 if (ndr_flags & NDR_BUFFERS) {
13224 switch (level) {
13225 case 1:
13226 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest1(ndr, NDR_BUFFERS, &r->req1));
13227 break;
13229 default:
13230 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
13233 return NDR_ERR_SUCCESS;
13236 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostRequest(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostRequest *r)
13238 int level;
13239 level = ndr_print_get_switch_value(ndr, r);
13240 ndr_print_union(ndr, name, level, "drsuapi_QuerySitesByCostRequest");
13241 switch (level) {
13242 case 1:
13243 ndr_print_drsuapi_QuerySitesByCostRequest1(ndr, "req1", &r->req1);
13244 break;
13246 default:
13247 ndr_print_bad_level(ndr, name, level);
13251 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsBind(struct ndr_push *ndr, int flags, const struct drsuapi_DsBind *r)
13253 if (flags & NDR_IN) {
13254 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.bind_guid));
13255 if (r->in.bind_guid) {
13256 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.bind_guid));
13258 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.bind_info));
13259 if (r->in.bind_info) {
13260 NDR_CHECK(ndr_push_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->in.bind_info));
13263 if (flags & NDR_OUT) {
13264 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.bind_info));
13265 if (r->out.bind_info) {
13266 NDR_CHECK(ndr_push_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->out.bind_info));
13268 if (r->out.bind_handle == NULL) {
13269 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13271 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle));
13272 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13274 return NDR_ERR_SUCCESS;
13277 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsBind(struct ndr_pull *ndr, int flags, struct drsuapi_DsBind *r)
13279 uint32_t _ptr_bind_guid;
13280 uint32_t _ptr_bind_info;
13281 TALLOC_CTX *_mem_save_bind_guid_0;
13282 TALLOC_CTX *_mem_save_bind_info_0;
13283 TALLOC_CTX *_mem_save_bind_handle_0;
13284 if (flags & NDR_IN) {
13285 ZERO_STRUCT(r->out);
13287 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_guid));
13288 if (_ptr_bind_guid) {
13289 NDR_PULL_ALLOC(ndr, r->in.bind_guid);
13290 } else {
13291 r->in.bind_guid = NULL;
13293 if (r->in.bind_guid) {
13294 _mem_save_bind_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
13295 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_guid, 0);
13296 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.bind_guid));
13297 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_guid_0, 0);
13299 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_info));
13300 if (_ptr_bind_info) {
13301 NDR_PULL_ALLOC(ndr, r->in.bind_info);
13302 } else {
13303 r->in.bind_info = NULL;
13305 if (r->in.bind_info) {
13306 _mem_save_bind_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
13307 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_info, 0);
13308 NDR_CHECK(ndr_pull_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->in.bind_info));
13309 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_info_0, 0);
13311 NDR_PULL_ALLOC(ndr, r->out.bind_handle);
13312 ZERO_STRUCTP(r->out.bind_handle);
13314 if (flags & NDR_OUT) {
13315 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_info));
13316 if (_ptr_bind_info) {
13317 NDR_PULL_ALLOC(ndr, r->out.bind_info);
13318 } else {
13319 r->out.bind_info = NULL;
13321 if (r->out.bind_info) {
13322 _mem_save_bind_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
13323 NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_info, 0);
13324 NDR_CHECK(ndr_pull_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->out.bind_info));
13325 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_info_0, 0);
13327 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13328 NDR_PULL_ALLOC(ndr, r->out.bind_handle);
13330 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13331 NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13332 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle));
13333 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13334 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13336 return NDR_ERR_SUCCESS;
13339 _PUBLIC_ void ndr_print_drsuapi_DsBind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsBind *r)
13341 ndr_print_struct(ndr, name, "drsuapi_DsBind");
13342 ndr->depth++;
13343 if (flags & NDR_SET_VALUES) {
13344 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13346 if (flags & NDR_IN) {
13347 ndr_print_struct(ndr, "in", "drsuapi_DsBind");
13348 ndr->depth++;
13349 ndr_print_ptr(ndr, "bind_guid", r->in.bind_guid);
13350 ndr->depth++;
13351 if (r->in.bind_guid) {
13352 ndr_print_GUID(ndr, "bind_guid", r->in.bind_guid);
13354 ndr->depth--;
13355 ndr_print_ptr(ndr, "bind_info", r->in.bind_info);
13356 ndr->depth++;
13357 if (r->in.bind_info) {
13358 ndr_print_drsuapi_DsBindInfoCtr(ndr, "bind_info", r->in.bind_info);
13360 ndr->depth--;
13361 ndr->depth--;
13363 if (flags & NDR_OUT) {
13364 ndr_print_struct(ndr, "out", "drsuapi_DsBind");
13365 ndr->depth++;
13366 ndr_print_ptr(ndr, "bind_info", r->out.bind_info);
13367 ndr->depth++;
13368 if (r->out.bind_info) {
13369 ndr_print_drsuapi_DsBindInfoCtr(ndr, "bind_info", r->out.bind_info);
13371 ndr->depth--;
13372 ndr_print_ptr(ndr, "bind_handle", r->out.bind_handle);
13373 ndr->depth++;
13374 ndr_print_policy_handle(ndr, "bind_handle", r->out.bind_handle);
13375 ndr->depth--;
13376 ndr_print_WERROR(ndr, "result", r->out.result);
13377 ndr->depth--;
13379 ndr->depth--;
13382 static enum ndr_err_code ndr_push_drsuapi_DsUnbind(struct ndr_push *ndr, int flags, const struct drsuapi_DsUnbind *r)
13384 if (flags & NDR_IN) {
13385 if (r->in.bind_handle == NULL) {
13386 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13388 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13390 if (flags & NDR_OUT) {
13391 if (r->out.bind_handle == NULL) {
13392 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13394 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle));
13395 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13397 return NDR_ERR_SUCCESS;
13400 static enum ndr_err_code ndr_pull_drsuapi_DsUnbind(struct ndr_pull *ndr, int flags, struct drsuapi_DsUnbind *r)
13402 TALLOC_CTX *_mem_save_bind_handle_0;
13403 if (flags & NDR_IN) {
13404 ZERO_STRUCT(r->out);
13406 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13407 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13409 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13410 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13411 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13412 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13413 NDR_PULL_ALLOC(ndr, r->out.bind_handle);
13414 *r->out.bind_handle = *r->in.bind_handle;
13416 if (flags & NDR_OUT) {
13417 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13418 NDR_PULL_ALLOC(ndr, r->out.bind_handle);
13420 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13421 NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13422 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle));
13423 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13424 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13426 return NDR_ERR_SUCCESS;
13429 _PUBLIC_ void ndr_print_drsuapi_DsUnbind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsUnbind *r)
13431 ndr_print_struct(ndr, name, "drsuapi_DsUnbind");
13432 ndr->depth++;
13433 if (flags & NDR_SET_VALUES) {
13434 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13436 if (flags & NDR_IN) {
13437 ndr_print_struct(ndr, "in", "drsuapi_DsUnbind");
13438 ndr->depth++;
13439 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13440 ndr->depth++;
13441 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13442 ndr->depth--;
13443 ndr->depth--;
13445 if (flags & NDR_OUT) {
13446 ndr_print_struct(ndr, "out", "drsuapi_DsUnbind");
13447 ndr->depth++;
13448 ndr_print_ptr(ndr, "bind_handle", r->out.bind_handle);
13449 ndr->depth++;
13450 ndr_print_policy_handle(ndr, "bind_handle", r->out.bind_handle);
13451 ndr->depth--;
13452 ndr_print_WERROR(ndr, "result", r->out.result);
13453 ndr->depth--;
13455 ndr->depth--;
13458 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSync(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaSync *r)
13460 if (flags & NDR_IN) {
13461 if (r->in.bind_handle == NULL) {
13462 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13464 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13465 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13466 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level));
13467 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13469 if (flags & NDR_OUT) {
13470 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13472 return NDR_ERR_SUCCESS;
13475 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSync(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaSync *r)
13477 TALLOC_CTX *_mem_save_bind_handle_0;
13478 if (flags & NDR_IN) {
13479 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13480 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13482 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13483 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13484 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13485 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13486 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13487 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level));
13488 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13490 if (flags & NDR_OUT) {
13491 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13493 return NDR_ERR_SUCCESS;
13496 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSync(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaSync *r)
13498 ndr_print_struct(ndr, name, "drsuapi_DsReplicaSync");
13499 ndr->depth++;
13500 if (flags & NDR_SET_VALUES) {
13501 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13503 if (flags & NDR_IN) {
13504 ndr_print_struct(ndr, "in", "drsuapi_DsReplicaSync");
13505 ndr->depth++;
13506 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13507 ndr->depth++;
13508 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13509 ndr->depth--;
13510 ndr_print_int32(ndr, "level", r->in.level);
13511 ndr_print_set_switch_value(ndr, &r->in.req, r->in.level);
13512 ndr_print_drsuapi_DsReplicaSyncRequest(ndr, "req", &r->in.req);
13513 ndr->depth--;
13515 if (flags & NDR_OUT) {
13516 ndr_print_struct(ndr, "out", "drsuapi_DsReplicaSync");
13517 ndr->depth++;
13518 ndr_print_WERROR(ndr, "result", r->out.result);
13519 ndr->depth--;
13521 ndr->depth--;
13524 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChanges(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetNCChanges *r)
13526 if (flags & NDR_IN) {
13527 if (r->in.bind_handle == NULL) {
13528 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13530 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13531 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13532 if (r->in.req == NULL) {
13533 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13535 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13536 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13538 if (flags & NDR_OUT) {
13539 if (r->out.level_out == NULL) {
13540 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13542 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
13543 if (r->out.ctr == NULL) {
13544 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13546 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13547 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13548 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13550 return NDR_ERR_SUCCESS;
13553 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChanges(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetNCChanges *r)
13555 TALLOC_CTX *_mem_save_bind_handle_0;
13556 TALLOC_CTX *_mem_save_req_0;
13557 TALLOC_CTX *_mem_save_level_out_0;
13558 TALLOC_CTX *_mem_save_ctr_0;
13559 if (flags & NDR_IN) {
13560 ZERO_STRUCT(r->out);
13562 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13563 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13565 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13566 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13567 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13568 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13569 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13570 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13571 NDR_PULL_ALLOC(ndr, r->in.req);
13573 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
13574 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
13575 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
13576 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13577 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
13578 NDR_PULL_ALLOC(ndr, r->out.level_out);
13579 ZERO_STRUCTP(r->out.level_out);
13580 NDR_PULL_ALLOC(ndr, r->out.ctr);
13581 ZERO_STRUCTP(r->out.ctr);
13583 if (flags & NDR_OUT) {
13584 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13585 NDR_PULL_ALLOC(ndr, r->out.level_out);
13587 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
13588 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
13589 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
13590 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
13591 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13592 NDR_PULL_ALLOC(ndr, r->out.ctr);
13594 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
13595 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
13596 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13597 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13598 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
13599 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13601 return NDR_ERR_SUCCESS;
13604 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChanges(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNCChanges *r)
13606 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChanges");
13607 ndr->depth++;
13608 if (flags & NDR_SET_VALUES) {
13609 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13611 if (flags & NDR_IN) {
13612 ndr_print_struct(ndr, "in", "drsuapi_DsGetNCChanges");
13613 ndr->depth++;
13614 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13615 ndr->depth++;
13616 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13617 ndr->depth--;
13618 ndr_print_int32(ndr, "level", r->in.level);
13619 ndr_print_ptr(ndr, "req", r->in.req);
13620 ndr->depth++;
13621 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
13622 ndr_print_drsuapi_DsGetNCChangesRequest(ndr, "req", r->in.req);
13623 ndr->depth--;
13624 ndr->depth--;
13626 if (flags & NDR_OUT) {
13627 ndr_print_struct(ndr, "out", "drsuapi_DsGetNCChanges");
13628 ndr->depth++;
13629 ndr_print_ptr(ndr, "level_out", r->out.level_out);
13630 ndr->depth++;
13631 ndr_print_int32(ndr, "level_out", *r->out.level_out);
13632 ndr->depth--;
13633 ndr_print_ptr(ndr, "ctr", r->out.ctr);
13634 ndr->depth++;
13635 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
13636 ndr_print_drsuapi_DsGetNCChangesCtr(ndr, "ctr", r->out.ctr);
13637 ndr->depth--;
13638 ndr_print_WERROR(ndr, "result", r->out.result);
13639 ndr->depth--;
13641 ndr->depth--;
13644 static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefs(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaUpdateRefs *r)
13646 if (flags & NDR_IN) {
13647 if (r->in.bind_handle == NULL) {
13648 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13650 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13651 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13652 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level));
13653 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13655 if (flags & NDR_OUT) {
13656 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13658 return NDR_ERR_SUCCESS;
13661 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefs(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaUpdateRefs *r)
13663 TALLOC_CTX *_mem_save_bind_handle_0;
13664 if (flags & NDR_IN) {
13665 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13666 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13668 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13669 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13670 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13671 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13672 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13673 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level));
13674 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13676 if (flags & NDR_OUT) {
13677 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13679 return NDR_ERR_SUCCESS;
13682 _PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefs(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaUpdateRefs *r)
13684 ndr_print_struct(ndr, name, "drsuapi_DsReplicaUpdateRefs");
13685 ndr->depth++;
13686 if (flags & NDR_SET_VALUES) {
13687 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13689 if (flags & NDR_IN) {
13690 ndr_print_struct(ndr, "in", "drsuapi_DsReplicaUpdateRefs");
13691 ndr->depth++;
13692 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13693 ndr->depth++;
13694 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13695 ndr->depth--;
13696 ndr_print_int32(ndr, "level", r->in.level);
13697 ndr_print_set_switch_value(ndr, &r->in.req, r->in.level);
13698 ndr_print_drsuapi_DsReplicaUpdateRefsRequest(ndr, "req", &r->in.req);
13699 ndr->depth--;
13701 if (flags & NDR_OUT) {
13702 ndr_print_struct(ndr, "out", "drsuapi_DsReplicaUpdateRefs");
13703 ndr->depth++;
13704 ndr_print_WERROR(ndr, "result", r->out.result);
13705 ndr->depth--;
13707 ndr->depth--;
13710 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAdd(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaAdd *r)
13712 if (flags & NDR_IN) {
13713 if (r->in.bind_handle == NULL) {
13714 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13716 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13717 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13718 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level));
13719 NDR_CHECK(ndr_push_drsuapi_DsReplicaAddRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13721 if (flags & NDR_OUT) {
13722 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13724 return NDR_ERR_SUCCESS;
13727 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAdd(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaAdd *r)
13729 TALLOC_CTX *_mem_save_bind_handle_0;
13730 if (flags & NDR_IN) {
13731 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13732 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13734 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13735 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13736 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13737 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13738 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13739 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level));
13740 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13742 if (flags & NDR_OUT) {
13743 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13745 return NDR_ERR_SUCCESS;
13748 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAdd(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaAdd *r)
13750 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAdd");
13751 ndr->depth++;
13752 if (flags & NDR_SET_VALUES) {
13753 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13755 if (flags & NDR_IN) {
13756 ndr_print_struct(ndr, "in", "drsuapi_DsReplicaAdd");
13757 ndr->depth++;
13758 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13759 ndr->depth++;
13760 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13761 ndr->depth--;
13762 ndr_print_int32(ndr, "level", r->in.level);
13763 ndr_print_set_switch_value(ndr, &r->in.req, r->in.level);
13764 ndr_print_drsuapi_DsReplicaAddRequest(ndr, "req", &r->in.req);
13765 ndr->depth--;
13767 if (flags & NDR_OUT) {
13768 ndr_print_struct(ndr, "out", "drsuapi_DsReplicaAdd");
13769 ndr->depth++;
13770 ndr_print_WERROR(ndr, "result", r->out.result);
13771 ndr->depth--;
13773 ndr->depth--;
13776 static enum ndr_err_code ndr_push_drsuapi_DsReplicaDel(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaDel *r)
13778 if (flags & NDR_IN) {
13779 if (r->in.bind_handle == NULL) {
13780 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13782 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13783 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13784 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level));
13785 NDR_CHECK(ndr_push_drsuapi_DsReplicaDelRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13787 if (flags & NDR_OUT) {
13788 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13790 return NDR_ERR_SUCCESS;
13793 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaDel(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaDel *r)
13795 TALLOC_CTX *_mem_save_bind_handle_0;
13796 if (flags & NDR_IN) {
13797 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13798 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13800 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13801 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13802 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13803 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13804 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13805 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level));
13806 NDR_CHECK(ndr_pull_drsuapi_DsReplicaDelRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13808 if (flags & NDR_OUT) {
13809 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13811 return NDR_ERR_SUCCESS;
13814 _PUBLIC_ void ndr_print_drsuapi_DsReplicaDel(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaDel *r)
13816 ndr_print_struct(ndr, name, "drsuapi_DsReplicaDel");
13817 ndr->depth++;
13818 if (flags & NDR_SET_VALUES) {
13819 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13821 if (flags & NDR_IN) {
13822 ndr_print_struct(ndr, "in", "drsuapi_DsReplicaDel");
13823 ndr->depth++;
13824 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13825 ndr->depth++;
13826 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13827 ndr->depth--;
13828 ndr_print_int32(ndr, "level", r->in.level);
13829 ndr_print_set_switch_value(ndr, &r->in.req, r->in.level);
13830 ndr_print_drsuapi_DsReplicaDelRequest(ndr, "req", &r->in.req);
13831 ndr->depth--;
13833 if (flags & NDR_OUT) {
13834 ndr_print_struct(ndr, "out", "drsuapi_DsReplicaDel");
13835 ndr->depth++;
13836 ndr_print_WERROR(ndr, "result", r->out.result);
13837 ndr->depth--;
13839 ndr->depth--;
13842 static enum ndr_err_code ndr_push_drsuapi_DsReplicaMod(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaMod *r)
13844 if (flags & NDR_IN) {
13845 if (r->in.bind_handle == NULL) {
13846 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13848 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13849 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13850 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level));
13851 NDR_CHECK(ndr_push_drsuapi_DsReplicaModRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13853 if (flags & NDR_OUT) {
13854 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13856 return NDR_ERR_SUCCESS;
13859 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaMod(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaMod *r)
13861 TALLOC_CTX *_mem_save_bind_handle_0;
13862 if (flags & NDR_IN) {
13863 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13864 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13866 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13867 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13868 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13869 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13870 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13871 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level));
13872 NDR_CHECK(ndr_pull_drsuapi_DsReplicaModRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
13874 if (flags & NDR_OUT) {
13875 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13877 return NDR_ERR_SUCCESS;
13880 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMod(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaMod *r)
13882 ndr_print_struct(ndr, name, "drsuapi_DsReplicaMod");
13883 ndr->depth++;
13884 if (flags & NDR_SET_VALUES) {
13885 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13887 if (flags & NDR_IN) {
13888 ndr_print_struct(ndr, "in", "drsuapi_DsReplicaMod");
13889 ndr->depth++;
13890 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13891 ndr->depth++;
13892 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13893 ndr->depth--;
13894 ndr_print_int32(ndr, "level", r->in.level);
13895 ndr_print_set_switch_value(ndr, &r->in.req, r->in.level);
13896 ndr_print_drsuapi_DsReplicaModRequest(ndr, "req", &r->in.req);
13897 ndr->depth--;
13899 if (flags & NDR_OUT) {
13900 ndr_print_struct(ndr, "out", "drsuapi_DsReplicaMod");
13901 ndr->depth++;
13902 ndr_print_WERROR(ndr, "result", r->out.result);
13903 ndr->depth--;
13905 ndr->depth--;
13908 static enum ndr_err_code ndr_push_DRSUAPI_VERIFY_NAMES(struct ndr_push *ndr, int flags, const struct DRSUAPI_VERIFY_NAMES *r)
13910 if (flags & NDR_IN) {
13912 if (flags & NDR_OUT) {
13913 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13915 return NDR_ERR_SUCCESS;
13918 static enum ndr_err_code ndr_pull_DRSUAPI_VERIFY_NAMES(struct ndr_pull *ndr, int flags, struct DRSUAPI_VERIFY_NAMES *r)
13920 if (flags & NDR_IN) {
13922 if (flags & NDR_OUT) {
13923 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13925 return NDR_ERR_SUCCESS;
13928 _PUBLIC_ void ndr_print_DRSUAPI_VERIFY_NAMES(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_VERIFY_NAMES *r)
13930 ndr_print_struct(ndr, name, "DRSUAPI_VERIFY_NAMES");
13931 ndr->depth++;
13932 if (flags & NDR_SET_VALUES) {
13933 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13935 if (flags & NDR_IN) {
13936 ndr_print_struct(ndr, "in", "DRSUAPI_VERIFY_NAMES");
13937 ndr->depth++;
13938 ndr->depth--;
13940 if (flags & NDR_OUT) {
13941 ndr_print_struct(ndr, "out", "DRSUAPI_VERIFY_NAMES");
13942 ndr->depth++;
13943 ndr_print_WERROR(ndr, "result", r->out.result);
13944 ndr->depth--;
13946 ndr->depth--;
13949 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetMemberships *r)
13951 if (flags & NDR_IN) {
13952 if (r->in.bind_handle == NULL) {
13953 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13955 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13956 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13957 if (r->in.req == NULL) {
13958 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13960 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13961 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13963 if (flags & NDR_OUT) {
13964 if (r->out.level_out == NULL) {
13965 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13967 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
13968 if (r->out.ctr == NULL) {
13969 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13971 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13972 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13973 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13975 return NDR_ERR_SUCCESS;
13978 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetMemberships *r)
13980 TALLOC_CTX *_mem_save_bind_handle_0;
13981 TALLOC_CTX *_mem_save_req_0;
13982 TALLOC_CTX *_mem_save_level_out_0;
13983 TALLOC_CTX *_mem_save_ctr_0;
13984 if (flags & NDR_IN) {
13985 ZERO_STRUCT(r->out);
13987 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13988 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13990 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13991 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13992 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13993 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13994 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13995 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13996 NDR_PULL_ALLOC(ndr, r->in.req);
13998 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
13999 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14000 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14001 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14002 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14003 NDR_PULL_ALLOC(ndr, r->out.level_out);
14004 ZERO_STRUCTP(r->out.level_out);
14005 NDR_PULL_ALLOC(ndr, r->out.ctr);
14006 ZERO_STRUCTP(r->out.ctr);
14008 if (flags & NDR_OUT) {
14009 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14010 NDR_PULL_ALLOC(ndr, r->out.level_out);
14012 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
14013 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
14014 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
14015 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
14016 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14017 NDR_PULL_ALLOC(ndr, r->out.ctr);
14019 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
14020 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
14021 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14022 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14023 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
14024 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14026 return NDR_ERR_SUCCESS;
14029 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships *r)
14031 ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships");
14032 ndr->depth++;
14033 if (flags & NDR_SET_VALUES) {
14034 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14036 if (flags & NDR_IN) {
14037 ndr_print_struct(ndr, "in", "drsuapi_DsGetMemberships");
14038 ndr->depth++;
14039 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14040 ndr->depth++;
14041 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14042 ndr->depth--;
14043 ndr_print_int32(ndr, "level", r->in.level);
14044 ndr_print_ptr(ndr, "req", r->in.req);
14045 ndr->depth++;
14046 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14047 ndr_print_drsuapi_DsGetMembershipsRequest(ndr, "req", r->in.req);
14048 ndr->depth--;
14049 ndr->depth--;
14051 if (flags & NDR_OUT) {
14052 ndr_print_struct(ndr, "out", "drsuapi_DsGetMemberships");
14053 ndr->depth++;
14054 ndr_print_ptr(ndr, "level_out", r->out.level_out);
14055 ndr->depth++;
14056 ndr_print_int32(ndr, "level_out", *r->out.level_out);
14057 ndr->depth--;
14058 ndr_print_ptr(ndr, "ctr", r->out.ctr);
14059 ndr->depth++;
14060 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
14061 ndr_print_drsuapi_DsGetMembershipsCtr(ndr, "ctr", r->out.ctr);
14062 ndr->depth--;
14063 ndr_print_WERROR(ndr, "result", r->out.result);
14064 ndr->depth--;
14066 ndr->depth--;
14069 static enum ndr_err_code ndr_push_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_push *ndr, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r)
14071 if (flags & NDR_IN) {
14073 if (flags & NDR_OUT) {
14074 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14076 return NDR_ERR_SUCCESS;
14079 static enum ndr_err_code ndr_pull_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_pull *ndr, int flags, struct DRSUAPI_INTER_DOMAIN_MOVE *r)
14081 if (flags & NDR_IN) {
14083 if (flags & NDR_OUT) {
14084 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14086 return NDR_ERR_SUCCESS;
14089 _PUBLIC_ void ndr_print_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r)
14091 ndr_print_struct(ndr, name, "DRSUAPI_INTER_DOMAIN_MOVE");
14092 ndr->depth++;
14093 if (flags & NDR_SET_VALUES) {
14094 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14096 if (flags & NDR_IN) {
14097 ndr_print_struct(ndr, "in", "DRSUAPI_INTER_DOMAIN_MOVE");
14098 ndr->depth++;
14099 ndr->depth--;
14101 if (flags & NDR_OUT) {
14102 ndr_print_struct(ndr, "out", "DRSUAPI_INTER_DOMAIN_MOVE");
14103 ndr->depth++;
14104 ndr_print_WERROR(ndr, "result", r->out.result);
14105 ndr->depth--;
14107 ndr->depth--;
14110 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLog(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetNT4ChangeLog *r)
14112 if (flags & NDR_IN) {
14113 if (r->in.bind_handle == NULL) {
14114 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14116 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14117 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
14118 if (r->in.req == NULL) {
14119 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14121 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
14122 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14124 if (flags & NDR_OUT) {
14125 if (r->out.level_out == NULL) {
14126 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14128 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level_out));
14129 if (r->out.info == NULL) {
14130 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14132 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, *r->out.level_out));
14133 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
14134 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14136 return NDR_ERR_SUCCESS;
14139 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLog(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetNT4ChangeLog *r)
14141 TALLOC_CTX *_mem_save_bind_handle_0;
14142 TALLOC_CTX *_mem_save_req_0;
14143 TALLOC_CTX *_mem_save_level_out_0;
14144 TALLOC_CTX *_mem_save_info_0;
14145 if (flags & NDR_IN) {
14146 ZERO_STRUCT(r->out);
14148 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14149 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14151 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14152 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14153 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14154 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14155 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
14156 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14157 NDR_PULL_ALLOC(ndr, r->in.req);
14159 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
14160 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14161 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14162 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14163 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14164 NDR_PULL_ALLOC(ndr, r->out.level_out);
14165 ZERO_STRUCTP(r->out.level_out);
14166 NDR_PULL_ALLOC(ndr, r->out.info);
14167 ZERO_STRUCTP(r->out.info);
14169 if (flags & NDR_OUT) {
14170 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14171 NDR_PULL_ALLOC(ndr, r->out.level_out);
14173 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
14174 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
14175 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.level_out));
14176 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
14177 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14178 NDR_PULL_ALLOC(ndr, r->out.info);
14180 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
14181 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
14182 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, *r->out.level_out));
14183 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
14184 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
14185 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14187 return NDR_ERR_SUCCESS;
14190 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLog(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNT4ChangeLog *r)
14192 ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLog");
14193 ndr->depth++;
14194 if (flags & NDR_SET_VALUES) {
14195 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14197 if (flags & NDR_IN) {
14198 ndr_print_struct(ndr, "in", "drsuapi_DsGetNT4ChangeLog");
14199 ndr->depth++;
14200 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14201 ndr->depth++;
14202 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14203 ndr->depth--;
14204 ndr_print_uint32(ndr, "level", r->in.level);
14205 ndr_print_ptr(ndr, "req", r->in.req);
14206 ndr->depth++;
14207 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14208 ndr_print_drsuapi_DsGetNT4ChangeLogRequest(ndr, "req", r->in.req);
14209 ndr->depth--;
14210 ndr->depth--;
14212 if (flags & NDR_OUT) {
14213 ndr_print_struct(ndr, "out", "drsuapi_DsGetNT4ChangeLog");
14214 ndr->depth++;
14215 ndr_print_ptr(ndr, "level_out", r->out.level_out);
14216 ndr->depth++;
14217 ndr_print_uint32(ndr, "level_out", *r->out.level_out);
14218 ndr->depth--;
14219 ndr_print_ptr(ndr, "info", r->out.info);
14220 ndr->depth++;
14221 ndr_print_set_switch_value(ndr, r->out.info, *r->out.level_out);
14222 ndr_print_drsuapi_DsGetNT4ChangeLogInfo(ndr, "info", r->out.info);
14223 ndr->depth--;
14224 ndr_print_WERROR(ndr, "result", r->out.result);
14225 ndr->depth--;
14227 ndr->depth--;
14230 static enum ndr_err_code ndr_push_drsuapi_DsCrackNames(struct ndr_push *ndr, int flags, const struct drsuapi_DsCrackNames *r)
14232 if (flags & NDR_IN) {
14233 if (r->in.bind_handle == NULL) {
14234 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14236 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14237 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
14238 if (r->in.req == NULL) {
14239 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14241 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
14242 NDR_CHECK(ndr_push_drsuapi_DsNameRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14244 if (flags & NDR_OUT) {
14245 if (r->out.level_out == NULL) {
14246 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14248 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
14249 if (r->out.ctr == NULL) {
14250 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14252 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14253 NDR_CHECK(ndr_push_drsuapi_DsNameCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14254 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14256 return NDR_ERR_SUCCESS;
14259 static enum ndr_err_code ndr_pull_drsuapi_DsCrackNames(struct ndr_pull *ndr, int flags, struct drsuapi_DsCrackNames *r)
14261 TALLOC_CTX *_mem_save_bind_handle_0;
14262 TALLOC_CTX *_mem_save_req_0;
14263 TALLOC_CTX *_mem_save_level_out_0;
14264 TALLOC_CTX *_mem_save_ctr_0;
14265 if (flags & NDR_IN) {
14266 ZERO_STRUCT(r->out);
14268 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14269 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14271 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14272 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14273 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14274 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14275 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
14276 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14277 NDR_PULL_ALLOC(ndr, r->in.req);
14279 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
14280 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14281 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14282 NDR_CHECK(ndr_pull_drsuapi_DsNameRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14283 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14284 NDR_PULL_ALLOC(ndr, r->out.level_out);
14285 ZERO_STRUCTP(r->out.level_out);
14286 NDR_PULL_ALLOC(ndr, r->out.ctr);
14287 ZERO_STRUCTP(r->out.ctr);
14289 if (flags & NDR_OUT) {
14290 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14291 NDR_PULL_ALLOC(ndr, r->out.level_out);
14293 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
14294 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
14295 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
14296 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
14297 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14298 NDR_PULL_ALLOC(ndr, r->out.ctr);
14300 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
14301 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
14302 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14303 NDR_CHECK(ndr_pull_drsuapi_DsNameCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14304 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
14305 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14307 return NDR_ERR_SUCCESS;
14310 _PUBLIC_ void ndr_print_drsuapi_DsCrackNames(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsCrackNames *r)
14312 ndr_print_struct(ndr, name, "drsuapi_DsCrackNames");
14313 ndr->depth++;
14314 if (flags & NDR_SET_VALUES) {
14315 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14317 if (flags & NDR_IN) {
14318 ndr_print_struct(ndr, "in", "drsuapi_DsCrackNames");
14319 ndr->depth++;
14320 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14321 ndr->depth++;
14322 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14323 ndr->depth--;
14324 ndr_print_int32(ndr, "level", r->in.level);
14325 ndr_print_ptr(ndr, "req", r->in.req);
14326 ndr->depth++;
14327 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14328 ndr_print_drsuapi_DsNameRequest(ndr, "req", r->in.req);
14329 ndr->depth--;
14330 ndr->depth--;
14332 if (flags & NDR_OUT) {
14333 ndr_print_struct(ndr, "out", "drsuapi_DsCrackNames");
14334 ndr->depth++;
14335 ndr_print_ptr(ndr, "level_out", r->out.level_out);
14336 ndr->depth++;
14337 ndr_print_int32(ndr, "level_out", *r->out.level_out);
14338 ndr->depth--;
14339 ndr_print_ptr(ndr, "ctr", r->out.ctr);
14340 ndr->depth++;
14341 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
14342 ndr_print_drsuapi_DsNameCtr(ndr, "ctr", r->out.ctr);
14343 ndr->depth--;
14344 ndr_print_WERROR(ndr, "result", r->out.result);
14345 ndr->depth--;
14347 ndr->depth--;
14350 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpn(struct ndr_push *ndr, int flags, const struct drsuapi_DsWriteAccountSpn *r)
14352 if (flags & NDR_IN) {
14353 if (r->in.bind_handle == NULL) {
14354 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14356 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14357 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
14358 if (r->in.req == NULL) {
14359 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14361 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
14362 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14364 if (flags & NDR_OUT) {
14365 if (r->out.level_out == NULL) {
14366 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14368 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
14369 if (r->out.res == NULL) {
14370 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14372 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.res, *r->out.level_out));
14373 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnResult(ndr, NDR_SCALARS, r->out.res));
14374 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14376 return NDR_ERR_SUCCESS;
14379 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpn(struct ndr_pull *ndr, int flags, struct drsuapi_DsWriteAccountSpn *r)
14381 TALLOC_CTX *_mem_save_bind_handle_0;
14382 TALLOC_CTX *_mem_save_req_0;
14383 TALLOC_CTX *_mem_save_level_out_0;
14384 TALLOC_CTX *_mem_save_res_0;
14385 if (flags & NDR_IN) {
14386 ZERO_STRUCT(r->out);
14388 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14389 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14391 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14392 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14393 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14394 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14395 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
14396 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14397 NDR_PULL_ALLOC(ndr, r->in.req);
14399 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
14400 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14401 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14402 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14403 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14404 NDR_PULL_ALLOC(ndr, r->out.level_out);
14405 ZERO_STRUCTP(r->out.level_out);
14406 NDR_PULL_ALLOC(ndr, r->out.res);
14407 ZERO_STRUCTP(r->out.res);
14409 if (flags & NDR_OUT) {
14410 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14411 NDR_PULL_ALLOC(ndr, r->out.level_out);
14413 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
14414 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
14415 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
14416 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
14417 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14418 NDR_PULL_ALLOC(ndr, r->out.res);
14420 _mem_save_res_0 = NDR_PULL_GET_MEM_CTX(ndr);
14421 NDR_PULL_SET_MEM_CTX(ndr, r->out.res, LIBNDR_FLAG_REF_ALLOC);
14422 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.res, *r->out.level_out));
14423 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnResult(ndr, NDR_SCALARS, r->out.res));
14424 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_0, LIBNDR_FLAG_REF_ALLOC);
14425 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14427 return NDR_ERR_SUCCESS;
14430 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpn(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsWriteAccountSpn *r)
14432 ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpn");
14433 ndr->depth++;
14434 if (flags & NDR_SET_VALUES) {
14435 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14437 if (flags & NDR_IN) {
14438 ndr_print_struct(ndr, "in", "drsuapi_DsWriteAccountSpn");
14439 ndr->depth++;
14440 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14441 ndr->depth++;
14442 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14443 ndr->depth--;
14444 ndr_print_int32(ndr, "level", r->in.level);
14445 ndr_print_ptr(ndr, "req", r->in.req);
14446 ndr->depth++;
14447 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14448 ndr_print_drsuapi_DsWriteAccountSpnRequest(ndr, "req", r->in.req);
14449 ndr->depth--;
14450 ndr->depth--;
14452 if (flags & NDR_OUT) {
14453 ndr_print_struct(ndr, "out", "drsuapi_DsWriteAccountSpn");
14454 ndr->depth++;
14455 ndr_print_ptr(ndr, "level_out", r->out.level_out);
14456 ndr->depth++;
14457 ndr_print_int32(ndr, "level_out", *r->out.level_out);
14458 ndr->depth--;
14459 ndr_print_ptr(ndr, "res", r->out.res);
14460 ndr->depth++;
14461 ndr_print_set_switch_value(ndr, r->out.res, *r->out.level_out);
14462 ndr_print_drsuapi_DsWriteAccountSpnResult(ndr, "res", r->out.res);
14463 ndr->depth--;
14464 ndr_print_WERROR(ndr, "result", r->out.result);
14465 ndr->depth--;
14467 ndr->depth--;
14470 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServer(struct ndr_push *ndr, int flags, const struct drsuapi_DsRemoveDSServer *r)
14472 if (flags & NDR_IN) {
14473 if (r->in.bind_handle == NULL) {
14474 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14476 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14477 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
14478 if (r->in.req == NULL) {
14479 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14481 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
14482 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14484 if (flags & NDR_OUT) {
14485 if (r->out.level_out == NULL) {
14486 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14488 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
14489 if (r->out.res == NULL) {
14490 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14492 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.res, *r->out.level_out));
14493 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerResult(ndr, NDR_SCALARS, r->out.res));
14494 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14496 return NDR_ERR_SUCCESS;
14499 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServer(struct ndr_pull *ndr, int flags, struct drsuapi_DsRemoveDSServer *r)
14501 TALLOC_CTX *_mem_save_bind_handle_0;
14502 TALLOC_CTX *_mem_save_req_0;
14503 TALLOC_CTX *_mem_save_level_out_0;
14504 TALLOC_CTX *_mem_save_res_0;
14505 if (flags & NDR_IN) {
14506 ZERO_STRUCT(r->out);
14508 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14509 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14511 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14512 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14513 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14514 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14515 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
14516 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14517 NDR_PULL_ALLOC(ndr, r->in.req);
14519 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
14520 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14521 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14522 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14523 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14524 NDR_PULL_ALLOC(ndr, r->out.level_out);
14525 ZERO_STRUCTP(r->out.level_out);
14526 NDR_PULL_ALLOC(ndr, r->out.res);
14527 ZERO_STRUCTP(r->out.res);
14529 if (flags & NDR_OUT) {
14530 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14531 NDR_PULL_ALLOC(ndr, r->out.level_out);
14533 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
14534 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
14535 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
14536 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
14537 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14538 NDR_PULL_ALLOC(ndr, r->out.res);
14540 _mem_save_res_0 = NDR_PULL_GET_MEM_CTX(ndr);
14541 NDR_PULL_SET_MEM_CTX(ndr, r->out.res, LIBNDR_FLAG_REF_ALLOC);
14542 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.res, *r->out.level_out));
14543 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerResult(ndr, NDR_SCALARS, r->out.res));
14544 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_0, LIBNDR_FLAG_REF_ALLOC);
14545 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14547 return NDR_ERR_SUCCESS;
14550 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServer(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsRemoveDSServer *r)
14552 ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServer");
14553 ndr->depth++;
14554 if (flags & NDR_SET_VALUES) {
14555 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14557 if (flags & NDR_IN) {
14558 ndr_print_struct(ndr, "in", "drsuapi_DsRemoveDSServer");
14559 ndr->depth++;
14560 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14561 ndr->depth++;
14562 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14563 ndr->depth--;
14564 ndr_print_int32(ndr, "level", r->in.level);
14565 ndr_print_ptr(ndr, "req", r->in.req);
14566 ndr->depth++;
14567 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14568 ndr_print_drsuapi_DsRemoveDSServerRequest(ndr, "req", r->in.req);
14569 ndr->depth--;
14570 ndr->depth--;
14572 if (flags & NDR_OUT) {
14573 ndr_print_struct(ndr, "out", "drsuapi_DsRemoveDSServer");
14574 ndr->depth++;
14575 ndr_print_ptr(ndr, "level_out", r->out.level_out);
14576 ndr->depth++;
14577 ndr_print_int32(ndr, "level_out", *r->out.level_out);
14578 ndr->depth--;
14579 ndr_print_ptr(ndr, "res", r->out.res);
14580 ndr->depth++;
14581 ndr_print_set_switch_value(ndr, r->out.res, *r->out.level_out);
14582 ndr_print_drsuapi_DsRemoveDSServerResult(ndr, "res", r->out.res);
14583 ndr->depth--;
14584 ndr_print_WERROR(ndr, "result", r->out.result);
14585 ndr->depth--;
14587 ndr->depth--;
14590 static enum ndr_err_code ndr_push_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_push *ndr, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r)
14592 if (flags & NDR_IN) {
14594 if (flags & NDR_OUT) {
14595 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14597 return NDR_ERR_SUCCESS;
14600 static enum ndr_err_code ndr_pull_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_pull *ndr, int flags, struct DRSUAPI_REMOVE_DS_DOMAIN *r)
14602 if (flags & NDR_IN) {
14604 if (flags & NDR_OUT) {
14605 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14607 return NDR_ERR_SUCCESS;
14610 _PUBLIC_ void ndr_print_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r)
14612 ndr_print_struct(ndr, name, "DRSUAPI_REMOVE_DS_DOMAIN");
14613 ndr->depth++;
14614 if (flags & NDR_SET_VALUES) {
14615 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14617 if (flags & NDR_IN) {
14618 ndr_print_struct(ndr, "in", "DRSUAPI_REMOVE_DS_DOMAIN");
14619 ndr->depth++;
14620 ndr->depth--;
14622 if (flags & NDR_OUT) {
14623 ndr_print_struct(ndr, "out", "DRSUAPI_REMOVE_DS_DOMAIN");
14624 ndr->depth++;
14625 ndr_print_WERROR(ndr, "result", r->out.result);
14626 ndr->depth--;
14628 ndr->depth--;
14631 static enum ndr_err_code ndr_push_drsuapi_DsGetDomainControllerInfo(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetDomainControllerInfo *r)
14633 if (flags & NDR_IN) {
14634 if (r->in.bind_handle == NULL) {
14635 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14637 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14638 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
14639 if (r->in.req == NULL) {
14640 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14642 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
14643 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14645 if (flags & NDR_OUT) {
14646 if (r->out.level_out == NULL) {
14647 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14649 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
14650 if (r->out.ctr == NULL) {
14651 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14653 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14654 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14655 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14657 return NDR_ERR_SUCCESS;
14660 static enum ndr_err_code ndr_pull_drsuapi_DsGetDomainControllerInfo(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetDomainControllerInfo *r)
14662 TALLOC_CTX *_mem_save_bind_handle_0;
14663 TALLOC_CTX *_mem_save_req_0;
14664 TALLOC_CTX *_mem_save_level_out_0;
14665 TALLOC_CTX *_mem_save_ctr_0;
14666 if (flags & NDR_IN) {
14667 ZERO_STRUCT(r->out);
14669 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14670 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14672 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14673 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14674 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14675 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14676 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
14677 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14678 NDR_PULL_ALLOC(ndr, r->in.req);
14680 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
14681 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14682 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14683 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14684 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14685 NDR_PULL_ALLOC(ndr, r->out.level_out);
14686 ZERO_STRUCTP(r->out.level_out);
14687 NDR_PULL_ALLOC(ndr, r->out.ctr);
14688 ZERO_STRUCTP(r->out.ctr);
14690 if (flags & NDR_OUT) {
14691 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14692 NDR_PULL_ALLOC(ndr, r->out.level_out);
14694 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
14695 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
14696 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
14697 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
14698 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14699 NDR_PULL_ALLOC(ndr, r->out.ctr);
14701 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
14702 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
14703 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14704 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14705 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
14706 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14708 return NDR_ERR_SUCCESS;
14711 _PUBLIC_ void ndr_print_drsuapi_DsGetDomainControllerInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetDomainControllerInfo *r)
14713 ndr_print_struct(ndr, name, "drsuapi_DsGetDomainControllerInfo");
14714 ndr->depth++;
14715 if (flags & NDR_SET_VALUES) {
14716 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14718 if (flags & NDR_IN) {
14719 ndr_print_struct(ndr, "in", "drsuapi_DsGetDomainControllerInfo");
14720 ndr->depth++;
14721 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14722 ndr->depth++;
14723 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14724 ndr->depth--;
14725 ndr_print_int32(ndr, "level", r->in.level);
14726 ndr_print_ptr(ndr, "req", r->in.req);
14727 ndr->depth++;
14728 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14729 ndr_print_drsuapi_DsGetDCInfoRequest(ndr, "req", r->in.req);
14730 ndr->depth--;
14731 ndr->depth--;
14733 if (flags & NDR_OUT) {
14734 ndr_print_struct(ndr, "out", "drsuapi_DsGetDomainControllerInfo");
14735 ndr->depth++;
14736 ndr_print_ptr(ndr, "level_out", r->out.level_out);
14737 ndr->depth++;
14738 ndr_print_int32(ndr, "level_out", *r->out.level_out);
14739 ndr->depth--;
14740 ndr_print_ptr(ndr, "ctr", r->out.ctr);
14741 ndr->depth++;
14742 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
14743 ndr_print_drsuapi_DsGetDCInfoCtr(ndr, "ctr", r->out.ctr);
14744 ndr->depth--;
14745 ndr_print_WERROR(ndr, "result", r->out.result);
14746 ndr->depth--;
14748 ndr->depth--;
14751 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAddEntry(struct ndr_push *ndr, int flags, const struct drsuapi_DsAddEntry *r)
14753 if (flags & NDR_IN) {
14754 if (r->in.bind_handle == NULL) {
14755 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14757 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14758 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
14759 if (r->in.req == NULL) {
14760 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14762 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
14763 NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14765 if (flags & NDR_OUT) {
14766 if (r->out.level_out == NULL) {
14767 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14769 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
14770 if (r->out.ctr == NULL) {
14771 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14773 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14774 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14775 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14777 return NDR_ERR_SUCCESS;
14780 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAddEntry(struct ndr_pull *ndr, int flags, struct drsuapi_DsAddEntry *r)
14782 TALLOC_CTX *_mem_save_bind_handle_0;
14783 TALLOC_CTX *_mem_save_req_0;
14784 TALLOC_CTX *_mem_save_level_out_0;
14785 TALLOC_CTX *_mem_save_ctr_0;
14786 if (flags & NDR_IN) {
14787 ZERO_STRUCT(r->out);
14789 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14790 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14792 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14793 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14794 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14795 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14796 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
14797 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14798 NDR_PULL_ALLOC(ndr, r->in.req);
14800 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
14801 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14802 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14803 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14804 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14805 NDR_PULL_ALLOC(ndr, r->out.level_out);
14806 ZERO_STRUCTP(r->out.level_out);
14807 NDR_PULL_ALLOC(ndr, r->out.ctr);
14808 ZERO_STRUCTP(r->out.ctr);
14810 if (flags & NDR_OUT) {
14811 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14812 NDR_PULL_ALLOC(ndr, r->out.level_out);
14814 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
14815 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
14816 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
14817 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
14818 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14819 NDR_PULL_ALLOC(ndr, r->out.ctr);
14821 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
14822 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
14823 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14824 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14825 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
14826 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14828 return NDR_ERR_SUCCESS;
14831 _PUBLIC_ void ndr_print_drsuapi_DsAddEntry(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsAddEntry *r)
14833 ndr_print_struct(ndr, name, "drsuapi_DsAddEntry");
14834 ndr->depth++;
14835 if (flags & NDR_SET_VALUES) {
14836 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14838 if (flags & NDR_IN) {
14839 ndr_print_struct(ndr, "in", "drsuapi_DsAddEntry");
14840 ndr->depth++;
14841 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14842 ndr->depth++;
14843 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14844 ndr->depth--;
14845 ndr_print_int32(ndr, "level", r->in.level);
14846 ndr_print_ptr(ndr, "req", r->in.req);
14847 ndr->depth++;
14848 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14849 ndr_print_drsuapi_DsAddEntryRequest(ndr, "req", r->in.req);
14850 ndr->depth--;
14851 ndr->depth--;
14853 if (flags & NDR_OUT) {
14854 ndr_print_struct(ndr, "out", "drsuapi_DsAddEntry");
14855 ndr->depth++;
14856 ndr_print_ptr(ndr, "level_out", r->out.level_out);
14857 ndr->depth++;
14858 ndr_print_int32(ndr, "level_out", *r->out.level_out);
14859 ndr->depth--;
14860 ndr_print_ptr(ndr, "ctr", r->out.ctr);
14861 ndr->depth++;
14862 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
14863 ndr_print_drsuapi_DsAddEntryCtr(ndr, "ctr", r->out.ctr);
14864 ndr->depth--;
14865 ndr_print_WERROR(ndr, "result", r->out.result);
14866 ndr->depth--;
14868 ndr->depth--;
14871 static enum ndr_err_code ndr_push_drsuapi_DsExecuteKCC(struct ndr_push *ndr, int flags, const struct drsuapi_DsExecuteKCC *r)
14873 if (flags & NDR_IN) {
14874 if (r->in.bind_handle == NULL) {
14875 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14877 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14878 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
14879 if (r->in.req == NULL) {
14880 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14882 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
14883 NDR_CHECK(ndr_push_drsuapi_DsExecuteKCCRequest(ndr, NDR_SCALARS, r->in.req));
14885 if (flags & NDR_OUT) {
14886 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14888 return NDR_ERR_SUCCESS;
14891 static enum ndr_err_code ndr_pull_drsuapi_DsExecuteKCC(struct ndr_pull *ndr, int flags, struct drsuapi_DsExecuteKCC *r)
14893 TALLOC_CTX *_mem_save_bind_handle_0;
14894 TALLOC_CTX *_mem_save_req_0;
14895 if (flags & NDR_IN) {
14896 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14897 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14899 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14900 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14901 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14902 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14903 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
14904 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14905 NDR_PULL_ALLOC(ndr, r->in.req);
14907 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
14908 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14909 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14910 NDR_CHECK(ndr_pull_drsuapi_DsExecuteKCCRequest(ndr, NDR_SCALARS, r->in.req));
14911 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14913 if (flags & NDR_OUT) {
14914 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14916 return NDR_ERR_SUCCESS;
14919 _PUBLIC_ void ndr_print_drsuapi_DsExecuteKCC(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsExecuteKCC *r)
14921 ndr_print_struct(ndr, name, "drsuapi_DsExecuteKCC");
14922 ndr->depth++;
14923 if (flags & NDR_SET_VALUES) {
14924 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14926 if (flags & NDR_IN) {
14927 ndr_print_struct(ndr, "in", "drsuapi_DsExecuteKCC");
14928 ndr->depth++;
14929 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14930 ndr->depth++;
14931 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14932 ndr->depth--;
14933 ndr_print_uint32(ndr, "level", r->in.level);
14934 ndr_print_ptr(ndr, "req", r->in.req);
14935 ndr->depth++;
14936 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14937 ndr_print_drsuapi_DsExecuteKCCRequest(ndr, "req", r->in.req);
14938 ndr->depth--;
14939 ndr->depth--;
14941 if (flags & NDR_OUT) {
14942 ndr_print_struct(ndr, "out", "drsuapi_DsExecuteKCC");
14943 ndr->depth++;
14944 ndr_print_WERROR(ndr, "result", r->out.result);
14945 ndr->depth--;
14947 ndr->depth--;
14950 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfo(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaGetInfo *r)
14952 if (flags & NDR_IN) {
14953 if (r->in.bind_handle == NULL) {
14954 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14956 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14957 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, r->in.level));
14958 if (r->in.req == NULL) {
14959 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14961 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
14962 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14964 if (flags & NDR_OUT) {
14965 if (r->out.info_type == NULL) {
14966 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14968 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, *r->out.info_type));
14969 if (r->out.info == NULL) {
14970 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14972 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, *r->out.info_type));
14973 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
14974 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14976 return NDR_ERR_SUCCESS;
14979 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfo(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaGetInfo *r)
14981 TALLOC_CTX *_mem_save_bind_handle_0;
14982 TALLOC_CTX *_mem_save_req_0;
14983 TALLOC_CTX *_mem_save_info_type_0;
14984 TALLOC_CTX *_mem_save_info_0;
14985 if (flags & NDR_IN) {
14986 ZERO_STRUCT(r->out);
14988 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14989 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14991 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14992 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14993 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14994 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14995 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, &r->in.level));
14996 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14997 NDR_PULL_ALLOC(ndr, r->in.req);
14999 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
15000 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
15001 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
15002 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
15003 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
15004 NDR_PULL_ALLOC(ndr, r->out.info_type);
15005 ZERO_STRUCTP(r->out.info_type);
15006 NDR_PULL_ALLOC(ndr, r->out.info);
15007 ZERO_STRUCTP(r->out.info);
15009 if (flags & NDR_OUT) {
15010 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15011 NDR_PULL_ALLOC(ndr, r->out.info_type);
15013 _mem_save_info_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
15014 NDR_PULL_SET_MEM_CTX(ndr, r->out.info_type, LIBNDR_FLAG_REF_ALLOC);
15015 NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->out.info_type));
15016 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_type_0, LIBNDR_FLAG_REF_ALLOC);
15017 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15018 NDR_PULL_ALLOC(ndr, r->out.info);
15020 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
15021 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
15022 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, *r->out.info_type));
15023 NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
15024 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
15025 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15027 return NDR_ERR_SUCCESS;
15030 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaGetInfo *r)
15032 ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfo");
15033 ndr->depth++;
15034 if (flags & NDR_SET_VALUES) {
15035 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15037 if (flags & NDR_IN) {
15038 ndr_print_struct(ndr, "in", "drsuapi_DsReplicaGetInfo");
15039 ndr->depth++;
15040 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
15041 ndr->depth++;
15042 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
15043 ndr->depth--;
15044 ndr_print_drsuapi_DsReplicaGetInfoLevel(ndr, "level", r->in.level);
15045 ndr_print_ptr(ndr, "req", r->in.req);
15046 ndr->depth++;
15047 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
15048 ndr_print_drsuapi_DsReplicaGetInfoRequest(ndr, "req", r->in.req);
15049 ndr->depth--;
15050 ndr->depth--;
15052 if (flags & NDR_OUT) {
15053 ndr_print_struct(ndr, "out", "drsuapi_DsReplicaGetInfo");
15054 ndr->depth++;
15055 ndr_print_ptr(ndr, "info_type", r->out.info_type);
15056 ndr->depth++;
15057 ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", *r->out.info_type);
15058 ndr->depth--;
15059 ndr_print_ptr(ndr, "info", r->out.info);
15060 ndr->depth++;
15061 ndr_print_set_switch_value(ndr, r->out.info, *r->out.info_type);
15062 ndr_print_drsuapi_DsReplicaInfo(ndr, "info", r->out.info);
15063 ndr->depth--;
15064 ndr_print_WERROR(ndr, "result", r->out.result);
15065 ndr->depth--;
15067 ndr->depth--;
15070 static enum ndr_err_code ndr_push_DRSUAPI_ADD_SID_HISTORY(struct ndr_push *ndr, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r)
15072 if (flags & NDR_IN) {
15074 if (flags & NDR_OUT) {
15075 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15077 return NDR_ERR_SUCCESS;
15080 static enum ndr_err_code ndr_pull_DRSUAPI_ADD_SID_HISTORY(struct ndr_pull *ndr, int flags, struct DRSUAPI_ADD_SID_HISTORY *r)
15082 if (flags & NDR_IN) {
15084 if (flags & NDR_OUT) {
15085 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15087 return NDR_ERR_SUCCESS;
15090 _PUBLIC_ void ndr_print_DRSUAPI_ADD_SID_HISTORY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r)
15092 ndr_print_struct(ndr, name, "DRSUAPI_ADD_SID_HISTORY");
15093 ndr->depth++;
15094 if (flags & NDR_SET_VALUES) {
15095 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15097 if (flags & NDR_IN) {
15098 ndr_print_struct(ndr, "in", "DRSUAPI_ADD_SID_HISTORY");
15099 ndr->depth++;
15100 ndr->depth--;
15102 if (flags & NDR_OUT) {
15103 ndr_print_struct(ndr, "out", "DRSUAPI_ADD_SID_HISTORY");
15104 ndr->depth++;
15105 ndr_print_WERROR(ndr, "result", r->out.result);
15106 ndr->depth--;
15108 ndr->depth--;
15111 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetMemberships2 *r)
15113 if (flags & NDR_IN) {
15114 if (r->in.bind_handle == NULL) {
15115 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15117 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
15118 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
15119 if (r->in.req == NULL) {
15120 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15122 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
15123 NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
15125 if (flags & NDR_OUT) {
15126 if (r->out.level_out == NULL) {
15127 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15129 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
15130 if (r->out.ctr == NULL) {
15131 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15133 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
15134 NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
15135 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15137 return NDR_ERR_SUCCESS;
15140 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetMemberships2 *r)
15142 TALLOC_CTX *_mem_save_bind_handle_0;
15143 TALLOC_CTX *_mem_save_req_0;
15144 TALLOC_CTX *_mem_save_level_out_0;
15145 TALLOC_CTX *_mem_save_ctr_0;
15146 if (flags & NDR_IN) {
15147 ZERO_STRUCT(r->out);
15149 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15150 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
15152 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
15153 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
15154 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
15155 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
15156 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
15157 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15158 NDR_PULL_ALLOC(ndr, r->in.req);
15160 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
15161 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
15162 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
15163 NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
15164 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
15165 NDR_PULL_ALLOC(ndr, r->out.level_out);
15166 ZERO_STRUCTP(r->out.level_out);
15167 NDR_PULL_ALLOC(ndr, r->out.ctr);
15168 ZERO_STRUCTP(r->out.ctr);
15170 if (flags & NDR_OUT) {
15171 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15172 NDR_PULL_ALLOC(ndr, r->out.level_out);
15174 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
15175 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
15176 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
15177 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
15178 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15179 NDR_PULL_ALLOC(ndr, r->out.ctr);
15181 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
15182 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
15183 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
15184 NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
15185 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
15186 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15188 return NDR_ERR_SUCCESS;
15191 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships2 *r)
15193 ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships2");
15194 ndr->depth++;
15195 if (flags & NDR_SET_VALUES) {
15196 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15198 if (flags & NDR_IN) {
15199 ndr_print_struct(ndr, "in", "drsuapi_DsGetMemberships2");
15200 ndr->depth++;
15201 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
15202 ndr->depth++;
15203 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
15204 ndr->depth--;
15205 ndr_print_int32(ndr, "level", r->in.level);
15206 ndr_print_ptr(ndr, "req", r->in.req);
15207 ndr->depth++;
15208 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
15209 ndr_print_drsuapi_DsGetMemberships2Request(ndr, "req", r->in.req);
15210 ndr->depth--;
15211 ndr->depth--;
15213 if (flags & NDR_OUT) {
15214 ndr_print_struct(ndr, "out", "drsuapi_DsGetMemberships2");
15215 ndr->depth++;
15216 ndr_print_ptr(ndr, "level_out", r->out.level_out);
15217 ndr->depth++;
15218 ndr_print_int32(ndr, "level_out", *r->out.level_out);
15219 ndr->depth--;
15220 ndr_print_ptr(ndr, "ctr", r->out.ctr);
15221 ndr->depth++;
15222 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
15223 ndr_print_drsuapi_DsGetMemberships2Ctr(ndr, "ctr", r->out.ctr);
15224 ndr->depth--;
15225 ndr_print_WERROR(ndr, "result", r->out.result);
15226 ndr->depth--;
15228 ndr->depth--;
15231 static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r)
15233 if (flags & NDR_IN) {
15235 if (flags & NDR_OUT) {
15236 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15238 return NDR_ERR_SUCCESS;
15241 static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r)
15243 if (flags & NDR_IN) {
15245 if (flags & NDR_OUT) {
15246 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15248 return NDR_ERR_SUCCESS;
15251 _PUBLIC_ void ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r)
15253 ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_VERIFY_OBJECTS");
15254 ndr->depth++;
15255 if (flags & NDR_SET_VALUES) {
15256 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15258 if (flags & NDR_IN) {
15259 ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_VERIFY_OBJECTS");
15260 ndr->depth++;
15261 ndr->depth--;
15263 if (flags & NDR_OUT) {
15264 ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_VERIFY_OBJECTS");
15265 ndr->depth++;
15266 ndr_print_WERROR(ndr, "result", r->out.result);
15267 ndr->depth--;
15269 ndr->depth--;
15272 static enum ndr_err_code ndr_push_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_push *ndr, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r)
15274 if (flags & NDR_IN) {
15276 if (flags & NDR_OUT) {
15277 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15279 return NDR_ERR_SUCCESS;
15282 static enum ndr_err_code ndr_pull_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_pull *ndr, int flags, struct DRSUAPI_GET_OBJECT_EXISTENCE *r)
15284 if (flags & NDR_IN) {
15286 if (flags & NDR_OUT) {
15287 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15289 return NDR_ERR_SUCCESS;
15292 _PUBLIC_ void ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r)
15294 ndr_print_struct(ndr, name, "DRSUAPI_GET_OBJECT_EXISTENCE");
15295 ndr->depth++;
15296 if (flags & NDR_SET_VALUES) {
15297 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15299 if (flags & NDR_IN) {
15300 ndr_print_struct(ndr, "in", "DRSUAPI_GET_OBJECT_EXISTENCE");
15301 ndr->depth++;
15302 ndr->depth--;
15304 if (flags & NDR_OUT) {
15305 ndr_print_struct(ndr, "out", "DRSUAPI_GET_OBJECT_EXISTENCE");
15306 ndr->depth++;
15307 ndr_print_WERROR(ndr, "result", r->out.result);
15308 ndr->depth--;
15310 ndr->depth--;
15313 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCost(struct ndr_push *ndr, int flags, const struct drsuapi_QuerySitesByCost *r)
15315 if (flags & NDR_IN) {
15316 if (r->in.bind_handle == NULL) {
15317 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15319 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
15320 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
15321 if (r->in.req == NULL) {
15322 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15324 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
15325 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
15327 if (flags & NDR_OUT) {
15328 if (r->out.level_out == NULL) {
15329 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15331 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
15332 if (r->out.ctr == NULL) {
15333 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
15335 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
15336 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
15337 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
15339 return NDR_ERR_SUCCESS;
15342 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCost(struct ndr_pull *ndr, int flags, struct drsuapi_QuerySitesByCost *r)
15344 TALLOC_CTX *_mem_save_bind_handle_0;
15345 TALLOC_CTX *_mem_save_req_0;
15346 TALLOC_CTX *_mem_save_level_out_0;
15347 TALLOC_CTX *_mem_save_ctr_0;
15348 if (flags & NDR_IN) {
15349 ZERO_STRUCT(r->out);
15351 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15352 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
15354 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
15355 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
15356 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
15357 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
15358 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
15359 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15360 NDR_PULL_ALLOC(ndr, r->in.req);
15362 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
15363 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
15364 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
15365 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
15366 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
15367 NDR_PULL_ALLOC(ndr, r->out.level_out);
15368 ZERO_STRUCTP(r->out.level_out);
15369 NDR_PULL_ALLOC(ndr, r->out.ctr);
15370 ZERO_STRUCTP(r->out.ctr);
15372 if (flags & NDR_OUT) {
15373 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15374 NDR_PULL_ALLOC(ndr, r->out.level_out);
15376 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
15377 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
15378 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
15379 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
15380 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
15381 NDR_PULL_ALLOC(ndr, r->out.ctr);
15383 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
15384 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
15385 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
15386 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
15387 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
15388 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
15390 return NDR_ERR_SUCCESS;
15393 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCost(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_QuerySitesByCost *r)
15395 ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCost");
15396 ndr->depth++;
15397 if (flags & NDR_SET_VALUES) {
15398 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
15400 if (flags & NDR_IN) {
15401 ndr_print_struct(ndr, "in", "drsuapi_QuerySitesByCost");
15402 ndr->depth++;
15403 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
15404 ndr->depth++;
15405 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
15406 ndr->depth--;
15407 ndr_print_int32(ndr, "level", r->in.level);
15408 ndr_print_ptr(ndr, "req", r->in.req);
15409 ndr->depth++;
15410 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
15411 ndr_print_drsuapi_QuerySitesByCostRequest(ndr, "req", r->in.req);
15412 ndr->depth--;
15413 ndr->depth--;
15415 if (flags & NDR_OUT) {
15416 ndr_print_struct(ndr, "out", "drsuapi_QuerySitesByCost");
15417 ndr->depth++;
15418 ndr_print_ptr(ndr, "level_out", r->out.level_out);
15419 ndr->depth++;
15420 ndr_print_int32(ndr, "level_out", *r->out.level_out);
15421 ndr->depth--;
15422 ndr_print_ptr(ndr, "ctr", r->out.ctr);
15423 ndr->depth++;
15424 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
15425 ndr_print_drsuapi_QuerySitesByCostCtr(ndr, "ctr", r->out.ctr);
15426 ndr->depth--;
15427 ndr_print_WERROR(ndr, "result", r->out.result);
15428 ndr->depth--;
15430 ndr->depth--;
15433 static const struct ndr_interface_call drsuapi_calls[] = {
15435 "drsuapi_DsBind",
15436 sizeof(struct drsuapi_DsBind),
15437 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsBind,
15438 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsBind,
15439 (ndr_print_function_t) ndr_print_drsuapi_DsBind,
15440 false,
15443 "drsuapi_DsUnbind",
15444 sizeof(struct drsuapi_DsUnbind),
15445 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsUnbind,
15446 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsUnbind,
15447 (ndr_print_function_t) ndr_print_drsuapi_DsUnbind,
15448 false,
15451 "drsuapi_DsReplicaSync",
15452 sizeof(struct drsuapi_DsReplicaSync),
15453 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaSync,
15454 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaSync,
15455 (ndr_print_function_t) ndr_print_drsuapi_DsReplicaSync,
15456 false,
15459 "drsuapi_DsGetNCChanges",
15460 sizeof(struct drsuapi_DsGetNCChanges),
15461 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNCChanges,
15462 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNCChanges,
15463 (ndr_print_function_t) ndr_print_drsuapi_DsGetNCChanges,
15464 false,
15467 "drsuapi_DsReplicaUpdateRefs",
15468 sizeof(struct drsuapi_DsReplicaUpdateRefs),
15469 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaUpdateRefs,
15470 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaUpdateRefs,
15471 (ndr_print_function_t) ndr_print_drsuapi_DsReplicaUpdateRefs,
15472 false,
15475 "drsuapi_DsReplicaAdd",
15476 sizeof(struct drsuapi_DsReplicaAdd),
15477 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaAdd,
15478 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaAdd,
15479 (ndr_print_function_t) ndr_print_drsuapi_DsReplicaAdd,
15480 false,
15483 "drsuapi_DsReplicaDel",
15484 sizeof(struct drsuapi_DsReplicaDel),
15485 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaDel,
15486 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaDel,
15487 (ndr_print_function_t) ndr_print_drsuapi_DsReplicaDel,
15488 false,
15491 "drsuapi_DsReplicaMod",
15492 sizeof(struct drsuapi_DsReplicaMod),
15493 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaMod,
15494 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaMod,
15495 (ndr_print_function_t) ndr_print_drsuapi_DsReplicaMod,
15496 false,
15499 "DRSUAPI_VERIFY_NAMES",
15500 sizeof(struct DRSUAPI_VERIFY_NAMES),
15501 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_VERIFY_NAMES,
15502 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_VERIFY_NAMES,
15503 (ndr_print_function_t) ndr_print_DRSUAPI_VERIFY_NAMES,
15504 false,
15507 "drsuapi_DsGetMemberships",
15508 sizeof(struct drsuapi_DsGetMemberships),
15509 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships,
15510 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships,
15511 (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships,
15512 false,
15515 "DRSUAPI_INTER_DOMAIN_MOVE",
15516 sizeof(struct DRSUAPI_INTER_DOMAIN_MOVE),
15517 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_INTER_DOMAIN_MOVE,
15518 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_INTER_DOMAIN_MOVE,
15519 (ndr_print_function_t) ndr_print_DRSUAPI_INTER_DOMAIN_MOVE,
15520 false,
15523 "drsuapi_DsGetNT4ChangeLog",
15524 sizeof(struct drsuapi_DsGetNT4ChangeLog),
15525 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNT4ChangeLog,
15526 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNT4ChangeLog,
15527 (ndr_print_function_t) ndr_print_drsuapi_DsGetNT4ChangeLog,
15528 false,
15531 "drsuapi_DsCrackNames",
15532 sizeof(struct drsuapi_DsCrackNames),
15533 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsCrackNames,
15534 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsCrackNames,
15535 (ndr_print_function_t) ndr_print_drsuapi_DsCrackNames,
15536 false,
15539 "drsuapi_DsWriteAccountSpn",
15540 sizeof(struct drsuapi_DsWriteAccountSpn),
15541 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsWriteAccountSpn,
15542 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsWriteAccountSpn,
15543 (ndr_print_function_t) ndr_print_drsuapi_DsWriteAccountSpn,
15544 false,
15547 "drsuapi_DsRemoveDSServer",
15548 sizeof(struct drsuapi_DsRemoveDSServer),
15549 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsRemoveDSServer,
15550 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsRemoveDSServer,
15551 (ndr_print_function_t) ndr_print_drsuapi_DsRemoveDSServer,
15552 false,
15555 "DRSUAPI_REMOVE_DS_DOMAIN",
15556 sizeof(struct DRSUAPI_REMOVE_DS_DOMAIN),
15557 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REMOVE_DS_DOMAIN,
15558 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REMOVE_DS_DOMAIN,
15559 (ndr_print_function_t) ndr_print_DRSUAPI_REMOVE_DS_DOMAIN,
15560 false,
15563 "drsuapi_DsGetDomainControllerInfo",
15564 sizeof(struct drsuapi_DsGetDomainControllerInfo),
15565 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetDomainControllerInfo,
15566 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetDomainControllerInfo,
15567 (ndr_print_function_t) ndr_print_drsuapi_DsGetDomainControllerInfo,
15568 false,
15571 "drsuapi_DsAddEntry",
15572 sizeof(struct drsuapi_DsAddEntry),
15573 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsAddEntry,
15574 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsAddEntry,
15575 (ndr_print_function_t) ndr_print_drsuapi_DsAddEntry,
15576 false,
15579 "drsuapi_DsExecuteKCC",
15580 sizeof(struct drsuapi_DsExecuteKCC),
15581 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsExecuteKCC,
15582 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsExecuteKCC,
15583 (ndr_print_function_t) ndr_print_drsuapi_DsExecuteKCC,
15584 false,
15587 "drsuapi_DsReplicaGetInfo",
15588 sizeof(struct drsuapi_DsReplicaGetInfo),
15589 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaGetInfo,
15590 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaGetInfo,
15591 (ndr_print_function_t) ndr_print_drsuapi_DsReplicaGetInfo,
15592 false,
15595 "DRSUAPI_ADD_SID_HISTORY",
15596 sizeof(struct DRSUAPI_ADD_SID_HISTORY),
15597 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_ADD_SID_HISTORY,
15598 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_ADD_SID_HISTORY,
15599 (ndr_print_function_t) ndr_print_DRSUAPI_ADD_SID_HISTORY,
15600 false,
15603 "drsuapi_DsGetMemberships2",
15604 sizeof(struct drsuapi_DsGetMemberships2),
15605 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships2,
15606 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships2,
15607 (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships2,
15608 false,
15611 "DRSUAPI_REPLICA_VERIFY_OBJECTS",
15612 sizeof(struct DRSUAPI_REPLICA_VERIFY_OBJECTS),
15613 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_VERIFY_OBJECTS,
15614 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_VERIFY_OBJECTS,
15615 (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS,
15616 false,
15619 "DRSUAPI_GET_OBJECT_EXISTENCE",
15620 sizeof(struct DRSUAPI_GET_OBJECT_EXISTENCE),
15621 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_GET_OBJECT_EXISTENCE,
15622 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_GET_OBJECT_EXISTENCE,
15623 (ndr_print_function_t) ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE,
15624 false,
15627 "drsuapi_QuerySitesByCost",
15628 sizeof(struct drsuapi_QuerySitesByCost),
15629 (ndr_push_flags_fn_t) ndr_push_drsuapi_QuerySitesByCost,
15630 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_QuerySitesByCost,
15631 (ndr_print_function_t) ndr_print_drsuapi_QuerySitesByCost,
15632 false,
15634 { NULL, 0, NULL, NULL, NULL, false }
15637 static const char * const drsuapi_endpoint_strings[] = {
15638 "ncacn_np:[\\pipe\\lsass]",
15639 "ncacn_np:[\\pipe\\protected_storage]",
15640 "ncacn_ip_tcp:",
15641 "ncalrpc:",
15644 static const struct ndr_interface_string_array drsuapi_endpoints = {
15645 .count = 4,
15646 .names = drsuapi_endpoint_strings
15649 static const char * const drsuapi_authservice_strings[] = {
15650 "ldap",
15653 static const struct ndr_interface_string_array drsuapi_authservices = {
15654 .count = 1,
15655 .names = drsuapi_authservice_strings
15659 const struct ndr_interface_table ndr_table_drsuapi = {
15660 .name = "drsuapi",
15661 .syntax_id = {
15662 {0xe3514235,0x4b06,0x11d1,{0xab,0x04},{0x00,0xc0,0x4f,0xc2,0xdc,0xd2}},
15663 NDR_DRSUAPI_VERSION
15665 .helpstring = NDR_DRSUAPI_HELPSTRING,
15666 .num_calls = 25,
15667 .calls = drsuapi_calls,
15668 .endpoints = &drsuapi_endpoints,
15669 .authservices = &drsuapi_authservices